SAMV71 Xplained Ultra Software Package 1.5

main.c File Reference

#include "board.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Defines

#define BUFFER_SIZE   1000
#define BAUDRATE_RS485   256000
#define USART   USART0
#define ID_USART   ID_USART0
#define PIN_USART0_CTS_IOR   {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT}

Functions

 COMPILER_ALIGNED (32)
 Configures USART in rs485 mode.
void XDMAC_Handler (void)
 xDMA interrupt handler.
int main (void)
 Application entry point.

Variables

const Pin pins [] = {PIN_USART0_RXD, PIN_USART0_TXD, PIN_USART0_CTS_IOR, PIN_USART0_RTS}
char palette [BUFFER_SIZE]

Detailed Description

This file contains all the specific code for the usart_rs485 example.

Definition in file main.c.


Define Documentation

#define BAUDRATE_RS485   256000

baud rate

Definition at line 116 of file main.c.

#define BUFFER_SIZE   1000

size of the receive buffer used by the DMA, in bytes.

Definition at line 113 of file main.c.

#define PIN_USART0_CTS_IOR   {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT}

RE for RS485

Definition at line 132 of file main.c.

#define USART   USART0

Register base for USART

Definition at line 119 of file main.c.


Function Documentation

COMPILER_ALIGNED ( 32   ) 

Configures USART in rs485 mode.

Transmit buffer.

Definition at line 152 of file main.c.

Here is the call graph for this function:

int main ( void   ) 

Application entry point.

Returns:
Unused (ANSI-C compatibility).

Definition at line 351 of file main.c.

Here is the call graph for this function:


Variable Documentation

char palette[BUFFER_SIZE]
Initial value:
"**************************************************************************\n\r\
 *  This application gives an example of how to use USART in RS485 mode.\n\r\
 *  The USART features the RS485 mode to enable line driver control.\n\r\
 *  While operating in RS485 mode, the USART behaves as though in asynchronous \n\r\
 *  or synchronous mode and configuration of all the parameters is possible \n\r\
 *  \n\r\
 *  The difference is that the RTS pin is driven high when the transmitter\n\r\
 *  is operating. The behavior of the RTS pin is controlled by the TXEMPTY bit.\n\r\
 *  \n\r\
 **************************************************************************\n\r\
 "

Transmit buffer.

Definition at line 138 of file main.c.

const Pin pins[] = {PIN_USART0_RXD, PIN_USART0_TXD, PIN_USART0_CTS_IOR, PIN_USART0_RTS}

Pins to configure for the application.

Definition at line 135 of file main.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines