101 lines
3.0 KiB
C
101 lines
3.0 KiB
C
/* USER CODE BEGIN Header */
|
||
/**
|
||
******************************************************************************
|
||
* @file : sts_lamp_bar.h
|
||
* @brief : Header for sts_lamp_bar.c file.
|
||
* This file contains the common defines of the application.
|
||
******************************************************************************
|
||
* @attention
|
||
*
|
||
*
|
||
* This software is licensed under terms that can be found in the LICENSE file
|
||
* in the root directory of this software component.
|
||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||
*
|
||
******************************************************************************
|
||
*/
|
||
/* USER CODE END Header */
|
||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||
#ifndef __STS_LAMP_BAR_H
|
||
#define __STS_LAMP_BAR_H
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
|
||
#include "main.h"
|
||
/* HSV value of STS_COLOR */
|
||
#define HSV_DARK 0
|
||
#define HSV_RED 0
|
||
#define HSV_YELLOW 60
|
||
#define HSV_GREEN 120
|
||
#define HSV_CYAN 180
|
||
#define HSV_BLUE 240
|
||
#define HSV_PINK 125
|
||
#define HSV_WHITE 360
|
||
#define HSV_RED_BLUE 0
|
||
|
||
#define DEFAULT_SATURATION 50 // 0 - 100 S:Saturation, 0~100
|
||
#define DEFAULT_BRIGHTNESS 50 // 0 - 100 V:Value of lightness, 0~100
|
||
|
||
enum sts_lamp_color {
|
||
STS_DARK = 0, //灭:0
|
||
STS_GREEN, //绿:1 0 1 0
|
||
STS_RED, //红:2 1 0 0
|
||
STS_BLUE, //蓝:3 0 0 1
|
||
STS_YELLOW, //黄:4 1 1 0
|
||
STS_PINK, //紫:5 1 0 1
|
||
STS_CYAN, //青:6 0 1 1
|
||
STS_WHITE, //白:7 1 1 1
|
||
STS_RED_BLUE //红蓝闪烁:8
|
||
};
|
||
|
||
enum sts_oo_work_mode {
|
||
STS_NETWORK_MODE = 0,
|
||
STS_WIRED_MODE, // 1
|
||
STS_REEDSWITCH_MODE, // 2 REED SWITCH ONLY
|
||
STS_RSS_MODE, // 3 RSS ONLY
|
||
STS_DUAL_MODE, // 4 RSS + REED SWITCH
|
||
STS_REEDSWITCH, // 5 REED SWITCH ?????
|
||
STS_DUAL_RSS_MODE, // 6
|
||
STS_TOF_MODE, // 7 TOF OCCUPANCY
|
||
STS_TOF_RSS_MODE // 8 TOF + RSS
|
||
|
||
};
|
||
|
||
#define STS_Reed_Hall_Status HAL_GPIO_ReadPin(BUT1_GPIO_Port, BUT1_Pin)
|
||
|
||
//void STS_Lamp_Bar_All(uint8_t lamp_color, uint8_t luminance_level);
|
||
void STS_Lamp_Bar_Set_Color(uint8_t red, uint8_t green, uint8_t blue );
|
||
void STS_Lamp_Bar_Set_RGB(uint8_t red, uint8_t green, uint8_t blue);
|
||
void STS_Lamp_Bar_Set_HSV(uint16_t H, uint16_t S, uint16_t V, uint16_t num);
|
||
void STS_Lamp_Bar_Init(void);
|
||
void STS_Lamp_Bar_Full_Color_Gradient(void);
|
||
void STS_WS2812B_Refresh(void);
|
||
void STS_Reed_Hall_Working(void);
|
||
void STS_Lamp_Bar_Self_Test(void);
|
||
void STS_Lamp_Bar_Set_Dark(void);
|
||
|
||
// Before Join LoRa-WAN Network
|
||
void STS_Lamp_Bar_Scoller(uint8_t color, uint8_t luminance_level);
|
||
// Occupancy Status, Set Color to STS_RED
|
||
// Vacant Status, Set Color to STS_GREEN
|
||
void STS_Lamp_Bar_Set_STS_RGB_Color(uint8_t sts_lamp_color, uint8_t luminance_level);
|
||
|
||
// Occupancy Status, Set Color to HSV_RED
|
||
// Vacant Status, Set Color to HSV_GREEN
|
||
void STS_Lamp_Bar_Set_STS_HSV_Color(uint8_t sts_lamp_color, uint8_t sts_lamp_hsv_value);
|
||
|
||
void STS_YunhornSTSEventP1_Process(void);
|
||
void STS_YunhornSTSEventP2_Process(void);
|
||
void STS_YunhornSTSEventP3_Process(void);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#endif /* _STS_LAMP_BAR_H */
|
||
|