mirror of
https://git.beihong.wang/wangbeihong/iot-bedroom-environment-controller.git
synced 2026-04-23 16:43:03 +08:00
32 lines
780 B
C
32 lines
780 B
C
#ifndef TIME_ALARM_H
|
|
#define TIME_ALARM_H
|
|
|
|
#include "esp_err.h"
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define ALARM_MAX_NUM 4
|
|
|
|
// 控制闹钟时间与使能的外部接口
|
|
void alarm_set_time(uint8_t alarm_idx, uint8_t hour, uint8_t minute, uint8_t second);
|
|
void alarm_set_enable(uint8_t alarm_idx, bool enable);
|
|
void alarm_disable_all(void);
|
|
void alarm_get_status(int alarm_idx, uint8_t *hour, uint8_t *minute, uint8_t *second, bool *enabled, bool *triggered);
|
|
|
|
esp_err_t time_alarm_init(void);
|
|
esp_err_t time_alarm_start(void);
|
|
esp_err_t time_alarm_stop(void);
|
|
|
|
// 等待 SNTP 时间同步完成(会阻塞直到同步成功或超时)
|
|
void time_alarm_wait_for_sntp_sync(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // TIME_ALARM_H
|