#include <MipiDisplay.h>

Inheritance diagram for Graphics::MipiDisplay:
Collaboration diagram for Graphics::MipiDisplay:

Public Member Functions

 MipiDisplay (HSPI::Controller &spi, Size resolution, Size screenSize)
 
bool begin (HSPI::PinSet pinSet, uint8_t chipSelect, uint8_t dcPin, uint8_t resetPin=PIN_NONE, uint32_t clockSpeed=4000000)
 
uint32_t readRegister (uint8_t cmd, uint8_t byteCount)
 
uint32_t readDisplayId ()
 
uint32_t readDisplayStatus ()
 
uint8_t readPowerMode ()
 
uint8_t readMADCTL ()
 
uint8_t readPixelFormat ()
 
uint8_t readImageFormat ()
 
uint8_t readSignalMode ()
 
uint8_t readSelfDiag ()
 
void setNativeSize (Size screenSize)
 Sets the screen size. Must be called before calling begin() More...
 
Size getNativeSize () const override
 Get physical size of display. More...
 
Size getResolution () const
 
bool setScrollMargins (uint16_t top, uint16_t bottom) override
 Set margins for hardware scrolling. More...
 
bool scroll (int16_t y) override
 Scroll region of display up or down using hardware scrolling. More...
 
bool setOrientation (Orientation orientation) override
 Set display orientation. More...
 
Size getSize () const override
 Get target dimensions. More...
 
PixelFormat getPixelFormat () const override
 All surfaces support the same pixel format. More...
 
Point getAddrOffset () const
 
SurfacecreateSurface (size_t bufferSize=0) override
 Create a surface for use with this render target. More...
 
uint16_t getScrollOffset () const
 
 SpiDisplay (HSPI::Controller &spi)
 
- Public Member Functions inherited from Graphics::SpiDisplay
 SpiDisplay (HSPI::Controller &spi)
 
bool begin (HSPI::PinSet pinSet, uint8_t chipSelect, uint8_t resetPin=PIN_NONE, uint32_t clockSpeed=4000000)
 
void execute (SpiDisplayList &list, DisplayList::Callback callback=nullptr, void *param=nullptr)
 
void execute (const SpiDisplayList::Commands &commands, const FSTR::ObjectBase &data)
 
void reset (bool state)
 
HSPI::IoModes getSupportedIoModes () const override
 Return set of IO modes supported by a device implementation. More...
 
AddressWindowgetAddressWindow ()
 
- Public Member Functions inherited from Graphics::AbstractDisplay
virtual ~AbstractDisplay ()
 
- Public Member Functions inherited from Graphics::Device
virtual ~Device ()
 
virtual String getName () const =0
 Get name of display. More...
 
Orientation getOrientation ()
 Get current display orientation. More...
 
- Public Member Functions inherited from Graphics::RenderTarget
virtual ~RenderTarget ()
 
PackedColor getColor (Color color) const
 

Static Public Attributes

static const SpiDisplayList::Commands commands
 

Protected Member Functions

virtual bool initialise ()=0
 Perform display-specific initialisation. More...
 
void sendInitData (const FSTR::ObjectBase &data)
 Called by implementation to send fixed initialisation sequences. More...
 
void setDefaultAddressMode (uint8_t mode)
 Set default address mode setting. More...
 
- Protected Member Functions inherited from HSPI::Device
void transferStarting (Request &request)
 
bool transferComplete (Request &request)
 
 Device (Controller &controller)
 
virtual ~Device ()
 
bool begin (PinSet pinSet, uint8_t chipSelect, uint32_t clockSpeed)
 Register device with controller and prepare for action. More...
 
void end ()
 
bool isReady () const
 Determine if the device is initialised. More...
 
PinSet getPinSet () const
 
uint8_t getChipSelect () const
 
uint32_t getSpeed () const
 
void setBitOrder (BitOrder bitOrder)
 
BitOrder getBitOrder () const
 
void setClockMode (ClockMode mode)
 
ClockMode getClockMode () const
 
bool isSupported (IoMode mode) const
 Determine if the device/controller combination supports an IO mode Must be called after begin() as other settings (e.g. pinset) can affect support. More...
 
virtual bool setIoMode (IoMode mode)
 
IoMode getIoMode () const
 
size_t getBitsPerClock () const
 
void execute (Request &request)
 
void onTransfer (Callback callback)
 Set a callback to be invoked before a request is started, and when it has finished. More...
 
void wait (Request &request)
 
- Protected Member Functions inherited from Graphics::AbstractDisplay
virtual ~AbstractDisplay ()
 
- Protected Member Functions inherited from Graphics::Device
virtual ~Device ()
 
virtual String getName () const =0
 Get name of display. More...
 
Orientation getOrientation ()
 Get current display orientation. More...
 
- Protected Member Functions inherited from Graphics::RenderTarget
virtual ~RenderTarget ()
 
PackedColor getColor (Color color) const
 

Protected Attributes

Size resolution {}
 Controller resolution. More...
 
Size nativeSize {}
 Size of attached screen. More...
 
Point addrOffset {}
 Display orientation may require adjustment to address window position. More...
 
uint8_t defaultAddressMode {Mipi::DCS_ADDRESS_MODE_BGR}
 
- Protected Attributes inherited from Graphics::SpiDisplay
uint8_t resetPin {PIN_NONE}
 
AddressWindow addrWindow {}
 
- Protected Attributes inherited from HSPI::Device
friend Controller
 
Controllercontroller
 
- Protected Attributes inherited from Graphics::Device
Orientation orientation {}
 

Constructor & Destructor Documentation

◆ MipiDisplay()

