EpdSetBuffer()

Library Description ›› EPD ›› Buffered ›› Buffers ››
… visits
Parent Previous Next

Syntax

EpdSetBuffer(bWorkingBuffer As bWorkingBuffer)

Parameters

Parameter

Description

bWorkingBuffer

Selects the active working buffer:

EPD_Buffer_A

automatic buffer management

EPD_Buffer_1

sets buffer 1 as currently active

EPD_Buffer_2

sets buffer 2 as currently active

Overview

Selects the current working buffer. 


Current working buffer is the frame buffer that drawing operations write into while building the image.


This is useful when there isn't enough RAM/SRAM for two full buffers on a BWR/BWY display, where each plane would normally get its own.
Managing a single buffer manually this way requires more careful planning of your image-building sequence, since the order in which colors and planes are written matters: Red/Yellow, for instance, takes visual precedence over Black/White wherever both would otherwise apply to the same pixel.

Note: Unlike EpdSetPlane(), this does not automatically revert to automatic management — once set manually, it stays as you left it until you explicitly change it again.


$define EpdFrameBuffer       RAM_1

...

EpdResetScreen(WHITE)                                           'Reset screen to white

'bWorkingBuffer = EPD_Buffer_1                                  'Set working buffer to 1 (disable automatic buffer management)

EpdSetBuffer(EPD_Buffer_1)                                      'Same as above - set working buffer To 1 (Disable automatic buffer management)

EpdSetPlane(EPD_Plane_RY)                                       'Set working plane to RY

EpdRstBuffer1(BLACK)                                            'Reset buffer1 to 0

EpdSetOrientation(0)                                            'Rotate working plane 90 degrees

TftSetBdfFont(0)                                                'Set current BDF font to #0

TftPrintBdfString("PC", 120,20,199,0,RED,WHITE,1)               'Print string with set BDF font

TftRectangleSNTC(268,0, 386,37, RED)                            'Draw rectangle around text

TftSetSndFont(15,0)

TftPrintSndString("SSD1683", 1,272,19,0, BLACK,RED,1)           'Print string, Red part

TftPrintSndString("400x300", 1,272,3,0, BLACK,RED,1)            'Print string, Red part

EpdSendBuffers()                                                'Send buffers to EPD RAM

EpdSetPlane(EPD_Plane_BW)                                       'Set working plane to BW

EpdRstBuffer1(WHITE)                                            'Reset buffer1 to 1

EpdSetOrientation(1)                                            'Rotate working plane 180 degrees

EpdBmpFromCode(BAR_300, 0,315)                                  'Draw Cat picture from FLASH code

TftSetSndFont(0,0)                                              'Set current SND font to #0

TftPrintSndString("POSITRON COMPILER",1,82,295,0, BLACK,WHITE,0)'Print string

EpdSetOrientation(0)                                            'Rotate working plane 90 degrees

EpdBmpFromCode(ATOM_200, 120,50)                                'Draw Cat picture from FLASH code

EpdBmpFromCode(QR_92, 306,206)                                  'Draw Cat picture from FLASH code

TftSetSndFont(15,0)                                             'Set current SND font to #15

TftPrintSndString("SSD1683", 1,272,19,0, BLACK,RED,1)           'Print string, Black part

TftPrintSndString("400x300", 1,272,3,0, BLACK,RED,1)            'Print string, Black part

TftRectangleENTC(268,0, 386,37, BLACK)                          'Draw rectangle around text

TftSetSndFont(5,0)                                              'Set current SND font to #5

TftPrintSndString("BuyDisplay 4.2", 1,271,40,0, BLACK,WHITE,0)  'Print string

EpdSendBuffers()                                                'Send buffers to EPD RAM

EpdFrameUpdate(EPD_UPDATE_NORMAL)                               'Update EPD screen

Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents