diff options
Diffstat (limited to 'include/peripheralmanager/peripheral_manager_client.h')
-rw-r--r-- | include/peripheralmanager/peripheral_manager_client.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/peripheralmanager/peripheral_manager_client.h b/include/peripheralmanager/peripheral_manager_client.h index 5fdc5ff..51821b0 100644 --- a/include/peripheralmanager/peripheral_manager_client.h +++ b/include/peripheralmanager/peripheral_manager_client.h @@ -23,6 +23,7 @@ #include "peripheralmanager/i2c_device.h" #include "peripheralmanager/led.h" #include "peripheralmanager/spi_device.h" +#include "peripheralmanager/uart_device.h" __BEGIN_DECLS @@ -97,8 +98,9 @@ char** BPeripheralManagerClient_listI2cBuses( int* num_i2c_buses); /// Opens an I2C device and takes ownership of it. -/// @oaram client Pointer to the BPeripheralManagerClient struct. -/// @param name Name of the SPI device. +/// @param client Pointer to the BPeripheralManagerClient struct. +/// @param name Name of the I2C bus. +/// @param address Address of the I2C device. /// @param dev Output pointer to the BI2cDevice struct. Empty on error. /// @return 0 on success, errno on error int BPeripheralManagerClient_openI2cDevice( @@ -107,6 +109,25 @@ int BPeripheralManagerClient_openI2cDevice( uint32_t address, BI2cDevice** dev); +/// Returns the list of UART buses. +/// This does not take ownership into account. +/// The list must be freed by the caller. +/// @param client Pointer to the BPeripheralManagerClient struct. +/// @param num_uart_buses Output pointer to the number of element in the list. +/// @return The list of uart buses. +char** BPeripheralManagerClient_listUartDevices( + const BPeripheralManagerClient* client, int* num_uart_buses); + +/// Opens an UART device and takes ownership of it. +/// @param client Pointer to the BPeripheralManagerClient struct. +/// @param name Name of the UART device. +/// @param dev Output pointer to the BUartDevice struct. Empty on error. +/// @return 0 on success, errno on error +int BPeripheralManagerClient_openUartDevice( + const BPeripheralManagerClient* client, + const char* name, + BUartDevice** dev); + /// Creates a new client. /// @return A pointer to the created client. nullptr on errors. BPeripheralManagerClient* BPeripheralManagerClient_new(); |