KSM edits to RA8875

Dependents:   Liz_Test_Code

Embed: (wiki syntax)

« Back to documentation index

RA8875 Class Reference

This is a graphics library for the Raio RA8875 Display Controller chip attached to a 4-wire SPI interface. More...

#include <RA8875.h>

Inherits GraphicsDisplay.

Public Types

enum  cursor_t { NOCURSOR, IBEAM, UNDER, BLOCK }
 

cursor type argument for SetTextCursorControl()

More...
enum  font_t { ISO8859_1, ISO8859_2, ISO8859_3, ISO8859_4 }
 

font type selection argument for SetTextFont()

More...
enum  orientation_t {
  normal, rotate_0 = normal, rotate_90, rotate_180,
  rotate_270
}
 

display orientation argument for SetOrientation() with landscape mode as the normal (0 degree) orientation.

More...
enum  alignment_t { align_none, align_full }
 

alignment control argument for SetTextFontControl()

More...
enum  Region_t { FULLWINDOW, ACTIVEWINDOW }
 

Clear screen region option for clsw()

More...
enum  LayerMode_T {
  ShowLayer0, ShowLayer1, LightenOverlay, TransparentMode,
  BooleanOR, BooleanAND, FloatingWindow
}
 

Layer Display Mode argument for SetLayerMode, GetLayerMode.

More...
enum  tpmode_t { TP_Auto, TP_Manual }
 

Touch Panel modes.

More...
enum  filecmd_t { OPEN, WRITE, CLOSE }
 

PrintScreen callback commands for the user code PrintCallback_T()

More...
enum  IdleReason_T {
  unknown, status_wait, command_wait, getc_wait,
  touch_wait, touchcal_wait, progress
}
 

Idle reason provided in the Idle Callback IdleCallback_T()

More...
typedef int HorizontalScale
 Font Horizontal Scale factor - 1, 2, 3 4 for SetTextFontSize(), GetTextFontSize()
typedef int VerticalScale
 Font Vertical Scale factor - 1, 2, 3, 4 for SetTextFontSize(), GetTextFontSize()
typedef RetCode_t(* PrintCallback_T )(filecmd_t cmd, uint8_t *buffer, uint16_t size)
 print screen callback
typedef RetCode_t(* IdleCallback_T )(IdleReason_T reason, uint16_t param=0)
 Idle Callback.

Public Member Functions

 RA8875 (PinName mosi, PinName miso, PinName sclk, PinName csel, PinName reset, const char *name="lcd")
 Basic constructor for a display based on the RAiO RA8875 display controller, which can be used with no touchscreen, or the RA8875 managed resistive touchscreen.
 RA8875 (PinName mosi, PinName miso, PinName sclk, PinName csel, PinName reset, PinName sda, PinName scl, PinName irq, const char *name="lcd")
 Constructor for a display based on the RAiO RA8875 display controller (using the FT5206 Capacitive TouchScreen Controller)
 RA8875 (PinName mosi, PinName miso, PinName sclk, PinName csel, PinName reset, PinName sda, PinName scl, PinName wake, PinName irq, const char *name="lcd")
 Constructor for a display based on the RAiO RA8875 display controller (using the GSL1680 Capacitive TouchScreen Controller)
RetCode_t init (int width=480, int height=272, int color_bpp=16, uint8_t poweron=40, bool keypadon=true, bool touchscreeenon=true)
 Initialize the driver.
const char * GetErrorMessage (RetCode_t code)
 Get a pointer to the text string representing the RetCode_t.
virtual RetCode_t SelectDrawingLayer (uint16_t layer, uint16_t *prevLayer=NULL)
 Select the drawing layer for subsequent commands.
virtual uint16_t GetDrawingLayer (void)
 Get the currently active drawing layer.
RetCode_t SetLayerMode (LayerMode_T mode)
 Set the Layer presentation mode.
LayerMode_T GetLayerMode (void)
 Get the Layer presentation mode.
RetCode_t SetLayerTransparency (uint8_t layer1, uint8_t layer2)
 Set the layer transparency for each layer.
RetCode_t SetBackgroundTransparencyColor (color_t color=RGB(0, 0, 0))
 Set the background color register used for transparency.
color_t GetBackgroundTransparencyColor (void)
 Get the background color value used for transparency.
RetCode_t TouchPanelInit (void)
 Initialize theTouch Panel controller with default values.
RetCode_t TouchPanelInit (uint8_t bTpEnable, uint8_t bTpAutoManual, uint8_t bTpDebounce, uint8_t bTpManualMode, uint8_t bTpAdcClkDiv, uint8_t bTpAdcSampleTime)
 Initialize the Touch Panel controller with detailed settings.
TouchCode_t TouchPanelReadable (point_t *TouchPoint=NULL)
 Get the screen calibrated point of touch.
uint8_t TouchGesture (void)
 Get the reported touch gesture, if any.
int TouchCount (void)
 Get the count of registered touches.
int TouchChannels (void)
 Get the count of possible touch channels.
uint8_t TouchID (uint8_t channel=0)
 Get the Touch ID value for a specified touch channel.
TouchCode_t TouchCode (uint8_t channel=0)
 Get the Touch Code for a touch channel.
point_t TouchCoordinates (uint8_t channel=0)
 Get the coordinates for a touch channel.
TouchCode_t TouchPanelA2DFiltered (int *x, int *y)
 Poll the TouchPanel and on a touch event return the a to d filtered x, y coordinates.
TouchCode_t TouchPanelA2DRaw (int *x, int *y)
 Poll the TouchPanel and on a touch event return the a to d raw x, y coordinates.
TouchCode_t TouchPanelGet (point_t *TouchPoint)
 Wait for a touch panel touch and return it.
void ResTouchPanelCfg (const char *tpFQFN=NULL, const char *tpCalMessage=NULL)
 Configuration Option for the Resistive Touch Panel Calibration.
RetCode_t TouchPanelComputeCalibration (point_t display[3], point_t screen[3], tpMatrix_t *matrix)
 Calibrate the touch panel.
RetCode_t TouchPanelCalibrate (tpMatrix_t *matrix=NULL)
 Perform the touch panel calibration process.
RetCode_t TouchPanelCalibrate (const char *msg, tpMatrix_t *matrix=NULL, int maxwait_s=30)
 Perform the touch panel calibration process.
RetCode_t TouchPanelSetMatrix (tpMatrix_t *matrix)
 Set the calibration matrix for the resistive touch panel.
const tpMatrix_tTouchPanelGetMatrix ()
 Get the calibration matrix for the resistive touch panel.
void AppendISR (uint8_t bISRType, void(*fptr)(void))
 Append interrupt handler for specific RA8875 interrupt source.
void UnAppendISR (uint8_t bISRType)
 Unappend interrupt handler for specific RA8875 interrupt source.
RetCode_t KeypadInit (bool scanEnable=true, bool longDetect=false, uint8_t sampleTime=0, uint8_t scanFrequency=0, uint8_t longTimeAdjustment=0, bool interruptEnable=false, bool wakeupEnable=false)
 Initialize the keypad interface on the RA8875 controller.
RetCode_t SetKeyMap (const uint8_t *CodeList=NULL)
 Create Key Code definitions for the key matrix.
bool readable ()
 Determine if a key has been hit.
uint8_t getc ()
 Blocking read of the keypad.
bool Intersect (rect_t rect, point_t p)
 Determine if a point is within a rectangle.
bool Intersect (rect_t rect1, rect_t rect2)
 Determine if a rectangle intersects another rectangle.
bool Intersect (rect_t *pRect1, const rect_t *pRect2)
 Determine if a rectangle intersects another rectangle and provides the area of intersection.
RetCode_t WriteCommandW (uint8_t command, uint16_t data)
 Write a command to the display with a word of data.
virtual RetCode_t WriteCommand (unsigned char command, unsigned int data=0xFFFF)
 Write a command to the display.
RetCode_t WriteDataW (uint16_t data)
 Write a data word to the display.
virtual RetCode_t WriteData (unsigned char data)
 Write a data byte to the display.
unsigned char ReadCommand (unsigned char command)
 Read a command register.
uint16_t ReadCommandW (unsigned char command)
 Read a word from a command register.
unsigned char ReadData (void)
 Read a data byte from the display.
uint16_t ReadDataW (void)
 Read a word from the display.
unsigned char ReadStatus (void)
 Read the display status.
dim_t fontwidth (void)
 get the width in pixels of the currently active font
dim_t fontheight (void)
 get the height in pixels of the currently active font
virtual int columns (void)
 get the number of colums based on the currently active font
virtual int rows (void)
 get the number of rows based on the currently active font
virtual dim_t width (void)
 get the screen width in pixels
virtual dim_t height (void)
 get the screen height in pixels
virtual dim_t color_bpp (void)
 get the color depth in bits per pixel.
virtual RetCode_t locate (textloc_t column, textloc_t row)
 Set cursor position based on the current font size.
RetCode_t SetTextCursor (loc_t x, loc_t y)
 Prepare the controller to write text to the screen by positioning the cursor.
RetCode_t SetTextCursor (point_t p)
 Prepare the controller to write text to the screen by positioning the cursor.
point_t GetTextCursor (void)
 Get the current cursor position in pixels.
loc_t GetTextCursor_X (void)
 Get the current cursor horizontal position in pixels.
loc_t GetTextCursor_Y (void)
 Get the current cursor vertical position in pixels.
RetCode_t SetTextCursorControl (cursor_t cursor=NOCURSOR, bool blink=false)
 Configure additional Cursor Control settings.
RetCode_t SetTextFont (font_t font=ISO8859_1)
 Select the built-in ISO 8859-X font to use next.
RetCode_t SetOrientation (orientation_t angle=normal)
 Sets the display orientation.
RetCode_t SetTextFontControl (fill_t fillit=FILL, HorizontalScale hScale=1, VerticalScale vScale=1, alignment_t alignment=align_none)
 Control the font behavior.
RetCode_t SetTextFontSize (HorizontalScale hScale=1, VerticalScale vScale=-1)
 Control the font size of the RA8875 rendered fonts.
RetCode_t GetTextFontSize (HorizontalScale *hScale, VerticalScale *vScale)
 Get the text font size of the RA8875 internal fonts.
virtual int _putc (int c)
 put a character on the screen.
void puts (const char *string)
 Write string of text to the display.
void puts (loc_t x, loc_t y, const char *string)
 Write string of text to the display at the specified location.
virtual RetCode_t SetGraphicsCursor (loc_t x, loc_t y)
 Prepare the controller to write binary data to the screen by positioning the memory cursor.
virtual RetCode_t SetGraphicsCursor (point_t p)
 Prepare the controller to write binary data to the screen by positioning the memory cursor.
virtual point_t GetGraphicsCursor (void)
 Read the current graphics cursor position as a point.
virtual RetCode_t SetGraphicsCursorRead (loc_t x, loc_t y)
 Prepare the controller to read binary data from the screen by positioning the memory read cursor.
virtual RetCode_t window (rect_t r)
 Set the window, constraining where items are written to the screen.
virtual RetCode_t window (loc_t x=0, loc_t y=0, dim_t width=(dim_t)-1, dim_t height=(dim_t)-1)
 Set the window, constraining where items are written to the screen.
virtual RetCode_t cls (uint16_t layers=0)
 Clear either the specified layer, or the active layer.
RetCode_t clsw (RA8875::Region_t region=FULLWINDOW)
 Clear the screen, or clear only the active window.
virtual RetCode_t background (color_t color)
 Set the background color.
virtual RetCode_t background (unsigned char r, unsigned char g, unsigned char b)
 Set the background color.
virtual RetCode_t foreground (color_t color)
 Set the foreground color.
virtual RetCode_t foreground (unsigned char r, unsigned char g, unsigned char b)
 Set the foreground color.
color_t GetForeColor (void)
 Get the current foreground color value.
virtual RetCode_t pixel (point_t p, color_t color)
 Draw a pixel in the specified color.
virtual RetCode_t pixel (point_t p)
 Draw a pixel in the current foreground color.
virtual RetCode_t pixel (loc_t x, loc_t y, color_t color)
 Draw a pixel in the specified color.
virtual RetCode_t pixel (loc_t x, loc_t y)
 Draw a pixel in the current foreground color.
virtual color_t getPixel (loc_t x, loc_t y)
 Get a pixel from the display.
virtual RetCode_t pixelStream (color_t *p, uint32_t count, loc_t x, loc_t y)
 Write an RGB565 stream of pixels to the display.
virtual RetCode_t getPixelStream (color_t *p, uint32_t count, loc_t x, loc_t y)
 Get a stream of pixels from the display.
virtual RetCode_t booleanStream (loc_t x, loc_t y, dim_t w, dim_t h, const uint8_t *boolStream)
 Write a boolean stream to the display.
RetCode_t line (point_t p1, point_t p2, color_t color)
 Draw a line in the specified color.
RetCode_t line (point_t p1, point_t p2)
 Draw a line.
RetCode_t line (loc_t x1, loc_t y1, loc_t x2, loc_t y2, color_t color)
 Draw a line in the specified color.
RetCode_t line (loc_t x1, loc_t y1, loc_t x2, loc_t y2)
 Draw a line.
RetCode_t ThickLine (point_t p1, point_t p2, dim_t thickness, color_t color)
 Draw a thick line.
RetCode_t rect (rect_t rect, color_t color, fill_t fillit=NOFILL)
 Draw a rectangle in the specified color.
RetCode_t fillrect (rect_t rect, color_t color, fill_t fillit=FILL)
 Draw a filled rectangle in the specified color.
RetCode_t rect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, color_t color, fill_t fillit=NOFILL)
 Draw a rectangle in the specified color.
virtual RetCode_t fillrect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, color_t color, fill_t fillit=FILL)
 Draw a filled rectangle in the specified color.
RetCode_t rect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, fill_t fillit=NOFILL)
 Draw a rectangle.
RetCode_t fillroundrect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=FILL)
 Draw a filled rectangle with rounded corners using the specified color.
RetCode_t fillroundrect (rect_t r, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=FILL)
 Draw a filled rectangle with rounded corners using the specified color.
RetCode_t roundrect (rect_t r, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=NOFILL)
 Draw a rectangle with rounded corners using the specified color.
RetCode_t roundrect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=NOFILL)
 Draw a rectangle with rounded corners using the specified color.
RetCode_t roundrect (loc_t x1, loc_t y1, loc_t x2, loc_t y2, dim_t radius1, dim_t radius2, fill_t fillit=NOFILL)
 Draw a rectangle with rounded corners.
RetCode_t triangle (loc_t x1, loc_t y1, loc_t x2, loc_t y2, loc_t x3, loc_t y3, color_t color, fill_t fillit=NOFILL)
 Draw a triangle in the specified color.
