Documentation

Documentation

Includes

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

time.h

#include "time.h"
#include "time.h"

Macros

Marco __TUYA_RTC_H__

#define __TUYA_RTC_H__

      

Functions

Func tuya_rtc_register

int tuya_rtc_register(tuya_rtc_ops_t *ops);
/**
 * @brief rtc register
 * 
 * @param[in] ops refer to tuya_rtc_ops_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Vars

Variable tuya_rtc_init

int tuya_rtc_init    (void);
/**
 * @brief rtc init
 *
 */

Variable tuya_rtc_time_set

int tuya_rtc_time_set   (time_t  timestamp);
/**
 * @brief time set
 * 
 * @param[in] timestamp time
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_time_get

int tuya_rtc_time_get   (time_t  *timestamp);
/**
 * @brief time get
 * 
 * @param[in] timestamp time
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_control

int tuya_rtc_control    (uint8_t cmd, void *arg);
/**
 * @brief time control
 * 
 * @param[in] cmd command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_deinit

int tuya_rtc_deinit    (void);
/**
 * @brief rtc deinit
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Consts

Types

Typedefs

Typedef tuya_rtc_ops_t;

typedef struct {
   int (*init)      (void);
   int (*time_get)  (time_t *timestamp);
   int (*time_set)  (time_t timestamp);
   int (*control)   (uint8_t cmd, void *arg);
   int (*deinit)    (void);
} tuya_rtc_ops_t;