ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_communication_uart.h
Go to the documentation of this file.
1 #ifndef RUUVI_INTERFACE_COMMUNICATION_UART_H
2 #define RUUVI_INTERFACE_COMMUNICATION_UART_H
14 #include "ruuvi_driver_error.h"
16 #include "ruuvi_interface_gpio.h"
17 
18 #include <stdbool.h>
19 
20 #if RI_UART_ENABLED
21 # define RUUVI_NRF5_SDK15_UART_ENABLED RUUVI_NRF5_SDK15_ENABLED
22 #endif
23 
25 typedef enum
26 {
31 
33 typedef struct
34 {
35  bool hwfc_enabled;
43 
56 
64 rd_status_t ri_uart_config (const ri_uart_init_t * const config);
65 
66 /*
67  * @brief Uninitializes UART.
68  *
69  * @param[out] channel comm api to send and receive data via uart.
70  *
71  * @retval RD_SUCCESS on success or if radio was not initialized.
72  * @retval RD_ERROR_INVALID_STATE if radio hardware was initialized by another radio module.
73  */
75 
76 #endif
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
ri_uart_baudrate_t
Supported baudrates.
@ RI_UART_BAUDRATE_NUM
Number of options.
@ RI_UART_BAUD_115200
Run at 115200 baud.
@ RI_UART_BAUD_9600
Run at 9600 baud.
rd_status_t ri_uart_uninit(ri_comm_channel_t *const channel)
rd_status_t ri_uart_config(const ri_uart_init_t *const config)
Configure UART.
rd_status_t ri_uart_init(ri_comm_channel_t *const channel)
Initialize UART.
uint16_t ri_gpio_id_t
port<<8 + pin
control API for communication via outside world
UART initialization data.
ri_gpio_id_t rts
RTS pin. Can be RI_GPIO_UNUSED if not using HWFC.
bool hwfc_enabled
True to enable hardware flow control.
bool parity_enabled
True to enable parity.
ri_uart_baudrate_t baud
ri_uart_baudrate_t.
ri_gpio_id_t cts
CTS pin. Can be RI_GPIO_UNUSED if not using HWFC.