Adafruit Arcada Library
Public Member Functions | Public Attributes | List of all members
Adafruit_Arcada Class Reference

An abstraction class for something with a display, and possibly button controls or speaker. Makes targing games and UI to multiple hardware designs easier. More...

#include <Adafruit_Arcada.h>

Inheritance diagram for Adafruit_Arcada:

Public Member Functions

 Adafruit_Arcada (void)
 Instantiator for Arcada class, will allso inistantiate (but not init) the TFT.
 
bool begin (void)
 Initialize GPIO, NeoPixels, and speaker. More...
 
bool timerCallback (uint32_t freq, void(*callback)())
 Create a repetative callback to a function using a timer. More...
 
void printf (const char *format,...)
 printf wrapper to serial debug, handy for logging config, C inclusion More...
 
Arcada_FilesystemType filesysBegin (Arcada_FilesystemType desiredFilesys=ARCADA_FILESYS_SD_AND_QSPI)
 Initialize the filesystem, either SD or QSPI. More...
 
int16_t filesysListFiles (const char *path=NULL, const char *extensionFilter=NULL)
 Debugging helper, prints to Serial a list of files in a path. More...
 
bool chdir (const char *path)
 Set working filesys directory to a given path (makes file naming easier) More...
 
File open (const char *path=NULL, uint32_t flags=O_READ)
 Opens a file and returns the object, a wrapper for our filesystem. More...
 
File openFileByIndex (const char *path, uint16_t index, uint32_t flags=O_READ, const char *extensionFilter=NULL)
 Opens a file as an indexed # in a directory (0 is first file), and returns the object. More...
 
bool exists (const char *path)
 Tests if a file exists on the filesys. More...
 
bool mkdir (const char *path)
 Make a directory in the filesys. More...
 
bool remove (const char *path)
 Remove a file from the filesys. More...
 
uint8_t * writeFileToFlash (const char *filename, uint32_t address)
 Opens a file and writes the data contents to the internal chip flash memory. NOT the QSPI flash but the actual chip memory! It will happily write over program memory being used so make sure the address is set to well past where the program ends! More...
 
bool filesysBeginMSD (Arcada_FilesystemType desiredFilesys=ARCADA_FILESYS_SD_AND_QSPI)
 Make the raw filesystem of the Arcada board available over USB. More...
 
bool recentUSB (uint32_t timeout=100)
 Hints whether we're doing a bunch of USB stuff recently. More...
 
bool chooseFile (const char *path, char *filename, uint16_t filename_max, const char *extensionFilter=NULL)
 Presents a navigation menu for choosing a file from the filesys. More...
 
bool hasControlPad (void)
 Does this board have a control pad - latch, buttons or analog joystick? More...
 
int16_t readJoystickX (uint8_t oversampling=3)
 Read X analog joystick. More...
 
int16_t readJoystickY (uint8_t oversampling=3)
 Read Y analog joystick. More...
 
uint32_t readButtons (void)
 Read all buttons/joystick and return a bitmask of which buttons are pressed, check ARCADA_BUTTONMASK_* for valid bitmasks to check again. If there's an analog joystick, it will 'simulate' the button presses. More...
 
uint32_t justPressedButtons (void)
 What buttons were just pressed as of the last readButtons() call. Use ARCADA_BUTTONMASK_* defines to extract which bits are true (just pressed) More...
 
uint32_t justReleasedButtons (void)
 What buttons were just released as of the last readButtons() call. Use ARCADA_BUTTONMASK_* defines to extract which bits are true (just releasd) More...
 
bool hasTouchscreen (void)
 Does this board have a touchscreen. More...
 
void setTouchscreenCalibration (int16_t xmin, int16_t xmax, int16_t ymin, int16_t ymax)
 Set the X/Y calibration values for the touchscreen. More...
 
TSPoint getTouchscreenPoint (void)
 Get a calibrated point that corresponds to the TFT. More...
 
uint16_t readLightSensor (void)
 Read the light sensor onboard if there is one. More...
 
float readBatterySensor (void)
 Read the batterysensor onboard if there is one. More...
 
void displayBegin (void)
 Initialize TFT display, doesn't turn on the backlight.
 
bool createFrameBuffer (uint16_t width, uint16_t height)
 Create (allocate) an internal GFX canvas of given width and height. More...
 
GFXcanvas16 * getCanvas (void)
 Return pointer to GFX canvas (NULL if not allocated) More...
 
