1 /* 2 * Copyright (C) 2015-2017 Alibaba Group Holding Limited 3 */ 4 5 #ifndef K_SOC_H 6 #define K_SOC_H 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 /** @addtogroup aos_rhino soc 13 * SOC hardware functions. 14 * 15 * @{ 16 */ 17 18 #if (RHINO_CONFIG_HW_COUNT > 0) 19 /** 20 * Hardware timer init. 21 * 22 * @param[in] NULL 23 * 24 * @return NULL 25 */ 26 void soc_hw_timer_init(void); 27 28 /** 29 * Get the high resolution hardware timer. 30 * 31 * @param[in] NULL 32 * 33 * @return NULL 34 */ 35 hr_timer_t soc_hr_hw_cnt_get(void); 36 37 /** 38 * Get the low resolution hardware timer. 39 * 40 * @param[in] NULL 41 * 42 * @return NULL 43 */ 44 lr_timer_t soc_lr_hw_cnt_get(void); 45 #define HR_COUNT_GET() soc_hr_hw_cnt_get() 46 #define LR_COUNT_GET() soc_lr_hw_cnt_get() 47 #else 48 #define HR_COUNT_GET() ((hr_timer_t)0u) 49 #define LR_COUNT_GET() ((lr_timer_t)0u) 50 #endif /* RHINO_CONFIG_HW_COUNT */ 51 52 void soc_err_proc(kstat_t err); 53 54 size_t soc_get_cur_sp(void); 55 56 /** @} */ 57 58 #ifdef __cplusplus 59 } 60 #endif 61 62 #endif /* K_SOC_H */ 63 64