PebbleOS v4.47.0-1075-g013613c8a
Loading...
Searching...
No Matches
mipi_dsi.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/drivers/mipi_dcs.h>
#include <pbl/drivers/panel.h>
#include <pbl/util/bits.h>
#include <sys/types.h>

Data Structures

struct  pbl_mipi_dsi_device
 A panel on a host. More...
 
struct  pbl_mipi_dsi_msg
 A packet to send, and what to read back. More...
 
struct  pbl_mipi_dsi_host_ops
 Host operations. More...
 
struct  pbl_mipi_dsi_host
 Host. More...
 

Macros

#define PBL_MIPI_DSI_DCS_MAX_PARAMS   63U
 Most parameters of a DCS command pbl_mipi_dsi_dcs_write() sends.
 
#define PBL_MIPI_DSI_HOST_INIT(sym, _name, _init, _parent, _ops)
 Initializer of a host.
 
Data types of the packets a host sends
#define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM   0x03U
 
#define PBL_MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM   0x04U
 
#define PBL_MIPI_DSI_DCS_SHORT_WRITE   0x05U
 
#define PBL_MIPI_DSI_DCS_READ   0x06U
 
#define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM   0x13U
 
#define PBL_MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM   0x14U
 
#define PBL_MIPI_DSI_DCS_SHORT_WRITE_PARAM   0x15U
 
#define PBL_MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM   0x23U
 
#define PBL_MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM   0x24U
 
#define PBL_MIPI_DSI_GENERIC_LONG_WRITE   0x29U
 
#define PBL_MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE   0x37U
 
#define PBL_MIPI_DSI_DCS_LONG_WRITE   0x39U
 
Mode flags
#define PBL_MIPI_DSI_MODE_VIDEO   PBL_BIT(0)
 Video mode: the host streams pixels, else the panel has its own frame memory.
 
#define PBL_MIPI_DSI_MODE_VIDEO_BURST   PBL_BIT(1)
 In video mode, lines in bursts at the full rate of the link, low power in between.
 
#define PBL_MIPI_DSI_MODE_VIDEO_SYNC_PULSE   PBL_BIT(2)
 In video mode, sync pulses with their ends, else sync events.
 
#define PBL_MIPI_DSI_MODE_LPM   PBL_BIT(3)
 Commands in low power, else at high speed.
 

Enumerations

enum  pbl_mipi_dsi_pixel_format { PBL_MIPI_DSI_FMT_RGB888 , PBL_MIPI_DSI_FMT_RGB666 , PBL_MIPI_DSI_FMT_RGB666_PACKED , PBL_MIPI_DSI_FMT_RGB565 }
 Pixel formats of the video stream. More...
 

Functions

int pbl_mipi_dsi_attach (const struct pbl_mipi_dsi_device *dsi)
 Set the link up for a device and start it.
 
int pbl_mipi_dsi_detach (const struct pbl_mipi_dsi_device *dsi)
 Stop the link of a device.
 
int pbl_mipi_dsi_dcs_write (const struct pbl_mipi_dsi_device *dsi, uint8_t cmd, const uint8_t *data, size_t len)
 Send a DCS command with its parameters, as the shortest packet that holds them.
 
int pbl_mipi_dsi_dcs_read (const struct pbl_mipi_dsi_device *dsi, uint8_t cmd, uint8_t *data, size_t len)
 Send a DCS command that reads, and read its response.
 
int pbl_mipi_dsi_generic_write (const struct pbl_mipi_dsi_device *dsi, const uint8_t *data, size_t len)
 Send generic data, as the shortest packet that holds it.