RetCode_t filltriangle (loc_t x1, loc_t y1, loc_t x2, loc_t y2, loc_t x3, loc_t y3, color_t color, fill_t fillit=FILL)
 Draw a filled triangle in the specified color.
RetCode_t triangle (loc_t x1, loc_t y1, loc_t x2, loc_t y2, loc_t x3, loc_t y3, fill_t fillit=NOFILL)
 Draw a triangle.
RetCode_t circle (point_t p, dim_t radius, color_t color, fill_t fillit=NOFILL)
 Draw a circle using the specified color.
RetCode_t fillcircle (point_t p, dim_t radius, color_t color, fill_t fillit=FILL)
 Draw a filled circle using the specified color.
RetCode_t circle (point_t p, dim_t radius, fill_t fillit=NOFILL)
 Draw a circle.
RetCode_t circle (loc_t x, loc_t y, dim_t radius, color_t color, fill_t fillit=NOFILL)
 Draw a circle using the specified color.
RetCode_t fillcircle (loc_t x, loc_t y, dim_t radius, color_t color, fill_t fillit=FILL)
 Draw a filled circle using the specified color.
RetCode_t circle (loc_t x, loc_t y, dim_t radius, fill_t fillit=NOFILL)
 Draw a circle.
RetCode_t ellipse (loc_t x, loc_t y, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=NOFILL)
 Draw an Ellipse using the specified color.
RetCode_t fillellipse (loc_t x, loc_t y, dim_t radius1, dim_t radius2, color_t color, fill_t fillit=FILL)
 Draw a filled Ellipse using the specified color.
RetCode_t ellipse (loc_t x, loc_t y, dim_t radius1, dim_t radius2, fill_t fillit=NOFILL)
 Draw an Ellipse.
RetCode_t BlockMove (uint8_t dstLayer, uint8_t dstDataSelect, point_t dstPoint, uint8_t srcLayer, uint8_t srcDataSelect, point_t srcPoint, dim_t bte_width, dim_t bte_height, uint8_t bte_op_code, uint8_t bte_rop_code)
 Block Move.
RetCode_t Power (bool on)
 Control display power.
RetCode_t Reset (void)
 Reset the display controller via the Software Reset interface.
RetCode_t Backlight_u8 (uint8_t brightness)
 Set backlight brightness.
uint8_t GetBacklight_u8 (void)
 Get backlight brightness.
RetCode_t Backlight (float brightness)
 Set backlight brightness.
float GetBacklight (void)
 Get backlight brightness.
virtual RetCode_t SelectUserFont (const uint8_t *font=NULL)
 Select a User Font for all subsequent text.
virtual const uint8_t * GetUserFont (void)
 Get the currently selected user font.
color_t DOSColor (int i)
 Get the color_t value from a DOS color index.
const char * DOSColorNames (int i)
 Get the color name (string) from a DOS color index.
virtual RetCode_t _StartGraphicsStream (void)
 Advanced method indicating the start of a graphics stream.
virtual RetCode_t _putp (color_t pixel)
 Advanced method to put a single color pixel to the screen.
virtual RetCode_t _EndGraphicsStream (void)
 Advanced method indicating the end of a graphics stream.
RetCode_t frequency (unsigned long Hz=RA8875_DEFAULT_SPI_FREQ, unsigned long Hz2=0)
 Set the SPI port frequency (in Hz).
RetCode_t PrintScreen (loc_t x, loc_t y, dim_t w, dim_t h, const char *Name_BMP, uint8_t bitsPerPixel=24)
 This method captures the specified area as a 24-bit bitmap file.
RetCode_t PrintScreen (loc_t x, loc_t y, dim_t w, dim_t h, uint8_t bitsPerPixel=24)
 This method captures the specified area as a 24-bit bitmap file and delivers it to the previously attached callback.
void AttachPrintHandler (PrintCallback_T callback=NULL)
 PrintScreen callback registration.
template<class T >
void AttachPrintHandler (T *object, RetCode_t(T::*method)(void))
 PrintScreen callback registration.
RetCode_t PrintScreen (uint16_t layer, loc_t x, loc_t y, dim_t w, dim_t h, const char *Name_BMP)
 This method captures the specified area as a 24-bit bitmap file, including the option of layer selection.
void AttachIdleHandler (IdleCallback_T callback=NULL)
 idle callback registration.
void ClearPerformance ()
 Clear the performance metrics to zero.
void CountIdleTime (uint32_t t)
 Count idle time.
void ReportPerformance (Serial &pc)
 Report the performance metrics for drawing functions using the available serial channel.
virtual RetCode_t WindowMax (void)
 method to set the window region to the full screen.
virtual RetCode_t fill (loc_t x, loc_t y, dim_t w, dim_t h, color_t color)
 method to fill a region.
virtual RetCode_t blit (loc_t x, loc_t y, dim_t w, dim_t h, const int *color)
 method to stream bitmap data to the display
virtual const uint8_t * getCharMetrics (const unsigned char c, dim_t *width, dim_t *height)
 This method returns the width in pixels of the chosen character from the previously selected external font.
virtual int fontblit (loc_t x, loc_t y, const unsigned char c)
 This method transfers one character from the external font data to the screen.
color_t RGBQuadToRGB16 (RGBQUAD *colorPaletteArray, uint16_t index)
 This method returns the color value from a palette.
RGBQUAD RGB16ToRGBQuad (color_t c)
 This method converts a 16-bit color value into a 24-bit RGB Quad.
RetCode_t RenderImageFile (loc_t x, loc_t y, const char *FileName)
 This method attempts to render a specified graphics image file at the specified screen location.
RetCode_t RenderJpegFile (loc_t x, loc_t y, const char *Name_JPG)
 This method reads a disk file that is in jpeg format and puts it on the screen.
RetCode_t RenderBitmapFile (loc_t x, loc_t y, const char *Name_BMP)
 This method reads a disk file that is in bitmap format and puts it on the screen.
RetCode_t RenderIconFile (loc_t x, loc_t y, const char *Name_ICO)
 This method reads a disk file that is in ico format and puts it on the screen.
RetCode_t RenderGIFFile (loc_t x, loc_t y, const char *Name_GIF)
 Render a GIF file on screen.
RetCode_t GetGIFMetrics (gif_screen_descriptor_t *imageDescriptor, const char *Name_GIF)
 GetGIFMetrics.
virtual int character (int x, int y, int value)
 prints one character at the specified coordinates.
virtual bool claim (FILE *stream)
 redirect output from a stream (stoud, sterr) to display

Protected Member Functions

RetCode_t _RenderBitmap (loc_t x, loc_t y, uint32_t fileOffset, FILE *fh)
 Protected method to render an image given a file handle and coordinates.
RetCode_t _RenderGIF (loc_t x, loc_t y, FILE *fh)
 Protected method to render a GIF given a file handle and coordinates.
virtual int _getc ()
 a method to get a character from the stdin

Protected Attributes

short _x
 keeps track of current X location
short _y
 keeps track of current Y location
uint8_t fontScaleX
 tracks the font scale factor for Soft fonts. Range: 1 .. 4
uint8_t fontScaleY
 tracks the font scale factor for soft fonts. Range: 1 .. 4
uint16_t _column
 character column location
uint16_t _row
 character row location
color_t _foreground
 presently set foreground color
color_t _background
 presently set background color
char * _path
 stream name when redirecting stdio

Detailed Description

This is a graphics library for the Raio RA8875 Display Controller chip attached to a 4-wire SPI interface.

It offers both primitive and high level APIs.

Central to this API is a coordinate system, where the origin (0,0) is in the top-left corner of the display, and the width (x) extends positive to the right and the height (y) extends positive toward the bottom.

Note:
As there are both graphics and text commands, one must take care to use the proper coordinate system for each. Some of the text APIs are in units of column and row, which is measured in character positions (and dependent on the font size), where other text APIs permit pixel level positioning.
 #include "RA8875.h"
 RA8875 lcd(p5, p6, p7, p12, NC, "tft");

 int main()
 {
     lcd.init();
     lcd.printf("printing 3 x 2 = %d", 3*2);
     lcd.circle(       400,25,  25,               BrightRed);
     lcd.fillcircle(   400,25,  15,               RGB(128,255,128));
     lcd.ellipse(      440,75,  35,20,            BrightBlue);
     lcd.fillellipse(  440,75,  25,10,            Blue);
     lcd.triangle(     440,100, 475,110, 450,125, Magenta);
     lcd.filltriangle( 445,105, 467,111, 452,120, Cyan);
     lcd.rect(         400,130, 475,155,          Brown);
     lcd.fillrect(     405,135, 470,150,          Pink);
     lcd.roundrect(    410,160, 475,190, 10,8,    Yellow);
     lcd.fillroundrect(415,165, 470,185,  5,3,    Orange);
     lcd.line(         430,200, 460,230,          RGB(0,255,0));
     for (int i=0; i<=30; i+=5) 
         lcd.pixel(435+i,200+i, White);
 }

Definition at line 422 of file RA8875.h.


Member Typedef Documentation

typedef int HorizontalScale

Font Horizontal Scale factor - 1, 2, 3 4 for SetTextFontSize(), GetTextFontSize()

Definition at line 462 of file RA8875.h.

typedef RetCode_t(* IdleCallback_T)(IdleReason_T reason, uint16_t param=0)

Idle Callback.

This defines the interface for an idle callback. That is, when the driver is held up, pending some event, it can call a previously registered idle function. This could be most useful for servicing a watchdog.

The user code, which is notified via this API, can force the idle to abort, by returning the external_abort value back to the driver. It is important to note that the abort could leave the driver in an undesireable state, so this should be used with care.

Note:
Should it be called the BusyCallback? It is true, that it will call this function when the RA8875 is busy, but this is also when the CPU is largely idle.
 RetCode_t myIdle_handler(RA8875::IdleReason_T reason, uint16_t param)
 {
     idleFlasher = !idleFlasher;
     if (it_has_been_too_long())
         return external_abort;
     else
         return noerror;
 }
Parameters:
reasoninforms the callback why it is idle.
paramis a 2nd parameter, which is used for certain reason codes for 'progress' reason code, param ranges from 0 to 100 (percent)
Returns:
RetCode_t value.

Definition at line 582 of file RA8875.h.

typedef RetCode_t(* PrintCallback_T)(filecmd_t cmd, uint8_t *buffer, uint16_t size)

print screen callback

The special form of the print screen will pass one blob at a time to the callback. There are basic commands declaring that the stream can be opened, a block written, and the stream closed. There is also a command to communicate the total size being delivered.

If the idle callback is registered, it will be activated passing a parameter indicating the percent complete, which may be of value.

 lcd.PrintScreen(x,y,w,h,callback);
 ... 
 void callback(filecmd_t cmd, uint8_t * buffer, uint16_t size) {
     switch(cmd) {
         case OPEN:
             pc.printf("About to write %u bytes\r\n", *(uint32_t *)buffer);
             fh = fopen("file.bmp", "w+b");
             break;
         case WRITE:
             fwrite(buffer, size, fh);
             break;
         case CLOSE:
             fclose(fh);
             break;
         default:
             pc.printf("Unexpected callback %d\r\n", cmd);
             break;
     }
 }
Parameters:
cmdis the command to execute. See filecmd_t.
bufferis a pointer to the buffer being passed.
sizeis the number of bytes in the buffer.
Returns:
RetCode_t value.

Definition at line 538 of file RA8875.h.

typedef int VerticalScale

Font Vertical Scale factor - 1, 2, 3, 4 for SetTextFontSize(), GetTextFontSize()

Definition at line 465 of file RA8875.h.


Member Enumeration Documentation

alignment control argument for SetTextFontControl()

Enumerator:
align_none 

align - none

align_full 

align - full

Definition at line 455 of file RA8875.h.

enum cursor_t

cursor type argument for SetTextCursorControl()

Enumerator:
NOCURSOR 

cursor is hidden

IBEAM 

I Beam '|' cursor.

UNDER 

Underscore '_' cursor.

BLOCK 

Block cursor.

Definition at line 426 of file RA8875.h.

enum filecmd_t

PrintScreen callback commands for the user code PrintCallback_T()

Enumerator:
OPEN 

command to open the file. cast uint32_t * to the buffer to get the total size to be written.

WRITE 

command to write some data, buffer points to the data and the size is in bytes.

CLOSE 

command to close the file

Definition at line 494 of file RA8875.h.

enum font_t

font type selection argument for SetTextFont()

Enumerator:
ISO8859_1 

ISO8859-1 font.

ISO8859_2 

ISO8859-2 font.

ISO8859_3 

ISO8859-3 font.

ISO8859_4 

ISO8859-4 font.

Definition at line 435 of file RA8875.h.

Idle reason provided in the Idle Callback IdleCallback_T()

Enumerator:
unknown 

reason has not been assigned (this should not happen)

status_wait 

driver is polling the status register while busy

command_wait 

driver is polling the command register while busy

getc_wait 

user has called the getc function

touch_wait 

user has called the touch function

touchcal_wait 

driver is performing a touch calibration

progress 

communicates progress

Definition at line 541 of file RA8875.h.

Layer Display Mode argument for SetLayerMode, GetLayerMode.

Enumerator:
ShowLayer0 

Only layer 0 is visible, layer 1 is hidden (default)

ShowLayer1 

Only layer 1 is visible, layer 0 is hidden.

LightenOverlay 

Lighten-overlay mode.

TransparentMode 

Transparent mode.

BooleanOR 

Boolean OR mode.

BooleanAND 

Boolean AND mode.

FloatingWindow 

Floating Window mode.

Definition at line 475 of file RA8875.h.

display orientation argument for SetOrientation() with landscape mode as the normal (0 degree) orientation.

Enumerator:
normal 

normal (landscape) orientation

rotate_0 

alternate to 'normal'

rotate_90 

rotated clockwise 90 degree

rotate_180 

rotated (clockwise) 180 degree

rotate_270 

rotated clockwise 270 degree

Definition at line 445 of file RA8875.h.

enum Region_t

Clear screen region option for clsw()

Enumerator:
FULLWINDOW 

Full screen.

ACTIVEWINDOW 

active window/region

Definition at line 468 of file RA8875.h.

enum tpmode_t

Touch Panel modes.

Enumerator:
TP_Auto 

Auto touch detection mode.

TP_Manual 

Manual touch detection mode.

Definition at line 487 of file RA8875.h.


Constructor & Destructor Documentation

RA8875 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  csel,
PinName  reset,
const char *  name = "lcd" 
)

Basic constructor for a display based on the RAiO RA8875 display controller, which can be used with no touchscreen, or the RA8875 managed resistive touchscreen.

This constructor differs from the alternate by supportting either No Touch Screen, or the RA8875 built-in resistive touch screen. If the application requires the use of the capacitive touchscreen, the alternate constructor must be used.

