Files
microchip-application-bmd38…/led_drv.h
T

68 lines
1.9 KiB
C

#pragma once
#ifndef __LED_DRV_H__
#define __LED_DRV_H__
#include "led_drv_if.h"
#define LED_DRV_ERROR (-1)
#define LED_DRV_SUCCESS (0)
#define LED_NONE \
(struct led_color) \
{ \
.R = 0x00, .G = 0x00, .B = 0x00 \
}
#define LED_RED \
(struct led_color) \
{ \
.R = 0xFF, .G = 0x00, .B = 0x00 \
}
#define LED_GREEN \
(struct led_color) \
{ \
.R = 0x00, .G = 0xFF, .B = 0x00 \
}
#define LED_CYAN \
(struct led_color) \
{ \
.R = 0x00, .G = 0xFF, .B = 0xFF \
}
#define LED_BLUE \
(struct led_color) \
{ \
.R = 0x00, .G = 0x00, .B = 0xFF \
}
#define LED_YELLOW \
(struct led_color) \
{ \
.R = 0xEF, .G = 0x9F, .B = 0x00 \
}
#define LED_PURPLE \
(struct led_color) \
{ \
.R = 0xFF, .G = 0x00, .B = 0xFF \
}
#define LED_OFF LED_NONE
#define LED_ON LED_GREEN
#define LED_ERROR LED_RED
#define LED_IDEL_DISCONNECT LED_YELLOW
#define LED_IDEL_CONNECTED LED_GREEN
#define LED_REC LED_CYAN
#define LED_IDENTICY_DEV LED_PURPLE
#define LED_BUTTON_PRESS LED_YELLOW
#define BT_WAIT 0x01
#define NO_EVENT 0x02
#define PRE_WORK 0x03
#define WORKING 0x04
#define POST_WORK 0x05
int32_t led_init(void);
int32_t led_set(struct led_color color);
int32_t led_mode(uint16_t mode_status);
#define ModeLED(x) led_mode(x)
#endif // __LED_DRV_H__