Loading...
Searching...
No Matches
Generic black/white e-paper/e-ink SPI display driver.

Device driver for black/white e-ink/e-paper SPI displays. More...

Detailed Description

Device driver for black/white e-ink/e-paper SPI displays.

This driver provides functionality for working with black/white e-ink (e-paper) SPI displays. Various display controllers are currently supported out of the box, see epd_bw_spi_params.h. Please open an issue or pull request with your controller details (size, Vcom, LUTs) if your display controller is not included yet.

Use of this driver requires knowing the parameters of your display. See epd_bw_spi_params_t and epd_bw_spi_params.h for more details on the parameters. Note that while the reset and busy pins are optional, using them is highly recommended.

This driver has Display device generic API support.

Files

file  epd_bw_spi_internal.h
 Device driver implementation for the epd_bw_spi display controller.
 
file  epd_bw_spi_params.h
 Default configuration for epd_bw_spi.
 
file  epd_bw_spi.h
 Generic black/white e-paper/e-ink display SPI driver.
 
file  epd_bw_spi_disp_dev.h
 Definition of the driver for the disp_dev generic interface.
 

Data Structures

struct  epd_bw_spi_controller_t
 Display controller parameters. More...
 
struct  epd_bw_spi_params_t
 SPI display device initialisation parameters. More...
 
struct  epd_bw_spi_t
 Device initialisation parameters. More...
 

Macros

#define EPD_BW_SPI_COLOR_WHITE   (0xFF)
 White (8x1 pixels)
 
#define EPD_BW_SPI_COLOR_BLACK   (0x00)
 Black (8x1 pixels)
 

Enumerations

enum  epd_bw_spi_entry_mode_t { EPD_BW_SPI_Y_DEC_X_DEC = 0x0 , EPD_BW_SPI_Y_DEC_X_INC = 0x1 , EPD_BW_SPI_Y_INC_X_DEC = 0x2 , EPD_BW_SPI_Y_INC_X_INC = 0x3 }
 Data entry mode settings. More...
 
enum  { EPD_BW_SPI_DC_FAIL = -5 , EPD_BW_SPI_RST_FAIL = -6 , EPD_BW_SPI_BUSY_FAIL = -7 }
 Additional status codes for black/white SPI e-paper displays. More...
 

Functions

int epd_bw_spi_init (epd_bw_spi_t *dev, const epd_bw_spi_params_t *params)
 Initialise the display.
 
void epd_bw_spi_activate (epd_bw_spi_t *dev)
 Activate the display.
 
void epd_bw_spi_deactivate (epd_bw_spi_t *dev)
 Deactivate the display.
 
void epd_bw_spi_init_full (epd_bw_spi_t *dev)
 Initialise the display for a full refresh.
 
void epd_bw_spi_update_full (epd_bw_spi_t *dev)
 Update the display with a full refresh.
 
void epd_bw_spi_init_part (epd_bw_spi_t *dev)
 Initialise the display for a partial refresh.
 
void epd_bw_spi_update_part (epd_bw_spi_t *dev)
 Update the display with a partial refresh.
 
void epd_bw_spi_init_auto (epd_bw_spi_t *dev)
 Initialise the display for an automatic partial/full refresh.
 
void epd_bw_spi_update_auto (epd_bw_spi_t *dev)
 Update the display with an automatic partial/full refresh.
 
void epd_bw_spi_clear (epd_bw_spi_t *dev)
 Clear the entire display.
 
void epd_bw_spi_fill (epd_bw_spi_t *dev, uint8_t x1, uint8_t x2, uint16_t y1, uint16_t y2, uint8_t color)
 Fill an area with a single color.
 
void epd_bw_spi_fill_pixels (epd_bw_spi_t *dev, uint8_t x1, uint8_t x2, uint16_t y1, uint16_t y2, uint8_t *px)
 Fill an area with an array of pixels.
 
void epd_bw_spi_set_area (epd_bw_spi_t *dev, uint8_t x1, uint8_t x2, uint16_t y1, uint16_t y2)
 Set the area in which can be drawn.
 
void epd_bw_spi_write_buffer (epd_bw_spi_t *dev, const uint8_t *buf, size_t len)
 Write to the RAM of the epd_bw_spi controller.
 
void epd_bw_spi_sleep (epd_bw_spi_t *dev)
 Set the display to deep sleep mode.
 
void epd_bw_spi_wake (epd_bw_spi_t *dev)
 Wake the device.
 
void epd_bw_spi_swreset (epd_bw_spi_t *dev)
 Perform a soft reset of the device.
 

Macro Definition Documentation

◆ EPD_BW_SPI_COLOR_BLACK

#define EPD_BW_SPI_COLOR_BLACK   (0x00)

Black (8x1 pixels)

Definition at line 47 of file epd_bw_spi.h.

◆ EPD_BW_SPI_COLOR_WHITE

#define EPD_BW_SPI_COLOR_WHITE   (0xFF)

White (8x1 pixels)

