PebbleOS v4.47.0-757-g12b6c531f
Loading...
Searching...
No Matches
Sharp memory LCDs

Display driver for the Sharp memory LCDs, SPI devices. More...

Data Structures

struct  pbl_display_sharp_memory
 Sharp memory LCD. More...
 

Macros

#define PBL_DISPLAY_SHARP_MEMORY_DEFINE(sym, _name, _width, _height, _bus, _cs, _max_hz, _mode, _enable, _rotation, ...)
 Define a Sharp memory LCD.
 

Detailed Description

Display driver for the Sharp memory LCDs, SPI devices.

The panels keep their image in pixel memory and take PBL_DISPLAY_FORMAT_MONO rows over SPI, with an active-high chip select. They expect every byte least significant bit first: with PBL_SPI_LSB_FIRST the controller shifts them so, otherwise the driver reverses their bits for a controller shifting most significant bit first. VCOM is inverted on the rising edges of EXTCOMIN, driven by a PWM output while the panel is on. Updates complete from the SPI controller.

PBL_DISPLAY_SHARP_MEMORY_DEFINE(s_display, "display", 144, 168, &s_spi3, 0, 1000000,
PBL_GPIO(&dt_gpio0, 4, 0), 0,
PBL_PWM(&s_extcomin, 0, PBL_PWM_HZ(120), 0));
#define PBL_DISPLAY_SHARP_MEMORY_DEFINE(sym, _name, _width, _height, _bus, _cs, _max_hz, _mode, _enable, _rotation,...)
Define a Sharp memory LCD.
Definition sharp_memory.h:80
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:158
#define PBL_PWM_HZ(hz)
Period of a hz Hz output, in nanoseconds.
Definition pwm.h:51
#define PBL_PWM(_ctrl, _channel, _period, _flags)
Initializer for a struct pbl_pwm.
Definition pwm.h:96
#define PBL_SPI_LSB_FIRST
Send the least significant bit of each byte first.
Definition spi.h:72
#define PBL_SPI_CS_HIGH
Chip select is active high.
Definition spi.h:70
#define PBL_SPI_MODE_0
Mode 0: clock idles low, sample on the leading edge.
Definition spi.h:62

Data Structure Documentation

◆ pbl_display_sharp_memory

struct pbl_display_sharp_memory

Sharp memory LCD.

Data Fields
uint8_t * buf Transfer buffer, of SHARP_MEMORY_BUF_SIZE() bytes.
struct pbl_display disp Display.
struct pbl_gpio enable DISP input, turning the image on.
struct pbl_pwm extcomin EXTCOMIN output.
struct pbl_spi_dev spi SPI device.
struct pbl_display_sharp_memory_state * state Driver runtime state.

Macro Definition Documentation

◆ PBL_DISPLAY_SHARP_MEMORY_DEFINE

#define PBL_DISPLAY_SHARP_MEMORY_DEFINE (   sym,
  _name,
  _width,
  _height,
  _bus,
  _cs,
  _max_hz,
  _mode,
  _enable,
  _rotation,
  ... 
)
Value:
static_assert((_width) % 8U == 0U && (_height) <= 255U, "panel size"); \
static_assert((_rotation) == 0 || (_rotation) == 180, "rotation of 0 or 180 degrees"); \
PBL_DISPLAY_STATE_DEFINE(sym); \
static struct pbl_display_sharp_memory_state sym##_sharp_state; \
static uint8_t sym##_sharp_buf[SHARP_MEMORY_BUF_SIZE(_width, _height)]; \
PBL_DEVICE_INSTANCE(sym, struct pbl_display_sharp_memory, struct pbl_display, disp) { \
.disp = PBL_DISPLAY_INIT(sym, _name, nullptr, &pbl_display_sharp_memory_ops, (_width), \
(_height), PBL_DISPLAY_FORMAT_MONO, (_rotation) == 180), \
.state = &sym##_sharp_state, .buf = sym##_sharp_buf, \
.spi = PBL_SPI_DEV(_bus, _cs, _max_hz, _mode), .enable = _enable, .extcomin = __VA_ARGS__, \
}
Sharp memory LCD.
Definition sharp_memory.h:46
A display.
Definition display.h:134
#define PBL_DISPLAY_INIT(sym, _name, _parent, _ops, _width, _height, _format, _rotated,...)
Initializer for the struct pbl_display of display sym.
Definition display.h:236
@ PBL_DISPLAY_FORMAT_MONO
1 bit per pixel, leftmost pixel in the least significant bit, set for white.
Definition display.h:50
#define PBL_SPI_DEV(_bus, _cs, _max_hz, _mode)
Initializer for a struct pbl_spi_dev.
Definition spi.h:173

Define a Sharp memory LCD.

Parameters
symSymbol of the display.
_nameName.
_widthWidth, in pixels, a multiple of 8.
_heightHeight, in pixels, up to 255.
_busSPI bus.
_csChip select number.
_max_hzClock frequency, in Hz.
_modeSPI mode flags, PBL_SPI_*.
_enableDISP input, from PBL_GPIO().
_rotationPanel rotation, 0 or 180 degrees.
...EXTCOMIN output, from PBL_PWM(), at twice the VCOM frequency.