This configures the registers and calls the init method.

 #include "RA8875.h"
 RA8875 lcd(p5, p6, p7, p12, NC, "tft");

 int main()
 {
     lcd.init();     // defaults for 480x272x16 at low brightness
     lcd.printf("printing 3 x 2 = %d", 3*2);
     lcd.circle(400,25, 25, BrightRed);
 }
Parameters:
[in]mosiis the SPI master out slave in pin on the mbed.
[in]misois the SPI master in slave out pin on the mbed.
[in]sclkis the SPI shift clock pin on the mbed.
[in]cselis the DigitalOut pin on the mbed to use as the active low chip select for the display controller.
[in]resetis the DigitalOut pin on the mbed to use as the active low reset input on the display controller - but this is not currently used.
[in]nameis a text name for this object, which will permit capturing stdout to puts() and printf() directly to it.

Definition at line 188 of file RA8875.cpp.

RA8875 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  csel,
PinName  reset,
PinName  sda,
PinName  scl,
PinName  irq,
const char *  name = "lcd" 
)

Constructor for a display based on the RAiO RA8875 display controller (using the FT5206 Capacitive TouchScreen Controller)

 #include "RA8875.h"
 RA8875 lcd(p5, p6, p7, p12, NC, p9,p10,p13, "tft");
 
 int main()
 {
     lcd.init();
     lcd.printf("printing 3 x 2 = %d", 3*2);
     lcd.circle(400,25, 25, BrightRed);
     TouchCode_t tp = lcd.TouchPanelReadable();
     if (tp == touch)
         ...
 }
Parameters:
[in]mosiis the SPI master out slave in pin on the mbed.
[in]misois the SPI master in slave out pin on the mbed.
[in]sclkis the SPI shift clock pin on the mbed.
[in]cselis the DigitalOut pin on the mbed to use as the active low chip select for the display controller.
[in]resetis the DigitalOut pin on the mbed to use as the active low reset input on the display controller - but this is not currently used.
[in]sdais the I2C Serial Data pin you are wiring to the FT5206.
[in]sclis the I2C Serial Clock pin you are wiring to the FT5206.
[in]irqis the Interrupt Request pin you are wiring to the FT5206.
[in]nameis a text name for this object, which will permit capturing stdout to puts() and printf() directly to it.

Definition at line 214 of file RA8875.cpp.

RA8875 ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  csel,
PinName  reset,
PinName  sda,
PinName  scl,
PinName  wake,
PinName  irq,
const char *  name = "lcd" 
)

Constructor for a display based on the RAiO RA8875 display controller (using the GSL1680 Capacitive TouchScreen Controller)

 #include "RA8875.h"
 RA8875 lcd(p5, p6, p7, p12, NC, p9,p10,p13,p14, "tft");
 
 int main()
 {
     lcd.init();
     lcd.printf("printing 3 x 2 = %d", 3*2);
     lcd.circle(400,25, 25, BrightRed);
     TouchCode_t tp = lcd.TouchPanelReadable();
     if (tp == touch)
         ...
 }
Parameters:
[in]mosiis the SPI master out slave in pin on the mbed.
[in]misois the SPI master in slave out pin on the mbed.
[in]sclkis the SPI shift clock pin on the mbed.
[in]cselis the DigitalOut pin on the mbed to use as the active low chip select for the display controller.
[in]resetis the DigitalOut pin on the mbed to use as the active low reset input on the display controller - but this is not currently used.
[in]sdais the I2C Serial Data pin you are wiring to the GSL1680.
[in]sclis the I2C Serial Clock pin you are wiring to the GSL1680.
[in]wakeis the wake control pin you are wiring to the GSL1680.
[in]irqis the Interrupt Request pin you are wiring to the GSL1680.
[in]nameis a text name for this object, which will permit capturing stdout to puts() and printf() directly to it.

Definition at line 259 of file RA8875.cpp.


Member Function Documentation

RetCode_t _EndGraphicsStream ( void   ) [virtual]

Advanced method indicating the end of a graphics stream.

This is called to conclude a stream of pixel data that was sent. This may cause register configuration changes in the derived class in order to stop the hardware from accept the streaming data.

Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1282 of file RA8875.cpp.

int _getc (  ) [protected, virtual, inherited]

a method to get a character from the stdin

Returns:
the fetched character.

Definition at line 81 of file TextDisplay.cpp.

int _putc ( int  c ) [virtual]

put a character on the screen.

Parameters:
[in]cis the character.
Returns:
the character, or EOF if there is an error.

Reimplemented from TextDisplay.

Definition at line 1191 of file RA8875.cpp.

RetCode_t _putp ( color_t  pixel ) [virtual]

Advanced method to put a single color pixel to the screen.

This method may be called as many times as necessary after See _StartGraphicsStream() is called, and it should be followed by _EndGraphicsStream.

     _putp(DOSColor(12));
Parameters:
[in]pixelis a color value to be put on the screen.
Returns:
RetCode_t value.

Reimplemented from GraphicsDisplay.

Definition at line 1288 of file RA8875.cpp.

RetCode_t _RenderBitmap ( loc_t  x,
loc_t  y,
uint32_t  fileOffset,
FILE *  fh 
) [protected, inherited]

Protected method to render an image given a file handle and coordinates.

Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]fileOffsetis the offset into the file where the image data starts
[in]fhis the file handle to the stream already opened for the data.
Returns:
success or error code.

Definition at line 281 of file GraphicsDisplay.cpp.

RetCode_t _RenderGIF ( loc_t  x,
loc_t  y,
FILE *  fh 
) [protected, inherited]

Protected method to render a GIF given a file handle and coordinates.

Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]fhis the file handle to the stream already opened for the data.
Returns:
success or error code.

Definition at line 412 of file GraphicsDisplayGIF.cpp.

RetCode_t _StartGraphicsStream ( void   ) [virtual]

Advanced method indicating the start of a graphics stream.

This is called prior to a stream of pixel data being sent. This may cause register configuration changes in the derived class in order to prepare the hardware to accept the streaming data.

Following this command, a series of See _putp() commands can be used to send individual pixels to the screen.

To conclude the graphics stream, See _EndGraphicsStream should be called.

Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1274 of file RA8875.cpp.

void AppendISR ( uint8_t  bISRType,
void(*)(void)  fptr 
)

Append interrupt handler for specific RA8875 interrupt source.

Parameters:
[in]bISRTypeInterrupt Source, should be:

  • RA8875_INT_KEYSCAN: KEYCAN interrupt
  • RA8875_INT_DMA: DMA interrupt
  • RA8875_INT_TP: Touch panel interrupt
  • RA8875_INT_BTE: BTE process complete interrupt
  • RA8875_INT_BTEMCU_FONTWR: Multi-purpose interrupt (see spec sheet)
[in]fptris a callback function to handle the interrupt event.
Returns:
none
void AttachIdleHandler ( IdleCallback_T  callback = NULL )

idle callback registration.

This method attaches a simple c-compatible callback of type IdleCallback_T. Then, at any time when the display driver is waiting, it will call the registered function. This is probably most useful if you want to service a watchdog, when you may have called an API that will "hang" waiting on the user.

 RetCode_t myIdle_handler(RA8875::IdleReason_T reason, uint16_t param)
 {
     static uint16_t lastProgress = 0xFFFF;

     if (reason == RA8875::progress && param != lastProgress) {
         printf("Progress %3d%%\r\n", param);
         lastProgress = progress;
     }
     return noerror;
 }

     ...
     lcd.AttachIdleHandler(myIdle_handler);
     ...
     RetCode_t r = lcd.PrintScreen(0,0,LCD_W,LCD_H,"/local/print.bmp");
     if (r ...)
Parameters:
callbackis the idle callback function. Without a callback function it will unregister the handler.

Definition at line 2997 of file RA8875.h.

void AttachPrintHandler ( PrintCallback_T  callback = NULL )

PrintScreen callback registration.

This method attaches a simple c-compatible callback of type PrintCallback_T. Then, the PrintScreen(x,y,w,h) method is called. Each chunk of data in the BMP file to be created is passed to this callback.

Parameters:
callbackis the optional callback function. Without a callback function it will unregister the handler.

Definition at line 2925 of file RA8875.h.

void AttachPrintHandler ( T *  object,
RetCode_t(T::*)(void)  method 
)

PrintScreen callback registration.

This method attaches a c++ class method as a callback of type PrintCallback_T. Then, the PrintScreen(x,y,w,h) method is called. Each chunk of data in the BMP file to be created is passed to this callback.

Parameters:
objectis the class hosting the callback function.
methodis the callback method in the object to activate.

Definition at line 2938 of file RA8875.h.

RetCode_t background ( color_t  color ) [virtual]

Set the background color.

Parameters:
[in]coloris expressed in 16-bit format.
Returns:
RetCode_t value.

Implements TextDisplay.

Definition at line 2073 of file RA8875.cpp.

RetCode_t background ( unsigned char  r,
unsigned char  g,
unsigned char  b 
) [virtual]

Set the background color.

Parameters:
[in]ris the red element of the color.
[in]gis the green element of the color.
[in]bis the blue element of the color.
Returns:
RetCode_t value.

Definition at line 2080 of file RA8875.cpp.

RetCode_t Backlight ( float  brightness )

Set backlight brightness.

When the built-in PWM is used to control the backlight, this API can be used to set the brightness.

Parameters:
[in]brightnessranges from 0.0 (off) to 1.0 (full on)
Returns:
RetCode_t value.

Definition at line 2030 of file RA8875.cpp.

RetCode_t Backlight_u8 ( uint8_t  brightness )

Set backlight brightness.

When the built-in PWM is used to control the backlight, this API can be used to set the brightness.

Parameters:
[in]brightnessranges from 0 (off) to 255 (full on)
Returns:
RetCode_t value.

Definition at line 2006 of file RA8875.cpp.

RetCode_t blit ( loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
const int *  color 
) [virtual, inherited]

method to stream bitmap data to the display

This method fills a region from a stream of color data.

Parameters:
[in]xis the left-edge of the region.
[in]yis the top-edge of the region.
[in]wspecifies the width of the region.
[in]hspecifies the height of the region.
[in]coloris a pointer to a color stream with w x h values.
Returns:
success/failure code.
See also:
RetCode_t.

Definition at line 177 of file GraphicsDisplay.cpp.

RetCode_t BlockMove ( uint8_t  dstLayer,
uint8_t  dstDataSelect,
point_t  dstPoint,
uint8_t  srcLayer,
uint8_t  srcDataSelect,
point_t  srcPoint,
dim_t  bte_width,
dim_t  bte_height,
uint8_t  bte_op_code,
uint8_t  bte_rop_code 
)

Block Move.

The Block Move API activates the RA8875 Block Transfer Engine. Due to the complex set of possible operations, the user should read the related sections of the RA8875 user manual.

Some operations may require that other registers are configured, such as the foreground and background color registers, and others. Those must be set outside of this API.

 // Block Move Demo
 
 // Calibrate the resistive touch screen, and store the data on the
 // local file system.
 //
 void CalibrateTS(void)
 {
    FILE * fh;
    tpMatrix_t matrix;
    RetCode_t r;
    Timer testperiod;
 
    r = lcd.TouchPanelCalibrate("Calibrate the touch panel", &matrix);
    if (r == noerror) {
        fh = fopen("/local/tpcal.cfg", "wb");
        if (fh) {
            fwrite(&matrix, sizeof(tpMatrix_t), 1, fh);
            fclose(fh);
            printf("  tp cal written.\r\n");
             lcd.cls();
         } else {
             printf("  couldn't open tpcal file.\r\n");
         }
     } else {
         printf("error return: %d\r\n", r);
     }
     lcd.cls();
 }
 
 // Try to load a previous resistive touch screen calibration from storage. If it
 // doesn't exist, activate the touch screen calibration process.
 //
 void InitTS(void)
 {
     FILE * fh;
     tpMatrix_t matrix;
 
     fh = fopen("/local/tpcal.cfg", "rb");
     if (fh) {
         fread(&matrix, sizeof(tpMatrix_t), 1, fh);
         fclose(fh);
         lcd.TouchPanelSetMatrix(&matrix);
         printf("  tp cal loaded.\r\n");
     } else {
         CalibrateTS();
     }
 }

 int main()
 {
     point_t src;
     point_t dst;
     TouchCode_t touch;
     const dim_t RECT_W = 100;
     const dim_t RECT_H = 100;
     
     pc.baud(460800);    //I like a snappy terminal, so crank it up!
     pc.printf("\r\nRA8875 BTE Move Test - Build " __DATE__ " " __TIME__ "\r\n");
     lcd.init(LCD_W,LCD_H,LCD_C, BL_NORM);
     lcd.TouchPanelInit();
     #ifndef CAP_TOUCH
     InitTS();   // Calibration for resistive touch panel
     #endif
     
     RetCode_t r = lcd.RenderImageFile(0,0,"/local/fullscrn.jpg");
     if (r) pc.printf("  Error: %d; %s\r\n", r, lcd.GetErrorMessage(r));
     while (1) {
         touch = lcd.TouchPanelReadable();
         if (touch) {
             point_t xy = lcd.TouchCoordinates();
             TouchCode_t t = lcd.TouchCode();
 
             if (t == touch) {
                 src = ComputeTopLeftOfRect(xy, RECT_W/2, RECT_H/2, LCD_W, LCD_H);
             } else if (t == release) {
                 dst = ComputeTopLeftOfRect(xy, RECT_W/2, RECT_H/2, LCD_W, LCD_H);
                 r = lcd.BlockMove(0,0,dst, 0,0,src, RECT_W,RECT_H, 0x2, 0xC);
             }
         }
     }
 }
Parameters:
[in]dstLayerlayer [5B.7]. layer value is 0 or 1 representing layer 1 and 2.
[in]dstDataSelect[50.5] defines the destination data type 0: block, 1: linear.
[in]dstPoint[58-5B] is a point_t defining the destination coordinate.
[in]srcLayerlayer [57.7]. layer value is 0 or 1 representing layer 1 and 2.
[in]srcDataSelect[50.6] defines the source data type 0: block, 1: linear.
[in]srcPoint[54-57] is a point_t defining the source coordinate.
[in]bte_width[5C-5D]. operation width.
[in]bte_height[5E-5F]. operation height.
[in]bte_op_code[51.3-0] defines the raster operation function (write/read/move/...)
[in]bte_rop_code[51.7-4] defines what type of BTE operation to perform (what is placed at the destination)
Returns:
RetCode_t value.

Definition at line 1968 of file RA8875.cpp.

RetCode_t booleanStream ( loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
const uint8_t *  boolStream 
) [virtual]

Write a boolean stream to the display.

This takes a bit stream in memory and using the current color settings it will stream it to the display. Along the way, each bit is translated to either the foreground or background color value and then that pixel is pushed onward.

