ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_communication_uart.h File Reference
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include "ruuvi_interface_communication.h"
#include "ruuvi_interface_gpio.h"
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  ri_uart_init_t
 UART initialization data. More...
 

Enumerations

enum  ri_uart_baudrate_t { RI_UART_BAUD_9600 , RI_UART_BAUD_115200 , RI_UART_BAUDRATE_NUM }
 Supported baudrates. More...
 

Functions

rd_status_t ri_uart_init (ri_comm_channel_t *const channel)
 Initialize UART. More...
 
rd_status_t ri_uart_config (const ri_uart_init_t *const config)
 Configure UART. More...
 
rd_status_t ri_uart_uninit (ri_comm_channel_t *const channel)
 

Detailed Description

Author
Otso Jousimaa otso@.nosp@m.ojou.nosp@m.sima..nosp@m.net
Date
2020-05-06

Sending and receiving data over UART

Definition in file ruuvi_interface_communication_uart.h.

Enumeration Type Documentation

◆ ri_uart_baudrate_t

Supported baudrates.

Enumerator
RI_UART_BAUD_9600 

Run at 9600 baud.

RI_UART_BAUD_115200 

Run at 115200 baud.

RI_UART_BAUDRATE_NUM 

Number of options.

Definition at line 25 of file ruuvi_interface_communication_uart.h.

Function Documentation

◆ ri_uart_config()

rd_status_t ri_uart_config ( const ri_uart_init_t *const  config)

Configure UART.

Parameters
[out]configInterface used for communicating through uart.
Return values
RD_SUCCESSon success.
RD_ERROR_NULLChannel is NULL.

◆ ri_uart_init()

rd_status_t ri_uart_init ( ri_comm_channel_t *const  channel)

Initialize UART.

This only setups the function interface, you must call ri_uart_config to setup pins, HWFC, baudrate tec.

Parameters
[out]channelInterface used for communicating through uart.
Return values
RD_SUCCESSon success.
RD_ERROR_INVALID_STATEif UART is already initialized.
RD_ERROR_NULLChannel is NULL.

◆ ri_uart_uninit()

rd_status_t ri_uart_uninit ( ri_comm_channel_t *const  channel)