cad update

This commit is contained in:
kraus 2021-10-03 23:14:28 +02:00
parent 3b4c6f8c9e
commit 918c03d688
1 changed files with 46 additions and 0 deletions

View File

@ -248,6 +248,52 @@ uint8_t u8x8_cad_110(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
return 1;
}
/*
convert to bytes by using
dc = 1 for commands and args and
dc = 0 for data
*/
uint8_t u8x8_gu800_cad_110(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
uint8_t *data;
switch(msg)
{
case U8X8_MSG_CAD_SEND_CMD:
u8x8_byte_SetDC(u8x8, 1);
u8x8_byte_StartTransfer(u8x8);
u8x8_byte_SendByte(u8x8, arg_int);
u8x8_byte_EndTransfer(u8x8);
break;
case U8X8_MSG_CAD_SEND_ARG:
u8x8_byte_SetDC(u8x8, 1);
u8x8_byte_StartTransfer(u8x8);
u8x8_byte_SendByte(u8x8, arg_int);
u8x8_byte_EndTransfer(u8x8);
break;
case U8X8_MSG_CAD_SEND_DATA:
u8x8_byte_SetDC(u8x8, 0);
data = (uint8_t *)arg_ptr;
whle( arg_int > 0 )
{
u8x8_byte_StartTransfer(u8x8);
u8x8_byte_SendByte(u8x8, *data);
u8x8_byte_EndTransfer(u8x8);
data++;
arg_int--;
}
break;
case U8X8_MSG_CAD_INIT:
u8x8->byte_cb(u8x8, msg, arg_int, arg_ptr);
break;
case U8X8_MSG_CAD_START_TRANSFER:
case U8X8_MSG_CAD_END_TRANSFER:
break;
default:
return 0;
}
return 1;
}
/*
convert to bytes by using
dc = 1 for commands and args and