Yes, using libdaisy. Not sure how close to metal you’re aiming for as I think libdaisy goes via HAL.
Is this any help:
I2CHandle i2c;
void Start_ST7036()
{
// This has two functions:
// 1. Activates I2C_1 via Daisy and HAL
// 2. Initialises the MIDAS display for use at 3.3V (based on data sheet sequence)
//
// The Follower and Contrast settings have been adjusted to work with this particular unit at 3.3V
// Seems like they are quite critical. Too much of either gives white squares as all pixels fire regardless
uint8_t midas_initialize[]={
ST_COMMAND,
ST_FUN_SET | 1<<DL | 1<<N,
ST_FUN_SET | 1<<DL | 1<<N | 1<<IS,
ST_OSC_FRQ | 1<<BS,
ST_CONTRAST | 0x0a,
ST_PO_IC_CO | 1<<BO | 0x01,
ST_FOLLOWER | 1<<FON | 0x0c,
ST_DIS_ON | 1<<D,
ST_CLEAR,
ST_ENT_MODE | 1<<ID,
ST_FUN_SET | 1<<DL | 1<<N,
ST_RET_HOME
};
static constexpr I2CHandle::Config petal_led_i2c_config
= {I2CHandle::Config::Peripheral::I2C_1,
{{DSY_GPIOB, 8}, {DSY_GPIOB, 9}}, // I have failed to place GetPin() successfully in these locations
I2CHandle::Config::Speed::I2C_100KHZ}; // PB8 and PB9 are pins that come out as D11 and D12 on Daisy for I2C_1
i2c.Init(petal_led_i2c_config);
// now i2c points to the corresponding peripheral and can be used.
i2c.TransmitBlocking(ST_ADDRESS,midas_initialize,12,1000); // timeout maybe in ms, doesn't seem to block on wrong address
dsy_system_delay(20); // wait for clear
} // End of Start_ST7036
// Takes a 16 char array and places across one line of I2C LCD unit
// Although this may waste some write cycles it’s quicker on START & STOP
// Use offset of 0x00 for first line and SECOND_LINE_OFFSET for second
void Show_Line(char *line,unsigned char offset)
{
int position;
unsigned char showline_header[3+LINE_LENGTH]={ // set MIDAS for one byte command followed by data
ST_COMMAND | ST_CO, // header space set t
static_cast(ST_SET_DDRAM | offset), // this must be 8 bit stream and is explicitly cast
ST_DATA
};
for (position=0; position<LINE_LENGTH;position++)
{
showline_header[position+3]=line[position]; // make a single array starting with commands and ending with text to show
}
i2c.TransmitBlocking(ST_ADDRESS,showline_header,3+LINE_LENGTH,1000);
} // End of Show_Line()