uint16_t * getFrameBuffer (void)
 Return address of internal framebuffer (NULL if not allocated) More...
 
bool blitFrameBuffer (uint16_t x, uint16_t y, bool blocking=false, bool bigEndian=false)
 Write the internal framebuffer to the display at coord (x, y) More...
 
uint16_t ColorHSV565 (int16_t H, uint8_t S, uint8_t V)
 Convert hue, saturation and value into a packed 16-bit RGB color that can be passed to TFT. More...
 
bool setBacklight (uint8_t brightness, bool saveToDisk=false)
 Set the backlight brightness and save to the configuration. More...
 
uint8_t getBacklight (void)
 Get the backlight brightness. More...
 
bool setVolume (uint8_t volume, bool saveToDisk=false)
 Set the audio volume (not working at this time) More...
 
uint8_t getVolume (void)
 Get the audio volume (not working at this time) More...
 
void enableSpeaker (bool flag)
 Turn on the speaker amplifier. More...
 
void alertBox (const char *string, uint16_t boxColor, uint16_t textColor, uint32_t continueButtonMask)
 Display an alert box with optional 'press to continue' button. More...
 
void infoBox (const char *string, uint32_t continueButtonMask=ARCADA_BUTTONMASK_A)
 Display an info box with optional 'press to continue' button. More...
 
void warnBox (const char *string, uint32_t continueButtonMask=ARCADA_BUTTONMASK_A)
 Display an warning box with optional 'press to continue' button. More...
 
void errorBox (const char *string, uint32_t continueButtonMask=ARCADA_BUTTONMASK_A)
 Display an error box with optional 'press to continue' button. More...
 
void haltBox (const char *string)
 Display an error box and halt operation. More...
 
uint8_t menu (const char **menu_strings, uint8_t menu_num, uint16_t boxColor, uint16_t textColor, bool cancellable=false)
 Draws a menu and lets a user select one of the menu items. More...
 
bool loadConfigurationFile (const char *filename=ARCADA_DEFAULT_CONFIGURATION_FILENAME)
 Loads the configuration JSON from the filesystem (which must be initialized before this function is called) and stores parsed JSON data internally. More...
 
bool saveConfigurationFile (const char *filename=ARCADA_DEFAULT_CONFIGURATION_FILENAME)
 Saves the configuration JSON to the filesystem (which must be initialized before this function is called) More...
 
bool hasWiFi (void)
 Gets the status of the ESP32 module connected via SPI. More...
 
ImageReturnCode drawBMP (char *filename, int16_t x, int16_t y, boolean transact=true)
 Loads BMP image file from SD card directly to SPITFT screen. More...
 
ImageReturnCode loadBMP (char *filename, Adafruit_Arcada_Image &img)
 Loads BMP image file from SD card into RAM (as one of the GFX canvas object types) for use with the bitmap-drawing functions. Not practical for most AVR microcontrollers, but some of the more capable 32-bit micros can afford some RAM for this. More...
 
ImageReturnCode bmpDimensions (char *filename, int32_t *w, int32_t *h)
 Query pixel dimensions of BMP image file on SD card. More...
 
void printImageStatus (ImageReturnCode stat, Stream &stream=Serial)
 Print human-readable status message corresponding to an ImageReturnCode type. More...
 

Public Attributes

Adafruit_NeoPixel pixels
 The neopixel strip, of length ARCADA_NEOPIXEL_NUM.
 

Detailed Description

An abstraction class for something with a display, and possibly button controls or speaker. Makes targing games and UI to multiple hardware designs easier.

Member Function Documentation

◆ begin()

bool Adafruit_Arcada::begin ( void  )

Initialize GPIO, NeoPixels, and speaker.

Returns
True on success, False if something failed!

◆ timerCallback()

bool Adafruit_Arcada::timerCallback ( uint32_t  freq,
void(*)()  callback 
)

Create a repetative callback to a function using a timer.

Parameters
freqThe callback frequency, must be between 50 Hz and 3MHz (slower is better)
callbackA pointer to the function we'll call every time
Returns
True on success, False if something failed!

◆ printf()

void Adafruit_Arcada::printf ( const char *  format,
  ... 
)

printf wrapper to serial debug, handy for logging config, C inclusion

Parameters
formatThe printf-compatible format and extra args

◆ filesysBegin()

Arcada_FilesystemType Adafruit_Arcada::filesysBegin ( Arcada_FilesystemType  desiredFilesys = ARCADA_FILESYS_SD_AND_QSPI)

