在ADC采样时,需要对通道进行配置:
const ADC_INIT_CHANNEL_STRUCT adc_Direct_current =
{
ADC0_SOURCE_AD18,
ADC_CHANNEL_MEASURE_LOOP | ADC_CHANNEL_START_NOW, // runs continuously after IOCTL trigger
4, // number of samples in one run sequence
0, // time offset from trigger point in us
30, // period in us
0x10000, // scale range of result (not used now)
10, // circular buffer size (sample count)
MY_TRIGGER, // logical trigger ID that starts this ADC channel
#if MQX_USE_LWEVENTS
&evn,
0x01 // mask of event to be set
#endif
}
问题1:对于ADC_CHANNEL_START_NOW指令,在MQX的IO驱动手册ADC章节写的是:ADC_CHANNEL_START_NOW Measurement starts immediately after fopen(). initiating with the IOCTL_ADC_RUN_CHANNEL ioctl command. This flag is mutually exclusive with ADC_CHANNEL_START_TRIGGERED. 意思是fopen()后马上开始采样,通过ioct1指令启动。这两个不是矛盾了么?
问题2:在通道配置时有一个 circular buffer size (sample count) ,这里设置的是10,也就是说有这么大的空间来存储采样到的数据了?那如果一直采样,采得的数据超过10个会怎么放呢?是向队列一样覆盖前面的数据吗?
|