sentry_chassis_hzz/modules/led/led.c

40 lines
819 B
C
Raw Normal View History

2023-02-14 11:05:41 +08:00
#include "led.h"
#include "stdlib.h"
#include "memory.h"
2023-02-14 11:05:41 +08:00
#include "user_lib.h"
static uint8_t idx;
static LEDInstance *bsp_led_ins[LED_MAX_NUM] = {NULL};
2023-02-14 11:05:41 +08:00
LEDInstance *LEDRegister(LED_Init_Config_s *led_config)
{
LEDInstance *led_ins = (LEDInstance *)zero_malloc(sizeof(LEDInstance));
// 剩下的值暂时都被置零
led_ins->led_pwm = PWMRegister(&led_config->pwm_config);
led_ins->led_switch = led_config->init_swtich;
2023-02-14 11:05:41 +08:00
bsp_led_ins[idx++] = led_ins;
return led_ins;
}
void LEDSet(LEDInstance *_led, uint8_t alpha, uint8_t color_value, uint8_t brightness)
2023-02-14 11:05:41 +08:00
{
}
void LEDSwitch(LEDInstance *_led, uint8_t led_switch)
2023-02-14 11:05:41 +08:00
{
if (led_switch == 1)
2023-02-14 11:05:41 +08:00
{
_led->led_switch = 1;
2023-02-14 11:05:41 +08:00
}
else
{
_led->led_switch = 0;
2023-02-14 11:05:41 +08:00
// PWMSetPeriod(_led,0);
}
}
void LEDShow()
{
}