Created
          March 21, 2018 05:55 
        
      - 
      
- 
        Save boochow/67568ac6bf6515f13e5272a278f93809 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | typedef volatile struct \ | |
| __attribute__((aligned(16))) _fb_info_t { | |
| uint32_t display_w; //write display width | |
| uint32_t display_h; //write display height | |
| uint32_t w; //write framebuffer width | |
| uint32_t h; //write framebuffer height | |
| uint32_t row_bytes; //write 0 to get value | |
| uint32_t bpp; //write bits per pixel | |
| uint32_t ofs_x; //write x offset of framebuffer | |
| uint32_t ofs_y; //write y offset of framebuffer | |
| uint32_t buf_addr; //write 0 to get value | |
| uint32_t buf_size; //write 0 to get value | |
| } fb_info_t; | |
| void fb_init(fb_info_t *fb_info) { | |
| fb_info->buf_addr = 0; | |
| fb_info->buf_size = 0; | |
| fb_info->row_bytes = 0; | |
| while(fb_info->buf_addr == 0) { | |
| mailbox_write(1, (uint32_t) (fb_info + 0x40000000)); | |
| mailbox_read(1); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment