ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
#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) |
Sending and receiving data over UART
Definition in file ruuvi_interface_communication_uart.h.
enum 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.
rd_status_t ri_uart_config | ( | const ri_uart_init_t *const | config | ) |
Configure UART.
[out] | config | Interface used for communicating through uart. |
RD_SUCCESS | on success. |
RD_ERROR_NULL | Channel is NULL. |
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.
[out] | channel | Interface used for communicating through uart. |
RD_SUCCESS | on success. |
RD_ERROR_INVALID_STATE | if UART is already initialized. |
RD_ERROR_NULL | Channel is NULL. |
rd_status_t ri_uart_uninit | ( | ri_comm_channel_t *const | channel | ) |