This is similar, but different, to the pixelStream API, which is given a stream of color values.

This is most often used for Soft Fonts, and for that reason, this method will scale the presentation based on the selected font size. See SetTextFontSize, So, users may want to SetTextFontSize(1) for 1:1 scaling.

Parameters:
[in]xis the horizontal position on the display.
[in]yis the vertical position on the display.
[in]wis the width of the rectangular region to fill.
[in]his the height of the rectangular region to fill.
[in]boolStreamis the inline memory image from which to extract the bitstream.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1471 of file RA8875.cpp.

int character ( int  x,
int  y,
int  value 
) [virtual, inherited]

prints one character at the specified coordinates.

This will print the character at the specified pixel coordinates.

Parameters:
[in]xis the horizontal offset in pixels.
[in]yis the vertical offset in pixels.
[in]valueis the character to print.
Returns:
number of pixels to index to the right if a character was printed, 0 otherwise.

Implements TextDisplay.

Definition at line 109 of file GraphicsDisplay.cpp.

RetCode_t circle ( point_t  p,
dim_t  radius,
fill_t  fillit = NOFILL 
)

Draw a circle.

Draws a circle using the foreground color setting.

Parameters:
[in]pdefines the center of the circle.
[in]radiusdefines the size of the circle.
[in]fillitis optional to FILL the circle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1844 of file RA8875.cpp.

RetCode_t circle ( loc_t  x,
loc_t  y,
dim_t  radius,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a circle using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]xis the horizontal center of the circle.
[in]yis the vertical center of the circle.
[in]radiusdefines the size of the circle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the circle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1850 of file RA8875.cpp.

RetCode_t circle ( point_t  p,
dim_t  radius,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a circle using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]pdefines the center of the circle.
[in]radiusdefines the size of the circle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the circle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1828 of file RA8875.cpp.

RetCode_t circle ( loc_t  x,
loc_t  y,
dim_t  radius,
fill_t  fillit = NOFILL 
)

Draw a circle.

Draws a circle using the foreground color setting.

Parameters:
[in]xis the horizontal center of the circle.
[in]yis the vertical center of the circle.
[in]radiusdefines the size of the circle.
[in]fillitis optional to FILL the circle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1866 of file RA8875.cpp.

bool claim ( FILE *  stream ) [virtual, inherited]

redirect output from a stream (stoud, sterr) to display

Note:
this method may be overridden in a derived class.
Parameters:
[in]streamthat shall be redirected to the TextDisplay
Returns:
true if the claim succeeded.

Definition at line 100 of file TextDisplay.cpp.

void ClearPerformance (  )

Clear the performance metrics to zero.

Definition at line 627 of file RA8875.cpp.

RetCode_t cls ( uint16_t  layers = 0 ) [virtual]

Clear either the specified layer, or the active layer.

The behavior is to clear the whole screen for the specified layer. When not specified, the active drawing layer is cleared. This command can also be used to specifically clear either, or both layers. See clsw().

     lcd.cls();
Parameters:
[in]layersis optional. If not provided, the active layer is cleared. If bit 0 is set, layer 0 is cleared, if bit 1 is set, layer 1 is cleared. If both are set, both layers are cleared. Any other value does not cause an action.
Returns:
RetCode_t value.

Reimplemented from GraphicsDisplay.

Definition at line 1370 of file RA8875.cpp.

RetCode_t clsw ( RA8875::Region_t  region = FULLWINDOW )

Clear the screen, or clear only the active window.

The default behavior is to clear the whole screen. With the optional parameter, the action can be restricted to the active window, which can be set with the See window method.

     lcd.window(20,20, 40,10);
     lcd.clsw();
Parameters:
[in]regionis an optional parameter that defaults to FULLWINDOW or may be set to ACTIVEWINDOW.
Returns:
RetCode_t value.

Definition at line 1398 of file RA8875.cpp.

dim_t color_bpp ( void   ) [virtual]

get the color depth in bits per pixel.

Returns:
8 or 16 only.

Definition at line 997 of file RA8875.cpp.

int columns ( void   ) [virtual]

get the number of colums based on the currently active font

Returns:
number of columns.

Reimplemented from GraphicsDisplay.

Definition at line 967 of file RA8875.cpp.

void CountIdleTime ( uint32_t  t )

Count idle time.

Parameters:
[in]tis the amount of idle time to accumulate.

Definition at line 648 of file RA8875.cpp.

color_t DOSColor ( int  i )

Get the color_t value from a DOS color index.

See Predefined Colors, color_t.

     color_t color = DOSColor(12);
Parameters:
[in]iis the color index, in the range 0 to 15;
Returns:
the color_t value of the selected index, or 0 (Black) if the index is out of bounds.

Definition at line 2107 of file RA8875.cpp.

const char * DOSColorNames ( int  i )

Get the color name (string) from a DOS color index.

See Predefined Colors, color_t.

     printf("color is %s\n", DOSColorNames(12));
Parameters:
[in]iis the color index, in the range 0 to 15;
Returns:
a pointer to a string with the color name, or NULL if the index is out of bounds.

Definition at line 2122 of file RA8875.cpp.

RetCode_t ellipse ( loc_t  x,
loc_t  y,
dim_t  radius1,
dim_t  radius2,
fill_t  fillit = NOFILL 
)

Draw an Ellipse.

Draws it using the foreground color setting.

Parameters:
[in]xis the horizontal center of the ellipse.
[in]yis the vertical center of the ellipse.
[in]radius1defines the horizontal radius of the ellipse.
[in]radius2defines the vertical radius of the ellipse.
[in]fillitdefines whether the circle is filled or not.
Returns:
RetCode_t value.

Definition at line 1909 of file RA8875.cpp.

RetCode_t ellipse ( loc_t  x,
loc_t  y,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw an Ellipse using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]xis the horizontal center of the ellipse.
[in]yis the vertical center of the ellipse.
[in]radius1defines the horizontal radius of the ellipse.
[in]radius2defines the vertical radius of the ellipse.
[in]colordefines the foreground color.
[in]fillitdefines whether the circle is filled or not.
Returns:
RetCode_t value.

Definition at line 1895 of file RA8875.cpp.

RetCode_t fill ( loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
color_t  color 
) [virtual, inherited]

method to fill a region.

This method fills a region with the specified color. It essentially is an alias for fillrect, however this uses width and height rather than a second x,y pair.

Parameters:
[in]xis the left-edge of the region.
[in]yis the top-edge of the region.
[in]wspecifies the width of the region.
[in]hspecifies the height of the region.
[in]coloris the color value to use to fill the region
Returns:
success/failure code.
See also:
RetCode_t.

Definition at line 157 of file GraphicsDisplay.cpp.

RetCode_t fillcircle ( point_t  p,
dim_t  radius,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled circle using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]pdefines the center of the circle.
[in]radiusdefines the size of the circle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the circle. default is FILL.
Returns:
RetCode_t value.

Definition at line 1836 of file RA8875.cpp.

RetCode_t fillcircle ( loc_t  x,
loc_t  y,
dim_t  radius,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled circle using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]xis the horizontal center of the circle.
[in]yis the vertical center of the circle.
[in]radiusdefines the size of the circle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the circle. default is FILL.
Returns:
RetCode_t value.

Definition at line 1858 of file RA8875.cpp.

RetCode_t fillellipse ( loc_t  x,
loc_t  y,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled Ellipse using the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]xis the horizontal center of the ellipse.
[in]yis the vertical center of the ellipse.
[in]radius1defines the horizontal radius of the ellipse.
[in]radius2defines the vertical radius of the ellipse.
[in]colordefines the foreground color.
[in]fillitdefines whether the circle is filled or not.
Returns:
RetCode_t value.

Definition at line 1902 of file RA8875.cpp.

RetCode_t fillrect ( rect_t  rect,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled rectangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]rectdefines the rectangle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1638 of file RA8875.cpp.

RetCode_t fillrect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
color_t  color,
fill_t  fillit = FILL 
) [virtual]

Draw a filled rectangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
[in]colordefines the foreground color.
[in]fillitis optional to NOFILL the rectangle. default is FILL.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1643 of file RA8875.cpp.

RetCode_t fillroundrect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled rectangle with rounded corners using the specified color.

This draws a rounded rectangle. A numbers of checks are made on the values, and it could reduce this to drawing a line (if either x1 == x2, or y1 == y2), or a single point (x1 == x2 && y1 == y2). If the radius parameters are > 1/2 the length of that side (width or height), an error value is returned.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal start of the line and must be <= x2.
[in]y1is the vertical start of the line and must be <= y2.
[in]x2is the horizontal end of the line and must be >= x1.
[in]y2is the vertical end of the line and must be >= y1.
[in]radius1defines the horizontal radius of the curved corner. Take care that this value < 1/2 the width of the rectangle, or bad_parameter is returned.
[in]radius2defines the vertical radius of the curved corner. Take care that this value < 1/2 the height of the rectangle, or bad_parameter is returned.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1707 of file RA8875.cpp.

RetCode_t fillroundrect ( rect_t  r,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled rectangle with rounded corners using the specified color.

This draws a rounded rectangle. A numbers of checks are made on the values, and it could reduce this to drawing a line (if either x1 == x2, or y1 == y2), or a single point (x1 == x2 && y1 == y2). If the radius parameters are > 1/2 the length of that side (width or height), an error value is returned.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]ris the rectangle to draw.
[in]radius1defines the horizontal radius of the curved corner. Take care that this value < 1/2 the width of the rectangle, or bad_parameter is returned.
[in]radius2defines the vertical radius of the curved corner. Take care that this value < 1/2 the height of the rectangle, or bad_parameter is returned.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1702 of file RA8875.cpp.

RetCode_t filltriangle ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
loc_t  x3,
loc_t  y3,
color_t  color,
fill_t  fillit = FILL 
)

Draw a filled triangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal for point 1.
[in]y1is the vertical for point 1.
[in]x2is the horizontal for point 2.
[in]y2is the vertical for point 2.
[in]x3is the horizontal for point 3.
[in]y3is the vertical for point 3.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1787 of file RA8875.cpp.

int fontblit ( loc_t  x,
loc_t  y,
const unsigned char  c 
) [virtual, inherited]

This method transfers one character from the external font data to the screen.

The font being used has already been set with the SelectUserFont API.

Note:
the font data is in a special format as generate by the mikroe font creator. See http://www.mikroe.com/glcd-font-creator/
Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]cis the character to render
Returns:
how far the cursor should advance to the right in pixels.
zero if the character could not be rendered.

Definition at line 231 of file GraphicsDisplay.cpp.

dim_t fontheight ( void   )

get the height in pixels of the currently active font

Returns:
font height in pixels.

Definition at line 952 of file RA8875.cpp.

dim_t fontwidth ( void   )

get the width in pixels of the currently active font

Returns:
font width in pixels.

Definition at line 943 of file RA8875.cpp.

RetCode_t foreground ( color_t  color ) [virtual]

Set the foreground color.

Parameters:
[in]coloris expressed in 16-bit format.
Returns:
RetCode_t value.

Implements TextDisplay.

Definition at line 2087 of file RA8875.cpp.

RetCode_t foreground ( unsigned char  r,
unsigned char  g,
unsigned char  b 
) [virtual]

Set the foreground color.

Parameters:
[in]ris the red element of the color.
[in]gis the green element of the color.
[in]bis the blue element of the color.
Returns:
RetCode_t value.

Definition at line 2094 of file RA8875.cpp.

RetCode_t frequency ( unsigned long  Hz = RA8875_DEFAULT_SPI_FREQ,
unsigned long  Hz2 = 0 
)

Set the SPI port frequency (in Hz).

This uses the mbed SPI driver, and is therefore dependent on its capabilities. The RA8875 can accept writes via SPI faster than a read can be performed. The frequency set by this API is for the SPI writes. It will automatically reduce the SPI clock rate when a read is performed, and restore it for the next write. Alternately, the 2nd parameters permits setting the read speed rather than letting it compute it automatically.

Note:
The primary effect of this is to recover more CPU cycles for your application code. Keep in mind that when more than one command is sent to the display controller, that it will wait for the controller to finish the prior command. In this case, the performance is limited by the RA8875.
Parameters:
[in]Hzis the frequency in Hz, tested range includes the range from 1,000,000 (1MHz) to 10,000,000 (10 MHz). Values outside this range will be accepted, but operation may be unreliable. This depends partially on your hardware design and the wires connecting the display module. The default value is 5,000,000, which should work for most applications as a starting point.
[in]Hz2is an optional parameter and will set the read speed independently of the write speed.
Returns:
RetCode_t value.

Definition at line 1939 of file RA8875.cpp.

color_t GetBackgroundTransparencyColor ( void   )

Get the background color value used for transparency.

This command reads the background color registers that define the transparency color for operations involving layers.

Returns:
the color.

Definition at line 498 of file RA8875.cpp.

float GetBacklight ( void   )

Get backlight brightness.

Returns:
backlight setting from 0 (off) to 1.0 (full on).

Definition at line 2043 of file RA8875.cpp.

uint8_t GetBacklight_u8 ( void   )

Get backlight brightness.

Returns:
backlight setting from 0 (off) to 255 (full on).

Definition at line 2025 of file RA8875.cpp.

uint8_t getc ( void   )

Blocking read of the keypad.

Note:
: This is a blocking read, so it is important to first call _kbhit() to avoid hanging your processes.

A keypad connected to the RA8875 is connected in a matrix of 4 rows and 5 columns. When pressed, this method will return a code in the range of 1 through 20, reserving the value 0 to indicate that no key is pressed.

Additionally, if configured to detect a "long press", bit 7 will be set to indicate this. In this situation, first a "normal press" would be detected and signaled and soon after that a "long press" of the same key would be detected and communicated.

Returns:
8-bit where bit 7 indicates a long press. The remaining bits indicate the keypress using 0 = no key pressed, 1 - 20 = the key pressed.

Definition at line 547 of file RA8875.cpp.

const uint8_t * getCharMetrics ( const unsigned char  c,
dim_t *  width,
dim_t *  height 
) [virtual, inherited]

This method returns the width in pixels of the chosen character from the previously selected external font.

Parameters:
[in]cis the character of interest.
[in,out]widthis a pointer to where the width will be stored. This parameter is NULL tested and will only be written if not null which is convenient if you only want the height.
[in,out]heightis a pointer to where the height will be stored. This parameter is NULL tested and will only be written if not null which is convenient if you only want the width.
Returns:
a pointer to the raw character data or NULL if not found.

Definition at line 206 of file GraphicsDisplay.cpp.

uint16_t GetDrawingLayer ( void   ) [virtual]

Get the currently active drawing layer.

This returns a value, 0 or 1, based on the screen configuration and the currently active drawing layer.

     uint16_t prevLayer = lcd.GetDrawingLayer();
     lcd.SelectDrawingLayer(x);
     lcd.circle(400,25, 25, BrightRed);
     lcd.SelectDrawingLayer(prevLayer);
