Ich habs in C umgesetzt:
Code:
//---- sound module config
#define sound_port PORTA
#define sound_reset PIN7_bm
#define sound_clk PIN6_bm
#define sound_data PIN5_bm
//---- sound module config
void wtv020_send_command(unsigned int command) {
unsigned int mask;
sound_port.OUTCLR = sound_clk;
delay_ms(2);
for (mask = 0x8000; mask > 0; mask >>= 1)
{
sound_port.OUTCLR = sound_clk;
if(command & mask)
{
sound_port.OUTSET = sound_data;
}
else
{
sound_port.OUTCLR = sound_data;
}
_delay_us(100);
sound_port.OUTSET = sound_clk;
_delay_us(100);
}
delay_ms(10);
}
und dann mit sowas ansteuern:
Code:
#define wtv020_play_pause wtv020_send_command(0xFFFE)
#define wtv020_stop wtv020_send_command(0xFFFF)
#define wtv020_mute wtv020_send_command(0xFFF0)
Lesezeichen