BLE5.2 1.0
开发文档说明
xc_drv_aotimer.h
浏览该文件的文档.
1
25#ifndef _XC_DRV_AOTIMER_H_
26#define _XC_DRV_AOTIMER_H_
27
28/*-----------------------------------------------------------------------------------
29 INCLUDE HEADE FILES
30 ------------------------------------------------------------------------------------*/
31#include "xc6xxx.h"
32/*------------------------------------------------------------------------------------
33 Macros
34 -------------------------------------------------------------------------------------*/
35
36#define AOTIMER_MIN_TLC_VAL 0x04
37
38#define AOTIMER_TCR_TIM_DISABLE (0x00UL)
39#define AOTIMER_TCR_TIM_ENABLE (0x01UL)
40
41#define AOTIMER_TCR_TES_ENABLE (0x01UL)
42#define AOTIMER_TCR_TES_DISABLE (0x00UL)
43
44#define AOTIMER_TICK_CAL(us) ((CLOCK_RC_LFCLK_IN_32K / 1000) * us / 1000)
45
46/*------------------------------------------------------------------------------------
47 TypeDef
48 -------------------------------------------------------------------------------------*/
49
50typedef enum
51{
55
56typedef struct
57{
59
61
62/*------------------------------------------------------------------------------------
63 Global Variables
64 -------------------------------------------------------------------------------------*/
65typedef void (*aotimer_handler_callback)(void *context);
66
67/*------------------------------------------------------------------------------------
68 Exported Functions
69 -------------------------------------------------------------------------------------*/
70void xc_aotimer_init(uint8_t reg_idx, AOTimer_InitCfg_t *init_cfg);
71void xc_aotimer_set_value(uint8_t reg_idx, uint32_t us);
72void xc_aotimer_start(uint8_t reg_idx);
73void xc_aotimer_stop(uint8_t reg_idx);
74
75void aotimer0_callback(void *context);
76void aotimer1_callback(void *context);
77
78#endif
AOTimer_ModeTypeDef aotimer_mode
void xc_aotimer_start(uint8_t reg_idx)
xc_aotimer_start
void aotimer0_callback(void *context)
aotimer0_callback
void xc_aotimer_init(uint8_t reg_idx, AOTimer_InitCfg_t *init_cfg)
xc_aotimer_init
void aotimer1_callback(void *context)
aotimer1_callback
AOTimer_ModeTypeDef
@ AOTIMER_MODE_CYCLE
@ AOTIMER_MODE_SINGLE
void xc_aotimer_set_value(uint8_t reg_idx, uint32_t us)
xc_aotimer_set_value
void(* aotimer_handler_callback)(void *context)
void xc_aotimer_stop(uint8_t reg_idx)
xc_aotimer_stop