Attention:
The user manual refers to Layer 1 and Layer 2, however the actual register values are value 0 and 1. This API as well as others that reference the layers use the values 0 and 1 for cleaner iteration in the code.
Returns:
the current drawing layer; 0 or 1.

Implements GraphicsDisplay.

Definition at line 439 of file RA8875.cpp.

const char * GetErrorMessage ( RetCode_t  code )

Get a pointer to the text string representing the RetCode_t.

This method returns a pointer to a text string that matches the code. See RetCode_t.

Parameters:
[in]codeis the return value from RetCode_t to look up.
Returns:
a pointer to the text message representing code. If code is not a valid value, then it returns the text for bad_parameter;

Definition at line 431 of file RA8875.cpp.

color_t GetForeColor ( void   )

Get the current foreground color value.

Returns:
the current foreground color as color_t.

Definition at line 2101 of file RA8875.cpp.

RetCode_t GetGIFMetrics ( gif_screen_descriptor_t *  imageDescriptor,
const char *  Name_GIF 
) [inherited]

GetGIFMetrics.

Get the GIF Image metrics.

Parameters:
[out]imageDescriptorcontains the image metrics on success.
[in]Name_GIFis the filename of the GIF file of interest.
Returns:
noerror, or a variety of error codes.

Definition at line 545 of file GraphicsDisplayGIF.cpp.

point_t GetGraphicsCursor ( void   ) [virtual]

Read the current graphics cursor position as a point.

Returns:
the graphics cursor as a point.

Implements GraphicsDisplay.

Definition at line 1327 of file RA8875.cpp.

RA8875::LayerMode_T GetLayerMode ( void   )

Get the Layer presentation mode.

This gets the current layer mode. See LayerMode_T.

Returns:
layer mode.

Definition at line 462 of file RA8875.cpp.

color_t getPixel ( loc_t  x,
loc_t  y 
) [virtual]

Get a pixel from the display.

Parameters:
[in]xis the horizontal offset to this pixel.
[in]yis the vertical offset to this pixel.
Returns:
the pixel. See color_t

Implements GraphicsDisplay.

Definition at line 1516 of file RA8875.cpp.

RetCode_t getPixelStream ( color_t *  p,
uint32_t  count,
loc_t  x,
loc_t  y 
) [virtual]

Get a stream of pixels from the display.

Parameters:
[in]pis a pointer to a color_t array to accept the stream.
[in]countis the number of pixels to read.
[in]xis the horizontal offset to this pixel.
[in]yis the vertical offset to this pixel.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1539 of file RA8875.cpp.

point_t GetTextCursor ( void   )

Get the current cursor position in pixels.

     point_t point = GetTextCursor();
     if (point.x > 100 && point.y > 150)
         //...
Returns:
cursor position.

Definition at line 1017 of file RA8875.cpp.

loc_t GetTextCursor_X ( void   )

Get the current cursor horizontal position in pixels.

Returns:
cursor position horizontal offset.

Definition at line 1039 of file RA8875.cpp.

loc_t GetTextCursor_Y ( void   )

Get the current cursor vertical position in pixels.

Returns:
cursor position vertical offset.

Definition at line 1026 of file RA8875.cpp.

RetCode_t GetTextFontSize ( RA8875::HorizontalScale hScale,
RA8875::VerticalScale vScale 
)

Get the text font size of the RA8875 internal fonts.

This command lets you retrieve the current settings for the font horizontal and vertical scale factors. The return value is one of the scale factors 1, 2, 3, or 4.

Parameters:
[out]hScaleis a pointer to memory where the horizontal scale factor will be written. If the pointer is null, that item will be ignored.
[out]vScaleis a pointer to memory where the vertical scale factor will be written. If the pointer is null, that item will be ignored.
Returns:
RetCode_t value.

Definition at line 1180 of file RA8875.cpp.

virtual const uint8_t* GetUserFont ( void   ) [virtual]

Get the currently selected user font.

Returns:
a pointer to the font, or null, if no user font is selected.

Definition at line 2753 of file RA8875.h.

dim_t height ( void   ) [virtual]

get the screen height in pixels

Returns:
screen height in pixels.

Implements GraphicsDisplay.

Definition at line 988 of file RA8875.cpp.

RetCode_t init ( int  width = 480,
int  height = 272,
int  color_bpp = 16,
uint8_t  poweron = 40,
bool  keypadon = true,
bool  touchscreeenon = true 
)

Initialize the driver.

The RA8875 can control typical displays from the 480x272 to 800x480, and it supports 8 or 16-bit color. It also supports 2 graphics layers, but it cannot support 2 layers at the maximum color depth and screen size. When configured under 480x400, it will support both 16-bit color depth and 2 drawing layers. Above 480x400 it support either 16-bit color, or 2 layers, but not both.

Typical of the displays that are readily purchased, you will find 480x272 and 800x480 resolutions.

Parameters:
[in]widthin pixels to configure the display for. This parameter is optional and the default is 480.
[in]heightin pixels to configure the display for. This parameter is optional and the default is 272.
[in]color_bppcan be either 8 or 16, but must be consistent with the width and height parameters. This parameter is optional and the default is 16.
[in]powerondefines if the display should be initialized into the power-on or off state. If power is non-zero(on), the backlight is set to this value. This parameter is optional and the default is 40 (on at a low brightness level because many users power the module from their PC USB port and it often cannot support the curent required for full brightness). See Power.
[in]keypadondefines if the keypad support should be enabled. This parameter is optional and the default is true (enabled). See KeypadInit.
[in]touchscreeenondefines if the touchscreen support should be enabled. This parameter is optional and the default is true (enabled). See TouchPanelInit.

  • If the constructor was called with support for the capacitive driver, this parameter causes the driver to initialize.
  • If the constructor was called without support for the capacitive driver, this parameter is used to enable and initialize the resistive touchscreen driver.
Returns:
RetCode_t value.

Definition at line 308 of file RA8875.cpp.

bool Intersect ( rect_t  rect,
point_t  p 
)

Determine if a point is within a rectangle.

Parameters:
[in]rectis a rectangular region to use.
[in]pis a point to analyze to see if it is within the rect.
Returns:
true if p is within rect.

Definition at line 671 of file RA8875.cpp.

bool Intersect ( rect_t pRect1,
const rect_t pRect2 
)

Determine if a rectangle intersects another rectangle and provides the area of intersection.

     +---------------------+
     | rect1               |
     |                     |
     |          +------------------+
     |          | rect3    |       |
     |          |          |       |
     +---------------------+       |
                | rect2            |
                +------------------+
Note:
that the first parameter is a pointer to a rect and the
Parameters:
inout]pRect1 is a pointer to a rectangular region, and returns the area of intersection.
[in]pRect2is a pointer to a second rectangular region.
Returns:
true if pRect1 and pRect2 intersect and pRect1 is written with the rectangle describing the intersection.

Definition at line 708 of file RA8875.cpp.

bool Intersect ( rect_t  rect1,
rect_t  rect2 
)

Determine if a rectangle intersects another rectangle.

Parameters:
[in]rect1is a rectangular region.
[in]rect2is a second rectangular region.
Returns:
true if any part of rect2 intersects rect1.

Definition at line 681 of file RA8875.cpp.

RetCode_t KeypadInit ( bool  scanEnable = true,
bool  longDetect = false,
uint8_t  sampleTime = 0,
uint8_t  scanFrequency = 0,
uint8_t  longTimeAdjustment = 0,
bool  interruptEnable = false,
bool  wakeupEnable = false 
)

Initialize the keypad interface on the RA8875 controller.

Enables the keypad subsystem. It will scan the 4 x 5 matrix and make available key presses.

Note:
See section 5-13 of RAIO RA8875 data sheet for more details.
When using the display from buy-display.com, be sure that the option for the keypad is configured on the hardware.

All parameters are optional.

Parameters:
[in]scanEnablewhen true, enables the key scan function (default: true).
[in]longDetectwhen true, additionally enables the long key held detection (default: false).
[in]sampleTimesetting (range: 0 - 3, default: 0).
[in]scanFrequencysetting (range: 0 - 7, default: 0).
[in]longTimeAdjustment(range: 0 - 3, default: 0).
[in]interruptEnablewhen true, enables interrupts from keypress (default: false).
[in]wakeupEnablewhen true, activates the wakeup function (default: false).
Returns:
RetCode_t value.

Definition at line 509 of file RA8875.cpp.

RetCode_t line ( point_t  p1,
point_t  p2,
color_t  color 
)

Draw a line in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]p1is the point to start the line.
[in]p2is the point to end the line.
[in]colordefines the foreground color.
Returns:
RetCode_t value.

Definition at line 1574 of file RA8875.cpp.

RetCode_t line ( point_t  p1,
point_t  p2 
)

Draw a line.

Draws a line using the foreground color setting.

Parameters:
[in]p1is the point to start the line.
[in]p2is the point to end the line.
Returns:
RetCode_t value.

Definition at line 1568 of file RA8875.cpp.

RetCode_t line ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
color_t  color 
)

Draw a line in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
[in]colordefines the foreground color.
Returns:
RetCode_t value.

Definition at line 1580 of file RA8875.cpp.

RetCode_t line ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2 
)

Draw a line.

Draws a line using the foreground color setting.

Parameters:
[in]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
Returns:
RetCode_t value.

Definition at line 1587 of file RA8875.cpp.

RetCode_t locate ( textloc_t  column,
textloc_t  row 
) [virtual]

Set cursor position based on the current font size.

Parameters:
[in]columnis the horizontal position in character positions
[in]rowis the vertical position in character positions
Returns:
RetCode_t value.

Implements TextDisplay.

Definition at line 961 of file RA8875.cpp.

RetCode_t pixel ( point_t  p,
color_t  color 
) [virtual]

Draw a pixel in the specified color.

Note:
Unlike many other operations, this does not set the forecolor!
Parameters:
[in]pis the point_t defining the location.
[in]coloris expressed in 16-bit format.
Returns:
RetCode_t value.

Definition at line 1411 of file RA8875.cpp.

RetCode_t pixel ( point_t  p ) [virtual]

Draw a pixel in the current foreground color.

Parameters:
[in]pis the point_t defining the location.
Returns:
RetCode_t value.

Definition at line 1416 of file RA8875.cpp.

RetCode_t pixel ( loc_t  x,
loc_t  y,
color_t  color 
) [virtual]

Draw a pixel in the specified color.

Note:
Unlike many other operations, this does not set the forecolor!
Parameters:
[in]xis the horizontal offset to this pixel.
[in]yis the vertical offset to this pixel.
[in]colordefines the color for the pixel.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1421 of file RA8875.cpp.

RetCode_t pixel ( loc_t  x,
loc_t  y 
) [virtual]

Draw a pixel in the current foreground color.

Parameters:
[in]xis the horizontal offset to this pixel.
[in]yis the veritical offset to this pixel.
Returns:
RetCode_t value.

Definition at line 1432 of file RA8875.cpp.

RetCode_t pixelStream ( color_t *  p,
uint32_t  count,
loc_t  x,
loc_t  y 
) [virtual]

Write an RGB565 stream of pixels to the display.

Parameters:
[in]pis a pointer to a color_t array to write.
[in]countis the number of pixels to write.
[in]xis the horizontal position on the display.
[in]yis the vertical position on the display.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1444 of file RA8875.cpp.

RetCode_t Power ( bool  on )

Control display power.

Parameters:
[in]onwhen set to true will turn on the display, when false it is turned off.
Returns:
RetCode_t value.

Definition at line 1999 of file RA8875.cpp.

RetCode_t PrintScreen ( loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
const char *  Name_BMP,
uint8_t  bitsPerPixel = 24 
)

This method captures the specified area as a 24-bit bitmap file.

Even though this is a 16-bit display, the stored image is in 24-bit format.

This method will interrogate the current display setting and create a bitmap based on those settings. For instance, if only layer 1 is visible, then the bitmap is only layer 1. However, if there is some other operation in effect (transparent mode).

If the idle callback is registered, it will be activated passing a parameter indicating the percent complete, which may be of value.

Parameters:
[in]xis the left edge of the region to capture
[in]yis the top edge of the region to capture
[in]wis the width of the region to capture
[in]his the height of the region to capture.
[in]Name_BMPis the filename to write the image to.
[in]bitsPerPixelis optional, defaults to 24, and only accepts the values 24, 8 NOTE: The downscaling is CPU intensive, and the operation takes longer.
Returns:
RetCode_t value.

Definition at line 2424 of file RA8875.cpp.

RetCode_t PrintScreen ( loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
uint8_t  bitsPerPixel = 24 
)

This method captures the specified area as a 24-bit bitmap file and delivers it to the previously attached callback.

Even though this is a 16-bit display, the stored image is in 24-bit format.

This method will interrogate the current display setting and create a bitmap based on those settings. For instance, if only layer 1 is visible, then the bitmap is only layer 1. However, if there is some other operation in effect (transparent mode), it will return the blended image.

If the idle callback is registered, it will be activated passing a parameter indicating the percent complete, which may be of value.

Parameters:
[in]xis the left edge of the region to capture
[in]yis the top edge of the region to capture
[in]wis the width of the region to capture
[in]his the height of the region to capture.
[in]bitsPerPixelis optional, defaults to 24, and only accepts the values 24, 8 NOTE: The downscaling is CPU intensive, and the operation takes longer.
Returns:
RetCode_t value.

Definition at line 2213 of file RA8875.cpp.

RetCode_t PrintScreen ( uint16_t  layer,
loc_t  x,
loc_t  y,
dim_t  w,
dim_t  h,
const char *  Name_BMP 
)

This method captures the specified area as a 24-bit bitmap file, including the option of layer selection.

Note:
This method is deprecated as the alternate PrintScreen API automatically examines the display layer configuration. Therefore, calls to this API will ignore the layer parameter and automatically execute the other method.

Even though this is a 16-bit display, the stored image is in 24-bit format.

Parameters:
[in]layeris 0 or 1 to select the layer to extract.
[in]xis the left edge of the region to capture
[in]yis the top edge of the region to capture
[in]wis the width of the region to capture
[in]his the height of the region to capture.
[out]Name_BMPis the filename to write the image to.
Returns:
RetCode_t value.

Definition at line 2170 of file RA8875.cpp.

void puts ( const char *  string )

Write string of text to the display.

     lcd.puts("Test STring");
Parameters:
[in]stringis the null terminated string to send to the display.

Definition at line 1302 of file RA8875.cpp.

void puts ( loc_t  x,
loc_t  y,
const char *  string 
)

Write string of text to the display at the specified location.

     lcd.puts(10,25, "Test STring");
