Uart Serial for SAM.
More...
#include "compiler.h"
#include "sysclk.h"
#include "uart.h"
#include "usart.h"
#include "conf_uart_serial.h"
Go to the source code of this file.
Uart Serial for SAM.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file uart_serial.h.
◆ usart_if
This type can be used independently to refer to USART module for the architecture used. It refers to the correct type definition for the architecture, ie. USART_t* for XMEGA or avr32_usart_t* for UC3.
Definition at line 78 of file uart_serial.h.
◆ usart_rs232_options_t
Input parameters when initializing RS232 and similar modes.
◆ usart_serial_options_t
◆ usart_serial_getchar()
static void usart_serial_getchar |
( |
usart_if |
p_usart, |
|
|
uint8_t * |
data |
|
) |
| |
|
inlinestatic |
Waits until a character is received, and returns it.
- Parameters
-
p_usart | Base address of the USART instance. |
data | Data to read |
Definition at line 476 of file uart_serial.h.
◆ usart_serial_init()
Initializes the Usart in master mode.
- Parameters
-
p_usart | Base address of the USART instance. |
opt | Options needed to set up RS232 communication (see usart_options_t). |
Definition at line 87 of file uart_serial.h.
◆ usart_serial_is_rx_ready()
static uint32_t usart_serial_is_rx_ready |
( |
usart_if |
p_usart | ) |
|
|
inlinestatic |
Check if Received data is ready.
- Parameters
-
p_usart | Base address of the USART instance. |
- Return values
-
1 | One data has been received. |
0 | No data has been received. |
Definition at line 577 of file uart_serial.h.
◆ usart_serial_putchar()
static int usart_serial_putchar |
( |
usart_if |
p_usart, |
|
|
const uint8_t |
c |
|
) |
| |
|
inlinestatic |
Sends a character with the USART.
- Parameters
-
p_usart | Base address of the USART instance. |
c | Character to write. |
- Returns
- Status.
- Return values
-
1 | The character was written. |
0 | The function timed out before the USART transmitter became ready to send. |
Definition at line 376 of file uart_serial.h.
◆ usart_serial_read_packet()
Receive a sequence of bytes to a USART device.
- Parameters
-
usart | Base address of the USART instance. |
data | data buffer to write |
len | Length of data |
Receive a sequence of bytes to a USART device.
- Parameters
-
usart | Base address of the USART instance. |
data | Data buffer to write |
len | Length of data |
Definition at line 68 of file usart_serial.c.
◆ usart_serial_write_packet()
Send a sequence of bytes to a USART device.
- Parameters
-
usart | Base address of the USART instance. |
data | data buffer to write |
len | Length of data |
Send a sequence of bytes to a USART device.
- Parameters
-
usart | Base address of the USART instance. |
data | Data buffer to read |
len | Length of data |
Definition at line 48 of file usart_serial.c.