20 lines
499 B
C
20 lines
499 B
C
#ifndef __LED_H
|
|
#define __LED_H
|
|
|
|
#include "stm32h7xx_hal.h"
|
|
|
|
#define LED_TIM TIM3
|
|
#define LED_CH_R TIM_CHANNEL_1
|
|
#define LED_CH_G TIM_CHANNEL_2
|
|
#define LED_CH_B TIM_CHANNEL_3
|
|
#define DUTY_CYCLE_R LED_TIM->CCR1
|
|
#define DUTY_CYCLE_G LED_TIM->CCR2
|
|
#define DUTY_CYCLE_B LED_TIM->CCR3
|
|
|
|
#define COLOR_HEARTBEAT 0x0000FFFF
|
|
#define COLOR_ERROR 0x00FF0000
|
|
|
|
HAL_StatusTypeDef led_init(TIM_HandleTypeDef* htim);
|
|
HAL_StatusTypeDef led_blink(TIM_HandleTypeDef* htim, int32_t color, int16_t blink_period);
|
|
|
|
#endif |