Parameters:
[in]xis the horizontal position in pixels (from the left edge)
[in]yis the vertical position in pixels (from the top edge)
[in]stringis the null terminated string to send to the display.

Definition at line 1295 of file RA8875.cpp.

bool readable ( void   )

Determine if a key has been hit.

Returns:
true if a key has been hit

Definition at line 541 of file RA8875.cpp.

unsigned char ReadCommand ( unsigned char  command )

Read a command register.

Parameters:
[in]commandis the command register to read.
Returns:
the value read from the register.

Definition at line 772 of file RA8875.cpp.

uint16_t ReadCommandW ( unsigned char  command )

Read a word from a command register.

Parameters:
[in]commandis the command register to read.
Returns:
the value read from the register.

Definition at line 778 of file RA8875.cpp.

unsigned char ReadData ( void   )

Read a data byte from the display.

This is a high level command, and may invoke several primitives.

Returns:
data that was read.

Definition at line 784 of file RA8875.cpp.

uint16_t ReadDataW ( void   )

Read a word from the display.

This is a high level command, and may invoke several primitives.

Returns:
data that was read.

Definition at line 796 of file RA8875.cpp.

unsigned char ReadStatus ( void   )

Read the display status.

This is a high level command, and may invoke several primitives.

Returns:
data that was read.

Definition at line 809 of file RA8875.cpp.

RetCode_t rect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a rectangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is FILL.
Returns:
RetCode_t value.

Definition at line 1654 of file RA8875.cpp.

RetCode_t rect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
fill_t  fillit = NOFILL 
)

Draw a rectangle.

Draws a rectangle using the foreground color setting.

Parameters:
[in]x1is the horizontal start of the line.
[in]y1is the vertical start of the line.
[in]x2is the horizontal end of the line.
[in]y2is the vertical end of the line.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1661 of file RA8875.cpp.

RetCode_t rect ( rect_t  rect,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a rectangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]rectdefines the rectangle.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1649 of file RA8875.cpp.

RetCode_t RenderBitmapFile ( loc_t  x,
loc_t  y,
const char *  Name_BMP 
) [inherited]

This method reads a disk file that is in bitmap format and puts it on the screen.

Supported formats:

  • 1-bit color format (2 colors)
  • 4-bit color format (16 colors)
  • 8-bit color format (256 colors)
  • 16-bit color format (65k colors)
  • 24-bit color format (16M colors)
  • compression: no.
Note:
This is a slow operation, typically due to the use of the file system, and partially because bmp files are stored from the bottom up, and the memory is written from the top down; as a result, it constantly 'seeks' on the file system for the next row of information.

As a performance test, a sample picture was timed. A family picture was converted to Bitmap format; shrunk to 352 x 272 pixels and save in 8-bit color format. The resulting file size was 94.5 KByte. The SPI port interface was set to 20 MHz. The original bitmap rendering software was purely in software, pushing 1 pixel at a time to the write function, which did use SPI hardware (not pin wiggling) to transfer commands and data to the display. Then, the driver was improved to leverage the capability of the derived display driver. As a final check, instead of the [known slow] local file system, a randomly chosen USB stick was used. The performance results are impressive (but depend on the listed factors).

  • 34 seconds, LocalFileSystem, Software Rendering
  • 9 seconds, LocalFileSystem, Hardware Rending for RA8875
  • 3 seconds, MSCFileSystem, Hardware Rendering for RA8875
Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_BMPis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 456 of file GraphicsDisplay.cpp.

RetCode_t RenderGIFFile ( loc_t  x,
loc_t  y,
const char *  Name_GIF 
) [inherited]

Render a GIF file on screen.

This function reads a GIF file, and places it onscreen at the specified coordinates.

Parameters:
[in]xis the left edge of the on-screen coordinates.
[in]yis the top edge of the on-screen coordinates.
[in]Name_GIFis a pointer to the fully qualified filename.
Returns:
noerror, or a variety of error codes.

Definition at line 563 of file GraphicsDisplayGIF.cpp.

RetCode_t RenderIconFile ( loc_t  x,
loc_t  y,
const char *  Name_ICO 
) [inherited]

This method reads a disk file that is in ico format and puts it on the screen.

Reading the disk is slow, but a typical icon file is small so it should be ok.

Note:
An Icon file can have more than one icon in it. This implementation only processes the first image in the file.
Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_ICOis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 483 of file GraphicsDisplay.cpp.

RetCode_t RenderImageFile ( loc_t  x,
loc_t  y,
const char *  FileName 
) [inherited]

This method attempts to render a specified graphics image file at the specified screen location.

This supports several variants of the following file types:

  • Bitmap file format,
  • Icon file format.
Note:
The specified image width and height, when adjusted for the x and y origin, must fit on the screen, or the image will not be shown (it does not clip the image).
The file extension is tested, and if it ends in a supported format, the appropriate handler is called to render that image.
Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]FileNamerefers to the fully qualified path and file on a mounted file system.
Returns:
success or error code.

Definition at line 400 of file GraphicsDisplay.cpp.

RetCode_t RenderJpegFile ( loc_t  x,
loc_t  y,
const char *  Name_JPG 
) [inherited]

This method reads a disk file that is in jpeg format and puts it on the screen.

Parameters:
[in]xis the horizontal pixel coordinate
[in]yis the vertical pixel coordinate
[in]Name_JPGis the filename on the mounted file system.
Returns:
success or error code.

Definition at line 415 of file GraphicsDisplay.cpp.

void ReportPerformance ( Serial &  pc )

Report the performance metrics for drawing functions using the available serial channel.

Parameters:
[in,out]pcis the serial channel to write to.

Definition at line 654 of file RA8875.cpp.

RetCode_t Reset ( void   )

Reset the display controller via the Software Reset interface.

Returns:
RetCode_t value.

Definition at line 410 of file RA8875.cpp.

void ResTouchPanelCfg ( const char *  tpFQFN = NULL,
const char *  tpCalMessage = NULL 
)

Configuration Option for the Resistive Touch Panel Calibration.

This method is only useful for the resistive touchscreen.

Also, this method is optional - the user can take all of the responsibility in their code, or for simplicity sake, this API can be used prior to the init method.

     RA8875 lcd(p5, p6, p7, p12, NC);
     ...
     // Be sure you previously mounted the "/sd" file system to put the cal there.
     lcd.ResTouchPanelCfg("/sd/tpcal.cfg", "Touch '+' to calibrate the touch panel");

     // Only if the touch panel is enabled, AND is configured as the resistive 
     // panel will the prior command be useful.
     lcd.init(LCD_W,LCD_H,LCD_C,40, false, true);
Parameters:
[in]tpFQFNis a pointer to a fully qualified read-write accessible filename where the calibration is held.
[in]tpCalMessageis an optional pointer to a message shown to the user in the calibration process.

  • If this parameter is not included, a default message will be shown.
  • If this parameter points to a NULL string, no message is shown.
  • If this parameter points to a non-NULL string, that string will be shown.

Definition at line 739 of file RA8875_Touch.cpp.

RGBQUAD RGB16ToRGBQuad ( color_t  c ) [inherited]

This method converts a 16-bit color value into a 24-bit RGB Quad.

Parameters:
[in]cis the 16-bit color.
See also:
color_t.
Returns:
an RGBQUAD value.
See also:
RGBQUAD

Definition at line 268 of file GraphicsDisplay.cpp.

color_t RGBQuadToRGB16 ( RGBQUAD colorPaletteArray,
uint16_t  index 
) [inherited]

This method returns the color value from a palette.

This method accepts a pointer to a Bitmap color palette, which is a table in memory composed of RGB Quad values (r, g, b, 0), and an index into that table. It then extracts the color information and downsamples it to a color_t value which it returns.

Note:
This method probably has very little value outside of the internal methods for reading BMP files.
Parameters:
[in]colorPaletteArrayis the handle to the color palette array to use.
[in]indexis the index into the color palette.
Returns:
the color in color_t format.

Definition at line 251 of file GraphicsDisplay.cpp.

RetCode_t roundrect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
dim_t  radius1,
dim_t  radius2,
fill_t  fillit = NOFILL 
)

Draw a rectangle with rounded corners.

This draws a rounded rectangle. A numbers of checks are made on the values, and it could reduce this to drawing a line (if either x1 == x2, or y1 == y2), or a single point (x1 == x2 && y1 == y2). If the radius parameters are > 1/2 the length of that side (width or height), an error value is returned.

Parameters:
[in]x1is the horizontal start of the line and must be <= x2.
[in]y1is the vertical start of the line and must be <= y2.
[in]x2is the horizontal end of the line and must be >= x1.
[in]y2is the vertical end of the line and must be >= y1.
[in]radius1defines the horizontal radius of the curved corner. Take care that this value < 1/2 the width of the rectangle, or bad_parameter is returned.
[in]radius2defines the vertical radius of the curved corner. Take care that this value < 1/2 the height of the rectangle, or bad_parameter is returned.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1727 of file RA8875.cpp.

RetCode_t roundrect ( rect_t  r,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a rectangle with rounded corners using the specified color.

This draws a rounded rectangle. A numbers of checks are made on the values, and it could reduce this to drawing a line (if either x1 == x2, or y1 == y2), or a single point (x1 == x2 && y1 == y2). If the radius parameters are > 1/2 the length of that side (width or height), an error value is returned.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]ris the rectangle to draw.
[in]radius1defines the horizontal radius of the curved corner. Take care that this value < 1/2 the width of the rectangle, or bad_parameter is returned.
[in]radius2defines the vertical radius of the curved corner. Take care that this value < 1/2 the height of the rectangle, or bad_parameter is returned.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1714 of file RA8875.cpp.

RetCode_t roundrect ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
dim_t  radius1,
dim_t  radius2,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a rectangle with rounded corners using the specified color.

This draws a rounded rectangle. A numbers of checks are made on the values, and it could reduce this to drawing a line (if either x1 == x2, or y1 == y2), or a single point (x1 == x2 && y1 == y2). If the radius parameters are > 1/2 the length of that side (width or height), an error value is returned.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal start of the line and must be <= x2.
[in]y1is the vertical start of the line and must be <= y2.
[in]x2is the horizontal end of the line and must be >= x1.
[in]y2is the vertical end of the line and must be >= y1.
[in]radius1defines the horizontal radius of the curved corner. Take care that this value < 1/2 the width of the rectangle, or bad_parameter is returned.
[in]radius2defines the vertical radius of the curved corner. Take care that this value < 1/2 the height of the rectangle, or bad_parameter is returned.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1719 of file RA8875.cpp.

int rows ( void   ) [virtual]

get the number of rows based on the currently active font

Returns:
number of rows.

Reimplemented from GraphicsDisplay.

Definition at line 973 of file RA8875.cpp.

RetCode_t SelectDrawingLayer ( uint16_t  layer,
uint16_t *  prevLayer = NULL 
) [virtual]

Select the drawing layer for subsequent commands.

If the screen configuration is 480 x 272, or if it is 800 x 480 and 8-bit color, the the display supports two layers, which can be independently drawn on and shown. Additionally, complex operations involving both layers are permitted.

Attention:
If the current display configuration does not support multiple layers, then layer 0 will be selected.
     //lcd.SetLayerMode(OnlyLayer0); // default is layer 0
     lcd.rect(400,130, 475,155,Brown);
     lcd.SelectDrawingLayer(1);
     lcd.circle(400,25, 25, BrightRed);
     wait(1);
     lcd.SetLayerMode(ShowLayer1);
Attention:
The user manual refers to Layer 1 and Layer 2, however the actual register values are value 0 and 1. This API as well as others that reference the layers use the values 0 and 1 for cleaner iteration in the code.
Parameters:
[in]layeris 0 or 1 to select the layer for subsequent commands.
[out]prevLayeris an optiona pointer to where the previous layer will be written, making it a little easer to restore layers. Writes 0 or 1 when the pointer is not NULL.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 445 of file RA8875.cpp.

RetCode_t SelectUserFont ( const uint8_t *  font = NULL ) [virtual]

Select a User Font for all subsequent text.

Note:
Tool to create the fonts is accessible from its creator available at http://www.mikroe.com. For version 1.2.0.0, choose the "Export for TFT and new GLCD" format.
Parameters:
[in]fontis a pointer to a specially formed font resource.
Returns:
RetCode_t value.

Reimplemented from GraphicsDisplay.

Definition at line 2048 of file RA8875.cpp.

RetCode_t SetBackgroundTransparencyColor ( color_t  color = RGB(0,0,0) )

Set the background color register used for transparency.

This command sets the background color registers that are used in the transparent color operations involving the layers.

Parameters:
[in]coloris optional and expressed in 16-bit format. If not supplied, a default of Black is used.
Returns:
RetCode_t value.

Definition at line 492 of file RA8875.cpp.

RetCode_t SetGraphicsCursor ( point_t  p ) [virtual]

Prepare the controller to write binary data to the screen by positioning the memory cursor.

Parameters:
[in]pis the point representing the cursor position to set
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1322 of file RA8875.cpp.

RetCode_t SetGraphicsCursor ( loc_t  x,
loc_t  y 
) [virtual]

Prepare the controller to write binary data to the screen by positioning the memory cursor.

Parameters:
[in]xis the horizontal position in pixels (from the left edge)
[in]yis the vertical position in pixels (from the top edge)
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1315 of file RA8875.cpp.

RetCode_t SetGraphicsCursorRead ( loc_t  x,
loc_t  y 
) [virtual]

Prepare the controller to read binary data from the screen by positioning the memory read cursor.

Parameters:
[in]xis the horizontal position in pixels (from the left edge)
[in]yis the vertical position in pixels (from the top edge)
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 1336 of file RA8875.cpp.

RetCode_t SetKeyMap ( const uint8_t *  CodeList = NULL )

Create Key Code definitions for the key matrix.

This API provides a table of 22 key-code assignments for the matrix of keys. This can be used to translate the keys 1 - 20 into some other value, as well as to communicate the "no key" (zero) and "error state" (21).

In this way, a keypad could easily emulate a piece of a keyboard, transforming 0 - 20 into the values 0, '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '*' , '/', '=', '(bs)', '(cr)', and so on...

 //        Return Value by Row, Column   Example reassignment
 //    Column    0    1    2    3    4 
 //          +-------------------------+  +-------------------------+
 // Row   0  |   1    2    3    4    5 |  | '7'  '8'  '9'  ',' '<-' |
 //       1  |   6    7    8    9   10 |  | '4'  '5'  '6'  '/'  '-' |
 //       2  |  11   12   13   14   15 |  | '1'  '2'  '3'  '*'  '+' |
 //       3  |  16   17   18   19   20 |  | '0'  '.'  '('  ')' '\n' |
 //          +-------------------------+  +-------------------------+
 //     Return value  0 = No Key pressed
 //     Return value 21 = Error
 const uint8_t CodeList[22] = 
     {0, '7', '8', '9', ',', '\h', 
         '4', '5', '6', '/', '-',
         '1', '2', '3', '*', '+',
         '0', '.', '(', ')', '\n', 
         '\x1b'};
     lcd.SetKeyMap(CodeList);
