2023-08-23 11:45:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* @author R<EFBFBD>mi Heredero (remi@heredero.ch)
|
|
|
|
|
* @version. 1.0.0
|
|
|
|
|
* @date 2023-06-15
|
|
|
|
|
*/
|
|
|
|
|
|
2023-08-22 07:22:00 +00:00
|
|
|
|
#include "led.h"
|
|
|
|
|
#include "../../mcc_generated_files/pin_manager.h"
|
|
|
|
|
|
2023-08-23 11:45:34 +00:00
|
|
|
|
void LED_init(LED* me, uint8_t id) {
|
2023-08-22 07:22:00 +00:00
|
|
|
|
me->id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Initialize the Driver
|
|
|
|
|
*
|
|
|
|
|
*/
|
2023-08-23 11:45:34 +00:00
|
|
|
|
void LED_initHW(LED* me) {
|
2023-08-22 07:22:00 +00:00
|
|
|
|
LED_off(me);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-23 11:45:34 +00:00
|
|
|
|
void LED_on(void* me) {
|
|
|
|
|
LED* l = (LED*) me;
|
|
|
|
|
switch (l->id) {
|
2023-08-22 07:22:00 +00:00
|
|
|
|
case 1:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT1_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT2_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT3_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT4_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 5:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT5_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 6:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT6_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT7_SetHigh();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 8:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT8_SetHigh();
|
|
|
|
|
break;
|
2023-08-22 07:22:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-23 11:45:34 +00:00
|
|
|
|
void LED_off(void* me) {
|
|
|
|
|
LED* l = (LED*) me;
|
|
|
|
|
switch (l->id) {
|
2023-08-22 07:22:00 +00:00
|
|
|
|
case 1:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT1_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT2_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT3_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT4_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 5:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT5_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 6:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT6_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT7_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
|
|
|
|
case 8:
|
2023-08-23 11:45:34 +00:00
|
|
|
|
OUTPUT8_SetLow();
|
2023-08-22 07:22:00 +00:00
|
|
|
|
break;
|
2023-08-23 11:45:34 +00:00
|
|
|
|
}
|
2023-08-22 07:22:00 +00:00
|
|
|
|
}
|
|
|
|
|
|