Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Documentation on what this is:
- // Copied relevant bits from the lk/bootloader from the FP2 to get "knowledge" about C and how to print the cmd hex values.
- // Now the code is integrated in my testing lk, but it's here for reference.
- #include <stdio.h>
- struct mipi_dsi_cmd {
- int size;
- char *payload;
- int wait;
- };
- /*---------------------------------------------------------------------------*/
- /* Panel Command information */
- /*---------------------------------------------------------------------------*/
- static char otm1902b_1080p_cmd_on_cmd0[] = {
- 0x02, 0x00, 0x29, 0xC0,
- 0x00, 0x00, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd1[] = {
- 0x05, 0x00, 0x29, 0xC0,
- 0xFF, 0x19, 0x02, 0x01,
- 0X00, 0xFF, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd2[] = {
- 0x02, 0x00, 0x29, 0xC0,
- 0x00, 0x80, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd3[] = {
- 0x03, 0x00, 0x29, 0xC0,
- 0xFF, 0x19, 0x02, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd4[] = {
- 0x02, 0x00, 0x29, 0xC0,
- 0x00, 0xB0, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd5[] = {
- 0x05, 0x00, 0x29, 0xC0,
- 0xCA, 0xFF, 0x02, 0x5F,
- 0x40, 0xFF, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd6[] = {
- 0x02, 0x00, 0x29, 0xC0,
- 0x53, 0x2C, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd7[] = {
- 0x02, 0x00, 0x29, 0xC0,
- 0x51, 0xFF, 0xFF, 0xFF, };
- static char otm1902b_1080p_cmd_on_cmd8[] = {
- 0x11, 0x00, 0x05, 0x80, };
- static char otm1902b_1080p_cmd_on_cmd9[] = {
- 0x29, 0x00, 0x05, 0x80, };
- static struct mipi_dsi_cmd otm1902b_1080p_cmd_on_command[] = {
- { 0x8 , otm1902b_1080p_cmd_on_cmd0 ,0x010},
- { 0xc , otm1902b_1080p_cmd_on_cmd1 ,0x010},
- { 0x8 , otm1902b_1080p_cmd_on_cmd2 ,0x010},
- { 0x8 , otm1902b_1080p_cmd_on_cmd3 ,0x010},
- { 0x8 , otm1902b_1080p_cmd_on_cmd4 ,0x010},
- { 0xc , otm1902b_1080p_cmd_on_cmd5 ,0x010},
- { 0x8 , otm1902b_1080p_cmd_on_cmd6 ,0x010},
- { 0x4 , otm1902b_1080p_cmd_on_cmd8 , 0x32},
- { 0x4 , otm1902b_1080p_cmd_on_cmd9 , 0x60},
- };
- int main() {
- printf("hello\n");
- struct mipi_dsi_cmd *cmds = otm1902b_1080p_cmd_on_command;
- int count = 9;
- int i = 0;
- struct mipi_dsi_cmd *cm;
- cm = cmds;
- for (i = 0; i < count; i++) {
- printf("One cmd with hex values of:\n");
- for(int j = 0; j < cm->size; j++) {
- printf("%02x ", (unsigned int)(unsigned char)cm->payload[j]);
- }
- printf("\n");
- cm++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement