iot-firmware/src/user_code.hpp

40 lines
1.0 KiB
C++
Raw Normal View History

2023-09-29 17:06:49 +00:00
#pragma once
#include <ESPMegaPRO.h>
#include <EasyNextionLibrary.h>
// External LCD Configuration
#define ENABLE_EXTERNAL_LCD
#define TXD2 4
#define RXD2 17
#ifdef ENABLE_EXTERNAL_LCD
extern EasyNex user_panel;
2023-09-29 16:18:21 +00:00
#endif
2023-09-29 17:06:49 +00:00
// User Defined Functions
2023-09-29 16:18:21 +00:00
void user_pre_init();
void user_init();
void user_loop();
void virtual_interrupt_user_callback(int pin, int state);
void timer_tick_callback();
void external_lcd_callback(int touch_hex);
2023-09-29 17:06:49 +00:00
void timer_tick_callback();
// ESPMega IoT Core Build-in Functions
extern void pwm_set_state(int id, int state);
extern void pwm_set_value(int id, int value);
extern void pwm_toggle(int id);
extern void pwm_toggle(int id1, int id2);
extern void pwm_cycle_value(int id);
extern bool pwm_get_state(int id);
extern uint16_t pwm_get_value(int id);
extern boolean pwm_group_state(int id1, int id2);
extern bool input_get_state(int id);
extern void ac_set_state(int mode, int temperature, int fan_speed);
extern uint8_t ac_get_temperature();
extern uint8_t ac_get_mode();
extern uint8_t ac_get_fan_speed();