31 lines
621 B
C++
31 lines
621 B
C++
#ifndef LCD_DMA_H
|
|
#define LCD_DMA_H
|
|
|
|
#include <cstdint>
|
|
#include "common_types.h"
|
|
|
|
#define LCD_DMA_BUFFER_OFFSET 0x00100000
|
|
#define LCD_DMA_WIDTH 480
|
|
#define LCD_DMA_HEIGHT 800
|
|
#define LCD_DMA_PIXELS (LCD_DMA_WIDTH * LCD_DMA_HEIGHT)
|
|
|
|
class LcdDma
|
|
{
|
|
public:
|
|
static LcdDma &instance();
|
|
RetCode init();
|
|
void fillBuffer(uint16_t color);
|
|
uint16_t *getBuffer(void) { return buffer_; }
|
|
|
|
private:
|
|
LcdDma() = default;
|
|
~LcdDma() = default;
|
|
LcdDma(const LcdDma &) = delete;
|
|
LcdDma &operator=(const LcdDma &) = delete;
|
|
|
|
uint16_t *buffer_{nullptr};
|
|
bool initialized_{false};
|
|
};
|
|
|
|
#endif
|