#include #include "stm32f10x_i2c.h" #include "stm32f10x_rcc.h" #include "I2C.h" void delay() { for (volatile uint16_t del = 0; del < 25000; del++) ; } void main() { uint8_t burst_data_write[5] = {0x24, 0x48, 0x52, 0x59, 0x73}, burst_data_read[6] = { 0 }; uint8_t single_data_read = 0; I2C_init(I2C2, 100000); delay(); I2C_single_write(I2C2, 0xA0, 0x20, 0x15); delay(); I2C_burst_write(I2C2, 0xA0, 0x11, 5, burst_data_write); delay(); single_data_read = I2C_single_read(I2C2, 0xA0, 0x20); delay(); I2C_burst_read(I2C2, 0xA0, 0x11, 5, burst_data_read); while(1); }