29 lines
696 B
C
29 lines
696 B
C
#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
|