PebbleOS v4.43.0-131-ga855823dd
Loading...
Searching...
No Matches
SF32LB LCD controller

Display driver for the SF32LB LCD controller scanning out to a panel. More...

Data Structures

struct  pbl_display_sf32lb_lcdc
 SF32LB LCD controller. More...
 

Macros

#define PBL_DISPLAY_SF32LB_LCDC_DEFINE(sym, _name, _base, _irqn, _clk, _rst, _panel, _width, _height, _rotated, _pinctrl, _discharge, _num_discharge)
 Define an SF32LB LCD controller display.
 

Functions

void pbl_display_sf32lb_lcdc_irq_handler (const struct pbl_display_sf32lb_lcdc *lcdc)
 Controller interrupt handler, to connect with PBL_IRQ_CONNECT().
 
void pbl_display_sf32lb_lcdc_test_drop_next_complete (void)
 Drop the next transfer-complete interrupt.
 

Detailed Description

Display driver for the SF32LB LCD controller scanning out to a panel.

Drives a Panel on the JDI memory-in-pixel parallel interface, with the panel's timing. Takes PBL_DISPLAY_FORMAT_ARGB2222 rows, converted in place to the controller's RGB332 while an update runs. Updates complete from the controller's interrupt, connected by the board.

PBL_DISPLAY_SF32LB_LCDC_DEFINE(s_display, "display", SF32LB52_LCDC1_BASE, PBL_IRQN(LCDC1),
&s_panel.panel, 200, 228, false,
PBL_PINCTRL(&s_lcdc_default, NULL, 0), s_discharge,
ARRAY_LENGTH(s_discharge));
#define SF32LB_HPSYS_RCC
HPSYS RCC clock controller.
Definition sf32lb.h:22
#define SF32LB52_HPSYS_CLK_LCDC1
Definition sf32lb.h:33
#define PBL_CLK(_ctrl, _id)
Initializer for a struct pbl_clk.
Definition clk.h:96
#define PBL_DISPLAY_SF32LB_LCDC_DEFINE(sym, _name, _base, _irqn, _clk, _rst, _panel, _width, _height, _rotated, _pinctrl, _discharge, _num_discharge)
Define an SF32LB LCD controller display.
Definition sf32lb_lcdc.h:95
void pbl_display_sf32lb_lcdc_irq_handler(const struct pbl_display_sf32lb_lcdc *lcdc)
Controller interrupt handler, to connect with PBL_IRQ_CONNECT().
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:131
#define SF32LB52_HPSYS_RST_LCDC1
Definition sf32lb.h:34
#define SF32LB_HPSYS_RCC_RESET
HPSYS RCC reset controller.
Definition sf32lb.h:22
#define PBL_RESET(_ctrl, _id)
Initializer for a struct pbl_reset.
Definition reset.h:87
#define PBL_IRQN(line)
Number of a SoC interrupt line from soc_irqs.h.
Definition irq.h:90
#define PBL_IRQ_CONNECT(line, prio, isr, arg, flags)
Bind a SoC interrupt line to a handler at build time.
Definition irq.h:114
#define ARRAY_LENGTH(array)
Calculate the length of an array, based on the size of the element type.
Definition size.h:18

Data Structure Documentation

◆ pbl_display_sf32lb_lcdc

struct pbl_display_sf32lb_lcdc

SF32LB LCD controller.

Data Fields
uintptr_t base Controller registers.
struct pbl_clk clk Controller clock.
const struct pbl_gpio * discharge Panel inputs driven low, as GPIOs, while the panel is power cycled at init.
struct pbl_display disp Display.
pbl_irq_t irqn Controller interrupt.
uint8_t num_discharge Number of discharge pins.
const struct pbl_panel * panel Panel.
struct pbl_pinctrl pinctrl Panel interface pins.
struct pbl_reset rst Controller reset.
struct pbl_display_sf32lb_lcdc_state * state Driver runtime state.

Macro Definition Documentation

◆ PBL_DISPLAY_SF32LB_LCDC_DEFINE

#define PBL_DISPLAY_SF32LB_LCDC_DEFINE (   sym,
  _name,
  _base,
  _irqn,
  _clk,
  _rst,
  _panel,
  _width,
  _height,
  _rotated,
  _pinctrl,
  _discharge,
  _num_discharge 
)
Value:
static struct pbl_display_sf32lb_lcdc_state sym##_lcdc_state; \
const struct pbl_display_sf32lb_lcdc sym = { \
.disp = PBL_DISPLAY_INIT(sym, _name, &pbl_display_sf32lb_lcdc_ops, nullptr, _width, _height, \
.state = &sym##_lcdc_state, \
.base = (_base), \
.irqn = (_irqn), \
.clk = _clk, \
.rst = _rst, \
.panel = (_panel), \
.pinctrl = _pinctrl, \
.discharge = (_discharge), \
.num_discharge = (_num_discharge), \
}; \
PBL_DEVICE_REGISTER(sym, &sym.disp.dev)
pbl_irq_t irqn
Controller interrupt.
Definition sf32lb_lcdc.h:59
struct pbl_display disp
Display.
Definition sf32lb_lcdc.h:53
struct pbl_pinctrl pinctrl
Panel interface pins.
Definition sf32lb_lcdc.h:67
const struct pbl_gpio * discharge
Panel inputs driven low, as GPIOs, while the panel is power cycled at init.
Definition sf32lb_lcdc.h:69
uintptr_t base
Controller registers.
Definition sf32lb_lcdc.h:57
SF32LB LCD controller.
Definition sf32lb_lcdc.h:51
struct pbl_display_state * state
Runtime state.
Definition display.h:113
struct pbl_device dev
Device.
Definition display.h:109
#define PBL_DISPLAY_INIT(sym, _name, _ops, _deps, _width, _height, _format, _rotated)
Initializer for the struct pbl_display of display sym.
Definition display.h:149
#define PBL_DISPLAY_STATE_DEFINE(sym)
Define the class state of display sym, for the PBL_*_DEFINE() macro of a driver.
Definition display.h:132
@ PBL_DISPLAY_FORMAT_ARGB2222
8 bits per pixel, 2 bits per alpha, red, green and blue, from the most significant bit.
Definition display.h:45

Define an SF32LB LCD controller display.

Parameters
symSymbol of the display.
_nameName.
_baseController registers.
_irqnController interrupt, from PBL_IRQN().
_clkController clock, from PBL_CLK().
_rstController reset, from PBL_RESET().
_panelPanel.
_widthWidth, in pixels, the panel's visible columns.
_heightHeight, in pixels, the panel's visible lines.
_rotatedPanel mounted upside down.
_pinctrlPanel interface pins, from PBL_PINCTRL().
_dischargePins driven low while the panel is power cycled, or NULL.
_num_dischargeNumber of _discharge pins.

Function Documentation

◆ pbl_display_sf32lb_lcdc_irq_handler()

void pbl_display_sf32lb_lcdc_irq_handler ( const struct pbl_display_sf32lb_lcdc *  lcdc)

Controller interrupt handler, to connect with PBL_IRQ_CONNECT().

Parameters
lcdcDisplay.

◆ pbl_display_sf32lb_lcdc_test_drop_next_complete()

void pbl_display_sf32lb_lcdc_test_drop_next_complete ( void  )

Drop the next transfer-complete interrupt.

Test hook simulating a lost completion. The silent-loss timer then fires about 500 ms later and crashes the system, producing a coredump. Not available in release builds.