PebbleOS v4.47.0-327-g7753e801d
Loading...
Searching...
No Matches
SF32LB57 LCD controller

Display driver for the SF32LB57 LCD controller, sending frames to a panel with frame memory over quad SPI. More...

Data Structures

struct  pbl_display_sf32lb57_lcdc
 SF32LB57 LCD controller. More...
 
struct  pbl_display_sf32lb57_lcdc_dbi
 MIPI DBI host of an SF32LB57 LCD controller. More...
 

Macros

#define PBL_DISPLAY_SF32LB57_LCDC_DEFINE(sym, _name, _base, _irq, _clk, _rst, _panel, _width, _height, _rotation, _fb, _fb_size, _fb_ram, _pinctrl)
 Define an SF32LB57 LCD controller display and its MIPI DBI host.
 

Functions

void pbl_display_sf32lb57_lcdc_irq_handler (const struct pbl_display_sf32lb57_lcdc *lcdc)
 Controller interrupt handler, to connect with PBL_IRQ_CONNECT().
 

Detailed Description

Display driver for the SF32LB57 LCD controller, sending frames to a panel with frame memory over quad SPI.

The controller is the MIPI DBI host of its panel, sym_dbi, through which the panel driver sends its commands: on one line, at the speed the panel reads at. Frames go out on four lines in RGB565, at the fastest clock the panel takes. The framebuffer format is CONFIG_DISPLAY_SF32LB57_LCDC_FORMAT: PBL_DISPLAY_FORMAT_RGB565 rows are sent as they are, and PBL_DISPLAY_FORMAT_ARGB2222 ones are converted in place to the controller's RGB332 while an update runs, for a framebuffer half the size. A panel turned by 180 degrees is read from its last line up and flipped left to right by the panel, or by mirroring the rows in place while an update runs if the panel cannot. Framebuffers are at addresses the controller reaches: the RAM of the SoC, or external RAM. Updates cover the multiples of rows the panel takes. They complete from the controller's interrupt, which an instance connects itself, with priority CONFIG_DISPLAY_SF32LB57_LCDC_IRQ_PRIO, or from the system work queue when rows have to be put back as they were.


Data Structure Documentation

◆ pbl_display_sf32lb57_lcdc

struct pbl_display_sf32lb57_lcdc

SF32LB57 LCD controller.

Data Fields
uintptr_t base Controller registers.
struct pbl_clk clk Controller clock.
struct pbl_display disp Display.
pbl_irq_t irq Controller interrupt.
const struct pbl_panel * panel Panel.
struct pbl_pinctrl pinctrl Panel interface pins.
struct pbl_reset rst Controller reset.
struct pbl_display_sf32lb57_lcdc_state * state Driver runtime state.

◆ pbl_display_sf32lb57_lcdc_dbi

struct pbl_display_sf32lb57_lcdc_dbi

MIPI DBI host of an SF32LB57 LCD controller.

Data Fields
struct pbl_mipi_dbi dbi Host.
const struct pbl_display_sf32lb57_lcdc * lcdc Controller.

Macro Definition Documentation

◆ PBL_DISPLAY_SF32LB57_LCDC_DEFINE

#define PBL_DISPLAY_SF32LB57_LCDC_DEFINE (   sym,
  _name,
  _base,
  _irq,
  _clk,
  _rst,
  _panel,
  _width,
  _height,
  _rotation,
  _fb,
  _fb_size,
  _fb_ram,
  _pinctrl 
)
Value:
static_assert((_rotation) == 0 || (_rotation) == 180, "rotation of 0 or 180 degrees"); \
static_assert( \
(_fb_size) == 0 || (_fb_size) >= (_width) * (_height) * PBL_DISPLAY_SF32LB57_LCDC_BPP, \
"reserved framebuffer smaller than a frame"); \
extern const struct pbl_mipi_dbi sym##_dbi; \
PBL_DISPLAY_STATE_DEFINE(sym); \
static struct pbl_display_sf32lb57_lcdc_state sym##_lcdc_state = { \
}; \
PBL_DEVICE_INSTANCE(sym, struct pbl_display_sf32lb57_lcdc, struct pbl_display, disp){ \
.disp = PBL_DISPLAY_INIT_FRAMEBUFFER(sym, _name, &pbl_display_sf32lb57_lcdc_ops, nullptr, \
_width, _height, PBL_DISPLAY_SF32LB57_LCDC_FORMAT, \
(_rotation) == 180, _fb, _fb_size, _fb_ram), \
.state = &sym##_lcdc_state, \
.base = (_base), \
.irq = (_irq), \
.clk = _clk, \
.rst = _rst, \
.panel = (_panel), \
.pinctrl = PBL_PINCTRL(_pinctrl, nullptr, 0), \
}; \
PBL_DEVICE_STATE_DEFINE(sym##_dbi); \
PBL_DEVICE_INSTANCE(sym##_dbi, struct pbl_display_sf32lb57_lcdc_dbi, struct pbl_mipi_dbi, dbi){ \
.dbi = PBL_MIPI_DBI_INIT(sym##_dbi, _name "_dbi", &sym##_inst.disp.dev, \
&pbl_display_sf32lb57_lcdc_dbi_ops), \
.lcdc = &sym##_inst, \
}; \
PBL_IRQ_CONNECT_NUM(_irq, CONFIG_DISPLAY_SF32LB57_LCDC_IRQ_PRIO, \
SF32LB57 LCD controller.
Definition sf32lb57_lcdc.h:72
MIPI DBI host of an SF32LB57 LCD controller.
Definition sf32lb57_lcdc.h:92
void pbl_display_sf32lb57_lcdc_irq_handler(const struct pbl_display_sf32lb57_lcdc *lcdc)
Controller interrupt handler, to connect with PBL_IRQ_CONNECT().
A display.
Definition display.h:134
#define PBL_DISPLAY_INIT_FRAMEBUFFER(sym, _name, _ops, _deps, _width, _height, _format, _rotated, _fb, _fb_size, _fb_ram,...)
Initializer for the struct pbl_display of display sym, with the memory the board reserves for its fra...
Definition display.h:205
MIPI DBI host.
Definition mipi_dbi.h:55
#define PBL_MIPI_DBI_INIT(sym, _name, _parent, _ops)
Initializer for the struct pbl_mipi_dbi of host sym.
Definition mipi_dbi.h:76
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:131
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50

Define an SF32LB57 LCD controller display and its MIPI DBI host.

Parameters
symSymbol of the display.
_nameName.
_baseController registers.
_irqController interrupt.
_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.
_rotationPanel rotation, 0 or 180 degrees.
_fbMemory reserved for the framebuffer, or 0.
_fb_sizeIts size, in bytes, at least a frame.
_fb_ramRAM device the memory is in, or NULL.
_pinctrlDefault state of the panel interface pins.

Function Documentation

◆ pbl_display_sf32lb57_lcdc_irq_handler()

void pbl_display_sf32lb57_lcdc_irq_handler ( const struct pbl_display_sf32lb57_lcdc *  lcdc)

Controller interrupt handler, to connect with PBL_IRQ_CONNECT().

Parameters
lcdcDisplay.