uarttoi2c 2.1.0.0
|
UART to I2C Click is a compact add-on board allowing connections to UART controllers and I2C targets for protocol conversion. This board features the SC18IM704, a bridge between the standard UART host interface and a serial I2C bus from NXP Semiconductors. The SC18IM704 provides a high-speed UART interface with a baud rate of up to 460.8 kbit/s and 256-byte FIFO for the transfer/receive data process, alongside several user-configurable GPIO pins. The host MCU communicates with the SC18IM704 with ASCII messages protocol, allowing it to control all the specific I2C-bus sequences, protocol, arbitration, and timing.
We provide a library for the UART to I2C 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for UART to I2C Click driver.
uarttoi2c_cfg_setup
Config Object Initialization function. uarttoi2c_init
Initialization function. uarttoi2c_default_cfg
Click Default Configuration function. uarttoi2c_gpio_write
This function writes a desired data to the gpio port. uarttoi2c_gpio_read
This function reads data from the gpio port. uarttoi2c_i2c_write_then_read
This function performs a write then read with a repeated start to the I2C target device. This example demonstrates the use of USB to I2C click board by reading the device ID of a 3D Hall 11 click board connected to the I2C port and controlling the GPIO pins.
The demo application is composed of two sections :
Initializes the driver and performs the click default config which resets the device and sets the GPIO pins 0-3 as push-pull output and others as input.
After that, reads and displays the chip firmware version.
Reads the device ID of a 3D Hall 11 click board connected to the I2C port, toggles the output pins and displays the GPIO port state.
The results will be displayed on the USB UART approximately once per second.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
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. UART terminal is available in all MikroElektronika compilers.