Graphics::MipiDisplay::MipiDisplay ( HSPI::Controller spi,
Size  resolution,
Size  screenSize 
)
inline

Member Function Documentation

◆ begin()

bool Graphics::MipiDisplay::begin ( HSPI::PinSet  pinSet,
uint8_t  chipSelect,
uint8_t  dcPin,
uint8_t  resetPin = PIN_NONE,
uint32_t  clockSpeed = 4000000 
)

◆ createSurface()

Surface* Graphics::MipiDisplay::createSurface ( size_t  bufferSize = 0)
overridevirtual

Create a surface for use with this render target.

Parameters
bufferSizeSize of internal command/data buffer
Return values
Surface*The surface to use

Caller is responsible for destroying the surface when no longer required.

Implements Graphics::RenderTarget.

◆ getAddrOffset()

Point Graphics::MipiDisplay::getAddrOffset ( ) const
inline

◆ getNativeSize()

Size Graphics::MipiDisplay::getNativeSize ( ) const
inlineoverridevirtual

Get physical size of display.

Return values
SizeDimensions for NORMAL orientation

Implements Graphics::Device.

◆ getPixelFormat()

PixelFormat Graphics::MipiDisplay::getPixelFormat ( ) const
inlineoverridevirtual

All surfaces support the same pixel format.

Implements Graphics::RenderTarget.

◆ getResolution()

Size Graphics::MipiDisplay::getResolution ( ) const
inline

◆ getScrollOffset()

uint16_t Graphics::MipiDisplay::getScrollOffset ( ) const
inline

◆ getSize()

Size Graphics::MipiDisplay::getSize ( ) const
inlineoverridevirtual

Get target dimensions.

Implements Graphics::RenderTarget.

◆ initialise()

virtual bool Graphics::MipiDisplay::initialise ( )
protectedpure virtual

Perform display-specific initialisation.

Return values
booltrue on success, false on failure

Implemented in Graphics::Display::ILI9341, and Graphics::Display::ST7789V.

◆ readDisplayId()

uint32_t Graphics::MipiDisplay::readDisplayId ( )
inline

◆ readDisplayStatus()

uint32_t Graphics::MipiDisplay::readDisplayStatus ( )
inline

◆ readImageFormat()

uint8_t Graphics::MipiDisplay::readImageFormat ( )
inline

◆ readMADCTL()

uint8_t Graphics::MipiDisplay::readMADCTL ( )
inline

◆ readPixelFormat()

uint8_t Graphics::MipiDisplay::readPixelFormat ( )
inline

◆ readPowerMode()

uint8_t Graphics::MipiDisplay::readPowerMode ( )
inline

◆ readRegister()

uint32_t Graphics::MipiDisplay::readRegister ( uint8_t  cmd,
uint8_t  byteCount 
)

◆ readSelfDiag()

uint8_t Graphics::MipiDisplay::readSelfDiag ( )
inline

◆ readSignalMode()

uint8_t Graphics::MipiDisplay::readSignalMode ( )
inline

◆ scroll()

bool Graphics::MipiDisplay::scroll ( int16_t  y)
overridevirtual

Scroll region of display up or down using hardware scrolling.

Parameters
yNumber of lines to scroll. Positive values scroll content down, negative values scroll up.

Implements Graphics::Device.

◆ sendInitData()

void Graphics::MipiDisplay::sendInitData ( const FSTR::ObjectBase data)
inlineprotected

Called by implementation to send fixed initialisation sequences.

◆ setDefaultAddressMode()

void Graphics::MipiDisplay::setDefaultAddressMode ( uint8_t  mode)
inlineprotected

Set default address mode setting.

The display may be attached to the controller in various ways, resulting in a flipped or rotated display.

Changing the default mode allows this to be corrected.

For example, if the display is flipped horizontally, use:

    setDefaultAddressMode(Graphics::Mipi::DCS_ADDRESS_MODE_MIRROR_X);

Flag values may be combined, for example:

    setDefaultAddressMode(
        Graphics::Mipi::DCS_ADDRESS_MODE_MIRROR_X |
        Graphics::Mipi::DCS_ADDRESS_MODE_MIRROR_Y
    );

◆ setNativeSize()

void Graphics::MipiDisplay::setNativeSize ( Size  screenSize)
inline

Sets the screen size. Must be called before calling begin()

◆ setOrientation()

bool Graphics::MipiDisplay::setOrientation ( Orientation  orientation)
overridevirtual

Set display orientation.

Implements Graphics::Device.

◆ setScrollMargins()

bool Graphics::MipiDisplay::setScrollMargins ( uint16_t  top,
uint16_t  bottom 
)
overridevirtual

Set margins for hardware scrolling.

Parameters
topNumber of fixed pixels at top of screen
bottomNumber of fixed pixels at bottom of screen

Area between top/bottom can be scrolled using scroll() method.

Implements Graphics::Device.

◆ SpiDisplay()

Graphics::SpiDisplay::SpiDisplay
inline

Member Data Documentation

◆ addrOffset

Point Graphics::MipiDisplay::addrOffset {}
protected

Display orientation may require adjustment to address window position.

◆ commands

const SpiDisplayList::Commands Graphics::MipiDisplay::commands
static

◆ defaultAddressMode

uint8_t Graphics::MipiDisplay::defaultAddressMode {Mipi::DCS_ADDRESS_MODE_BGR}
protected

◆ nativeSize

Size Graphics::MipiDisplay::nativeSize {}
protected

Size of attached screen.

◆ resolution

Size Graphics::MipiDisplay::resolution {}
protected

Controller resolution.


The documentation for this class was generated from the following file: