Advertisement
tranthudo

app_led.h

Jun 6th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. /*****************************************************************************
  2. *
  3. * MODULE: JN-AN-1217
  4. *
  5. * COMPONENT: app_led.c
  6. *
  7. * DESCRIPTION: DK4 DR1175 Led interface (White Led)
  8. *
  9. ***************************************************************************/
  10. #ifndef APP_LED_H_
  11. #define APP_LED_H_
  12.  
  13. /****************************************************************************/
  14. /*** Include files ***/
  15. /****************************************************************************/
  16. #include "drv_leds.h"
  17. /****************************************************************************/
  18. /*** Macro Definitions ***/
  19. /****************************************************************************/
  20. #define SWITCH1_LED_GREEN (16) //DIO_16 = D1 on Generic Expansion board
  21. #define SWITCH1_LED_RED (13) //DIO_13 = D2 on Generic Expansion board
  22. #define SWITCH2_LED_GREEN (0) //DIO_0 = D3 on Generic Expansion board
  23. #define SWITCH2_LED_RED (1) //DIO_1 = D4 on Generic Expansion board
  24. #define SWITCH3_LED_GREEN (3) //DIO_3 = D3 on Carrier board
  25. #define SWITCH3_LED_RED (2) //DIO_2 = D6 on Carrier board
  26. #define SWITCH4_LED_GREEN (DO_0_PIN) //DO_0
  27. #define SWITCH4_LED_RED (DO_1_PIN) //DO_1
  28.  
  29. #define NUMBER_OF_LED (8)
  30.  
  31. #define LED_D1 SWITCH1_LED_GREEN
  32. #define LED_D2 SWITCH1_LED_RED
  33. #define LED_D3 SWITCH2_LED_GREEN
  34. #define LED_D4 SWITCH2_LED_RED
  35.  
  36. #define LED_D3_C SWITCH3_LED_GREEN
  37. #define LED_D6_C SWITCH3_LED_RED
  38.  
  39. /****************************************************************************/
  40. /*** Type Definitions ***/
  41. /****************************************************************************/
  42.  
  43. /****************************************************************************/
  44. /*** Exported Functions ***/
  45. /****************************************************************************/
  46. PUBLIC void APP_LED_vInitialize(void);
  47.  
  48. PUBLIC void APP_LED_vSetLevel(DRV_LEDS_teLedLevel_t eLedLevel);
  49.  
  50. PUBLIC void APP_LED_vTurnOn(uint8_t u8LedPin);
  51.  
  52. PUBLIC void APP_LED_vTurnOff(uint8_t u8LedPin);
  53.  
  54. PUBLIC void APP_LED_vBlink(
  55. uint8_t u8LedPin,
  56. int16_t i16BlinkDuration,
  57. uint16_t u16Cycle,
  58. fnCbAfterBlink fnCallback,
  59. void *pParams
  60. );
  61.  
  62. PUBLIC void APP_LED_vBlinkAlternately(
  63. int16_t i16BlinkDuration,
  64. uint16_t u16Cycle,
  65. fnCbAfterBlink fnCallback,
  66. void *pParams
  67. );
  68.  
  69. PUBLIC void APP_LED_vStopBlinkLed(uint8_t u8LedPin);
  70.  
  71. PUBLIC void APP_LED_vStopBlinkAllLeds(void);
  72. /****************************************************************************/
  73. /*** External Variables ***/
  74. /****************************************************************************/
  75.  
  76. /****************************************************************************/
  77. /****************************************************************************/
  78. /****************************************************************************/
  79. #endif /* APP_LED_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement