objc

Data Structures | Typedefs | Enumerations | Functions

UC8151 e-paper display driver interface for monochrome displays. More...

Collaboration diagram for UC8151:

Data Structures

struct  driver_uc8151_rect_t
 UC8151 display rectangle for partial updates. More...
 
struct  driver_uc8151_t
 UC8151 display driver structure. More...
 

Typedefs

typedef struct driver_uc8151_t driver_uc8151_t
 UC8151 display driver structure. More...
 

Enumerations

enum  driver_uc8151_update_speed_t { DRIVER_UC8151_UPDATE_SPEED_DEFAULT = 0, DRIVER_UC8151_UPDATE_SPEED_MEDIUM = 1, DRIVER_UC8151_UPDATE_SPEED_FAST = 2, DRIVER_UC8151_UPDATE_SPEED_TURBO = 3 }
 UC8151 update speed modes. More...
 
enum  driver_uc8151_rotation_t { DRIVER_UC8151_ROTATION_0 = 0, DRIVER_UC8151_ROTATION_180 = 1 }
 UC8151 rotation modes. More...
 

Functions

driver_uc8151_t driver_uc8151_init (hw_spi_t *spi, uint8_t dc_pin, uint8_t reset_pin, uint8_t busy_pin, uint16_t width, uint16_t height)
 Initialize a UC8151 display driver using the SPI interface. More...
 
void driver_uc8151_finalize (driver_uc8151_t *uc8151)
 Finalize and release a UC8151 display driver. More...
 
static bool driver_uc8151_valid (driver_uc8151_t *uc8151)
 Check if a UC8151 driver structure is valid. More...
 
bool driver_uc8151_set_update_speed (driver_uc8151_t *uc8151, driver_uc8151_update_speed_t speed)
 Set the update speed of the UC8151 display. More...
 
bool driver_uc8151_set_rotation (driver_uc8151_t *uc8151, driver_uc8151_rotation_t rotation)
 Set the rotation of the UC8151 display. More...
 
bool driver_uc8151_set_inverted (driver_uc8151_t *uc8151, bool inverted)
 Set the color inversion of the UC8151 display. More...
 
bool driver_uc8151_set_blocking (driver_uc8151_t *uc8151, bool blocking)
 Set the blocking mode of the UC8151 display. More...
 
uint32_t driver_uc8151_get_update_time (driver_uc8151_t *uc8151)
 Get the estimated update time for the current speed setting. More...
 
bool driver_uc8151_is_busy (driver_uc8151_t *uc8151)
 Check if the UC8151 display is busy. More...
 
void driver_uc8151_busy_wait (driver_uc8151_t *uc8151)
 Wait for the UC8151 display to become ready. More...
 
void driver_uc8151_reset (driver_uc8151_t *uc8151)
 Reset the UC8151 display. More...
 
void driver_uc8151_power_off (driver_uc8151_t *uc8151)
 Turn off the UC8151 display. More...
 
bool driver_uc8151_update (driver_uc8151_t *uc8151, const void *data, size_t size)
 Update the entire UC8151 display with new framebuffer data. More...
 
bool driver_uc8151_partial_update (driver_uc8151_t *uc8151, const uint8_t *data, size_t size, driver_uc8151_rect_t rect)
 Update a partial region of the UC8151 display. More...
 

Detailed Description

UC8151 e-paper display driver interface for monochrome displays.

The UC8151 is a popular e-paper display controller used in various e-ink displays, supporting partial and full updates with different refresh speeds.

Typedef Documentation

◆ driver_uc8151_t

UC8151 display driver structure.

This structure contains the configuration and state information for a UC8151 e-paper display controller instance. The UC8151 supports various update speeds and partial refresh capabilities.

Enumeration Type Documentation

◆ driver_uc8151_rotation_t

UC8151 rotation modes.

Enumerator
DRIVER_UC8151_ROTATION_0 

No rotation.

DRIVER_UC8151_ROTATION_180 

180-degree rotation

Definition at line 35 of file drivers_uc8151.h.