Parameters:
[in]CodeListis a pointer to an always available byte-array where the first 22 bytes are used as the transformation from raw code to your reassigned value. If CodeList is NULL, the original raw value key map is restored.
Returns:
RetCode_t value.

Definition at line 534 of file RA8875.cpp.

RetCode_t SetLayerMode ( LayerMode_T  mode )

Set the Layer presentation mode.

This sets the presentation mode for layers, and permits showing a single layer, or applying a mode where the two layers are combined using one of the hardware methods.

Refer to the RA8875 data sheet for full details.

     //lcd.SetLayerMode(OnlyLayer0); // default is layer 0
     lcd.rect(400,130, 475,155,Brown);
     lcd.SelectDrawingLayer(1);
     lcd.circle(400,25, 25, BrightRed);
     wait(1);
     lcd.SetLayerMode(ShowLayer1);
Parameters:
[in]modesets the mode in the Layer Transparency Register.
Returns:
RetCode_t value.

Definition at line 468 of file RA8875.cpp.

RetCode_t SetLayerTransparency ( uint8_t  layer1,
uint8_t  layer2 
)

Set the layer transparency for each layer.

Set the transparency, where the range of values is from zero (fully visible) to eight (fully transparent). The input value is automatically limited to this range.

     // draw something on each layer, then step-fade across
     display.SetLayerMode(RA8875::TransparentMode);
     for (i=0; i<=8; i++) {
         display.SetLayerTransparency(i, 8-i);
         wait_ms(200);
     }
Parameters:
[in]layer1sets the layer 1 transparency.
[in]layer2sets the layer 2 transparency.
Returns:
RetCode_t value.

Definition at line 481 of file RA8875.cpp.

RetCode_t SetOrientation ( RA8875::orientation_t  angle = normal )

Sets the display orientation.

Note:
This command does not let you "merge" text onto an existing image, since it reuses the memory for the new orientation. Therefore, it is recommended that you issue a cls() prior to sending text to the screen, or you end with a blended image that is probably not as intended.
This command only operates on the RA8875 internal fonts.
     lcd.cls();
     lcd.SetOrientation(RA8875::normal);
     lcd.puts(30,30, "Normal Landscape");
     wait_ms(2500);
     
     lcd.cls();
     lcd.SetOrientation(RA8875::rotate_90);
     lcd.puts(30,30, "Rotated 90 Text\r\n");
     wait_ms(2500);
     
     lcd.cls();
     lcd.SetOrientation(RA8875::rotate_180);
     lcd.puts(30,30, "Rotated 180 Text\r\n");
     wait_ms(2500);
 
     lcd.cls();
     lcd.SetOrientation(RA8875::rotate_270);
     lcd.puts(30,30, "Rotated 270 Text\r\n");
     wait_ms(2500);
Parameters:
[in]angledefaults to normal, but can be rotated

  • normal | rotate_0
  • rotate_90 (clockwise)
  • rotate_180
  • rotate_270 (clockwise)
Returns:
RetCode_t value.

Definition at line 1101 of file RA8875.cpp.

RetCode_t SetTextCursor ( point_t  p )

Prepare the controller to write text to the screen by positioning the cursor.

     point_t point = {100, 25};
     lcd.SetTextCursor(point);
     lcd.puts("Hello");
Parameters:
[in]pis the x:y point in pixels from the top-left.
Returns:
RetCode_t value.

Definition at line 1002 of file RA8875.cpp.

RetCode_t SetTextCursor ( loc_t  x,
loc_t  y 
)

Prepare the controller to write text to the screen by positioning the cursor.

     lcd.SetTextCursor(100, 25);
     lcd.puts("Hello");
Parameters:
[in]xis the horizontal position in pixels (from the left edge)
[in]yis the vertical position in pixels (from the top edge)
Returns:
RetCode_t value.

Definition at line 1007 of file RA8875.cpp.

RetCode_t SetTextCursorControl ( cursor_t  cursor = NOCURSOR,
bool  blink = false 
)

Configure additional Cursor Control settings.

This API lets you modify other cursor control settings; Cursor visible/hidden, Cursor blink/normal, Cursor I-Beam/underscore/box.

Parameters:
[in]cursorcan be set to NOCURSOR (default), IBEAM, UNDER, or BLOCK.
[in]blinkcan be set to true or false (default false)
Returns:
RetCode_t value.

Definition at line 1052 of file RA8875.cpp.

RetCode_t SetTextFont ( RA8875::font_t  font = ISO8859_1 )

Select the built-in ISO 8859-X font to use next.

Supported fonts: ISO 8859-1, -2, -3, -4

Note:
This only modifies the choice of font from the RA8875 internal fonts.
Parameters:
[in]fontselects the font for the subsequent text rendering.
Note:
if either hScale or vScale is outside of its permitted range, the command is not executed.
Returns:
RetCode_t value.

Definition at line 1090 of file RA8875.cpp.

RetCode_t SetTextFontControl ( fill_t  fillit = FILL,
RA8875::HorizontalScale  hScale = 1,
RA8875::VerticalScale  vScale = 1,
RA8875::alignment_t  alignment = align_none 
)

Control the font behavior.

This command lets you make several modifications to any text that will be written to the screen.

Note:
This command only operates on the RA8875 internal fonts.

Options can be combined: Default:

  • Full alignment disabled,
  • Font with Background color,
  • Font in normal orientiation, or rotated 90, 180, or 270 clockwise,
  • Horizontal scale x 1, 2, 3, or 4
  • Vertical scale x 1, 2, 3, or 4
Note:
alignment is a special mode for the fonts, when mixing half and full fonts on one presentation. 'align_full' starts each full character on an even alignment. See section 7-4-7 of the RA8875 specification.
Parameters:
[in]fillitdefaults to FILL, but can be NOFILL
[in]hScaledefaults to 1, but can be 1, 2, 3, or 4, and scales the font size by this amount.
[in]vScaledefaults to 1, but can be 1, 2, 3, or 4, and scales the font size by this amount.
[in]alignmentdefaults to align_none, but can be align_full.
Note:
if either hScale or vScale is outside of its permitted range, the command is not executed.
Returns:
RetCode_t value.

Definition at line 1138 of file RA8875.cpp.

RetCode_t SetTextFontSize ( RA8875::HorizontalScale  hScale = 1,
RA8875::VerticalScale  vScale = -1 
)

Control the font size of the RA8875 rendered fonts.

This command lets you set the font enlargement for both horizontal and vertical, independent of the rotation, background, and alignment. See SetTextFontControl.

Note:
This command operates on the RA8875 internal fonts.
This command also operates on the selected soft font.
Parameters:
[in]hScaledefaults to 1, but can be 1, 2, 3, or 4, and scales the font size by this amount.
[in]vScaleis an optional parameter that defaults to the hScale value, but can be 1, 2, 3, or 4, and scales the font size by this amount.
     lcd.SetTextFontSize(2);     // Set the font to 2x normal size
     lcd.puts("Two times");
     lcd.SetTextFontSize(2,3);   // Set the font to 2x Width and 3x Height
     lcd.puts("2*2 3*h");
     lcd.SetTextFontSize();      // Restore to normal size in both dimensions
     lcd.puts("normal");
     lcd.SelectUserFont(BPG_Arial63x63); // Large user font
     lcd.puts("B63x63");                 // Show a sample
     lcd.SetTextFontSize(2);             // Now twice as big
     lcd.puts("x2");                     // Show a sample
Note:
if either hScale or vScale is outside of its permitted range, the command is not executed.
Returns:
RetCode_t value.

Definition at line 1161 of file RA8875.cpp.

RetCode_t ThickLine ( point_t  p1,
point_t  p2,
dim_t  thickness,
color_t  color 
)

Draw a thick line.

Draw a line of a specified thickness and color.

In order to draw a thick line, this draws filled circles using bresenham's algorithm to move the center point of the circle. As a result, this is much slower than drawing a 1-pixel line which uses the hardware line drawing algorithm.

Drawing multiple parallel lines to create a thick line is faster, however the line drawing was not guaranteed to fill every pixel on the diagonals.

Parameters:
[in]p1is the point to start the line.
[in]p2is the point to end the line.
[in]thicknessis the line thickness.
[in]colordefines the foreground color.
Returns:
RetCode_t value.

Definition at line 1610 of file RA8875.cpp.

int TouchChannels ( void   )

Get the count of possible touch channels.

Returns:
count of touch channels supported by the hardware.

Definition at line 134 of file RA8875_Touch.cpp.

TouchCode_t TouchCode ( uint8_t  channel = 0 )

Get the Touch Code for a touch channel.

It is possible to query the data for a channel that is not presently reported as touched.

Parameters:
[in]channelis the touch channel, from 0 to 4, or 0 to TouchChannels()-1 It defaults to 0, in case the user is not interested in multi-touch.
Returns:
the touch code (TouchCode_t).
channel 0 information if an invalid channel is queried.

Definition at line 357 of file RA8875_Touch.cpp.

point_t TouchCoordinates ( uint8_t  channel = 0 )

Get the coordinates for a touch channel.

This returns the (X,Y) coordinates for a touch channel.

It is possible to query the data for a channel that is not presently reported as touched.

Parameters:
[in]channelis an optional touch channel, from 0 to 4, or 0 to TouchChannels()-1. It defaults to 0, in case the user is not interested in multi-touch.
Returns:
the coordinates as a point_t structure.
channel 0 information if an invalid channel is queried.

Definition at line 364 of file RA8875_Touch.cpp.

int TouchCount ( void   )

Get the count of registered touches.

Returns:
count of touch points to communicate; 0 to 5.

Definition at line 997 of file RA8875.h.

uint8_t TouchGesture ( void   )

Get the reported touch gesture, if any.

If it could detect a gesture, it will return a value based on the interpreted gesture.

Valid gesture values are:

  • 0x00 No gesture
  • 0x48 Zoom in
  • 0x49 Zoom out

The following gestures are defined in the FT5206 specification, but do not appear to work.

  • 0x10 Move up
  • 0x14 Move left
  • 0x18 Move down
  • 0x1C Move right
Returns:
gesture information.

Definition at line 990 of file RA8875.h.

uint8_t TouchID ( uint8_t  channel = 0 )

Get the Touch ID value for a specified touch channel.

Touch ID is a tracking number based on the order of the touch detections. The first touch is ID 0, the next is ID 1, and so on. If the first touch is lifted (no touch), the touch count decrements, and the remaining touch is communicated on touch channel zero, even as the Touch ID remains as originally reported (1 in this example). In this way, it is easy to track a specific touch.

It is possible to query the data for a channel that is not presently reported as touched.

Parameters:
[in]channelis the touch channel, from 0 to 4, or 0 to TouchChannels()-1 It defaults to 0, in case the user is not interested in multi-touch.
Returns:
the touch ID, or 15 if you get the ID for an untouched channel.
0 if an invalid channel is queried.

Definition at line 350 of file RA8875_Touch.cpp.

TouchCode_t TouchPanelA2DFiltered ( int *  x,
int *  y 
)

Poll the TouchPanel and on a touch event return the a to d filtered x, y coordinates.

This method reads the touch controller, which has a 10-bit range for each the x and the y axis.

Note:
The returned values are not in display (pixel) units but are in analog to digital converter units.
This API is usually not needed and is likely to be deprecated. See TouchPanelComputeCalibration. See TouchPanelReadable.
Parameters:
[out]xis the x scale a/d value.
[out]yis the y scale a/d value.
Returns:
a value indicating the state of the touch,
  • no_cal: no calibration matrix is available, touch coordinates are not returned.
  • no_touch: no touch is detected, touch coordinates are not returned.
  • touch: touch is detected, touch coordinates are returned.
  • held: held after touch, touch coordinates are returned.
  • release: indicates a release, touch coordinates are returned.

Definition at line 454 of file RA8875_Touch.cpp.

TouchCode_t TouchPanelA2DRaw ( int *  x,
int *  y 
)

Poll the TouchPanel and on a touch event return the a to d raw x, y coordinates.

This method reads the touch controller, which has a 10-bit range for each the x and the y axis. A number of samples of the raw data are taken, filtered, and the results are returned.

Note:
The returned values are not in display (pixel) units but are in analog to digital converter units.
This API is usually not needed and is likely to be deprecated. See TouchPanelComputeCalibration. See TouchPanelReadable.
Parameters:
[out]xis the x scale a/d value.
[out]yis the y scale a/d value.
Returns:
a value indicating the state of the touch,
  • no_cal: no calibration matrix is available, touch coordinates are not returned.
  • no_touch: no touch is detected, touch coordinates are not returned.
  • touch: touch is detected, touch coordinates are returned.
  • held: held after touch, touch coordinates are returned.
  • release: indicates a release, touch coordinates are returned.

Definition at line 436 of file RA8875_Touch.cpp.

RetCode_t TouchPanelCalibrate ( const char *  msg,
tpMatrix_t matrix = NULL,
int  maxwait_s = 30 
)

Perform the touch panel calibration process.

This method provides the easy "shortcut" to calibrating the touch panel. The process will automatically generate the calibration points, present the targets on-screen, detect the touches, compute the calibration matrix, and optionally provide the calibration matrix to the calling code for persistence in non-volatile memory.

Parameters:
[in]msgis a text message to present on the screen during the calibration process.
[out]matrixis an optional parameter to hold the calibration matrix as a result of the calibration. This can be saved in non-volatile memory to recover the calibration after a power fail.
[in]maxwait_sis the maximum number of seconds to wait for a touch calibration. If no touch panel installed, it then reports touch_cal_timeout. Default: 30 s.
Returns:
RetCode_t value.

Definition at line 165 of file RA8875_Touch.cpp.

RetCode_t TouchPanelCalibrate ( tpMatrix_t matrix = NULL )

Perform the touch panel calibration process.

This method provides the easy "shortcut" to calibrating the touch panel. The process will automatically generate the calibration points, present the targets on-screen, detect the touches, compute the calibration matrix, and optionally provide the calibration matrix to the calling code for persistence in non-volatile memory.

Parameters:
[out]matrixis an optional parameter to hold the calibration matrix as a result of the calibration. This can be saved in non-volatile memory to recover the calibration after a power fail.
Returns:
RetCode_t value.

Definition at line 160 of file RA8875_Touch.cpp.

RetCode_t TouchPanelComputeCalibration ( point_t  display[3],
point_t  screen[3],
tpMatrix_t matrix 
)

Calibrate the touch panel.

