1 /* AliGenie - Example 2 3 This example code is in the Public Domain (or CC0 licensed, at your option.) 4 5 Unless required by applicable law or agreed to in writing, this 6 software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 7 CONDITIONS OF ANY KIND, either express or implied. 8 */ 9 10 #ifndef _BOARD_H_ 11 #define _BOARD_H_ 12 13 #include "driver/gpio.h" 14 15 #include "light_driver.h" 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif /**< __cplusplus */ 20 21 #define LED_ON 1 22 #define LED_OFF 0 23 24 #define POWERUP_KEY "powerup" 25 26 /** 27 * @brief 28 */ 29 void board_init(void); 30 31 /** 32 * @brief 33 */ 34 void board_led_hsl(uint8_t elem_index, uint16_t hue, uint16_t saturation, uint16_t lightness); 35 36 /** 37 * @brief 38 */ 39 void board_led_temperature(uint8_t elem_index, uint16_t temperature); 40 41 /** 42 * @brief 43 */ 44 void board_led_lightness(uint8_t elem_index, uint16_t actual); 45 46 /** 47 * @brief 48 */ 49 void board_led_switch(uint8_t elem_index, uint8_t onoff); 50 51 /** 52 * @brief 53 */ 54 uint16_t convert_lightness_actual_to_linear(uint16_t actual); 55 56 /** 57 * @brief 58 */ 59 uint16_t convert_lightness_linear_to_actual(uint16_t linear); 60 61 /** 62 * @brief 63 */ 64 int16_t convert_temperature_to_level(uint16_t temp, uint16_t min, uint16_t max); 65 66 /** 67 * @brief 68 */ 69 uint16_t covert_level_to_temperature(int16_t level, uint16_t min, uint16_t max); 70 71 /** 72 * @brief 73 */ 74 void swap_buf(uint8_t *dst, const uint8_t *src, int len); 75 76 /** 77 * @brief 78 */ 79 uint8_t *mac_str2hex(const char *mac_str, uint8_t *mac_hex); 80 81 #ifdef __cplusplus 82 } 83 #endif /**< __cplusplus */ 84 85 #endif 86