Adapter Click example.
Description
Adapter click is a breakout board which simplifies connection of add-on boards. There are two ways of establishing connection: using male or female IDC10 connectors. Male header must be soldered on the top side of Adapter Click to connect the add-on board directly or via flat cable. Female header can be soldered either on the top, or the bottom side, depending on which one is more convenient in given circumstances.
There are two jumpers for SPI/I2C selection and one for selection of power supply range.
The demo application is composed of two sections :
Application Init
Initalizes I2C or SPI driver and makes an initial log.
Application Task
This is an example that shows the use of the Adapter click board (SPI mode - set as default). In I2C mode we are reading internal temperature from another device (THERMO 5 click board). In SPI mode example we are writing "mikroElektronika" to SRAM click board, and then reading from the same memory location.
Additional Functions
- float thermo5_read_inter_temp ( adapter_t *ctx ) - @description Function reads measurements made by internal diode.
- void sram_write_byte ( adapter_t *ctx, uint32_t reg_address, uint8_t write_data ) - @description Function writes the 8-bit data to the target 24-bit register address of 23LC1024 chip.
- uint8_t sram_read_byte ( adapter_t *ctx, uint32_t reg_address ) - @description Function reads the 8-bit data to the target 24-bit register address of 23LC1024 chip.
- Author
- MikroE Team