PicoWAN SDK Documentation
|
UART/USART driver. More...
#include <stdint.h>
#include <arch.h>
Go to the source code of this file.
Functions | |
void | usart_putc (usart_port_t usart, uint8_t c) |
Writes a byte to a given USART port (blocking). More... | |
uint8_t | usart_getc (usart_port_t usart) |
Reads a byte from a given USART port (blocking). More... | |
void | usart_init (usart_port_t usart, uint32_t baudrate) |
Initializes a given USART (RX disabled by default). More... | |
void | usart_deinit (usart_port_t usart) |
De-initializes a given USART. More... | |
void | usart_enable_rx (usart_port_t usart, void(*irq_cb)(void)) |
Enables the reception of data (RX). More... | |
void | usart_disable_rx (usart_port_t usart) |
Disables the reception of data (RX). More... | |
void | usart_sync (usart_port_t usart) |
Synchronizes a given USART. More... | |
uint8_t | usart_is_rx_not_empty (usart_port_t usart) |
Checks is some data are available to read. More... | |
UART/USART driver.
Copyright (c) 2018, Archos S.A. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND AND EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARCHOS S.A. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void usart_deinit | ( | usart_port_t | usart | ) |
De-initializes a given USART.
usart | The USART port number (USART_PORT_n). |
void usart_disable_rx | ( | usart_port_t | usart | ) |
Disables the reception of data (RX).
usart | The USART port number (USART_PORT_n). |
void usart_enable_rx | ( | usart_port_t | usart, |
void(*)(void) | irq_cb | ||
) |
Enables the reception of data (RX).
usart | The USART port number (USART_PORT_n). |
irq_cb | The callback that will be executed in IRQ context when data will be available. |
uint8_t usart_getc | ( | usart_port_t | usart | ) |
Reads a byte from a given USART port (blocking).
usart | The USART port number (USART_PORT_n). |
uint8_t | The byte read. |
void usart_init | ( | usart_port_t | usart, |
uint32_t | baudrate | ||
) |
Initializes a given USART (RX disabled by default).
usart | The USART port number (USART_PORT_n). |
baudrate | The requested baud-rate in bps. |
uint8_t usart_is_rx_not_empty | ( | usart_port_t | usart | ) |
Checks is some data are available to read.
usart | The USART port number (USART_PORT_n). |
uint8_t | 1 if some data are available, 0 otherwise. |
void usart_putc | ( | usart_port_t | usart, |
uint8_t | c | ||
) |
Writes a byte to a given USART port (blocking).
usart | The USART port number (USART_PORT_n). |
c | The byte to write. |
void usart_sync | ( | usart_port_t | usart | ) |
Synchronizes a given USART.
This function waits until the ongoing transmission in finished.
usart | The USART port number (USART_PORT_n). |