uarti2cspi 2.0.0.0
|
UART I2C/SPI Click is an all-in-one solution which allows ESD-protected RS-232 connectivity to any embedded application while bridging the UART and I2C/SPI interfaces at the same time. It is equipped with the DE-9 connector, so it can be easily connected.
We provide a library for the UARTI2CSPI Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for UARTI2CSPI Click driver.
- Initialization function.void uarti2cspi_cfg_setup ( uarti2cspi_cfg_t *cfg );
UARTI2CSPI_RETVAL uarti2cspi_init ( uarti2cspi_t *ctx, uarti2cspi_cfg_t *cfg );
void uarti2cspi_set_reset ( uarti2cspi_t *ctx, uint8_t state );
- Uart write text function.void uarti2cspi_advanced_init ( uarti2cspi_t *ctx, uint32_t baud_rate, uint8_t data_bits, uint8_t parity_mode, uint8_t stop_bits );
void uarti2cspi_uart_write_text ( uarti2cspi_t *ctx, uint8_t *w_text );
uint8_t uarti2cspi_uart_read ( uarti2cspi_t *ctx );
This example showcases how to initialize, configure and use the UART I2C/SPI click module. The click is a I2C/SPI to UART bridge interface. It requires a RS232/485 cable in order to be connected to other click module or an adapter.
The demo application is composed of two sections :
Initializes the driver, configures UART, and enables UART interrupts.
Depending on the selected mode, it reads all the received data or sends the desired message every 2 seconds.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.