Tool/software: TI C/C++ Compiler
Hi,
I am new in this TM4c129ENCPDT microcontroller. I want to create a driver routines to access the Universal Synchronous/Asynchronous Receiver/Transmitter (USART) port of the Tiva™ TM4C129ENCPDT Microcontrolle.I found difficulty to found API functions..I make these functions
//#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include <main.h>
#include "tm4c129encpdt.h"
SYSCTL_RCGCGPIO_R = SYSCTL_RCGCGPIO_R | 0x01;
GPIO_PORTA_AHB_AFSEL_R = GPIO_PORTA_AHB_AFSEL_R | 0x03;
GPIO_PORTA_AHB_DR2R_R = GPIO_PORTA_AHB_DR2R_R | 0x01;
GPIO_PORTA_AHB_PCTL_R = GPIO_PORTA_AHB_PCTL_R&0xFFFFFF00; //First reset
GPIO_PORTA_AHB_PCTL_R = GPIO_PORTA_AHB_PCTL_R | 0x00000011;
//Configure baud-rate divisor (BRD)
UART0_CTL_R = UART0_CTL_R&(~UART_CTL_UARTEN); // Disable UART
UART0_IBRD_R = 130; // IBRD = int(20,000,000 / (16 * 9,600)) = int(130.2083)
UART0_FBRD_R = 13; // FBRD = int(0.2083 * 64 + 0.5) = int(13)
UART0_LCRH_R = (UART_LCRH_WLEN_8|USART_LCRH_PAR_NONE|UART_LCRH_STOP_ONE);
UART0_CC_R = UART0_CC_R|0x00; //Using system clock
UART0_CTL_R = UART0_CTL_R|UART_CTL_UARTEN;