35  {
driver_uc8151_rotation_t
UC8151 rotation modes.
180-degree rotation

◆ driver_uc8151_update_speed_t

UC8151 update speed modes.

Enumerator
DRIVER_UC8151_UPDATE_SPEED_DEFAULT 

Default speed (~4.5s)

DRIVER_UC8151_UPDATE_SPEED_MEDIUM 

Medium speed (~2s)

DRIVER_UC8151_UPDATE_SPEED_FAST 

Fast speed (~0.8s)

DRIVER_UC8151_UPDATE_SPEED_TURBO 

Turbo speed (~0.25s)

Definition at line 24 of file drivers_uc8151.h.

Function Documentation

◆ driver_uc8151_busy_wait()

void driver_uc8151_busy_wait ( driver_uc8151_t uc8151)

Wait for the UC8151 display to become ready.

Parameters
uc8151Pointer to the UC8151 driver structure.

◆ driver_uc8151_finalize()

void driver_uc8151_finalize ( driver_uc8151_t uc8151)

Finalize and release a UC8151 display driver.

Parameters
uc8151Pointer to the UC8151 driver structure to finalize.

This function releases resources associated with the UC8151 display driver and puts the display into a low-power state.

◆ driver_uc8151_get_update_time()

uint32_t driver_uc8151_get_update_time ( driver_uc8151_t uc8151)

Get the estimated update time for the current speed setting.

Parameters
uc8151Pointer to the UC8151 driver structure.
Returns
Estimated update time in milliseconds.

◆ driver_uc8151_init()

driver_uc8151_t driver_uc8151_init ( hw_spi_t spi,
uint8_t  dc_pin,
uint8_t  reset_pin,
uint8_t  busy_pin,
uint16_t  width,
uint16_t  height 
)

Initialize a UC8151 display driver using the SPI interface.

Parameters
spiPointer to an initialized SPI interface for display communication.
dc_pinGPIO pin number for Data/Command control.
reset_pinGPIO pin number for display reset.
busy_pinGPIO pin number for busy status.
widthDisplay width in pixels.
heightDisplay height in pixels.
Returns
A UC8151 driver structure representing the initialized display.

This function initializes a UC8151 e-paper display driver for communication over SPI. The display requires several control pins and supports various resolutions.

Note
The spi pointer must be valid and the SPI interface must be properly initialized with appropriate speed and mode.
See also
hw_spi_init() for SPI interface initialization.
driver_uc8151_finalize() for cleanup and resource release.

◆ driver_uc8151_is_busy()

bool driver_uc8151_is_busy ( driver_uc8151_t uc8151)

Check if the UC8151 display is busy.

Parameters
uc8151Pointer to the UC8151 driver structure.
Returns
True if the display is busy, false if ready.

◆ driver_uc8151_partial_update()

bool driver_uc8151_partial_update ( driver_uc8151_t uc8151,
const uint8_t *  data,
size_t  size,
driver_uc8151_rect_t  rect 
)

Update a partial region of the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.
dataPointer to the framebuffer data.
sizeSize of the framebuffer in bytes.
rectRegion to update.
Returns
True if the partial update was initiated successfully, false otherwise.

◆ driver_uc8151_power_off()

void driver_uc8151_power_off ( driver_uc8151_t uc8151)

Turn off the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.

◆ driver_uc8151_reset()

void driver_uc8151_reset ( driver_uc8151_t uc8151)

Reset the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.

◆ driver_uc8151_set_blocking()

bool driver_uc8151_set_blocking ( driver_uc8151_t uc8151,
bool  blocking 
)

Set the blocking mode of the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.
blockingTrue to enable blocking mode, false for non-blocking.
Returns
True if the blocking mode was set successfully, false otherwise.

◆ driver_uc8151_set_inverted()

bool driver_uc8151_set_inverted ( driver_uc8151_t uc8151,
bool  inverted 
)

Set the color inversion of the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.
invertedTrue to invert colors, false for normal colors.
Returns
True if the inversion was set successfully, false otherwise.

◆ driver_uc8151_set_rotation()

bool driver_uc8151_set_rotation ( driver_uc8151_t uc8151,
driver_uc8151_rotation_t  rotation 
)

Set the rotation of the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.
rotationRotation mode.
Returns
True if the rotation was set successfully, false otherwise.

◆ driver_uc8151_set_update_speed()

bool driver_uc8151_set_update_speed ( driver_uc8151_t uc8151,
driver_uc8151_update_speed_t  speed 
)

Set the update speed of the UC8151 display.

Parameters
uc8151Pointer to the UC8151 driver structure.
speedUpdate speed mode.
Returns
True if the speed was set successfully, false otherwise.

◆ driver_uc8151_update()

bool driver_uc8151_update ( driver_uc8151_t uc8151,
const void *  data,
size_t  size 
)

Update the entire UC8151 display with new framebuffer data.

Parameters
uc8151Pointer to the UC8151 driver structure.
dataPointer to the framebuffer data.
sizeSize of the framebuffer in bytes.
Returns
True if the update was initiated successfully, false otherwise.

◆ driver_uc8151_valid()

static bool driver_uc8151_valid ( driver_uc8151_t uc8151)
inlinestatic

Check if a UC8151 driver structure is valid.

Parameters
uc8151Pointer to the UC8151 driver structure to validate.
Returns
True if the driver structure is valid, false otherwise.

Definition at line 119 of file drivers_uc8151.h.

119  {
120  return uc8151 && uc8151->spi && hw_spi_valid(uc8151->spi) &&
121  uc8151->width > 0 && uc8151->height > 0;
122 }
uint16_t height
Display height in pixels.
uint16_t width
Display width in pixels.
hw_spi_t * spi
Pointer to the SPI interface.
static bool hw_spi_valid(hw_spi_t *spi)
Get true if the SPI interface is valid.
Definition: spi.h:111