![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
CI130X芯片TIMER驱动 更多...
结构体 | |
struct | timer_init_t |
timer配置结构体定义 更多... | |
枚举 | |
enum | timer_base_t { TIMER0 = HAL_TIMER0_BASE, TIMER1 = HAL_TIMER1_BASE, TIMER2 = HAL_TIMER2_BASE, TIMER3 = HAL_TIMER3_BASE, AON_TIMER0 = HAL_PWM4_BASE, AON_TIMER1 = HAL_PWM5_BASE } |
TIMER控制器定义 更多... | |
enum | timer_count_mode_t { timer_count_mode_single = 0, timer_count_mode_auto = 1, timer_count_mode_free = 2, timer_count_mode_event = 3 } |
计数模式定义 更多... | |
enum | timer_clock_div_t { timer_clk_div_0 = 0, timer_clk_div_2 = 1, timer_clk_div_4 = 2, timer_clk_div_16 = 3 } |
分频系数定义 更多... | |
enum | timer_iqr_width_t { timer_iqr_width_f = 0, timer_iqr_width_2 = 1, timer_iqr_width_4 = 2, timer_iqr_width_8 = 3 } |
中断信号宽度定义 更多... | |
函数 | |
void | timer_init (timer_base_t base, timer_init_t init) |
定时器初始化 更多... | |
void | timer_set_mode (timer_base_t base, timer_count_mode_t mode) |
设置计数模式 更多... | |
void | timer_start (timer_base_t base) |
启动定时器 更多... | |
void | timer_stop (timer_base_t base) |
暂停定时器 更多... | |
void | timer_event_start (timer_base_t base) |
事件计数(必须处于事件计数模式下) 更多... | |
void | timer_set_count (timer_base_t base, unsigned int count) |
设置计时周期 更多... | |
void | timer_get_count (timer_base_t base, unsigned int *count) |
获取当前计数值 更多... | |
void | timer_cascade_set (timer_base_t base, unsigned int count) |
设置级联时钟计数模式 更多... | |
void | timer_clear_irq (timer_base_t base) |
清除中断 更多... | |
CI130X芯片TIMER驱动
struct timer_init_t |
timer配置结构体定义
成员变量 | ||
---|---|---|
unsigned int | count |
计数值 |
timer_clock_div_t | div |
时钟分频系数 |
timer_count_mode_t | mode |
计数模式 |
timer_iqr_width_t | width |
中断信号宽度 |
void timer_cascade_set | ( | timer_base_t | base, |
unsigned int | count | ||
) |
设置级联时钟计数模式
base | 外设基地址TIMER1/TIMER2/TIMER3/AON_TIMER1 |
count | 计数值 |
void timer_clear_irq | ( | timer_base_t | base | ) |
清除中断
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
void timer_event_start | ( | timer_base_t | base | ) |
事件计数(必须处于事件计数模式下)
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
void timer_get_count | ( | timer_base_t | base, |
unsigned int * | count | ||
) |
获取当前计数值
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
count | 当前计数值 |
void timer_init | ( | timer_base_t | base, |
timer_init_t | init | ||
) |
定时器初始化
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
init | 初始化结构体 |
void timer_set_count | ( | timer_base_t | base, |
unsigned int | count | ||
) |
设置计时周期
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
count | 计数周期 |
void timer_set_mode | ( | timer_base_t | base, |
timer_count_mode_t | mode | ||
) |
设置计数模式
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
mode | timer_mode_single/timer_mode_auto/timer_mode_free/timer_mode_event |
void timer_start | ( | timer_base_t | base | ) |
启动定时器
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |
void timer_stop | ( | timer_base_t | base | ) |
暂停定时器
base | 外设基地址TIMER0/TIMER1/TIMER2/TIMER3/AON_TIMER0/AON_TIMER1 |