i2cisolator2 2.0.0.0
main.c File Reference

I2C Isolator 2 Click example. More...

#include "board.h"
#include "log.h"
#include "i2cisolator2.h"

Macros

#define EEPROM3_MEMORY_ADDRESS   0x10000ul
 
#define EEPROM3_SLAVE_ADDRESS   0x54
 
#define EEPROM3_DEMO_TEXT   "MikroE - I2C Isolator 2 with EEPROM 3 click!"
 

Functions

err_t eeprom3_write_page (uint32_t address, uint8_t *data_in, uint8_t len)
 
err_t eeprom3_read_page (uint32_t address, uint8_t *data_out, uint8_t len)
 
void application_init ()
 
void application_task ()
 
int main (void)
 

Detailed Description

I2C Isolator 2 Click example.

Description

This example showcases how to initialize, configure and use the I2C Isolator 2 click module. The click provides I2C lines and power isolation for slave devices. In order for this example to work, you need the EEPROM 3 click.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the power output.

Application Task

Writes the desired message to EEPROM 3 click board and reads it back every 2 seconds. All data is being displayed on the USB UART where you can track the program flow.

Note
Make sure to provide the VCC power supply on VCC pin and EEPROM 3 click.
Author
MikroE Team

Macro Definition Documentation

◆ EEPROM3_DEMO_TEXT

#define EEPROM3_DEMO_TEXT   "MikroE - I2C Isolator 2 with EEPROM 3 click!"

◆ EEPROM3_MEMORY_ADDRESS

#define EEPROM3_MEMORY_ADDRESS   0x10000ul

◆ EEPROM3_SLAVE_ADDRESS

#define EEPROM3_SLAVE_ADDRESS   0x54

Function Documentation

◆ application_init()

void application_init ( )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( )

◆ eeprom3_read_page()

err_t eeprom3_read_page ( uint32_t address,
uint8_t * data_out,
uint8_t len )

◆ eeprom3_write_page()

err_t eeprom3_write_page ( uint32_t address,
uint8_t * data_in,
uint8_t len )

◆ main()

int main ( void )