Documentation

Documentation

Includes

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

Macros

Marco _TUYA_HAL_SYSTEM_H

#define _TUYA_HAL_SYSTEM_H

      

Functions

Func tuya_hal_get_systemtickcount

SYS_TICK_T tuya_hal_get_systemtickcount(VOID_T);
/**
* @brief Get system ticket count
*
* @param VOID
*
* @note This API is used to get system ticket count.
*
* @return system ticket count
*/

Func tuya_hal_get_tickratems

UINT_T tuya_hal_get_tickratems(VOID_T);
/**
* @brief Get time in MS per system ticket
*
* @param VOID
*
* @note This API is used to get time in MS per system ticket.
*
* @return time in MS
*/

Func tuya_hal_system_sleep

VOID_T tuya_hal_system_sleep(const unsigned long msTime);
/**
* @brief System sleep
*
* @param[in] msTime: time in MS
*
* @note This API is used for system sleep.
*
* @return VOID
*/

Func tuya_hal_system_reset

VOID_T tuya_hal_system_reset(VOID_T);
/**
* @brief System reset
*
* @param VOID
*
* @note This API is used for system reset.
*
* @return VOID
*/

Func tuya_hal_watchdog_init_start

unsigned int tuya_hal_watchdog_init_start(const unsigned int timeval);
/**
* @brief Watch dog init and start
*
* @param[in] timeval: interval time for watch dog detection
*
* @note This API is used to init and start watch dog.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_watchdog_refresh

VOID_T tuya_hal_watchdog_refresh(VOID_T);
/**
* @brief Watch dog refresh
*
* @param VOID
*
* @note This API is used to refresh watch dog.
*
* @return VOID
*/

Func tuya_hal_watchdog_stop

VOID_T tuya_hal_watchdog_stop(VOID_T);
/**
* @brief Watch dog stop
*
* @param VOID
*
* @note This API is used to stop watch dog.
*
* @return VOID
*/

Func tuya_hal_system_getheapsize

INT_T tuya_hal_system_getheapsize(VOID_T);
/**
* @brief Get free heap size
*
* @param VOID
*
* @note This API is used for getting free heap size.
*
* @return size of free heap
*/

Func tuya_hal_system_get_rst_ext_info

OPERATE_RET tuya_hal_system_get_rst_ext_info(CHAR_T** ext_info);
/**
* @brief Get system extend reset reason
*
* @param[out] ext_info: extend reset reason information
*
* @note This API is used for getting system extend reset reason.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_get_random_data

int tuya_hal_get_random_data(const unsigned int range);
/**
* @brief Get a random number in the specified range
*
* @param[in] range: range
*
* @note This API is used for getting a random number in the specified range
*
* @return a random number in the specified range
*/

Func tuya_hal_set_cpu_lp_mode

int tuya_hal_set_cpu_lp_mode(const BOOL_T en, const TY_CPU_SLEEP_MODE_E mode);
/**
* @brief Set the low power mode of CPU
*
* @param[in] en: enable switch
* @param[in] en: cpu sleep mode
*
* @note This API is used for setting the low power mode of CPU.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_system_intf_init

VOID_T tuya_os_system_intf_init(VOID_T);
/**
 * @brief System interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of system interface.
 *
 * @return VOID
 */

Vars

Variable TY_RST_REASON_E

TY_RST_REASON_E tuya_hal_system_get_rst_info(VOID_T);
/**
* @brief Get system reset reason
*
* @param VOID
*
* @note This API is used for getting system reset reason.
*
* @return reset reason of system
*/

Consts

Types

Typedefs