#include "display.h" #ifndef OTM80009A_H #define OTM80009A_H #define OTM8009A_CMD_NOP 0x00 // NOP command #define OTM8009A_CMD_SWRESET 0x01 // Sw reset command #define OTM8009A_CMD_RDDMADCTL 0x0B // Read Display MADCTR command : read memory display access ctrl #define OTM8009A_CMD_RDDCOLMOD 0x0C // Read Display pixel format #define OTM8009A_CMD_SLPIN 0x10 // Sleep In command #define OTM8009A_CMD_SLPOUT 0x11 // Sleep Out command #define OTM8009A_CMD_PTLON 0x12 // Partial mode On command #define OTM8009A_CMD_DISPOFF 0x28 // Display Off command #define OTM8009A_CMD_DISPON 0x29 // Display On command #define OTM8009A_CMD_CASET 0x2A // Column address set command #define OTM8009A_CMD_PASET 0x2B // Page address set command #define OTM8009A_CMD_RAMWR 0x2C // Memory (GRAM) write command #define OTM8009A_CMD_RAMRD 0x2E // Memory (GRAM) read command #define OTM8009A_CMD_PLTAR 0x30 // Partial area command (4 parameters) #define OTM8009A_CMD_TEOFF 0x34 // Tearing Effect Line Off command : command with no parameter #define OTM8009A_CMD_TEEON 0x35 // Tearing Effect Line On command : command with 1 parameter 'TELOM' // Parameter TELOM : Tearing Effect Line Output Mode : possible values #define OTM8009A_TEEON_TELOM_VBLANKING_INFO_ONLY 0x00 #define OTM8009A_TEEON_TELOM_VBLANKING_AND_HBLANKING_INFO 0x01 #define OTM8009A_CMD_MADCTR 0x36 // Memory Access write control command // Possible used values of MADCTR #define OTM8009A_MADCTR_MODE_PORTRAIT 0x00 #define OTM8009A_MADCTR_MODE_LANDSCAPE 0x60 // MY = 0, MX = 1, MV = 1, ML = 0, RGB = 0 #define OTM8009A_CMD_IDMOFF 0x38 // Idle mode Off command #define OTM8009A_CMD_IDMON 0x39 // Idle mode On command #define OTM8009A_CMD_COLMOD 0x3A // Interface Pixel format command // Possible values of COLMOD parameter corresponding to used pixel formats #define OTM8009A_COLMOD_RGB565 0x55 #define OTM8009A_COLMOD_RGB888 0x77 #define OTM8009A_COLMOD_RGB888_3T 0b11100111 #define OTM8009A_CMD_RAMWRC 0x3C // Memory write continue command #define OTM8009A_CMD_RAMRDC 0x3E // Memory read continue command #define OTM8009A_CMD_WRTESCN 0x44 // Write Tearing Effect Scan line command #define OTM8009A_CMD_RDSCNL 0x45 // Read Tearing Effect Scan line command // CABC Management : ie : Content Adaptive Back light Control in IC OTM8009a #define OTM8009A_CMD_WRDISBV 0x51 // Write Display Brightness command #define OTM8009A_CMD_WRCTRLD 0x53 // Write CTRL Display command #define OTM8009A_CMD_WRCABC 0x55 // Write Content Adaptive Brightness command #define OTM8009A_CMD_WRCABCMB 0x5E // Write CABC Minimum Brightness command #define OTM8009A_CMD_ID1 0xDA // Read ID1 command #define OTM8009A_CMD_ID2 0xDB // Read ID2 command #define OTM8009A_CMD_ID3 0xDC // Read ID3 command typedef enum { OTM8009A_35HZ = 0, OTM8009A_40HZ = 1, OTM8009A_45HZ = 2, OTM8009A_50HZ = 3, OTM8009A_55HZ = 4, OTM8009A_60HZ = 5, OTM8009A_70HZ = 6, } otm8009a_frame_rates_t; typedef enum { OTM8009A_COLORMAP_RGB, OTM8009A_COLORMAP_BGR, } otm8009a_colormap_t; typedef enum { OTM8009A_MODE_PORTRAIT, OTM8009A_MODE_LANDSCAPE, } otm8009a_mode_t; /** * @brief Send * @param[in,out] display The display * @param[in] mode The mode to use * @param[in] frame_rate The rate of frame * @param[in] colormap The colormap to use * @param[in] width The width of the display * @param[in] height The height of the display */ void otm8009_init(display_t *display, otm8009a_mode_t mode, otm8009a_frame_rates_t frame_rate, otm8009a_colormap_t colormap, uint16_t width, uint16_t height); #endif // OTM80009A_H