Initialize the filesystem, either SD or QSPI.

Parameters
desiredFilesysThe filesystem we'd prefer to use, can be ARCADA_FILESYS_SD, ARCADA_FILESYS_QSPI, or ARCADA_FILESYS_SD_AND_QSPI
Returns
Filesystem type found, can be ARCADA_FILESYS_NONE (none found), ARCADA_FILESYS_SD (found SD card), ARCADA_FILESYS_QSPI (QSPI flash memory), or ARCADA_FILESYS_SD_AND_QSPI (both found)

◆ filesysListFiles()

int16_t Adafruit_Arcada::filesysListFiles ( const char *  path = NULL,
const char *  extensionFilter = NULL 
)

Debugging helper, prints to Serial a list of files in a path.

Parameters
pathA string with the filename path, must start with / e.g. "/roms". If nothing is passed in, we use the CWD (default is "/")
extensionFilterThe 3 letters to check at the end of the filename to match
Returns
-1 if was not able to open, or the number of files

◆ chdir()

bool Adafruit_Arcada::chdir ( const char *  path)

Set working filesys directory to a given path (makes file naming easier)

Parameters
pathA string with the directory to change to
Returns
True if was able to find a directory at that path

◆ open()

File Adafruit_Arcada::open ( const char *  path = NULL,
uint32_t  flags = O_READ 
)

Opens a file and returns the object, a wrapper for our filesystem.