This method accepts two lists - one list is target points in , display coordinates and the other is a lit of raw touch coordinate values. It generates a calibration matrix for later use. This matrix is also accessible to the calling API, which may store the matrix in persistent memory and then install the calibration matrix on the next power cycle. By doing so, it can avoid the need to calibrate on every power cycle.

Note:
The methods "TouchPanelComputeCalibration", "TouchPanelReadable", and indirectly the "TouchPanelSetMatrix" methods are all derived from a program by Carlos E. Vidales. See the copyright note for further details. See also the article http://www.embedded.com/design/system-integration/4023968/How-To-Calibrate-Touch-Screens

Copyright © 2001, Carlos E. Vidales. All rights reserved. This sample program was written and put in the public domain by Carlos E. Vidales. The program is provided "as is" without warranty of any kind, either expressed or implied. If you choose to use the program within your own products you do so at your own risk, and assume the responsibility for servicing, repairing or correcting the program should it prove defective in any manner. You may copy and distribute the program's source code in any medium, provided that you also include in each copy an appropriate copyright notice and disclaimer of warranty. You may also modify this program and distribute copies of it provided that you include prominent notices stating that you changed the file(s) and the date of any change, and that you do not charge any royalties or licenses for its use.

Parameters:
[in]displayis a pointer to a set of 3 points, which are in display units of measure. These are the targets the calibration was aiming for.
[in]screenis a pointer to a set of 3 points, which are in touchscreen units of measure. These are the registered touches.
[out]matrixis an optional parameter to hold the calibration matrix as a result of the calibration. This can be saved in non-volatile memory to recover the calibration after a power fail.
Returns:
RetCode_t value.
TouchCode_t TouchPanelGet ( point_t TouchPoint )

Wait for a touch panel touch and return it.

This method is similar to Serial.getc() in that it will wait for a touch and then return. In order to extract the coordinates of the touch, a valid pointer to a point_t must be provided.

Note:
There is no timeout on this function, so its use is not recommended.
     Timer t;
     t.start();
     do {
        point_t point = {0, 0};
        display.TouchPanelGet(&point);   // hangs here until touch
        display.pixel(point, Red);
    } while (t.read_ms() < 30000);
Parameters:
[out]TouchPointis the touch point, if a touch is registered.
Returns:
a value indicating the state of the touch,
  • no_cal: no calibration matrix is available, touch coordinates are not returned.
  • no_touch: no touch is detected, touch coordinates are not returned.
  • touch: touch is detected, touch coordinates are returned.
  • held: held after touch, touch coordinates are returned.
  • release: indicates a release, touch coordinates are returned.

Definition at line 371 of file RA8875_Touch.cpp.

const tpMatrix_t * TouchPanelGetMatrix (  )

Get the calibration matrix for the resistive touch panel.

This method returns a const pointer to the matrix. If this matrix has not be set, with either the TouchPanelSetMatrix API or the calibration process, the results are indeterminate.

return const tpMatrix_t pointer

Definition at line 400 of file RA8875_Touch.cpp.

RetCode_t TouchPanelInit ( uint8_t  bTpEnable,
uint8_t  bTpAutoManual,
uint8_t  bTpDebounce,
uint8_t  bTpManualMode,
uint8_t  bTpAdcClkDiv,
uint8_t  bTpAdcSampleTime 
)

Initialize the Touch Panel controller with detailed settings.

This is the detailed touch panel init, which provides the ability to set nearly every option.

Note:
If the capacitive touch panel was constructed, this behaves the same as the simplified version.
Parameters:
[in]bTpEnableTouch Panel enable/disable control:

  • TP_ENABLE: enable the touch panel
  • TP_DISABLE: disable the touch panel
[in]bTpAutoManualTouch Panel operating mode:

  • TP_MODE_AUTO: automatic capture
  • TP_MODE_MANUAL: manual capture
[in]bTpDebounceDebounce circuit enable for touch panel interrupt:

  • TP_DEBOUNCE_OFF: disable the debounce circuit
  • TP_DEBOUNCE_ON: enable the debounce circuit
[in]bTpManualModeWhen Manual Mode is selected, this sets the mode:

  • TP_MANUAL_IDLE: touch panel is idle
  • TP_MANUAL_WAIT: wait for touch panel event
  • TP_MANUAL_LATCH_X: latch X data
  • TP_MANUAL_LATCH_Y: latch Y data
[in]bTpAdcClkDivSets the ADC clock as a fraction of the System CLK:

  • TP_ADC_CLKDIV_1: Use CLK
  • TP_ADC_CLKDIV_2: Use CLK/2
  • TP_ADC_CLKDIV_4: Use CLK/4
  • TP_ADC_CLKDIV_8: Use CLK/8
  • TP_ADC_CLKDIV_16: Use CLK/16
  • TP_ADC_CLKDIV_32: Use CLK/32
  • TP_ADC_CLKDIV_64: Use CLK/64
  • TP_ADC_CLKDIV_128: Use CLK/128
[in]bTpAdcSampleTimeTouch Panel sample time delay before ADC data is ready:

  • TP_ADC_SAMPLE_512_CLKS: Wait 512 system clocks
  • TP_ADC_SAMPLE_1024_CLKS: Wait 1024 system clocks
  • TP_ADC_SAMPLE_2048_CLKS: Wait 2048 system clocks
  • TP_ADC_SAMPLE_4096_CLKS: Wait 4096 system clocks
  • TP_ADC_SAMPLE_8192_CLKS: Wait 8192 system clocks
  • TP_ADC_SAMPLE_16384_CLKS: Wait 16384 system clocks
  • TP_ADC_SAMPLE_32768_CLKS: Wait 32768 system clocks
  • TP_ADC_SAMPLE_65536_CLKS: Wait 65536 system clocks
Returns:
RetCode_t value.

Definition at line 86 of file RA8875_Touch.cpp.

RetCode_t TouchPanelInit ( void   )

Initialize theTouch Panel controller with default values.

This activates the simplified touch panel init, which may work for most uses. The alternate API is available if fine-grained control of the numerous settings of the resistive panel is needed.

Additionally, for an even simpler interface for most RESISTIVE touch use cases, the init() method can perform the calibration.

Returns:
RetCode_t value.

Definition at line 49 of file RA8875_Touch.cpp.

TouchCode_t TouchPanelReadable ( point_t TouchPoint = NULL )

Get the screen calibrated point of touch.

This method determines if there is a touch and if so it will provide the screen-relative touch coordinates. This method can be used in a manner similar to Serial.readable(), to determine if there was a touch and indicate that - but not care about the coordinates. Alternately, if a valid pointer to a point_t is provided, then if a touch is detected the point_t will be populated with data.

     Timer t;
     t.start();
     do {
        point_t point = {0, 0};
        if (display.TouchPanelReadable(&point)) {
            display.pixel(point, Red);
        }
    } while (t.read_ms() < 30000);
Parameters:
[out]TouchPointis a pointer to a point_t, which is set as the touch point, if a touch is registered.
Returns:
a value indicating the state of the touch,
  • no_cal: no calibration matrix is available, touch coordinates are not returned.
  • no_touch: no touch is detected, touch coordinates are not returned.
  • touch: touch is detected, touch coordinates are returned.
  • held: held after touch, touch coordinates are returned.
  • release: indicates a release, touch coordinates are returned.

Definition at line 295 of file RA8875_Touch.cpp.

RetCode_t TouchPanelSetMatrix ( tpMatrix_t matrix )

Set the calibration matrix for the resistive touch panel.

This method is used to set the calibration matrix for the touch panel. After performing the calibration (See TouchPanelComputeCalibration), the matrix can be stored. On a subsequence power cycle, the matrix may be restored from non-volatile and passed in to this method. It will then be held to perform the corrections when reading the touch panel point.

 FILE * fh = fopen("/local/tpmatrix.cfg", "r");
 if (fh) {
     tpMatrix_t matrix;
     if (fread(fh, &matrix, sizeof(tpMatrix_t))) {
         lcd.TouchPanelSetMatrix(&matrix);
     }
     fclose(fh);
 }
Parameters:
[in]matrixis a pointer to the touch panel calibration matrix.
Returns:
RetCode_t value.

Definition at line 391 of file RA8875_Touch.cpp.

RetCode_t triangle ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
loc_t  x3,
loc_t  y3,
fill_t  fillit = NOFILL 
)

Draw a triangle.

Draws a triangle using the foreground color setting.

Parameters:
[in]x1is the horizontal for point 1.
[in]y1is the vertical for point 1.
[in]x2is the horizontal for point 2.
[in]y2is the vertical for point 2.
[in]x3is the horizontal for point 3.
[in]y3is the vertical for point 3.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1798 of file RA8875.cpp.

RetCode_t triangle ( loc_t  x1,
loc_t  y1,
loc_t  x2,
loc_t  y2,
loc_t  x3,
loc_t  y3,
color_t  color,
fill_t  fillit = NOFILL 
)

Draw a triangle in the specified color.

Note:
As a side effect, this changes the current foreground color for subsequent operations.
Parameters:
[in]x1is the horizontal for point 1.
[in]y1is the vertical for point 1.
[in]x2is the horizontal for point 2.
[in]y2is the vertical for point 2.
[in]x3is the horizontal for point 3.
[in]y3is the vertical for point 3.
[in]colordefines the foreground color.
[in]fillitis optional to FILL the rectangle. default is NOFILL.
Returns:
RetCode_t value.

Definition at line 1773 of file RA8875.cpp.

void UnAppendISR ( uint8_t  bISRType )

Unappend interrupt handler for specific RA8875 interrupt source.

Parameters:
[in]bISRTypeInterrupt Source, should be:

  • RA8875_INT_KEYSCAN: KEYCAN interrupt
  • RA8875_INT_DMA: DMA interrupt
  • RA8875_INT_TP: Touch panel interrupt
  • RA8875_INT_BTE: BTE process complete interrupt
  • RA8875_INT_BTEMCU_FONTWR: Multi-purpose interrupt (see spec sheet)
Returns:
none
dim_t width ( void   ) [virtual]

get the screen width in pixels

Returns:
screen width in pixels.

Implements GraphicsDisplay.

Definition at line 979 of file RA8875.cpp.

RetCode_t window ( loc_t  x = 0,
loc_t  y = 0,
dim_t  width = (dim_t)-1,
dim_t  height = (dim_t)-1 
) [virtual]

Set the window, constraining where items are written to the screen.

After setting the window, text and graphics are constrained to this window. Text will wrap from the right edge back to the left and down one row and from the bottom to the top. Graphics drawing will be clipped at the edge of the window.

Note:
if no parameters are provided, it restores the window to full screen.
If the initial text write is outside the window, it will be shown where the cursor position it. Once the write hits the right edge of the defined window, it will then wrap back to the left edge. Once it hits the bottom, it wraps to the top of the window. For this reason, it is common to set the text cursor to the window.
     lcd.window(10,10, 80,80);
     lcd.SetTextCursor(10,10);
     lcd.puts("012345678901234567890123456789012345678901234567890");
     lcd.window(); restore to full screen
Parameters:
[in]xis the left edge in pixels.
[in]yis the top edge in pixels.
[in]widthis the window width in pixels.
[in]heightis the window height in pixels.
Returns:
RetCode_t value.

Reimplemented from GraphicsDisplay.

Definition at line 1348 of file RA8875.cpp.

RetCode_t window ( rect_t  r ) [virtual]

Set the window, constraining where items are written to the screen.

After setting the window, text and graphics are constrained to this window. Text will wrap from the right edge back to the left and down one row and from the bottom to the top. Graphics drawing will be clipped at the edge of the window.

Note:
If the initial text write is outside the window, it will be shown where the cursor position it. Once the write hits the right edge of the defined window, it will then wrap back to the left edge. Once it hits the bottom, it wraps to the top of the window. For this reason, it is common to set the text cursor to the window.
     rect_t r = {10,10, 90,90};
     lcd.window(r);
     lcd.SetTextCursor(r.p1.x, r.p1.y);
     lcd.puts("012345678901234567890123456789012345678901234567890");
     lcd.window(); restore to full screen
Parameters:
[in]ris the rect_t used to set the window.
Returns:
RetCode_t value.

Reimplemented from GraphicsDisplay.

Definition at line 1343 of file RA8875.cpp.

RetCode_t WindowMax ( void   ) [virtual, inherited]

method to set the window region to the full screen.

This restores the 'window' to the full screen, so that other operations (

See also:
cls) would clear the whole screen.
Returns:
success/failure code.
See also:
RetCode_t.

Definition at line 137 of file GraphicsDisplay.cpp.

RetCode_t WriteCommand ( unsigned char  command,
unsigned int  data = 0xFFFF 
) [virtual]

Write a command to the display.

This is a high level command, and may invoke several primitives.

Parameters:
[in]commandis the command to write.
[in]datais optional data to be written to the command register and only occurs if the data is in the range [0 - 0xFF].
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 733 of file RA8875.cpp.

RetCode_t WriteCommandW ( uint8_t  command,
uint16_t  data 
)

Write a command to the display with a word of data.

This is a high level command, and may invoke several primitives.

Parameters:
[in]commandis the command to write.
[in]datais data to be written to the command register.
Returns:
RetCode_t value.

Definition at line 725 of file RA8875.cpp.

RetCode_t WriteData ( unsigned char  data ) [virtual]

Write a data byte to the display.

This is a high level command, and may invoke several primitives.

Parameters:
[in]datais the data to write.
Returns:
RetCode_t value.

Implements GraphicsDisplay.

Definition at line 762 of file RA8875.cpp.

RetCode_t WriteDataW ( uint16_t  data )

Write a data word to the display.

This is a high level command, and may invoke several primitives.

Parameters:
[in]datais the data to write.
Returns:
RetCode_t value.

Definition at line 751 of file RA8875.cpp.


Field Documentation

color_t _background [protected, inherited]

presently set background color

Definition at line 146 of file TextDisplay.h.

uint16_t _column [protected, inherited]

character column location

Definition at line 141 of file TextDisplay.h.

color_t _foreground [protected, inherited]

presently set foreground color

Definition at line 145 of file TextDisplay.h.

char* _path [protected, inherited]

stream name when redirecting stdio

Definition at line 147 of file TextDisplay.h.

uint16_t _row [protected, inherited]

character row location

Definition at line 142 of file TextDisplay.h.

short _x [protected, inherited]

keeps track of current X location

Definition at line 666 of file GraphicsDisplay.h.

short _y [protected, inherited]

keeps track of current Y location

Definition at line 667 of file GraphicsDisplay.h.

uint8_t fontScaleX [protected, inherited]

tracks the font scale factor for Soft fonts. Range: 1 .. 4

Definition at line 669 of file GraphicsDisplay.h.

uint8_t fontScaleY [protected, inherited]

tracks the font scale factor for soft fonts. Range: 1 .. 4

Definition at line 670 of file GraphicsDisplay.h.