34 lines
1.2 KiB
C
34 lines
1.2 KiB
C
/*
|
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
|
Unless required by applicable law or agreed to in writing, this
|
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
CONDITIONS OF ANY KIND, either express or implied.
|
|
*/
|
|
#pragma once
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <esp_err.h>
|
|
|
|
#define RGB_POWER_DEFAULT false
|
|
#define RGB_HUE_DEFAULT 180
|
|
#define RGB_SATURATION_DEFAULT 100
|
|
#define RGB_BRIGHTNESS_DEFAULT 25
|
|
|
|
#define GPIO_DEVICE_OUT1_NAME "Output-1"
|
|
#define GPIO_DEVICE_OUT2_NAME "Output-2"
|
|
#define GPIO_DEVICE_OUT3_NAME "Output-3"
|
|
|
|
extern esp_rmaker_device_t *gpio_device;
|
|
extern esp_rmaker_device_t *light_device;
|
|
extern esp_rmaker_device_t *switch_device;
|
|
|
|
void app_driver_init(void);
|
|
esp_err_t app_driver_set_gpio(const char *name, bool state);
|
|
esp_err_t app_light_set(uint32_t hue, uint32_t saturation, uint32_t brightness);
|
|
esp_err_t app_light_set_power(bool power);
|
|
esp_err_t app_light_set_brightness(uint16_t brightness);
|
|
esp_err_t app_light_set_hue(uint16_t hue);
|
|
esp_err_t app_light_set_saturation(uint16_t saturation);
|
|
int app_switch_set_state(bool state);
|
|
bool app_switch_get_state(void); |