完成初代的雏形设计
This commit is contained in:
28
components/io_device_control/include/io_device_control.h
Normal file
28
components/io_device_control/include/io_device_control.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Initializes fan/light/hot/cool outputs and sets all devices off by default.
|
||||
esp_err_t io_device_control_init(void);
|
||||
|
||||
// High level control APIs, all are active-high outputs.
|
||||
esp_err_t io_device_control_set_fan(bool on);
|
||||
esp_err_t io_device_control_set_light(bool on);
|
||||
esp_err_t io_device_control_set_hot(bool on);
|
||||
esp_err_t io_device_control_set_cool(bool on);
|
||||
|
||||
// Read current output states from GPIO.
|
||||
esp_err_t io_device_control_get_states(bool *fan_on,
|
||||
bool *light_on,
|
||||
bool *hot_on,
|
||||
bool *cool_on);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user