ADC检测添加

1.ADC部分的代码如下

#include "user_adc.h"
// Import ADC Driver definitions
#include 
#include "user_keywords.h"
// Define name for ADC channel index


uint8_t AdcTaskStack[512];
/*task object (to be constructed)*/
Task_Struct Adc_task;


#define THERMOCOUPLE_OUT  0
ADC_Handle adc;
ADC_Params params;

void UserADC_init(void)
{
    // One-time init of ADC driver
    ADC_init();
    ADC_Params_init(¶ms);
    adc = ADC_open(Board_ADC0, ¶ms);
    if (adc == NULL) {
        // ADC_open() failed
        while (1) {}
    }
}


static void taskFxn(uintptr_t a0, uintptr_t a1)
{
    int_fast16_t res;
    uint16_t adcValue;
    uint32_t adcValue0MicroVolt;
    UserADC_init();
    while(1)
    {

        res = ADC_convert(adc, &adcValue);
        adcValue0MicroVolt = ADC_convertRawToMicroVolts(adc, adcValue);
        if (res == ADC_STATUS_SUCCESS)
        {
           User_UART_w

你可能感兴趣的:(CC2640R2F(驱动))