Definition at line 46 of file epd_bw_spi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Additional status codes for black/white SPI e-paper displays.

Definition at line 64 of file epd_bw_spi.h.

◆ epd_bw_spi_entry_mode_t

Data entry mode settings.

This setting affect the automatic increment/decrement of the address counters.

Enumerator
EPD_BW_SPI_Y_DEC_X_DEC 

Y decrement, X decrement.

EPD_BW_SPI_Y_DEC_X_INC 

Y decrement, X increment.

EPD_BW_SPI_Y_INC_X_DEC 

Y increment, X decrement.

EPD_BW_SPI_Y_INC_X_INC 

Y increment, X increment.

Definition at line 54 of file epd_bw_spi.h.

Function Documentation

◆ epd_bw_spi_activate()

void epd_bw_spi_activate ( epd_bw_spi_t dev)

Activate the display.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_clear()

void epd_bw_spi_clear ( epd_bw_spi_t dev)

Clear the entire display.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_deactivate()

void epd_bw_spi_deactivate ( epd_bw_spi_t dev)

Deactivate the display.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_fill()

void epd_bw_spi_fill ( epd_bw_spi_t dev,
uint8_t  x1,
uint8_t  x2,
uint16_t  y1,
uint16_t  y2,
uint8_t  color 
)

Fill an area with a single color.

Parameters
[in]devDevice descriptor
[in]x1X coordinate of the first corner (multiple of 8).
[in]x2X coordinate of the opposite corner (multiple of 8).
[in]y1Y coordinate of the first corner.
[in]y2Y coordinate of the opposite corner.
[in]colorColor to use (EPD_BW_SPI_COLOR_BLACK or EPD_BW_SPI_COLOR_WHITE)

◆ epd_bw_spi_fill_pixels()

void epd_bw_spi_fill_pixels ( epd_bw_spi_t dev,
uint8_t  x1,
uint8_t  x2,
uint16_t  y1,
uint16_t  y2,
uint8_t *  px 
)

Fill an area with an array of pixels.

Note that the length of the array should be the same as the number of pixels in the given area.

Parameters
[in]devDevice descriptor.
[in]x1X coordinate of the first corner (multiple of 8).
[in]x2X coordinate of the opposite corner (multiple of 8).
[in]y1Y coordinate of the first corner.
[in]y2Y coordinate of the opposite corner.
[in]pxArray of pixels to use.

◆ epd_bw_spi_init()

int epd_bw_spi_init ( epd_bw_spi_t dev,
const epd_bw_spi_params_t params 
)

Initialise the display.

Parameters
[out]devDisplay to initialise.
[in]paramsSPI Display parameters to use for initialisation.

◆ epd_bw_spi_init_auto()

void epd_bw_spi_init_auto ( epd_bw_spi_t dev)

Initialise the display for an automatic partial/full refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_init_full()

void epd_bw_spi_init_full ( epd_bw_spi_t dev)

Initialise the display for a full refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_init_part()

void epd_bw_spi_init_part ( epd_bw_spi_t dev)

Initialise the display for a partial refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_set_area()

void epd_bw_spi_set_area ( epd_bw_spi_t dev,
uint8_t  x1,
uint8_t  x2,
uint16_t  y1,
uint16_t  y2 
)

Set the area in which can be drawn.

Parameters
[in]devDevice descriptor.
[in]x1X coordinate of the first corner (multiple of 8).
[in]x2X coordinate of the opposite corner (multiple of 8).
[in]y1Y coordinate of the first corner.
[in]y2Y coordinate of the opposite corner.

◆ epd_bw_spi_sleep()

void epd_bw_spi_sleep ( epd_bw_spi_t dev)

Set the display to deep sleep mode.

After the display has gone to sleep, a wake can be triggered with the reset pin. Do not use this if no reset pin has been defined.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_swreset()

void epd_bw_spi_swreset ( epd_bw_spi_t dev)

Perform a soft reset of the device.

This resets all commands and parameters to their default values, except for sleep mode and the RAM.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_update_auto()

void epd_bw_spi_update_auto ( epd_bw_spi_t dev)

Update the display with an automatic partial/full refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_update_full()

void epd_bw_spi_update_full ( epd_bw_spi_t dev)

Update the display with a full refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_update_part()

void epd_bw_spi_update_part ( epd_bw_spi_t dev)

Update the display with a partial refresh.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_wake()

void epd_bw_spi_wake ( epd_bw_spi_t dev)

Wake the device.

This doesn't do anything without using the reset pin.

Parameters
[in]devDevice descriptor.

◆ epd_bw_spi_write_buffer()

void epd_bw_spi_write_buffer ( epd_bw_spi_t dev,
const uint8_t *  buf,
size_t  len 
)

Write to the RAM of the epd_bw_spi controller.

Together with epd_bw_spi_set_area(), this allows one to draw a pregenerated image on the screen.

Parameters
[in]devDevice descriptor.
[in]bufBuffer to write to the display.
[in]lenSize of the buffer to write to the display.