Adafruit Library
|
Class that provides an interface between WipperSnapper's app and the device's UART bus. More...
#include <ws_uart.h>
Public Member Functions | |
~ws_uart (void) | |
UART class destructor. | |
void | initUARTBus (wippersnapper_uart_v1_UARTDeviceAttachRequest *msgUARTRequest) |
Initializes the UART bus, called once. More... | |
bool | initUARTDevice (wippersnapper_uart_v1_UARTDeviceAttachRequest *msgUARTRequest) |
Initializes a UART driver. More... | |
bool | isUARTBusInitialized () |
Returns true if the UART bus is initialized. More... | |
void | detachUARTDevice (wippersnapper_uart_v1_UARTDeviceDetachRequest *msgUARTDetachReq) |
Detaches a UART device from the UART bus. More... | |
void | deinitUARTDevice (const char *device_id) |
Deinitializes a device from the UART bus and frees its memory. More... | |
void | update () |
Polls the UART driver for new data and sends it to IO. More... | |
bool | initUARTDevicePM25AQI (HardwareSerial *hwSerial, int32_t pollingInterval, const char *device_id) |
Initializes the pms5003 device driver using HardwareSerial. More... | |
Class that provides an interface between WipperSnapper's app and the device's UART bus.
void ws_uart::initUARTBus | ( | wippersnapper_uart_v1_UARTDeviceAttachRequest * | msgUARTRequest | ) |
Initializes the UART bus, called once.
Initializes a UART bus.
msgUARTRequest | Pointer to a UARTDeviceAttachRequest message. |
bool ws_uart::initUARTDevice | ( | wippersnapper_uart_v1_UARTDeviceAttachRequest * | msgUARTRequest | ) |
Initializes a UART driver.
Initializes a device on the UART bus.
msgUARTRequest | Pointer to a UARTDeviceAttachRequest message. |
bool ws_uart::isUARTBusInitialized | ( | ) |
Returns true if the UART bus is initialized.
Checks if the UART bus has been initialized.
void ws_uart::detachUARTDevice | ( | wippersnapper_uart_v1_UARTDeviceDetachRequest * | msgUARTDetachReq | ) |
Detaches a UART device from the UART bus.
Detaches a UART device from the bus and frees its memory.
msgUARTDetachReq | Pointer to a UARTDeviceDetachRequest message. |
void ws_uart::deinitUARTDevice | ( | const char * | device_id | ) |
Deinitializes a device from the UART bus and frees its memory.
device_id | Device identifier of the UART device to deinitialize. |
void ws_uart::update | ( | ) |
Polls the UART driver for new data and sends it to IO.
Updates the UART device at every polling interval, must be called by main app.
bool ws_uart::initUARTDevicePM25AQI | ( | HardwareSerial * | hwSerial, |
int32_t | pollingInterval, | ||
const char * | device_id | ||
) |
Initializes the pms5003 device driver using HardwareSerial.
hwSerial | Pointer to a HardwareSerial instance. |
pollingInterval | Polling interval for the pms5003 device. |
device_id | Which PM25 device are we communicating with? |