4*4 的芯片
我把5,6,7口设置成一般io,8,9设置成ad,这样配置的:
const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCCOUNT] = {
// {
// .adcDIO = CC1310_LAUNCHXL_DIO5_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO4,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO6_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO3,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO7_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO2,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
{
.adcDIO = CC1310_LAUNCHXL_DIO8_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO1,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC1310_LAUNCHXL_DIO9_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO0,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
// {
// .adcDIO = CC1310_LAUNCHXL_DIO28_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO2,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO29_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO1,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO30_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO0,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_DCOUPL,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VSS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VDDS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
}
};
typedef enum CC1310_LAUNCHXL_ADCBuf0ChannelName {
// CC1310_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL1,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL2,
CC1310_LAUNCHXL_ADCBUF0CHANNEL3,
CC1310_LAUNCHXL_ADCBUF0CHANNEL4,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL5,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL6,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL7,
CC1310_LAUNCHXL_ADCBUF0CHANNELVDDS,
CC1310_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
CC1310_LAUNCHXL_ADCBUF0CHANNELVSS,
CC1310_LAUNCHXL_ADCBUF0CHANNELCOUNT
} CC1310_LAUNCHXL_ADCBuf0ChannelName;
/*!
* @def CC1310_LAUNCHXL_ADCName
* @brief Enum of ADCs
*/
typedef enum CC1310_LAUNCHXL_ADCName {
// CC1310_LAUNCHXL_ADC0 = 0,
// CC1310_LAUNCHXL_ADC1,
// CC1310_LAUNCHXL_ADC2,
CC1310_LAUNCHXL_ADC3,
CC1310_LAUNCHXL_ADC4,
// CC1310_LAUNCHXL_ADC5,
// CC1310_LAUNCHXL_ADC6,
// CC1310_LAUNCHXL_ADC7,
CC1310_LAUNCHXL_ADCDCOUPL,
CC1310_LAUNCHXL_ADCVSS,
CC1310_LAUNCHXL_ADCVDDS,
CC1310_LAUNCHXL_ADCCOUNT
} CC1310_LAUNCHXL_ADCName;
调用ADC_open(Board_ADC3, ¶ms);或者ADC_open(Board_ADC0, ¶ms);结果都不对。
请问可以这样用吗?