Mi10Pro_ISP568_FHD_BC/src/sdk/include/hal_system.h

154 lines
4.4 KiB
C
Raw Normal View History

/*******************************************************************************
*
*
* File: hal_system.h
* Description hal
* Version V0.1
* Date 2021-05-21
* Author lzy
*******************************************************************************/
#ifndef __HAL_SYSTEM_H__
#define __HAL_SYSTEM_H__
/*******************************************************************************
* 1.Included files
*******************************************************************************/
#include "tau_common.h"
/*******************************************************************************
* 2.Global constant and macro definitions using #define
*******************************************************************************/
/*******************************************************************************
* 3.Global structures, unions and enumerations using typedef
*******************************************************************************/
/*******************************************************************************
* 4.Global variable extern declarations
*******************************************************************************/
/*******************************************************************************
* 5.Global function prototypes
*******************************************************************************/
/**
* @brief system
* @param none
* @retval none
*/
void hal_system_init(uint32_t sysclk);
/**
* @brief system console
* @param baud_rate
* @retval none
*/
void hal_system_init_console(uint32_t baud_rate);
/**
* @brief mcu进入idle模式,
* @param disable_systick: idle时是否关闭systick(退idle systick)
* @retval none
*/
void hal_system_idle_mode(bool disable_systick);
/**
* @brief systick回调函数
* @param cb_func
* @retval
*/
void hal_system_register_systick_cb(fcb_type cb_func);
/**
* @brief sys tickt
* @param ms: sys tickt , 1-10ms
* @retval true/false
*/
bool hal_system_enable_systick(uint8_t ms);
/**
* @brief systickt
* @param none
* @retval systickt值
*/
bool hal_system_disable_systick(void);
/**
* @brief systickt
* @param none
* @retval systickt值
*/
uint32_t hal_system_get_tick(void);
/**
* @brief deep sleep mode , AP_RSTN
* @param polarity true:沿, false:沿
* @retval none
*/
void hal_system_deep_sleep_mode(bool polarity);
/**
* @brief flash开关(使,)
* @param enable:true:F_SPI访问内部flash , false:F_SPI访问内部flash
* @retval true/false
*/
bool hal_system_share_flash_mode(bool enable);
/**
* @brief sleep mode
* @param enable
* @retval none
*/
void hal_system_sleep_mode(bool enable);
/**
* @brief reset chip
* @param none
* @retval none
*/
void hal_system_reset_chip(void);
/**
* @brief PVD检测
* @param none
* @retval none
*/
void hal_system_set_pvd(bool enable);
/**
* @brief VCC电源开关
* 使: VCC掉电13D与13M使用外灌电源时VCC供电,
* @param enable: true:CP, false:CP
* @retval none
*/
void hal_system_set_vcc(bool enable);
/**
* @brief flash读取数据,1024
* @param *usr_cfg_t_addr(),
usr_cfg_t_size(1024)
flash_page 0~63
* @retval bool
*/
bool hal_system_flash_read(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page);
/**
* @brief flash(),1024
* @param *usr_cfg_t_addr(),
usr_cfg_t_size(1024)
01~63
flash_page 0~63
* @retval bool size是否超出
*/
bool hal_system_flash_write(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page);
#if defined(ISP_568) || defined(ISP_368)
/**
* @brief DPHY内部校准开关
* @param en: 使
* @retval none
*/
void hal_system_set_phy_calibration(bool en);
#endif
#endif //__HAL_SYSTEM_H__