Hi,
is there any porting example for u8g2 library for MSPM0G series MCU using i2c HW connection?
I just would like to know how the HAL for I2C byte send callback looks like as its HW i2c can support only 8 FIFOs. How to split and implement into this callback function?
Just FYI, below is the sample provided for Arduino I2C.
uint8_t u8x8_byte_arduino_hw_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
switch(msg)
{
case U8X8_MSG_BYTE_SEND:
Wire.write((uint8_t *)arg_ptr, (int)arg_int);
break;
case U8X8_MSG_BYTE_INIT:
Wire.begin();
break;
case U8X8_MSG_BYTE_SET_DC:
break;
case U8X8_MSG_BYTE_START_TRANSFER:
if ( u8x8->display_info->i2c_bus_clock_100kHz >= 4 )
{
Wire.setClock(400000L);
}
Wire.beginTransmission(u8x8_GetI2CAddress(u8x8)>>1);
break;
case U8X8_MSG_BYTE_END_TRANSFER:
Wire.endTransmission();
break;
default:
return 0;
}
return 1;
}
