soundout.c File Reference

Include dependency graph for soundout.c:

Functions

uns8 soundout_is_busy ()
void soundout_play_pause ()
void soundout_reset ()
void soundout_send_data (uns16 data)
void soundout_set_file_id (uns16 file_id)
void soundout_set_volume (uns8 level)
void soundout_setup_io ()
void soundout_standby ()
void soundout_stop ()
void soundout_wake ()

Function Documentation

uns8 soundout_is_busy (  ) 

00123                         {
00124     #ifdef soundout_busy_port 
00125         return test_pin(soundout_busy_port, soundout_busy_pin);
00126     #else
00127         return 0;
00128     #endif  
00129 }

void soundout_play_pause (  ) 

Here is the call graph for this function:

void soundout_reset (  ) 

00057                       {
00058     #ifdef soundout_reset_port 
00059         clear_pin(soundout_reset_port, soundout_reset_pin);
00060         delay_ms(10);   // minimum 5ms
00061         set_pin(soundout_reset_port, soundout_reset_pin);
00062     #endif
00063 }       

void soundout_send_data ( uns16  data  ) 

00079                                     {
00080     
00081     // Signal start
00082     clear_pin(soundout_clk_port, soundout_clk_pin);
00083     delay_ms(3);    // tSTART = 2ms
00084     
00085     for (uns8 count = 0; count < 16; count++) {
00086         if (data.15) {
00087             set_pin(soundout_data_port, soundout_data_pin);
00088         } else {
00089             clear_pin(soundout_data_port, soundout_data_pin);
00090         }
00091         delay_us(2);    // tDS = 1us
00092         set_pin(soundout_clk_port, soundout_clk_pin);
00093         delay_us(220);  // tCH = 200us
00094         clear_pin(soundout_clk_port, soundout_clk_pin);
00095         delay_us(220); // tCL = 200us
00096         data = data << 1;
00097     }
00098     // Signal end
00099     set_pin(soundout_clk_port, soundout_clk_pin);
00100     delay_ms(3);    // tSTOP = 2ms
00101 }

Here is the caller graph for this function:

void soundout_set_file_id ( uns16  file_id  ) 

00103                                          {
00104 
00105     soundout_send_data(file_id);
00106 }

Here is the call graph for this function:

void soundout_set_volume ( uns8  level  ) 

00108                                      {
00109     level = level & 0x07;
00110     soundout_send_data(soundout_VOLUME_CMD + level);
00111 }

Here is the call graph for this function:

void soundout_setup_io (  ) 

00041                          {
00042     
00043     make_output(soundout_clk_port, soundout_clk_pin);
00044     set_pin(soundout_clk_port, soundout_clk_pin);   // idle high
00045     
00046     make_output(soundout_data_port, soundout_data_pin);
00047     // don't care about data pin state
00048     #ifdef soundout_reset_port
00049         make_output(soundout_reset_port, soundout_reset_pin);
00050         set_pin(soundout_reset_port, soundout_reset_pin);
00051     #endif
00052     #ifdef soundout_busy_port
00053         make_input(soundout_busy_port, soundout_busy_pin);
00054     #endif
00055 }   

void soundout_standby (  ) 

00065                         {
00066     #ifdef soundout_reset_port 
00067         clear_pin(soundout_reset_port, soundout_reset_pin);
00068         // Need to wait for 1 second to go into standby
00069         // seems a shame to hang around here waiting though...
00070         // delay_s(1);
00071     #endif
00072 }   

void soundout_stop (  ) 

00117                      {
00118 
00119     soundout_send_data(soundout_STOP_CMD);
00120 
00121 }

Here is the call graph for this function:

void soundout_wake (  ) 

00073                      {
00074     #ifdef soundout_reset_port 
00075         set_pin(soundout_reset_port, soundout_reset_pin);
00076     #endif
00077 }   


Generated on Fri Aug 19 09:09:22 2011 for Pic Pack Library by  doxygen 1.6.1