Parameters
pathA string with the filename path, must start with / e.g. "/roms"
flagsDefaults to O_READ but can use O_WRITE for writing (uses SDfat's flag system)
Returns
A File object, for whatever filesystem we're using

◆ openFileByIndex()

File Adafruit_Arcada::openFileByIndex ( const char *  path,
uint16_t  index,
uint32_t  flags = O_READ,
const char *  extensionFilter = NULL 
)

Opens a file as an indexed # in a directory (0 is first file), and returns the object.

Parameters
pathA string with the directory path, must start with / e.g. "/roms"
indexThe n'th file to open, 0 is first file
flagsDefaults to O_READ but can use O_WRITE for writing (uses SDfat's flag system)
extensionFilterA 3 (or more?) string to match against the final characters of each file for them to count. If they don't match, the index isn't incremented at all. We toupper() the extension and filename so don't worry about it.
Returns
A File object, for whatever filesystem we're using

◆ exists()

bool Adafruit_Arcada::exists ( const char *  path)

Tests if a file exists on the filesys.

Parameters
pathA string with the filename path
Returns
true or false if we can open the file

◆ mkdir()

bool Adafruit_Arcada::mkdir ( const char *  path)

Make a directory in the filesys.

Parameters
pathA string with the new directory path
Returns
true or false if we succeeded

◆ remove()

bool Adafruit_Arcada::remove ( const char *  path)

Remove a file from the filesys.

Parameters
pathA string with the file to be deleted
Returns
true or false if we succeeded

◆ writeFileToFlash()

uint8_t * Adafruit_Arcada::writeFileToFlash ( const char *  filename,
uint32_t  address 
)

Opens a file and writes the data contents to the internal chip flash memory. NOT the QSPI flash but the actual chip memory! It will happily write over program memory being used so make sure the address is set to well past where the program ends!

Parameters
filenameA string with the filename path, can be relative or absolute
addressThe address we'll start writing data to, make sure this is well past where program memory ends, at least 4K away.
Returns
A pointer to the flash memory address, or NULL on failure

◆ filesysBeginMSD()

bool Adafruit_Arcada::filesysBeginMSD ( Arcada_FilesystemType  desiredFilesys = ARCADA_FILESYS_SD_AND_QSPI)

Make the raw filesystem of the Arcada board available over USB.

Parameters
desiredFilesysThe filesystem we'd prefer to use, can be ARCADA_FILESYS_SD, ARCADA_FILESYS_QSPI, or ARCADA_FILESYS_SD_AND_QSPI
Returns
True on success, false on failure

◆ recentUSB()

bool Adafruit_Arcada::recentUSB ( uint32_t  timeout = 100)

Hints whether we're doing a bunch of USB stuff recently.

Parameters
timeoutThe timeperiod to look at, defaults to 100ms
Returns
True if some USB stuff happened in last timeout # millis

◆ chooseFile()

bool Adafruit_Arcada::chooseFile ( const char *  path,
char *  selected_filename,
uint16_t  selected_filename_maxlen,
const char *  extensionFilter = NULL 
)

Presents a navigation menu for choosing a file from the filesys.

Parameters
pathA string with the starting directory path, must start with / e.g. "/roms"
selected_filenameA buffer to put the final selection in. Given long filename support, make this big!
selected_filename_maxlenMaximum buffer available in 'selected_filename'
extensionFilterA 3 (or more?) string to match against the final characters of each file for them to count. If they don't match, the index isn't incremented at all. We toupper() the extension and filename so don't worry about it.
Returns
true on success, false on some sort of failure

◆ hasControlPad()

bool Adafruit_Arcada::hasControlPad ( void  )

Does this board have a control pad - latch, buttons or analog joystick?

Returns
True if it does

◆ readJoystickX()

int16_t Adafruit_Arcada::readJoystickX ( uint8_t  sampling = 3)

Read X analog joystick.

Parameters
samplingHow many samples to read and average, default is 3
Returns
Signed 16 bits, from -512 to 511, 0 being 'center'

◆ readJoystickY()

int16_t Adafruit_Arcada::readJoystickY ( uint8_t  sampling = 3)

Read Y analog joystick.

Parameters
samplingHow many samples to read and average, default is 3
Returns
Signed 16 bits, from -512 to 511, 0 being 'center'

◆ readButtons()

uint32_t Adafruit_Arcada::readButtons ( void  )

Read all buttons/joystick and return a bitmask of which buttons are pressed, check ARCADA_BUTTONMASK_* for valid bitmasks to check again. If there's an analog joystick, it will 'simulate' the button presses.

Returns
Bit array with up to 32 buttons, 1 for pressed, 0 for not.

◆ justPressedButtons()

uint32_t Adafruit_Arcada::justPressedButtons ( void  )

What buttons were just pressed as of the last readButtons() call. Use ARCADA_BUTTONMASK_* defines to extract which bits are true (just pressed)

Returns
Bitmask of all buttons that were just pressed

◆ justReleasedButtons()

uint32_t Adafruit_Arcada::justReleasedButtons ( void  )

What buttons were just released as of the last readButtons() call. Use ARCADA_BUTTONMASK_* defines to extract which bits are true (just releasd)

Returns
Bitmask of all buttons that were just released

◆ hasTouchscreen()

bool Adafruit_Arcada::hasTouchscreen ( void  )

Does this board have a touchscreen.

Returns
True if it does

◆ setTouchscreenCalibration()

void Adafruit_Arcada::setTouchscreenCalibration ( int16_t  xmin,
int16_t  xmax,
int16_t  ymin,
int16_t  ymax 
)

Set the X/Y calibration values for the touchscreen.

Parameters
xminThe value of X which corresponds to 0 on that axis
yminThe value of Y which corresponds to 0 on that axis
xmaxThe value of X which corresponds to the TFT width on that axis
ymaxThe value of Y which corresponds to the TFT height on that axis

◆ getTouchscreenPoint()

TSPoint Adafruit_Arcada::getTouchscreenPoint ( void  )

Get a calibrated point that corresponds to the TFT.

Returns
A TSPoint with x, y and z pressure readings. If z is 0 no touch was detected.

◆ readLightSensor()

uint16_t Adafruit_Arcada::readLightSensor ( void  )

Read the light sensor onboard if there is one.

Returns
0 (darkest) to 1023 (brightest) or 0 if there is no sensor

◆ readBatterySensor()

float Adafruit_Arcada::readBatterySensor ( void  )

Read the batterysensor onboard if there is one.

Returns
Voltage as floating point or NAN if there is no sensor

◆ createFrameBuffer()

bool Adafruit_Arcada::createFrameBuffer ( uint16_t  width,
uint16_t  height 
)

Create (allocate) an internal GFX canvas of given width and height.

Parameters
widthNumber of pixels wide
heightNumber of pixels tall
Returns
True on success (could allocate) or false on failure

◆ getCanvas()

GFXcanvas16* Adafruit_Arcada::getCanvas ( void  )
inline

Return pointer to GFX canvas (NULL if not allocated)

Returns
The pointer to a width*height*16-bit GFXcanvas16 canvas.

◆ getFrameBuffer()

uint16_t* Adafruit_Arcada::getFrameBuffer ( void  )
inline

Return address of internal framebuffer (NULL if not allocated)

Returns
The pointer to a width*height*16-bit framebuf

◆ blitFrameBuffer()

bool Adafruit_Arcada::blitFrameBuffer ( uint16_t  x,
uint16_t  y,
bool  blocking = false,
bool  bigEndian = false 
)

Write the internal framebuffer to the display at coord (x, y)

Parameters
xX coordinate in the TFT screen to write it to
yY coordinate in the TFT screen to write it to
blockingIf true, function waits until blit is done. Otherwise we let DMA do the blitting and return immediately (THIS ISN'T NECESSARILY TRUE, SEE NOTE BELOW)
bigEndianIf true, frame buffer data is already in big-endian order (which is NOT SAMD-native order) and an actual background DMA blit can take place (SEE NOTE BELOW)
Returns
True on success, failure if no canvas exists yet
Note
Even if blocking is 'false,' this function may still block. For starters, DMA must be enabled in Adafruit_SPITFT.h. If bigEndian is NOT true (and this is the normal case on SAMD, being little-endian, and with GFX pixels in RAM being in MCU-native order), then every pixel needs to be byte-swapped before issuing to the display (which tend to be big-endian). If blocking is false, DMA transfers are used on a per- scanline basis and we at least get the cycles to perform this byte- swapping "free," but really it's no faster than a blocking write without byte swaps (except for the last scanline, which we allow the transfer to complete in the background). To really truly get a non-blocking full DMA transfer, blocking must be false AND bigEndian must be true...and graphics must be drawn to the canvas using byte-swapped colors, which is not normal (GFX uses device-native 16-bit type for pixels, i.e. little- endian). ONLY THEN will the entire transfer take place in the background (and the application should wait before further drawing in the framebuffer until the transfer completes).

◆ ColorHSV565()

uint16_t Adafruit_Arcada::ColorHSV565 ( int16_t  H,
uint8_t  S,
uint8_t  V 
)

Convert hue, saturation and value into a packed 16-bit RGB color that can be passed to TFT.

Parameters
HThe Hue ranging from 0 to 359
SSaturation, 8-bit value, 0 (min or pure grayscale) to 100 (max or pure hue)
VValue (brightness), 8-bit value, 0 (min / black / off) to 100 (max or full brightness)
Returns
Packed 16-bit 5-6-5 RGB. Result is linearly but not perceptually correct for LEDs. Intended for TFT use only.

◆ setBacklight()

bool Adafruit_Arcada::setBacklight ( uint8_t  brightness,
bool  saveToDisk = false 
)

Set the backlight brightness and save to the configuration.

Parameters
brightnessFrom 0 (off) to 255 (full on)
saveToDiskWhether we save this permanently to disk, default is false
Returns
Whether saving to disk succeeded, or true if we don't save

◆ getBacklight()

uint8_t Adafruit_Arcada::getBacklight ( void  )

Get the backlight brightness.

Returns
brightness From 0 (off) to 255 (full on)

◆ setVolume()

bool Adafruit_Arcada::setVolume ( uint8_t  volume,
bool  saveToDisk = false 
)

Set the audio volume (not working at this time)

Parameters
volumeFrom 0 (off) to 255 (full on)
saveToDiskWhether we save this permanently to disk, default is false
Returns
Whether saving to disk succeeded, or true if we don't save

◆ getVolume()

uint8_t Adafruit_Arcada::getVolume ( void  )

Get the audio volume (not working at this time)

Returns
Volume From 0 (off) to 255 (full on)

◆ enableSpeaker()

void Adafruit_Arcada::enableSpeaker ( bool  on)

Turn on the speaker amplifier.

Parameters
onTrue to enable, False to disable

◆ alertBox()

void Adafruit_Arcada::alertBox ( const char *  string,
uint16_t  boxColor,
uint16_t  textColor,
uint32_t  continueButtonMask 
)

Display an alert box with optional 'press to continue' button.

Parameters
stringThe message to display
boxColor16-bit color to use as background
textColor16-bit color to use as outline and text
continueButtonMaskARCADA_BUTTONMASK_ value to wait for, or 0 for immediate return.

◆ infoBox()

void Adafruit_Arcada::infoBox ( const char *  string,
uint32_t  continueButtonMask = ARCADA_BUTTONMASK_A 
)

Display an info box with optional 'press to continue' button.

Parameters
stringThe message to display
continueButtonMaskARCADA_BUTTONMASK_ value to wait for, or 0 for immediate return. Default is ARCADA_BUTTONMASK_A

◆ warnBox()

void Adafruit_Arcada::warnBox ( const char *  string,
uint32_t  continueButtonMask = ARCADA_BUTTONMASK_A 
)

Display an warning box with optional 'press to continue' button.

Parameters
stringThe message to display
continueButtonMaskARCADA_BUTTONMASK_ value to wait for, or 0 for immediate return. Default is ARCADA_BUTTONMASK_A

◆ errorBox()

void Adafruit_Arcada::errorBox ( const char *  string,
uint32_t  continueButtonMask = ARCADA_BUTTONMASK_A 
)

Display an error box with optional 'press to continue' button.

Parameters
stringThe message to display
continueButtonMaskARCADA_BUTTONMASK_ value to wait for, or 0 for immediate return. Default is ARCADA_BUTTONMASK_A

◆ haltBox()

void Adafruit_Arcada::haltBox ( const char *  string)

Display an error box and halt operation.

Parameters
stringThe message to display

◆ menu()

uint8_t Adafruit_Arcada::menu ( const char **  menu_strings,
uint8_t  menu_num,
uint16_t  boxColor,
uint16_t  textColor,
bool  cancellable = false 
)

Draws a menu and lets a user select one of the menu items.

Parameters
menu_stringsList of menu-item strings
menu_numNumber of menu items
boxColor16-bit color to use as menu-background
textColor16-bit color to use as outline and text
cancellablesetting this to true will enable the user to exit the menu by pressing "B"
Returns
uint8_t, The selected menu item, returns 255 if the menu is canceled

◆ loadConfigurationFile()

bool Adafruit_Arcada::loadConfigurationFile ( const char *  filename = ARCADA_DEFAULT_CONFIGURATION_FILENAME)

Loads the configuration JSON from the filesystem (which must be initialized before this function is called) and stores parsed JSON data internally.

Parameters
filenameThe path to the JSON file
Returns
True if a the file was found and was parsable

◆ saveConfigurationFile()

bool Adafruit_Arcada::saveConfigurationFile ( const char *  filename = ARCADA_DEFAULT_CONFIGURATION_FILENAME)

Saves the configuration JSON to the filesystem (which must be initialized before this function is called)

Parameters
filenameThe path to the JSON file
Returns
True if a the file was writable and saved

◆ hasWiFi()

bool Adafruit_Arcada::hasWiFi ( void  )
inline

Gets the status of the ESP32 module connected via SPI.

Returns
True if the ESP32 module was detected, false otherwise.

◆ drawBMP()

ImageReturnCode Adafruit_Arcada::drawBMP ( char *  filename,
int16_t  x,
int16_t  y,
boolean  transact = true 
)

Loads BMP image file from SD card directly to SPITFT screen.

Parameters
filenameName of BMP image file to load.
xHorizontal offset in pixels; left edge = 0, positive = right. Value is signed, image will be clipped if all or part is off the screen edges. Screen rotation setting is observed.
yVertical offset in pixels; top edge = 0, positive = down.
transactPass 'true' if TFT and SD are on the same SPI bus, in which case SPI transactions are necessary. If separate peripherals, can pass 'false'.
Returns
One of the ImageReturnCode values (IMAGE_SUCCESS on successful completion, other values on failure).

◆ loadBMP()

ImageReturnCode Adafruit_Arcada::loadBMP ( char *  filename,
Adafruit_Arcada_Image img 
)

Loads BMP image file from SD card into RAM (as one of the GFX canvas object types) for use with the bitmap-drawing functions. Not practical for most AVR microcontrollers, but some of the more capable 32-bit micros can afford some RAM for this.

Parameters
filenameName of BMP image file to load.
imgAdafruit_Image object, contents will be initialized, allocated and loaded on success (else cleared).
Returns
One of the ImageReturnCode values (IMAGE_SUCCESS on successful completion, other values on failure).

◆ bmpDimensions()

ImageReturnCode Adafruit_Arcada::bmpDimensions ( char *  filename,
int32_t *  width,
int32_t *  height 
)

Query pixel dimensions of BMP image file on SD card.

Parameters
filenameName of BMP image file to query.
widthPointer to int32_t; image width in pixels, returned.
heightPointer to int32_t; image height in pixels, returned.
Returns
One of the ImageReturnCode values (IMAGE_SUCCESS on successful completion, other values on failure).

◆ printImageStatus()

void Adafruit_Arcada::printImageStatus ( ImageReturnCode  stat,
Stream &  stream = Serial 
)

Print human-readable status message corresponding to an ImageReturnCode type.

Parameters
statNumeric ImageReturnCode value.
streamOutput stream (Serial default if unspecified).
Returns
None (void).

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