在线时间514 小时
UID2025756
注册时间2013-7-16
NXP金币0
该用户从未签到
金牌会员
 
- 积分
- 9267
- 最后登录
- 1970-1-1
|
发表于 2014-12-9 18:28:38
|
显示全部楼层
楼主可能误解了如下结构体的定义:
typedef struct
{
uint16_t bIntEn :1; /*!< 1: Interrupt Enable, 0: Interrupt disable */
uint16_t bContinuousEn :1; /*!< 1: Continuous Conversion Enable, 0: Continuous Conversion disable */
uint16_t bHardwareTriggerEn :1; /*!< 1: hardware trigger, 0: software trigger */
uint16_t bCompareEn :1; /*!< 1: compare mode Enable, 0: compare mode disable */
uint16_t bCompareGreaterEn :1; /*!< 1: Compare greater mode, 0: compare less than mode */
uint16_t bLowPowerEn :1; /*!< 1: Low power mode, 0: high speed mode */
uint16_t bLongSampleEn :1; /*!< 1: long sample mode, 0: short sample mode */
uint16_t bFiFoScanModeEn :1; /*!< 1: FIFO scan mode enable, 0: FIFO scan mode disable */
uint16_t bCompareAndEn :1; /*!< 1: Compare and logic, 0: Compare and logic */
#ifdef CPU_KE02
uint16_t bReverse :7;
#else
uint16_t bHTRGMEn :1; /*!< one hardware trigger pulse trigger multiple conversions in fifo mode */
uint16_t bHTRGMASKEn :1; /*!< Hardware trigger mask enable. */
uint16_t bHTRGMASKSEL :1; /*!< This field selects hardware trigger mask mode. */
uint16_t Reserve :4;
#endif
}ADC_SettingType;
其实 uint16_t bHardwareTriggerEn :1;指的是bHardwareTriggerEn 在该结构体中占了一位,而不是说bHardwareTriggerEn 这个值初始为1.
在main程序中第一行就是: ADC_ConfigType sADC_Config = {0};
说明,其实bHardwareTriggerEn 这位已经被初始化为0了,所以你之后在 ADC_Init( ADC, &sADC_Config);中会看到bHardwareTriggerEn=0.
|
|