CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
宏定义 | 枚举 | 函数
ci130x_adc.h 文件参考

CI130X芯片ADC模块的驱动程序头文件 更多...

#include "ci130x_system.h"

浏览源代码.

宏定义

#define ADC_DRIVER_USE_RTOS   0
 
#define ADC_INIT_ADDR   0x1ff53000
 
#define AIN0   *(volatile unsigned int *)(ADC_INIT_ADDR + 0*4)
 
#define AIN1   *(volatile unsigned int *)(ADC_INIT_ADDR + 1*4)
 
#define AIN2   *(volatile unsigned int *)(ADC_INIT_ADDR + 2*4)
 
#define AIN3   *(volatile unsigned int *)(ADC_INIT_ADDR + 3*4)
 
#define ADC_INIT_RSEILT_ADDR   0x1ff54000
 
#define RESULT_AIN0   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +0*4)
 
#define RESULT_AIN1   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +1*4)
 
#define RESULT_AIN2   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +2*4)
 
#define RESULT_AIN3   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +3*4)
 
#define RESULT_JY_AIN0   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +4*4)
 
#define RESULT_JY_AIN1   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +5*4)
 
#define RESULT_JY_AIN2   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +6*4)
 
#define RESULT_JY_AIN3   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +7*4)
 
#define a3_result_in   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +8*4)
 
#define an0_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ 13*4)
 
#define an1_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24)*4)
 
#define an2_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12)*4)
 
#define an3_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8)*4)
 
#define an0_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6)*4)
 
#define an1_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3)*4)
 
#define an2_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3+3)*4)
 
#define an3_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3+3+3)*4)
 

枚举

enum  adc_clkcyclex_t {
  ADC_CLKCYCLE_1 = 0,
  ADC_CLKCYCLE_2 =1,
  ADC_CLKCYCLE_3 =2,
  ADC_CLKCYCLE_4 =3,
  ADC_CLKCYCLE_5 =4
}
 采样保持时间选择 更多...
 
enum  adc_channelx_t {
  ADC_CHANNEL_0 =0,
  ADC_CHANNEL_1 =1,
  ADC_CHANNEL_2 =2,
  ADC_CHANNEL_3 =3,
  ADC_CHANNEL_4 =4,
  ADC_CHANNEL_5 =5,
  ADC_CHANNEL_MAX =6
}
 ADC通道编号 更多...
 
enum  adc_int_mode_t {
  ADC_INT_MODE_TRANS_END = 0,
  ADC_INT_MODE_VALUE_NOT_MEET = 1
}
 ADC中断条件选择 更多...
 

函数

void adc_int_clear (adc_channelx_t channel)
 ADC中断标志清除(只支持ADC_CHANNEL_0-ADC_CHANNEL_5) 更多...
 
void adc_soc_soft_ctrl (FunctionalState cmd)
 ADC软件触发(软件强制开始转换) 更多...
 
int8_t adc_get_vol_value (adc_channelx_t cha, float *vol_val)
 获取ADC转换的电压值 更多...
 
void adc_poweron (void)
 ADC上电 更多...
 
void adc_reset (void)
 ADC复位 更多...
 
void adc_signal_mode (adc_channelx_t cha)
 ADC soft软件触发模式配置 更多...
 
void adc_series_mode (adc_channelx_t cha)
 ADC连续模式配置 更多...
 
void adc_cycle_mode (adc_channelx_t cha, uint16_t cycle)
 ADC周期模式配置 更多...
 
void adc_caculate_mode (void)
 ADC校准模式配置 更多...
 
uint32_t adc_get_result (adc_channelx_t channel)
 获取ADC某个通道的转换结果(只支持ADC_CHANNEL_0-ADC_CHANNEL_5) 更多...
 
void adc_calibrate (FunctionalState cmd)
 ADC校准使能 更多...
 
void adc_wait_int (adc_channelx_t cha)
 ADC等待中断全局变量标志 更多...
 
void ADC_irqhandle (void)
 ADC中断服务函数 更多...
 

详细描述

CI130X芯片ADC模块的驱动程序头文件

版本
0.1
日期
2019-05-17

宏定义说明

◆ a3_result_in

#define a3_result_in   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +8*4)

◆ ADC_DRIVER_USE_RTOS

#define ADC_DRIVER_USE_RTOS   0

◆ ADC_INIT_ADDR

#define ADC_INIT_ADDR   0x1ff53000

◆ ADC_INIT_RSEILT_ADDR

#define ADC_INIT_RSEILT_ADDR   0x1ff54000

◆ AIN0

#define AIN0   *(volatile unsigned int *)(ADC_INIT_ADDR + 0*4)

◆ AIN1

#define AIN1   *(volatile unsigned int *)(ADC_INIT_ADDR + 1*4)

◆ AIN2

#define AIN2   *(volatile unsigned int *)(ADC_INIT_ADDR + 2*4)

◆ AIN3

#define AIN3   *(volatile unsigned int *)(ADC_INIT_ADDR + 3*4)

◆ an0_result_last

#define an0_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6)*4)

◆ an0_result_other

#define an0_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ 13*4)

◆ an1_result_last

#define an1_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3)*4)

◆ an1_result_other

#define an1_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24)*4)

◆ an2_result_last

#define an2_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3+3)*4)

◆ an2_result_other

#define an2_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12)*4)

◆ an3_result_last

#define an3_result_last   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8+6+3+3+3)*4)

◆ an3_result_other

#define an3_result_other   (volatile unsigned int *)(ADC_INIT_RSEILT_ADDR+ (13+24+12+8)*4)

◆ RESULT_AIN0

#define RESULT_AIN0   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +0*4)

◆ RESULT_AIN1

#define RESULT_AIN1   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +1*4)

◆ RESULT_AIN2

#define RESULT_AIN2   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +2*4)

◆ RESULT_AIN3

#define RESULT_AIN3   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +3*4)

◆ RESULT_JY_AIN0

#define RESULT_JY_AIN0   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +4*4)

◆ RESULT_JY_AIN1

#define RESULT_JY_AIN1   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +5*4)

◆ RESULT_JY_AIN2

#define RESULT_JY_AIN2   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +6*4)

◆ RESULT_JY_AIN3

#define RESULT_JY_AIN3   *(volatile unsigned int *)(ADC_INIT_RSEILT_ADDR +7*4)