platform_leds.h File Reference

Easy access to the LEDs on your platform. More...

Include dependency graph for platform_leds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __platform_heds_h

Functions

void platform_leds_flash (uns8 led)
void platform_leds_flashing (uns8 led, uns8 enable)
void platform_leds_off (uns8 led)
void platform_leds_on (uns8 led)
void platform_leds_process ()
void platform_leds_setup_io ()

Detailed Description


Define Documentation

#define __platform_heds_h

Function Documentation

void platform_leds_flash ( uns8  led  ) 

00116                                    {
00117     
00118     switch (led) {
00119         case 1:
00120             platform_led1_on();
00121             led1_start_tick = tick_get_count();
00122             led1_on = 1;
00123             break;
00124         #ifdef led2_port
00125             case 2:
00126                 platform_led2_on();
00127                 led2_start_tick = tick_get_count();
00128                 led2_on = 1;
00129                 break;
00130         #endif
00131         #ifdef led3_port        
00132             case 3:
00133                 platform_led3_on();
00134                 led3_start_tick = tick_get_count();
00135                 led3_on = 1;
00136                 break;
00137         #endif
00138     }
00139 }

Here is the call graph for this function:

Here is the caller graph for this function:

void platform_leds_flashing ( uns8  led,
uns8  enable 
)

00141                                                    {
00142     switch (led) {
00143         case 1:
00144             led1_flashing = enable.0;
00145             break;
00146         #ifdef led2_port
00147             case 2:
00148                 led2_flashing = enable.0;
00149                 break;
00150         #endif
00151         #ifdef led3_port        
00152             case 3:
00153                 led3_flashing = enable.0;
00154                 break;
00155         #endif
00156     }
00157 }   

void platform_leds_off ( uns8  led  ) 

00098                                  {
00099         switch (led) {
00100         case 1:
00101             platform_led1_off();
00102             break;
00103         #ifdef led2_port
00104             case 2:
00105                 platform_led2_off();
00106                 break;
00107         #endif
00108         #ifdef led3_port        
00109             case 3:
00110                 platform_led3_off();
00111                 break;
00112         #endif
00113     }
00114 }

void platform_leds_on ( uns8  led  ) 

00080                                 {
00081         switch (led) {
00082         case 1:
00083             platform_led1_on();
00084             break;
00085         #ifdef led2_port
00086             case 2:
00087                 platform_led2_on();
00088                 break;
00089         #endif
00090         #ifdef led3_port        
00091             case 3:
00092                 platform_led3_on();
00093                 break;
00094         #endif
00095     }
00096 }

void platform_leds_process (  ) 

00159                              {
00160 
00161 uns16 current_tick;
00162 
00163     current_tick = tick_get_count();
00164     
00165     #ifdef led1_port
00166     if (led1_on || led1_flashing) {
00167         if (tick_calc_diff(led1_start_tick, current_tick) > PLATFORM_LEDS_FLASH_TICKS) {
00168             if (led1_on) {
00169                 led1_on = 0;
00170                 platform_led1_off();
00171             } else {
00172                 led1_on = 1;
00173                 platform_led1_on();
00174             }   
00175             if (led1_flashing) {
00176                 led1_start_tick = tick_get_count(); 
00177             }   
00178         }
00179     }
00180     #endif
00181     #ifdef led2_port
00182     if (led2_on || led2_flashing) {
00183         if (tick_calc_diff(led2_start_tick, current_tick) > PLATFORM_LEDS_FLASH_TICKS) {
00184             if (led2_on) {
00185                 led2_on = 0;
00186                 platform_led2_off();
00187             } else {
00188                 led2_on = 1;
00189                 platform_led2_on();
00190             }   
00191             if (led2_flashing) {
00192                 led2_start_tick = tick_get_count(); 
00193             }   
00194         }
00195     }
00196     #endif
00197     #ifdef led3_port
00198     if (led3_on || led1_flashing) {
00199         if (tick_calc_diff(led3_start_tick, current_tick) > PLATFORM_LEDS_FLASH_TICKS) {
00200             if (led3_on) {
00201                 led3_on = 0;
00202                 platform_led3_off();
00203             } else {
00204                 led3_on = 1;
00205                 platform_led3_on();
00206             }   
00207             if (led3_flashing) {
00208                 led3_start_tick = tick_get_count(); 
00209             }   
00210         }
00211     }
00212     #endif
00213 }

Here is the call graph for this function:

void platform_leds_setup_io (  ) 

00064                               {         
00065 
00066     #ifdef led1_port
00067         clear_pin(led1_port, led1_pin);
00068         make_output(led1_port, led1_pin);
00069     #endif
00070     #ifdef led2_port
00071         clear_pin(led2_port, led2_pin);
00072         make_output(led2_port, led2_pin);
00073     #endif
00074     #ifdef led3_port
00075         clear_pin(led3_port, led3_pin);
00076         make_output(led3_port, led3_pin);
00077     #endif
00078 }       


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