FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
devices::display::DisplayDeviceTrait< DEVICE > Struct Template Reference

Traits for display devices. More...

#include <fastarduino/devices/display.h>

Public Types

using COLOR = void
 The type of a pixel for DEVICE. More...
 
using XCOORD = uint8_t
 The shortest integral type that can hold X coordinates for DEVICE. More...
 
using YCOORD = uint8_t
 The shortest integral type that can hold Y coordinates for DEVICE. More...
 
using SCALAR = uint8_t
 The longest type of XCOORD and YCOORD, used to hold scalar on some drawing primitives, eg for radius in Display::draw_circle(). More...
 
using SIGNED_SCALAR = int8_t
 The signed integral type used by Display algorithms in some drawing primitives, like Display::draw_line() or Display::draw_circle(). More...
 

Static Public Attributes

static constexpr bool IS_DISPLAY = false
 Marker of display devices. More...
 
static constexpr XCOORD MAX_X = 0
 The maximum X coordinate for DEVICE. More...
 
static constexpr YCOORD MAX_Y = 0
 The maximum Y coordinate for DEVICE. More...
 
static constexpr uint8_t WIDTH = 0
 The width in pixels of DEVICE. More...
 
static constexpr uint8_t HEIGHT = 0
 The height in pixels of DEVICE. More...
 
static constexpr bool VERTICAL_FONT = false
 Tells if DEVICE uses vertical fonts (e.g. More...
 
static constexpr bool HAS_RASTER = false
 Tells if DEVICE implements a bitmap raster in SRAM (e.g. More...
 

Detailed Description

template<typename DEVICE>
struct devices::display::DisplayDeviceTrait< DEVICE >

Traits for display devices.

Each display device must define a DisplayDeviceTrait<MyDevice> struct with its characteristics.

The simplest way to do that is to use DisplayDeviceTrait_impl as a base class for each device trait class:

template<board::DigitalPin SCE, board::DigitalPin DC, board::DigitalPin RST>
struct DisplayDeviceTrait<LCD5110<SCE, DC, RST>> :
DisplayDeviceTrait_impl<bool, 84, 48, true, true> {};
SPI device driver for Nokia 5110 display chip.
Definition: lcd5110.h:117
Default base class for all DisplayDeviceTrait.
Definition: display.h:394
Traits for display devices.
Definition: display.h:342
Template Parameters
DEVICEthe actual display device class for which to define traits
See also
DisplayDeviceTrait_impl

Definition at line 341 of file display.h.

Member Typedef Documentation

◆ COLOR

template<typename DEVICE >
using devices::display::DisplayDeviceTrait< DEVICE >::COLOR = void

The type of a pixel for DEVICE.

May be bool for B&W displays, or any more complex type (eg bitfields struct) for displays with large range of colors (on 1 or more bytes).

Definition at line 350 of file display.h.

◆ XCOORD

template<typename DEVICE >
using devices::display::DisplayDeviceTrait< DEVICE >::XCOORD = uint8_t

The shortest integral type that can hold X coordinates for DEVICE.

Definition at line 352 of file display.h.

◆ YCOORD

template<typename DEVICE >
using devices::display::DisplayDeviceTrait< DEVICE >::YCOORD = uint8_t

The shortest integral type that can hold Y coordinates for DEVICE.

Definition at line 354 of file display.h.

◆ SCALAR

template<typename DEVICE >
using devices::display::DisplayDeviceTrait< DEVICE >::SCALAR = uint8_t

The longest type of XCOORD and YCOORD, used to hold scalar on some drawing primitives, eg for radius in Display::draw_circle().

Definition at line 367 of file display.h.

◆ SIGNED_SCALAR

template<typename DEVICE >
using devices::display::DisplayDeviceTrait< DEVICE >::SIGNED_SCALAR = int8_t

The signed integral type used by Display algorithms in some drawing primitives, like Display::draw_line() or Display::draw_circle().

This must be large enough to store -4 * min(WIDTH,HEIGHT).

Definition at line 373 of file display.h.

Member Data Documentation

◆ IS_DISPLAY

template<typename DEVICE >
constexpr bool devices::display::DisplayDeviceTrait< DEVICE >::IS_DISPLAY = false
staticconstexpr

Marker of display devices.

Must be true when DEVICE is a display device.

Definition at line 344 of file display.h.

◆ MAX_X

template<typename DEVICE >
constexpr XCOORD devices::display::DisplayDeviceTrait< DEVICE >::MAX_X = 0
staticconstexpr

The maximum X coordinate for DEVICE.

Definition at line 356 of file display.h.

◆ MAX_Y

template<typename DEVICE >
constexpr YCOORD devices::display::DisplayDeviceTrait< DEVICE >::MAX_Y = 0
staticconstexpr

The maximum Y coordinate for DEVICE.

Definition at line 358 of file display.h.

◆ WIDTH

template<typename DEVICE >
constexpr uint8_t devices::display::DisplayDeviceTrait< DEVICE >::WIDTH = 0
staticconstexpr

The width in pixels of DEVICE.

Definition at line 360 of file display.h.

◆ HEIGHT

template<typename DEVICE >
constexpr uint8_t devices::display::DisplayDeviceTrait< DEVICE >::HEIGHT = 0
staticconstexpr

The height in pixels of DEVICE.

Definition at line 362 of file display.h.

◆ VERTICAL_FONT

template<typename DEVICE >
constexpr bool devices::display::DisplayDeviceTrait< DEVICE >::VERTICAL_FONT = false
staticconstexpr

Tells if DEVICE uses vertical fonts (e.g.

Nokia 5110 display).

Definition at line 375 of file display.h.

◆ HAS_RASTER

template<typename DEVICE >
constexpr bool devices::display::DisplayDeviceTrait< DEVICE >::HAS_RASTER = false
staticconstexpr

Tells if DEVICE implements a bitmap raster in SRAM (e.g.

Nokia 5110 display).

Definition at line 377 of file display.h.


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