t k / Mbed 2 deprecated MovPlayer

Dependencies:   AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP TLV320_RBSP mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD.hpp Source File

LCD.hpp

00001 #ifndef __LCD__
00002 #define __LCD__
00003 
00004 #include "mbed.h"
00005 #include "DisplayBace.h"
00006 #include "LCD_shield_config_4_3inch.h"
00007 #include "RGA.h"
00008 #include "CppStandardHelper.hpp"
00009 
00010 class LCD {
00011     static constexpr int FRAME_BUFFER_BYTE_PER_PIXEL = 2;
00012     static constexpr int FRAME_BUFFER_STRIDE = ((LCD_PIXEL_WIDTH * FRAME_BUFFER_BYTE_PER_PIXEL) + 31u) & ~31u;
00013     static volatile int32_t vsync_count;
00014     static void IntCallbackFunc_LoVsync(DisplayBase::int_type_t int_type);
00015     static frame_buffer_t frame_buffer_info;
00016     static uint8_t MBED_ALIGN(32) user_frame_buffer1[FRAME_BUFFER_STRIDE * LCD_PIXEL_HEIGHT];
00017     static uint8_t MBED_ALIGN(32) user_frame_buffer2[FRAME_BUFFER_STRIDE * LCD_PIXEL_HEIGHT];
00018     mbed::DigitalOut lcd_pwon;
00019     mbed::DigitalOut lcd_blon;
00020     mbed::PwmOut     lcd_cntrst;
00021     DisplayBase Display;
00022     Canvas2D_ContextClass canvas2d;
00023     graphics_t *graphics;
00024     LCD();
00025     static LCD instance;
00026     void Wait_Vsync(const int32_t wait_count);
00027     void Swap_FrameBuffer();
00028     void Update_LCD_Display();
00029     
00030 public:
00031     static LCD *singleton() {
00032         return &instance;
00033     }
00034     void start();
00035     void stop();
00036     void drawImage(const graphics_image_t *image, int_t minX, int_t minY) {
00037 //        Swap_FrameBuffer();
00038         frame_buffer_info.draw_buffer_index ^= 1;
00039         R_GRAPHICS_DrawImage(graphics, image, minX, minY);
00040         R_GRAPHICS_Finish(graphics);
00041         Display.Graphics_Read_Change(DisplayBase::GRAPHICS_LAYER_0,
00042                                      (void *)frame_buffer_info.buffer_address[frame_buffer_info.draw_buffer_index]);
00043 //        Update_LCD_Display();
00044     }
00045     void drawImage(const graphics_image_t *image) {
00046         drawImage(image, 0, 0);
00047     }
00048 };
00049 
00050 #endif
00051