This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

使用串口时遇到问题



#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/fpu.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/rom.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "driverlib/adc.h"

void ConfigureUART(void)
{
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Enable UART0
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Configure GPIO Pins for UART mode.
    //
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);

    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);
}
int main(void)
{
 uint32_t ui32ADC0Value[4];
 volatile uint32_t ui32TempAvg;
 volatile uint32_t ui32TempValueC;
 volatile uint32_t ui32TempValueF;

 SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);

 SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

 ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
 ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
 ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
 ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
 ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
 ADCSequenceEnable(ADC0_BASE, 1);
 ConfigureUART();

 while(1)
 {
    ADCIntClear(ADC0_BASE, 1);
    ADCProcessorTrigger(ADC0_BASE, 1);

    while(!ADCIntStatus(ADC0_BASE, 1, false))
    {
    }

    ADCSequenceDataGet(ADC0_BASE, 1, ui32ADC0Value);
    ui32TempAvg = (ui32ADC0Value[0] + ui32ADC0Value[1] + ui32ADC0Value[2] + ui32ADC0Value[3] + 2)/4;
    ui32TempValueC = (1475 - ((2475 * ui32TempAvg)) / 4096)/10;
    UARTprintf("\n芯片温度%d",ui32TempValueC);
    ui32TempValueF = ((ui32TempValueC * 9) + 160) / 5;
 }
}

 

#10010 errors encountered during linking; "ADC_TS.out" not built

#10234-D unresolved symbols remain

unresolved symbol ROM_GPIOPinConfigure, first referenced in ./main.obj

unresolved symbol ROM_GPIOPinTypeUART, first referenced in ./main.obj

unresolved symbol ROM_SysCtlPeripheralEnable, first referenced in ./main.obj

unresolved symbol UARTprintf, first referenced in ./main.obj

unresolved symbol UARTStdioConfig, first referenced in ./main.obj

#225-D function "ROM_GPIOPinConfigure" declared implicitly

#225-D function "ROM_GPIOPinTypeUART" declared implicitly

#225-D function "ROM_SysCtlPeripheralEnable" declared implicitly

出现以上错误 和警告 该如何解决

ADC_TS.rar