在线时间321 小时
UID3079600
注册时间2014-12-1
NXP金币0
TA的每日心情 | 开心 2024-7-31 10:09 |
---|
签到天数: 392 天 连续签到: 1 天 [LV.9]以坛为家II
金牌会员
 
- 积分
- 3163
- 最后登录
- 2024-12-27
|
现在用LPC55S69做项目,ADC采样可以用,初始化的时候有个void LPADC_Init(ADC_Type *base, const lpadc_config_t *config)函数,其中的ADC_Type为/** ADC - Register Layout Typedef */typedef struct {
__I uint32_t VERID; /**< Version ID Register, offset: 0x0 */
__I uint32_t PARAM; /**< Parameter Register, offset: 0x4 */
uint8_t RESERVED_0[8];
__IO uint32_t CTRL; /**< ADC Control Register, offset: 0x10 */
__IO uint32_t STAT; /**< ADC Status Register, offset: 0x14 */
__IO uint32_t IE; /**< Interrupt Enable Register, offset: 0x18 */
__IO uint32_t DE; /**< DMA Enable Register, offset: 0x1C */
__IO uint32_t CFG; /**< ADC Configuration Register, offset: 0x20 */
__IO uint32_t PAUSE; /**< ADC Pause Register, offset: 0x24 */
uint8_t RESERVED_1[12];
__IO uint32_t SWTRIG; /**< Software Trigger Register, offset: 0x34 */
__IO uint32_t TSTAT; /**< Trigger Status Register, offset: 0x38 */
uint8_t RESERVED_2[4];
__IO uint32_t OFSTRIM; /**< ADC Offset Trim Register, offset: 0x40 */
uint8_t RESERVED_3[92];
__IO uint32_t TCTRL[16]; /**< Trigger Control Register, array offset: 0xA0, array step: 0x4 */
__IO uint32_t FCTRL[2]; /**< FIFO Control Register, array offset: 0xE0, array step: 0x4 */
uint8_t RESERVED_4[8];
__I uint32_t GCC[2]; /**< Gain Calibration Control, array offset: 0xF0, array step: 0x4 */
__IO uint32_t GCR[2]; /**< Gain Calculation Result, array offset: 0xF8, array step: 0x4 */
struct { /* offset: 0x100, array step: 0x8 */
__IO uint32_t CMDL; /**< ADC Command Low Buffer Register, array offset: 0x100, array step: 0x8 */
__IO uint32_t CMDH; /**< ADC Command High Buffer Register, array offset: 0x104, array step: 0x8 */
} CMD[15];
uint8_t RESERVED_5[136];
__IO uint32_t CV[4]; /**< Compare Value Register, array offset: 0x200, array step: 0x4 */
uint8_t RESERVED_6[240];
__I uint32_t RESFIFO[2]; /**< ADC Data Result FIFO Register, array offset: 0x300, array step: 0x4 */
uint8_t RESERVED_7[248];
__IO uint32_t CAL_GAR[33]; /**< Calibration General A-Side Registers, array offset: 0x400, array step: 0x4 */
uint8_t RESERVED_8[124];
__IO uint32_t CAL_GBR[33]; /**< Calibration General B-Side Registers, array offset: 0x500, array step: 0x4 */
uint8_t RESERVED_9[2680];
__IO uint32_t TST; /**< ADC Test Register, offset: 0xFFC */
} ADC_Type;
__I uint32_t VERID; /**< Version ID Register, offset: 0x0 */这个寄存器是控制选择采集多少位AD,是否差分模式。但是这个定义为只读模式,没办法修改,我怎么修改能满足我所需的单端的16位ADC采集?
最佳答案
楼主你好!
你贴出来的代码其实是ADC模块对应的寄存器。
关于具体支持多少位,你可以查看LPC55S69的芯片手册,ADC章节,里面会有具体的寄存器介绍,查看各个寄存器的功能,然后配置对应的寄存器,另外,官方的SDK代 ...
|
|