Files
incp-test/app/src/main.c

32 lines
499 B
C

#include "main.h"
#include "i2c.h"
#include "stm32f411xe.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_gpio.h"
#include "stm32f4xx_ll_i2c.h"
#include "incp_handler.h"
#include "my_i2c.h"
#define MSG_BUF_CAPACITY (2*1024)
uint8_t i2c_msg_store[MSG_BUF_CAPACITY];
int my_main()
{
LL_I2C_EnableIT_EVT(I2C1);
msg_buf_init(&i2c_msgs, i2c_msg_store, sizeof(i2c_msg_store));
while (1)
{
for (int i = 0; i < 500; ++i)
{
HAL_Delay(1);
handle_incp(&i2c_msgs);
}
}
return 0;
}