emWin driver GUIDRV_BitPlains
This driver has been developed for systems without display controller. It manages each color bit in a separate plain. This
means if the color dept is for example 4 bits per pixel the driver manages 4 bit plains each containing one bit. Initially the
driver has been made to drive monochrome and color TFTs with an R323C/111 CPU via SPI interface. But the driver can
be used also for similar applications. The driver does only manage the content of the bit plains. It does not contain any
display controller specific code.
Supported hardware
Controllers
None.
Bits per pixel
The driver has been developed for a color depth of 1 to 8 bits per pixel.
Interface
It is required to write an application defined routine which uses the content of the bit plains to generate the color signals
for the display. The driver comes with a sample for the R32C/111 CPU which refreshes the display via timer interrupt
routine using the SPI interface.
Driver selection
To use GUIDRV_BitPlains for the given display, e.g. the following command can be used:
GUI_DEVICE_CreateAndLink(GUIDRV_BITPLAINS, GUICC_M111, 0, 0);
Please refer to the emWin documentation to get more information about using the proper palette mode.
Display data RAM organization

The picture above shows the relation between the display memory and the SEG and COM lines of the display.
The display memory is divided into separate plains for each bit of the colors. This means that bit 0 of each pixel
is stored in plain 0, the bit 1 in plain 1 and so on. The advantage of this method is that each color bit of the display
data can be accessed very quickly.
RAM requirements of the driver
The required size of the display memory area can be calculated as follows:
Size = BitsPerPixel * (LCD_XSIZE + 7) / 8 * LCD_YSIZE
Please note that the pointers to the bit plain areas need to be passed to the configuration routine of the driver.
They are not allocated within the driver but from application side.
Hardware configuration
Normally, the hardware interface is an interrupt service routine (ISR) which updates the display. The driver comes
with an example written in "C" code. This routine should serve as an example.
Additional run-time configuration
The table below shows the available run-time configuration routines of this driver:
| Routine | Explanation |
|---|---|
| LCD_SetVRAMAddrEx() | Passes a pointer to a CONFIG_BITPLAINS structure containing pointers to the memory locations of the bit plains. |
Configuration example
#define XSIZE 320
#define YSIZE 240
CONFIG_BITPLAINS Config;
void LCD_X_Config(void) {
GUI_DEVICE * pDevice;
int BitsPerPixel;
int i;
pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_BITPLAINS, GUICC_111, 0, 0);
LCD_SetSizeEx (0, XSIZE, YSIZE);
LCD_SetVSizeEx(0, XSIZE, YSIZE);
BitsPerPixel = LCD_GetBitsPerPixelEx(0);
for (i = 0; i < BitsPerPixel; i++) {
Config.apVRAM[i] = (U8 *)malloc(XSIZE * YSIZE / 8);
}
LCD_SetVRAMAddrEx(0, (void *)&Config);
}
GUIDRV_BitPlains
