diff --git a/software/firmware/source/SoftRF/src/platform/RA4M1.cpp b/software/firmware/source/SoftRF/src/platform/RA4M1.cpp index 3d7f57e4d..56fb28c3a 100644 --- a/software/firmware/source/SoftRF/src/platform/RA4M1.cpp +++ b/software/firmware/source/SoftRF/src/platform/RA4M1.cpp @@ -80,48 +80,12 @@ const char *RA4M1_Device_Manufacturer = SOFTRF_IDENT; const char *RA4M1_Device_Model = "Academy Edition"; const uint16_t RA4M1_Device_Version = SOFTRF_USB_FW_VERSION; -#if defined(USE_USB_HOST) - -#include -#include - -class ACMAsyncOper : public CDCAsyncOper -{ -public: - uint8_t OnInit(ACM *pacm); -}; - -uint8_t ACMAsyncOper::OnInit(ACM *pacm) -{ - uint8_t rcode; - // Set DTR = 1 RTS=1 - rcode = pacm->SetControlLineState(3); - - if (rcode) - { - ErrorMessage(PSTR("SetControlLineState"), rcode); - return rcode; - } - - LINE_CODING lc; - lc.dwDTERate = 115200; - lc.bCharFormat = 0; - lc.bParityType = 0; - lc.bDataBits = 8; - - rcode = pacm->SetLineCoding(&lc); - - if (rcode) - ErrorMessage(PSTR("SetLineCoding"), rcode); - - return rcode; -} - -USBHost UsbH; -ACMAsyncOper AsyncOper; -ACM AcmSerial(&UsbH, &AsyncOper); +#if defined(ARDUINO_UNOR4_WIFI) +#include "ArduinoGraphics.h" +#include "Arduino_LED_Matrix.h" -#endif /* USE_USB_HOST */ +ArduinoLEDMatrix matrix; +#endif /* ARDUINO_UNOR4_WIFI */ static void RA4M1_setup() { @@ -169,15 +133,26 @@ static void RA4M1_setup() USBDevice.setDeviceVersion(RA4M1_Device_Version); #endif /* USE_TINYUSB */ -#if defined(USE_USB_HOST) - UsbH.Init(); -#endif /* USE_USB_HOST */ - Serial.begin(SERIAL_OUT_BR, SERIAL_OUT_BITS); #if defined(USBCON) for (int i=0; i < 20; i++) {if (Serial) break; else delay(100);} #endif + +#if defined(ARDUINO_UNOR4_WIFI) + matrix.begin(); + matrix.beginDraw(); + + matrix.stroke(0xFFFFFFFF); + matrix.textScrollSpeed(50); + + const char text[] = " " SOFTRF_IDENT; + matrix.textFont(Font_5x7); + matrix.beginText(0, 1, 0xFFFFFF); + matrix.println(text); + matrix.endText(SCROLL_LEFT); + matrix.endDraw(); +#endif /* ARDUINO_UNOR4_WIFI */ } static void RA4M1_post_init() @@ -213,28 +188,34 @@ static void RA4M1_post_init() Serial.print(F("NMEA - ")); switch (settings->nmea_out) { - case NMEA_UART : Serial.println(F("UART")); break; - case NMEA_USB : Serial.println(F("USB CDC")); break; + case NMEA_UART : Serial.println(F("UART")); break; + case NMEA_USB : Serial.println(F("USB CDC")); break; + case NMEA_UDP : Serial.println(F("UDP")); break; + case NMEA_TCP : Serial.println(F("TCP")); break; + case NMEA_BLUETOOTH : Serial.println(F("Bluetooth")); break; case NMEA_OFF : - default : Serial.println(F("NULL")); break; + default : Serial.println(F("NULL")); break; } Serial.print(F("GDL90 - ")); switch (settings->gdl90) { - case GDL90_UART : Serial.println(F("UART")); break; - case GDL90_USB : Serial.println(F("USB CDC")); break; + case GDL90_UART : Serial.println(F("UART")); break; + case GDL90_USB : Serial.println(F("USB CDC")); break; + case GDL90_UDP : Serial.println(F("UDP")); break; + case GDL90_BLUETOOTH : Serial.println(F("Bluetooth")); break; case GDL90_OFF : - default : Serial.println(F("NULL")); break; + default : Serial.println(F("NULL")); break; } Serial.print(F("D1090 - ")); switch (settings->d1090) { - case D1090_UART : Serial.println(F("UART")); break; - case D1090_USB : Serial.println(F("USB CDC")); break; + case D1090_UART : Serial.println(F("UART")); break; + case D1090_USB : Serial.println(F("USB CDC")); break; + case D1090_BLUETOOTH : Serial.println(F("Bluetooth")); break; case D1090_OFF : - default : Serial.println(F("NULL")); break; + default : Serial.println(F("NULL")); break; } Serial.println(); @@ -288,6 +269,19 @@ static void RA4M1_loop() } } #endif /* SOC_GPIO_RADIO_LED_RX */ + +#if SOC_GPIO_PIN_GNSS_PPS != SOC_UNUSED_PIN + static bool prev_PPS_state = LOW; + + if (digitalPinToInterrupt(SOC_GPIO_PIN_GNSS_PPS) == NOT_AN_INTERRUPT) { + bool PPS_state = digitalRead(SOC_GPIO_PIN_GNSS_PPS); + + if (PPS_state == HIGH && prev_PPS_state == LOW) { + PPS_TimeMarker = millis(); + } + prev_PPS_state = PPS_state; + } +#endif } static void RA4M1_fini(int reason) @@ -326,7 +320,7 @@ static String RA4M1_getResetInfo() { switch (reset_info.reason) { - default : return F("No reset information available"); + default : return F("No reset information available"); } } @@ -455,11 +449,7 @@ static void RA4M1_EEPROM_extension(int cmd) static void RA4M1_SPI_begin() { -#if USE_ISP_PORT SPI.begin(); -#else -// SPI1.begin(); -#endif } static void RA4M1_swSer_begin(unsigned long baud) @@ -675,7 +665,45 @@ static void RA4M1_Button_fini() #endif /* SOC_GPIO_PIN_BUTTON != SOC_UNUSED_PIN */ } -#if !defined(ARDUINO_UNOR4_WIFI) +#if defined(ARDUINO_UNOR4_WIFI) + +static void UNOR4W_Serial_setup() { } +static void UNOR4W_Serial_loop() { } +static void UNOR4W_Serial_fini() { } +static int UNOR4W_Serial_available() { return SerialOutput.available(); } +static int UNOR4W_Serial_read() { return SerialOutput.read(); } + +static size_t UNOR4W_Serial_write(const uint8_t *buffer, size_t size) +{ +/* + if (nl) { + if (buf[size-1] == '\r') { + SerialOutput.write(buf, size-1); + SerialOutput.write((byte *) "\r\n", 2); + } else { + SerialOutput.write(buf, size); + SerialOutput.write('\n'); + } + } else { + SerialOutput.write(buf, size); + } +*/ + + return SerialOutput.write(buffer, size); +} + +IODev_ops_t UNOR4W_Serial_ops = { + "UNOR4W Serial", + UNOR4W_Serial_setup, + UNOR4W_Serial_loop, + UNOR4W_Serial_fini, + UNOR4W_Serial_available, + UNOR4W_Serial_read, + UNOR4W_Serial_write +}; + +#else + static void RA4M1_USB_setup() { if (USBSerial && USBSerial != Serial) { @@ -699,55 +727,7 @@ RingBufferN USB_RX_FIFO = RingBufferN(); static void RA4M1_USB_loop() { -#if defined(USE_USB_HOST) - - UsbH.Task(); - - if (AcmSerial.isReady()) { - uint8_t rcode; - uint8_t data[USBD_CDC_IN_OUT_MAX_SIZE]; - size_t size; - - while ((size = USB_TX_FIFO.available()) != 0) { - - if (size > sizeof(data)) { - size = sizeof(data); - } - - for (size_t i=0; i < size; i++) { - data[i] = USB_TX_FIFO.read_char(); - } - - rcode = AcmSerial.SndData(size, data); - if (rcode) { - ErrorMessage(PSTR("SndData"), rcode); - } - } - - uint16_t rcvd = sizeof(data); - rcode = AcmSerial.RcvData(&rcvd, data); - if (rcode && rcode != USB_ERRORFLOW) { - ErrorMessage(PSTR("RcvData"), rcode); - } else { - if( rcvd ) { -#if 1 - SerialOutput.write(data, rcvd); -#else - size_t written; - - for (written=0; written < rcvd; written++) { - if (!USB_RX_FIFO.isFull()) { - USB_RX_FIFO.store_char(data[written]); - } else { - break; - } - } -#endif - } - } - } - -#elif !defined(USE_TINYUSB) +#if !defined(USE_TINYUSB) uint8_t buf[USBD_CDC_IN_OUT_MAX_SIZE]; size_t size; @@ -783,7 +763,6 @@ static void RA4M1_USB_loop() break; } } - #endif /* USE_TINYUSB */ } @@ -893,10 +872,11 @@ const SoC_ops_t RA4M1_ops = { #endif /* EXCLUDE_BLUETOOTH */ #if !defined(ARDUINO_UNOR4_WIFI) &RA4M1_USBSerial_ops, + NULL, #else NULL, + &UNOR4W_Serial_ops, #endif /* ARDUINO_UNOR4_WIFI */ - NULL, RA4M1_Display_setup, RA4M1_Display_loop, RA4M1_Display_fini, diff --git a/software/firmware/source/SoftRF/src/platform/RA4M1.h b/software/firmware/source/SoftRF/src/platform/RA4M1.h index 6d72b4a7f..0fcf9f9e3 100644 --- a/software/firmware/source/SoftRF/src/platform/RA4M1.h +++ b/software/firmware/source/SoftRF/src/platform/RA4M1.h @@ -128,6 +128,7 @@ struct rst_info { #define SOC_GPIO_PIN_LED SOC_UNUSED_PIN #define SOC_GPIO_PIN_GNSS_PPS PIN_A3 +#define NOT_AN_INTERRUPT SOC_GPIO_PIN_GNSS_PPS #define SOC_GPIO_PIN_BATTERY PIN_A0 #define SOC_GPIO_PIN_BUTTON SOC_UNUSED_PIN @@ -175,6 +176,9 @@ struct rst_info { #define EXCLUDE_LED_RING // - kb #define EXCLUDE_SOUND +//#define USE_BASICMAC +//#define EXCLUDE_SX1276 // - 3 kb + #define USE_OLED // kb #define EXCLUDE_OLED_049 //#define EXCLUDE_OLED_BARO_PAGE diff --git a/software/firmware/source/libraries/ArduinoGraphics/README.adoc b/software/firmware/source/libraries/ArduinoGraphics/README.adoc new file mode 100644 index 000000000..eeee79b61 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/README.adoc @@ -0,0 +1,37 @@ +:repository-owner: arduino-libraries +:repository-name: ArduinoGraphics + += {repository-name} Library for Arduino = + +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"] +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] + +Core graphics library for Arduino. Based on the Processing API. + +For more information about this library please visit us at https://www.arduino.cc/en/Reference/ArduinoGraphics + +== License == + +Copyright (c) 2019 Arduino SA. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +== How-to generate bitmaps from the fonts == +[source,bash] +---- +cd extra +./generate_font.py 5x7.bdf Font_5x7.c Font_5x7 +---- diff --git a/software/firmware/source/libraries/ArduinoGraphics/docs/api.md b/software/firmware/source/libraries/ArduinoGraphics/docs/api.md new file mode 100644 index 000000000..a87092087 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/docs/api.md @@ -0,0 +1,904 @@ +# Arduino Graphics Library + +## Methods + +### `begin()` + +#### Description + + +Initializes the graphics device. + +#### Syntax + +``` +YourScreen.begin() +``` + + +#### Parameters + +None + +#### Returns + +1 for success, 0 on failure. + +#### Example + +``` +if (!YourScreen.begin() { + Serial.println(“Failed to initialize the display!”); + while (1); +} +``` + + + +### `end()` + +#### Description + +Stops the graphics device. + +#### Syntax + +``` +YourScreen.end() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.end(); +``` + + + +### `width()` + +#### Description + + +Returns the pixel width of the graphics device. + +#### Syntax + +``` +YourScreen.width() + +``` + + +#### Parameters + + +None + +#### Returns + +Returns the pixel width of the graphics device. + +#### Example + +``` +int w = YourScreen.width(); +``` + + +### `height()` + +#### Description + + +Returns the pixel height of the graphics device. + +#### Syntax + +``` +YourScreen.height() + +``` + + +#### Parameters + + +None + +#### Returns + +Returns the pixel height of the graphics device. + +#### Example + +``` +int h = YourScreen.height(); +``` + + +### `beginDraw()` + +#### Description + + +Begins a drawing operation. + +#### Syntax + +``` +YourScreen.beginDraw() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + + +YourScreen.beginDraw(); +YourScreen.set(0, 0, 255, 0, 0); +YourScreen.endDraw(); + + + +### `endDraw()` + +#### Description + + +Ends a drawing operation, any drawing operations after beginDraw() is called will be displayed to the screen. + +#### Syntax + +``` +YourScreen.endDraw() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.set(0, 0, 255, 0, 0); +YourScreen.endDraw(); +``` + + +### `background()` + +#### Description + + +Set the background color of drawing operations. Used when calling clear() or drawing text. + +#### Syntax + +``` +YourScreen.background(r, g, b) +YourScreen.background(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.background(255, 0, 0); +YourScreen.clear(); +YourScreen.endDraw(); +``` + + +### `clear()` + +#### Description + + +Set clear the screen contents, uses the background colour set in background(). + +#### Syntax + +``` +YourScreen.clear() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.background(255, 0, 0); +YourScreen.clear(); +YourScreen.endDraw(); +``` + + + +### `fill()` + +#### Description + + +Set the fill color of drawing operations. + +#### Syntax + +``` +YourScreen.fill(r, g, b) +YourScreen.fill(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `noFill()` + +#### Description + + +Clears the fill color of drawing operations. + +#### Syntax + +``` +YourScreen.noFill() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 0, 255); +YourScreen.noFill(); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `stroke()` + +#### Description + + +Set the stroke color of drawing operations. + +#### Syntax + +``` +YourScreen.stroke(r, g, b) +YourScreen.stroke(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 0, 255); +YourScreen.noFill(); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + + +### `noStroke()` + +#### Description + + +Clears the stroke color of drawing operations. + +#### Syntax + +``` +YourScreen.noStroke() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `line()` + +#### Description + + +Stroke a line, uses the stroke color set in stroke(). + +#### Syntax + +``` +YourScreen.line(x1, y1, x2, y2) + +``` + + +#### Parameters + + +- x1: x position of the starting point of the line +- y1: y position of the starting point of the line +- x2: x position of the end point of the line +- y2: y position of the end point of the line + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(0, 0, 255); +YourScreen.line(0, 0, YourScreen.width() - 1, YourScreen.height() - 1); +YourScreen.endDraw(); +``` + + +### `point()` + +#### Description + + +Stroke a point, uses the stroke color set in stroke(). + +#### Syntax + +``` +YourScreen.point(x, y) + +``` + + +#### Parameters + + +x: x position of the point +y: y position of the point + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(0, 255, 0); +YourScreen.point(1, 1); +YourScreen.endDraw(); +``` + + +### `rect()` + +#### Description + + +Stroke and fill a rectangle, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.rect(x, y, width, height) + +``` + + +#### Parameters + + +- x: x position of the rectangle +- y: y position of the rectangle +- width: width of the rectangle +- height: height of the rectangle + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `circle()` + +#### Description + + +Stroke and fill a circle, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.circle(x, y, diameter) + +``` + + +#### Parameters + + +- x: x center position of the circle +- y: y center position of the circle +- diameter: diameter of the circle + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.circle(YourScreen.width()/2, YourScreen.height()/2, YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `ellipse()` + +#### Description + + +Stroke and fill an ellipse, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.ellipse(x, y, width, height) + +``` + + +#### Parameters + + +- x: x center position of the ellipse +- y: y center position of the ellipse +- width: width of the ellipse +- height: height of the ellipse + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.ellipse(YourScreen.width()/2, YourScreen.height()/2, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `text()` + +#### Description + + +Draw some text, uses the stroke color set in stroke() and the background color set in background(). + +#### Syntax + +``` +YourScreen.text(string) +YourScreen.text(string, x, y) + +``` + + +#### Parameters + + +- string: string to draw +- x: x position for the start of the text +- y: y position for the start of the text + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 255, 255); +YourScreen.text("abc", 0, 1); +YourScreen.endDraw(); +``` + + +### `textFont()` + +#### Description + + +Sets the font uses for text. The library current has the Font_4x6 and Font_5x7 built in. + +#### Syntax + +``` +YourScreen.textFont(font) + +``` + + +#### Parameters + + +font: font to set + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 255, 255); +YourScreen.textFont(Font_5x7); +YourScreen.text("abc", 0, 1); +YourScreen.endDraw(); +``` + + +### `textFontWidth()` + +#### Description + + +Returns the width, in pixels, of the current font. + +#### Syntax + +``` +YourScreen.textFontWidth() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +int w = YourScreen.textFontWidth(); +``` + + +### `textFontHeight()` + +#### Description + + +Returns the height, in pixels, of the current font. + +#### Syntax + +``` +YourScreen.textFontHeight() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +int h = YourScreen.textFontHeight(); +``` + + +### `set()` + +#### Description + + +Set a pixel’s color value. + +#### Syntax + +``` +YourScreen.set(x, y, r, g, b) +YourScreen.set(x, y, color) + +``` + + +#### Parameters + + +x: x position of the pixel +y: y position of the pixel +r: red color value (0 - 255) +g: green color value (0 - 255) +b: blue color value (0 - 255) +color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.point(1, 1, 0, 255, 0); +YourScreen.endDraw(); +``` + + +### `beginText()` + +#### Description + + +Start the process of displaying and optionally scrolling text. The Print interface can be used to set the text. + +#### Syntax + +``` +YourScreen.beginText() +YourScreen.beginText(x, y, r, g, b) +YourScreen.beginText(x, y, color) + +``` + + +#### Parameters + + +x: x position of the text +y: y position of the text +r: red color value (0 - 255) +g: green color value (0 - 255) +b: blue color value (0 - 255) +color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.print("Hi"); +YourScreen.endText(); +``` + + +### `endText()` + +#### Description + + +End the process of displaying and optionally scrolling text. + +#### Syntax + +``` +YourScreen.endText() +YourScreen.endText(scrollDirection) + +``` + + +#### Parameters + + +scrollDirection: (optional) the direction to scroll, defaults to NO_SCROLL if not provided. Valid options are NO_SCROLL, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.print("Hi"); +YourScreen.endText(); +``` + + +### `textScrollSpeed()` + +#### Description + + +Sets the text scrolling speed, the speed controls the delay in milliseconds between scrolling each pixel. + +#### Syntax + +``` +YourScreen.textScrollSpeed(speed) + +``` + + +#### Parameters + + +speed: scroll speed + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.textScrollSpeed(500); +YourScreen.print("Hello There!"); +YourScreen.endText(true); +``` + diff --git a/software/firmware/source/libraries/ArduinoGraphics/docs/readme.md b/software/firmware/source/libraries/ArduinoGraphics/docs/readme.md new file mode 100644 index 000000000..92ff8dba9 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/docs/readme.md @@ -0,0 +1,13 @@ +# Arduino Graphics Library + +This is a library that allows you to draw and write on screens with graphical primitives; it requires a specific hardware interfacce library to drive the screen you are using, therefore every screen type should have its own hardware specific library. + +To use this library + +``` +#include +``` + +To let you easily understand the usage of the graphics primitives, we are using a dummy screen object named YourScreen that should be substituted with the real one, Eg. MATRIX, OLED, TFT and so on. Refer to the hardware interfacing library of your screen to get more details. + +The style and syntax of this library is inspired by [Processing 3](https://processing.org/) and we believe that learning Processing is very helpful to develop complex applications that combine the versatility of Arduino driven hardware with the power of a pc based graphical interface. \ No newline at end of file diff --git a/software/firmware/source/libraries/ArduinoGraphics/examples/ASCIIDraw/ASCIIDraw.ino b/software/firmware/source/libraries/ArduinoGraphics/examples/ASCIIDraw/ASCIIDraw.ino new file mode 100644 index 000000000..398a40db1 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/examples/ASCIIDraw/ASCIIDraw.ino @@ -0,0 +1,107 @@ +/* + ASCIIDraw + + Use the ArduinoGraphics library to draw ASCII art on the Serial Monitor. + + This is intended primarily to allow testing of the library. + See the Arduino_MKRRGB library for a more useful demonstration of the ArduinoGraphics library. + + The circuit: + - Arduino board + + This example code is in the public domain. +*/ + +#include + +const byte canvasWidth = 61; +const byte canvasHeight = 27; + +class ASCIIDrawClass : public ArduinoGraphics { + public: + // can be used with an object of any class that inherits from the Print class + ASCIIDrawClass(Print &printObject = (Print &)Serial) : + ArduinoGraphics(canvasWidth, canvasHeight), + _printObject(&printObject) {} + + // this function is called by the ArduinoGraphics library's functions + virtual void set(int x, int y, uint8_t r, uint8_t g, uint8_t b) { + // the r parameter is (mis)used to set the character to draw with + _canvasBuffer[x][y] = r; + // cast unused parameters to void to fix "unused parameter" warning + (void)g; + (void)b; + } + + // display the drawing + void endDraw() { + ArduinoGraphics::endDraw(); + + for (byte row = 0; row < canvasHeight; row++) { + for (byte column = 0; column < canvasWidth; column++) { + // handle unset parts of buffer + if (_canvasBuffer[column][row] == 0) { + _canvasBuffer[column][row] = ' '; + } + _printObject->print(_canvasBuffer[column][row]); + } + _printObject->println(); + } + } + + private: + Print *_printObject; + char _canvasBuffer[canvasWidth][canvasHeight] = {{0}}; +}; + +ASCIIDrawClass ASCIIDraw; + +void setup() { + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB port only + } + + ASCIIDraw.beginDraw(); + + // configure the character used to fill the background. The second and third parameters are ignored + ASCIIDraw.background('+', 0, 0); + ASCIIDraw.clear(); + + // add the outer border + ASCIIDraw.stroke('-', 0, 0); + ASCIIDraw.fill('*', 0, 0); + const byte outerBorderThickness = 1; + ASCIIDraw.rect(outerBorderThickness, outerBorderThickness, canvasWidth - outerBorderThickness * 2, canvasHeight - outerBorderThickness * 2); + + // add the inner border + ASCIIDraw.stroke('+', 0, 0); + ASCIIDraw.fill('O', 0, 0); + const byte borderThickness = outerBorderThickness + 6; + ASCIIDraw.rect(borderThickness, borderThickness, canvasWidth - borderThickness * 2, canvasHeight - borderThickness * 2); + + // add the text + ASCIIDraw.background(' ', 0, 0); + ASCIIDraw.stroke('@', 0, 0); + const char text[] = "ARDUINO"; + ASCIIDraw.textFont(Font_5x7); + const byte textWidth = strlen(text) * ASCIIDraw.textFontWidth(); + const byte textHeight = ASCIIDraw.textFontHeight(); + const byte textX = (canvasWidth - textWidth) / 2; + const byte textY = (canvasHeight - textHeight) / 2; + ASCIIDraw.text(text, textX, textY); + + // underline the text + ASCIIDraw.stroke('-', 0, 0); + ASCIIDraw.line(textX, textY + textHeight - 1, textX + textWidth - 1, textY + textHeight - 1); + + // add some accents to the underline + ASCIIDraw.stroke('+', 0, 0); + ASCIIDraw.point(textX + 4, textY + textHeight - 1); + ASCIIDraw.point(textX + textWidth - 1 - 4, textY + textHeight - 1); + + // print the drawing to the Serial Monitor + ASCIIDraw.endDraw(); +} + +void loop() {} diff --git a/software/firmware/source/libraries/ArduinoGraphics/keywords.txt b/software/firmware/source/libraries/ArduinoGraphics/keywords.txt new file mode 100644 index 000000000..ce07cc7e0 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/keywords.txt @@ -0,0 +1,74 @@ +########################################## +# Syntax Coloring Map For ArduinoGraphics +########################################## +# Class +########################################## + +ArduinoGraphics KEYWORD1 +MATRIX KEYWORD1 +Font KEYWORD1 +Image KEYWORD1 + +########################################## +# Methods and Functions +########################################## + +begin KEYWORD2 +end KEYWORD2 + +width KEYWORD2 +height KEYWORD2 + +beginDraw KEYWORD2 +endDraw KEYWORD2 + +background KEYWORD2 +clear KEYWORD2 +fill KEYWORD2 +noFill KEYWORD2 +stroke KEYWORD2 +noStroke KEYWORD2 + +line KEYWORD2 +point KEYWORD2 +quad KEYWORD2 +rect KEYWORD2 +circle KEYWORD2 +ellipse KEYWORD2 + +text KEYWORD2 +textFont KEYWORD2 +textFontWidth KEYWORD2 +textFontHeight KEYWORD2 + +image KEYWORD2 + +set KEYWORD2 + +write KEYWORD2 +flush KEYWORD2 + +beginText KEYWORD2 +endText KEYWORD2 +textScrollSpeed KEYWORD2 + +encoding KEYWORD2 +data KEYWORD2 + +########################################## +# Constants +########################################## + +Font_4x6 LITERAL1 +Font_5x7 LITERAL1 + +ENCODING_NONE LITERAL1 +ENCODING_RGB LITERAL1 +ENCODING_RGB24 LITERAL1 +ENCODING_RGB16 LITERAL1 + +NO_SCROLL LITERAL1 +SCROLL_LEFT LITERAL1 +SCROLL_RIGHT LITERAL1 +SCROLL_UP LITERAL1 +SCROLL_DOWN LITERAL1 diff --git a/software/firmware/source/libraries/ArduinoGraphics/library.properties b/software/firmware/source/libraries/ArduinoGraphics/library.properties new file mode 100644 index 000000000..3ee63690f --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/library.properties @@ -0,0 +1,10 @@ +name=ArduinoGraphics +version=1.1.2 +author=Arduino +maintainer=Arduino +sentence=Core graphics library for Arduino. +paragraph=Based on the Processing API. +category=Display +url=http://github.com/arduino-libraries/ArduinoGraphics +architectures=samd +includes=ArduinoGraphics.h diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.cpp b/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.cpp new file mode 100644 index 000000000..b47c2b55f --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.cpp @@ -0,0 +1,554 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "ArduinoGraphics.h" + +#define COLOR_R(color) (uint8_t(color >> 16)) +#define COLOR_G(color) (uint8_t(color >> 8)) +#define COLOR_B(color) (uint8_t(color >> 0)) + +ArduinoGraphics::ArduinoGraphics(int width, int height) : + _width(width), + _height(height), + _font(NULL) +{ +} + +ArduinoGraphics::~ArduinoGraphics() +{ +} + +int ArduinoGraphics::begin() +{ + background(0, 0, 0); + noFill(); + noStroke(); + + _textScrollSpeed = 100; + + return 1; +} + +void ArduinoGraphics::end() +{ +} + +int ArduinoGraphics::width() +{ + return _width; +} + +int ArduinoGraphics::height() +{ + return _height; +} + +uint32_t ArduinoGraphics::background() +{ + uint32_t bg = (uint32_t)((uint32_t)(_backgroundR << 16) | (uint32_t)(_backgroundG << 8) | (uint32_t)(_backgroundB << 0)); + return bg; +} + +void ArduinoGraphics::beginDraw() +{ +} + +void ArduinoGraphics::endDraw() +{ +} + +void ArduinoGraphics::background(uint8_t r, uint8_t g, uint8_t b) +{ + _backgroundR = r; + _backgroundG = g; + _backgroundB = b; +} + +void ArduinoGraphics::background(uint32_t color) +{ + background(COLOR_R(color), COLOR_G(color), COLOR_B(color)); +} + +void ArduinoGraphics::clear() +{ + for (int x = 0; x < _width; x++) { + for (int y = 0; y < _height; y++) { + set(x, y, _backgroundR, _backgroundG, _backgroundB); + } + } +} + +void ArduinoGraphics::fill(uint8_t r, uint8_t g, uint8_t b) +{ + _fill = true; + _fillR = r; + _fillG = g; + _fillB = b; +} + +void ArduinoGraphics::fill(uint32_t color) +{ + fill(COLOR_R(color), COLOR_G(color), COLOR_B(color)); +} + +void ArduinoGraphics::noFill() +{ + _fill = false; +} + +void ArduinoGraphics::stroke(uint8_t r, uint8_t g, uint8_t b) +{ + _stroke = true; + _strokeR = r; + _strokeG = g; + _strokeB = b; +} + +void ArduinoGraphics::stroke(uint32_t color) +{ + stroke(COLOR_R(color), COLOR_G(color), COLOR_B(color)); +} + +void ArduinoGraphics::noStroke() +{ + _stroke = false; +} + +void ArduinoGraphics::circle(int x, int y, int diameter) +{ + ellipse(x, y, diameter, diameter); +} + +void ArduinoGraphics::ellipse(int x, int y, int width, int height) +{ + if (!_stroke && !_fill) { + return; + } + + int32_t a = width / 2; + int32_t b = height / 2; + int64_t a2 = a * a; + int64_t b2 = b * b; + int64_t i, j; + + if (_fill) { + for (j = -b; j <= b; j++) { + for (i = -a; i <= a; i++) { + if (i*i*b2 + j*j*a2 <= a2*b2) { + set(x + i, y + j, _fillR, _fillG, _fillB); + } + } + } + } + if (_stroke) { + int x_val, y_val; + for (i = -a; i <= a; i++) { + y_val = b * sqrt(1 - (double)i*i / a2); + set(x + i, y + y_val, _strokeR, _strokeG, _strokeB); + set(x + i, y - y_val, _strokeR, _strokeG, _strokeB); + } + for (j = -b; j <= b; j++) { + x_val = a * sqrt(1 - (double)j*j / b2); + set(x + x_val, y + j, _strokeR, _strokeG, _strokeB); + set(x - x_val, y + j, _strokeR, _strokeG, _strokeB); + } + } +} + +void ArduinoGraphics::line(int x1, int y1, int x2, int y2) +{ + if (!_stroke) { + return; + } + + if (x1 == x2) { + for (int y = y1; y <= y2; y++) { + set(x1, y, _strokeR, _strokeG, _strokeB); + } + } else if (y1 == y2) { + for (int x = x1; x <= x2; x++) { + set(x, y1, _strokeR, _strokeG, _strokeB); + } + } else if (abs(y2 - y1) < abs(x2 - x1)) { + if (x1 > x2) { + lineLow(x2, y2, x1, y1); + } else { + lineLow(x1, y1, x2, y2); + } + } else { + if (y1 > y2) { + lineHigh(x2, y2, x1, y1); + } else { + lineHigh(x1, y1, x2, y2); + } + } +} + +void ArduinoGraphics::point(int x, int y) +{ + if (_stroke) { + set(x, y, _strokeR, _strokeG, _strokeB); + } +} + +void ArduinoGraphics::rect(int x, int y, int width, int height) +{ + if (!_stroke && !_fill) { + return; + } + + int x1 = x; + int y1 = y; + int x2 = x1 + width - 1; + int y2 = y1 + height - 1; + + for (x = x1; x <= x2; x++) { + for (y = y1; y <= y2; y++) { + if ((x == x1 || x == x2 || y == y1 || y == y2) && _stroke) { + // stroke + set(x, y, _strokeR, _strokeG, _strokeB); + } else if (_fill) { + // fill + set(x, y, _fillR, _fillG, _fillB); + } + } + } +} + +void ArduinoGraphics::text(const char* str, int x, int y) +{ + if (!_font || !_stroke) { + return; + } + + while (*str) { + uint8_t const c = (uint8_t)*str++; + + if (c == '\n') { + y += _font->height; + } else if (c == '\r') { + x = 0; + } else if (c == 0xc2 || c == 0xc3) { + // drop + } else { + const uint8_t* b = _font->data[c]; + + if (b == NULL) { + b = _font->data[0x20]; + } + + if (b) { + bitmap(b, x, y, _font->width, _font->height); + } + + x += _font->width; + } + } +} + +void ArduinoGraphics::textFont(const Font& which) +{ + _font = &which; +} + +int ArduinoGraphics::textFontWidth() const +{ + return (_font ? _font->width : 0); +} + +int ArduinoGraphics::textFontHeight() const +{ + return (_font ? _font->height : 0); +} + +void ArduinoGraphics::bitmap(const uint8_t* data, int x, int y, int width, int height) +{ + if (!_stroke) { + return; + } + + if ((data == NULL) || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > _height)) { + // offscreen + return; + } + + for (int j = 0; j < height; j++) { + uint8_t b = data[j]; + + for (int i = 0; i < width; i++) { + if (b & (1 << (7 - i))) { + set(x + i, y + j, _strokeR, _strokeG, _strokeB); + } else { + set(x + i, y + j, _backgroundR, _backgroundG, _backgroundB); + } + } + } +} + +void ArduinoGraphics::imageRGB(const Image& img, int x, int y, int width, int height) +{ + const uint8_t* data = img.data(); + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + uint8_t r = *data++; + uint8_t g = *data++; + uint8_t b = *data++; + + set(x + i, y + j, r, g, b); + + data++; + } + + data += (4 * (img.width() - width)); + } +} + +void ArduinoGraphics::imageRGB24(const Image& img, int x, int y, int width, int height) +{ + const uint8_t* data = img.data(); + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + uint8_t r = *data++; + uint8_t g = *data++; + uint8_t b = *data++; + + set(x + i, y + j, r, g, b); + } + + data += (3 * (img.width() - width)); + } +} + +void ArduinoGraphics::imageRGB16(const Image& img, int x, int y, int width, int height) +{ + const uint16_t* data = (const uint16_t*)img.data(); + + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + uint16_t pixel = *data++; + + set(x + i, y + j, ((pixel >> 8) & 0xf8), ((pixel >> 3) & 0xfc), (pixel << 3) & 0xf8); + } + + data += (img.width() - width); + } +} + +void ArduinoGraphics::image(const Image& img, int x, int y) +{ + image(img, x, y, img.width(), img.height()); +} + +void ArduinoGraphics::image(const Image& img, int x, int y, int width, int height) +{ + if (!img || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > height)) { + // offscreen + return; + } + + switch (img.encoding()) { + case ENCODING_RGB: + imageRGB(img, x, y, width, height); + break; + + case ENCODING_RGB24: + imageRGB24(img, x, y, width, height); + break; + + case ENCODING_RGB16: + imageRGB16(img, x, y, width, height); + break; + } +} + +void ArduinoGraphics::set(int x, int y, uint32_t color) +{ + set(x, y, COLOR_R(color), COLOR_G(color), COLOR_B(color)); +} + +size_t ArduinoGraphics::write(uint8_t b) +{ + if (b != 0xc2 && b != 0xc3) { + _textBuffer += (char)b; + } + + return 1; +} + +void ArduinoGraphics::flush() +{ + _textBuffer = ""; +} + +void ArduinoGraphics::beginText(int x, int y) +{ + _textBuffer = ""; + + _textX = x; + _textY = y; +} + +void ArduinoGraphics::beginText(int x, int y, uint8_t r, uint8_t g, uint8_t b) +{ + beginText(x, y); + + _textR = r; + _textG = g; + _textB = b; +} + +void ArduinoGraphics::beginText(int x, int y, uint32_t color) +{ + beginText(x, y, COLOR_R(color), COLOR_G(color), COLOR_B(color)); +} + +void ArduinoGraphics::endText(int scrollDirection) +{ + // backup the stroke color and set the color to the text color + bool strokeOn = _stroke; + uint8_t strokeR = _strokeR; + uint8_t strokeG = _strokeG; + uint8_t strokeB = _strokeB; + + + stroke(_textR, _textG, _textB); + + if (scrollDirection == SCROLL_LEFT) { + int scrollLength = _textBuffer.length() * textFontWidth() + _textX; + + for (int i = 0; i < scrollLength; i++) { + beginDraw(); + int const text_x = _textX - i; + text(_textBuffer, text_x, _textY); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); + endDraw(); + + delay(_textScrollSpeed); + } + } else if (scrollDirection == SCROLL_RIGHT) { + int scrollLength = _textBuffer.length() * textFontWidth() + _textX; + + for (int i = 0; i < scrollLength; i++) { + beginDraw(); + int const text_x = _textX - (scrollLength - i - 1); + text(_textBuffer, text_x, _textY); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); + endDraw(); + + delay(_textScrollSpeed); + } + } else if (scrollDirection == SCROLL_UP) { + int scrollLength = textFontHeight() + _textY; + + for (int i = 0; i < scrollLength; i++) { + beginDraw(); + int const text_y = _textY - i; + text(_textBuffer, _textX, text_y); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); + endDraw(); + + delay(_textScrollSpeed); + } + } else if (scrollDirection == SCROLL_DOWN) { + int scrollLength = textFontHeight() + _textY; + + for (int i = 0; i < scrollLength; i++) { + beginDraw(); + int const text_y = _textY - (scrollLength - i - 1); + text(_textBuffer, _textX, text_y); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); + endDraw(); + + delay(_textScrollSpeed); + } + } else { + beginDraw(); + text(_textBuffer, _textX, _textY); + endDraw(); + } + + // restore the stroke color + if (strokeOn) { + stroke(strokeR, strokeG, strokeB); + } else { + noStroke(); + } + + // clear the buffer + _textBuffer = ""; +} + +void ArduinoGraphics::textScrollSpeed(unsigned long speed) +{ + _textScrollSpeed = speed; +} + +void ArduinoGraphics::lineLow(int x1, int y1, int x2, int y2) +{ + int dx = x2 - x1; + int dy = y2 - y1; + int yi = 1; + + if (dy < 0) { + yi = -1; + dy = -dy; + } + + int D = 2 * dy - dx; + int y = y1; + + for (int x = x1; x <= x2; x++) { + set(x, y, _strokeR, _strokeG, _strokeB); + + if (D > 0) { + y += yi; + D -= (2 * dx); + } + + D += (2 * dy); + } +} + +void ArduinoGraphics::lineHigh(int x1, int y1, int x2, int y2) +{ + int dx = x2 - x1; + int dy = y2 - y1; + int xi = 1; + + if (dx < 0) { + xi = -1; + dx = -dx; + } + + int D = 2 * dx - dy; + int x = x1; + + for (int y = y1; y <= y2; y++) { + set(x, y, _strokeR, _strokeG, _strokeB); + + if (D > 0) { + x += xi; + D -= 2 * dy; + } + + D += 2 * dx; + } +} diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.h b/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.h new file mode 100644 index 000000000..1f1c9148e --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/ArduinoGraphics.h @@ -0,0 +1,123 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _ARDUINO_GRAPHICS_H +#define _ARDUINO_GRAPHICS_H + +#include + +#include "Font.h" +#include "Image.h" + +enum { + NO_SCROLL, + SCROLL_LEFT, + SCROLL_RIGHT, + SCROLL_UP, + SCROLL_DOWN +}; + +class ArduinoGraphics : public Print { +public: + ArduinoGraphics(int width, int height); + virtual ~ArduinoGraphics(); + + virtual int begin(); + virtual void end(); + + int width(); + int height(); + uint32_t background(); + + virtual void beginDraw(); + virtual void endDraw(); + + void background(uint8_t r, uint8_t g, uint8_t b); + void background(uint32_t color); + void clear(); + void fill(uint8_t r, uint8_t g, uint8_t b); + void fill(uint32_t color); + void noFill(); + void stroke(uint8_t r, uint8_t g, uint8_t b); + void stroke(uint32_t color); + void noStroke(); + + //virtual void arc(int x, int y, int width, int height, int start, int stop); + virtual void circle(int x, int y, int diameter); + virtual void ellipse(int x, int y, int width, int height); + virtual void line(int x1, int y1, int x2, int y2); + virtual void point(int x, int y); + //virtual void quad(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); + //virtual void triangle(int x1, int y1, int x2, int y2, int x3, int y3); + virtual void rect(int x, int y, int width, int height); + + virtual void text(const char* str, int x = 0, int y = 0); + virtual void text(const String& str, int x = 0, int y = 0) { text(str.c_str(), x, y); } + virtual void textFont(const Font& which); + + virtual int textFontWidth() const; + virtual int textFontHeight() const; + + virtual void image(const Image& img, int x, int y); + virtual void image(const Image& img, int x, int y, int width, int height); + + virtual void set(int x, int y, uint8_t r, uint8_t g, uint8_t b) = 0; + virtual void set(int x, int y, uint32_t color); + + // from Print + virtual size_t write(uint8_t); + virtual void flush(); + + virtual void beginText(int x = 0, int y = 0); + virtual void beginText(int x, int y, uint8_t r, uint8_t g, uint8_t b); + virtual void beginText(int x, int y, uint32_t color); + virtual void endText(int scroll = NO_SCROLL); + virtual void textScrollSpeed(unsigned long speed = 150); + +protected: + virtual void bitmap(const uint8_t* data, int x, int y, int width, int height); + virtual void imageRGB(const Image& img, int x, int y, int width, int height); + virtual void imageRGB24(const Image& img, int x, int y, int width, int height); + virtual void imageRGB16(const Image& img, int x, int y, int width, int height); + +private: + void lineLow(int x1, int y1, int x2, int y2); + void lineHigh(int x1, int y1, int x2, int y2); + +private: + int _width; + int _height; + const Font* _font; + + bool _fill, _stroke; + uint8_t _backgroundR, _backgroundG, _backgroundB; + uint8_t _fillR, _fillG, _fillB; + uint8_t _strokeR, _strokeG, _strokeB; + + String _textBuffer; + uint8_t _textR, _textG, _textB; + int _textX; + int _textY; + unsigned long _textScrollSpeed; +}; + +extern const struct Font Font_4x6; +extern const struct Font Font_5x7; + +#endif diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/Font.h b/software/firmware/source/libraries/ArduinoGraphics/src/Font.h new file mode 100644 index 000000000..f44f9b566 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/Font.h @@ -0,0 +1,32 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _FONT_H +#define _FONT_H + +#include +#include + +struct Font { + const int width; + const int height; + const uint8_t** data; +}; + +#endif diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/Font_4x6.c b/software/firmware/source/libraries/ArduinoGraphics/src/Font_4x6.c new file mode 100644 index 000000000..257ef7381 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/Font_4x6.c @@ -0,0 +1,1810 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Font.h" + +const struct Font Font_4x6 = { + 4, + 6, + (const uint8_t*[]){ + // char0 + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b10100000, + 0b00000000, + 0b10100000, + 0b00000000, + }, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + // space + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // exclam + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b01000000, + 0b00000000, + }, + // quotedbl + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // numbersign + (const uint8_t[]){ + 0b10100000, + 0b11110000, + 0b10100000, + 0b11110000, + 0b10100000, + 0b00000000, + }, + // dollar + (const uint8_t[]){ + 0b01000000, + 0b11100000, + 0b11000000, + 0b00100000, + 0b11100000, + 0b01000000, + }, + // percent + (const uint8_t[]){ + 0b10000000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00100000, + 0b00000000, + }, + // ampersand + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01000000, + 0b10100000, + 0b01010000, + 0b00000000, + }, + // quotesingle + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // parenleft + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00100000, + }, + // parenright + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b10000000, + }, + // asterisk + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b10100000, + 0b00000000, + }, + // plus + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // comma + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000000, + 0b10000000, + }, + // hyphen + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // period + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01000000, + 0b00000000, + }, + // slash + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // zero + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // one + (const uint8_t[]){ + 0b01000000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // two + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b00100000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // three + (const uint8_t[]){ + 0b11100000, + 0b00100000, + 0b01000000, + 0b00100000, + 0b11000000, + 0b00000000, + }, + // four + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b11100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // five + (const uint8_t[]){ + 0b11100000, + 0b10000000, + 0b11000000, + 0b00100000, + 0b11000000, + 0b00000000, + }, + // six + (const uint8_t[]){ + 0b01100000, + 0b10000000, + 0b11000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // seven + (const uint8_t[]){ + 0b11100000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // eight + (const uint8_t[]){ + 0b01100000, + 0b10100000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // nine + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01100000, + 0b00100000, + 0b11000000, + 0b00000000, + }, + // colon + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b01000000, + 0b00000000, + }, + // semicolon + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b01000000, + 0b10000000, + }, + // less + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00000000, + }, + // equal + (const uint8_t[]){ + 0b00000000, + 0b11100000, + 0b00000000, + 0b11100000, + 0b00000000, + 0b00000000, + }, + // greater + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000000, + }, + // question + (const uint8_t[]){ + 0b11000000, + 0b00100000, + 0b01000000, + 0b00000000, + 0b01000000, + 0b00000000, + }, + // at + (const uint8_t[]){ + 0b01100000, + 0b10100000, + 0b10100000, + 0b10000000, + 0b01100000, + 0b00000000, + }, + // A + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // B + (const uint8_t[]){ + 0b11000000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // C + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b10000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // D + (const uint8_t[]){ + 0b11000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // E + (const uint8_t[]){ + 0b11100000, + 0b10000000, + 0b11000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // F + (const uint8_t[]){ + 0b11100000, + 0b10000000, + 0b11000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // G + (const uint8_t[]){ + 0b01100000, + 0b10000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // H + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // I + (const uint8_t[]){ + 0b11100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // J + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b00100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // K + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // L + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // M + (const uint8_t[]){ + 0b10100000, + 0b11100000, + 0b11100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // N + (const uint8_t[]){ + 0b00100000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b10000000, + 0b00000000, + }, + // O + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // P + (const uint8_t[]){ + 0b11000000, + 0b10100000, + 0b11000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // Q + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00100000, + }, + // R + (const uint8_t[]){ + 0b11000000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // S + (const uint8_t[]){ + 0b01100000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b11000000, + 0b00000000, + }, + // T + (const uint8_t[]){ + 0b11100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // U + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b00000000, + }, + // V + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b01000000, + 0b00000000, + }, + // W + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b11100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // X + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // Y + (const uint8_t[]){ + 0b10100000, + 0b10100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // Z + (const uint8_t[]){ + 0b11100000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // bracketleft + (const uint8_t[]){ + 0b01100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01100000, + 0b00000000, + }, + // backslash + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // bracketright + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11000000, + 0b00000000, + }, + // asciicircum + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // underscore + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11100000, + }, + // grave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // a + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // b + (const uint8_t[]){ + 0b10000000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // c + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b10000000, + 0b10000000, + 0b01100000, + 0b00000000, + }, + // d + (const uint8_t[]){ + 0b00100000, + 0b01100000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // e + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // f + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // g + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00100000, + 0b11000000, + }, + // h + (const uint8_t[]){ + 0b10000000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // i + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b11000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // j + (const uint8_t[]){ + 0b00100000, + 0b00000000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b11000000, + }, + // k + (const uint8_t[]){ + 0b10000000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // l + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // m + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // n + (const uint8_t[]){ + 0b00000000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // o + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // p + (const uint8_t[]){ + 0b00000000, + 0b11000000, + 0b10100000, + 0b11000000, + 0b10000000, + 0b10000000, + }, + // q + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00100000, + }, + // r + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b11000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // s + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b11000000, + 0b00100000, + 0b11000000, + 0b00000000, + }, + // t + (const uint8_t[]){ + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00000000, + }, + // u + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // v + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // w + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // x + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b01000000, + 0b01000000, + 0b10100000, + 0b00000000, + }, + // y + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00100000, + 0b11000000, + }, + // z + (const uint8_t[]){ + 0b00000000, + 0b11100000, + 0b00100000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // braceleft + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b00100000, + }, + // bar + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // braceright + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b01100000, + 0b01000000, + 0b01000000, + 0b10000000, + }, + // asciitilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + // space + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // exclamdown + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // cent + (const uint8_t[]){ + 0b01000000, + 0b11100000, + 0b10000000, + 0b11100000, + 0b01000000, + 0b00000000, + }, + // sterling + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01100000, + 0b01000000, + 0b10100000, + 0b00000000, + }, + // currency + (const uint8_t[]){ + 0b00000000, + 0b10010000, + 0b01100000, + 0b01100000, + 0b10010000, + 0b00000000, + }, + // yen + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // brokenbar + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b00000000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // section + (const uint8_t[]){ + 0b01100000, + 0b11000000, + 0b10100000, + 0b01100000, + 0b00100000, + 0b11000000, + }, + // dieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // copyright + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b11010000, + 0b11010000, + 0b10010000, + 0b01100000, + }, + // ordfeminine + (const uint8_t[]){ + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + 0b11100000, + 0b00000000, + }, + // guillemotleft + (const uint8_t[]){ + 0b00000000, + 0b01010000, + 0b10100000, + 0b01010000, + 0b00000000, + 0b00000000, + }, + // logicalnot + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b00100000, + 0b00000000, + 0b00000000, + }, + // hyphen + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // registered + (const uint8_t[]){ + 0b01100000, + 0b11110000, + 0b11010000, + 0b01100000, + 0b00000000, + 0b00000000, + }, + // macron + (const uint8_t[]){ + 0b11100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // degree + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // plusminus + (const uint8_t[]){ + 0b01000000, + 0b11100000, + 0b01000000, + 0b00000000, + 0b11100000, + 0b00000000, + }, + // twosuperior + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b10000000, + 0b11000000, + 0b00000000, + 0b00000000, + }, + // threesuperior + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b10000000, + 0b01000000, + 0b10000000, + 0b00000000, + }, + // acute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // mu + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b10100000, + 0b10100000, + 0b11000000, + 0b10000000, + }, + // paragraph + (const uint8_t[]){ + 0b01110000, + 0b11010000, + 0b11010000, + 0b01010000, + 0b01010000, + 0b00000000, + }, + // periodcentered + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // cedilla + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00100000, + 0b01000000, + 0b00000000, + }, + // onesuperior + (const uint8_t[]){ + 0b01000000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b00000000, + }, + // ordmasculine + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + 0b11100000, + 0b00000000, + }, + // guillemotright + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b01010000, + 0b10100000, + 0b00000000, + 0b00000000, + }, + // onequarter + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10000000, + 0b01010000, + 0b01110000, + 0b00010000, + }, + // onehalf + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10110000, + 0b00010000, + 0b00100000, + 0b00110000, + }, + // threequarters + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b10000000, + 0b01010000, + 0b10110000, + 0b00010000, + }, + // questiondown + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b01000000, + 0b10000000, + 0b01100000, + 0b00000000, + }, + // Agrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Aacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Acircumflex + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Atilde + (const uint8_t[]){ + 0b01100000, + 0b11000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Adieresis + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Aring + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // AE + (const uint8_t[]){ + 0b01110000, + 0b10100000, + 0b11110000, + 0b10100000, + 0b10110000, + 0b00000000, + }, + // Ccedilla + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b10000000, + 0b10100000, + 0b01000000, + 0b10000000, + }, + // Egrave + (const uint8_t[]){ + 0b10000000, + 0b11100000, + 0b11000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // Eacute + (const uint8_t[]){ + 0b00100000, + 0b11100000, + 0b11000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // Ecircumflex + (const uint8_t[]){ + 0b01100000, + 0b11100000, + 0b11000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // Edieresis + (const uint8_t[]){ + 0b10100000, + 0b11100000, + 0b11000000, + 0b10000000, + 0b11100000, + 0b00000000, + }, + // Igrave + (const uint8_t[]){ + 0b10000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // Iacute + (const uint8_t[]){ + 0b00100000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // Icircumflex + (const uint8_t[]){ + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // Idieresis + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // Eth + (const uint8_t[]){ + 0b11100000, + 0b01010000, + 0b11010000, + 0b01010000, + 0b11100000, + 0b00000000, + }, + // Ntilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b11100000, + 0b11100000, + 0b10100000, + 0b00000000, + }, + // Ograve + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // Oacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // Ocircumflex + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // Otilde + (const uint8_t[]){ + 0b01110000, + 0b11100000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // Odieresis + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // multiply + (const uint8_t[]){ + 0b00000000, + 0b10100000, + 0b01000000, + 0b10100000, + 0b00000000, + 0b00000000, + }, + // Oslash + (const uint8_t[]){ + 0b01100000, + 0b10100000, + 0b11100000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // Ugrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b00000000, + }, + // Uacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b00000000, + }, + // Ucircumflex + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b00000000, + }, + // Udieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b10100000, + 0b10100000, + 0b11100000, + 0b00000000, + }, + // Yacute + (const uint8_t[]){ + 0b00100000, + 0b00000000, + 0b10100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // Thorn + (const uint8_t[]){ + 0b10000000, + 0b11000000, + 0b10100000, + 0b11000000, + 0b10000000, + 0b00000000, + }, + // germandbls + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b11100000, + 0b10000000, + }, + // agrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // aacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // acircumflex + (const uint8_t[]){ + 0b01100000, + 0b00000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // atilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // adieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // aring + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // ae + (const uint8_t[]){ + 0b00000000, + 0b01110000, + 0b10110000, + 0b10100000, + 0b01110000, + 0b00000000, + }, + // ccedilla + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b10100000, + 0b10000000, + 0b01100000, + 0b01000000, + }, + // egrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // eacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // ecircumflex + (const uint8_t[]){ + 0b11000000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // edieresis + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b10100000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // igrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // iacute + (const uint8_t[]){ + 0b00100000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // icircumflex + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // idieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b11000000, + 0b01000000, + 0b11100000, + 0b00000000, + }, + // eth + (const uint8_t[]){ + 0b10100000, + 0b01000000, + 0b01100000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // ntilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b10100000, + 0b00000000, + }, + // ograve + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // oacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // ocircumflex + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // otilde + (const uint8_t[]){ + 0b11100000, + 0b00000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // odieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + }, + // divide + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b11100000, + 0b00000000, + 0b01000000, + 0b00000000, + }, + // oslash + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b10100000, + 0b10100000, + 0b11000000, + 0b00000000, + }, + // ugrave + (const uint8_t[]){ + 0b10000000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // uacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // ucircumflex + (const uint8_t[]){ + 0b01000000, + 0b00000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // udieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b10100000, + 0b10100000, + 0b01100000, + 0b00000000, + }, + // yacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10100000, + 0b11100000, + 0b00100000, + 0b11000000, + }, + // thorn + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b11000000, + 0b10100000, + 0b11000000, + 0b10000000, + }, + } +}; diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/Font_5x7.c b/software/firmware/source/libraries/ArduinoGraphics/src/Font_5x7.c new file mode 100644 index 000000000..3c9a31bae --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/Font_5x7.c @@ -0,0 +1,2002 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Font.h" + +const struct Font Font_5x7 = { + 5, + 7, + (const uint8_t*[]){ + // char0 + (const uint8_t[]){ + 0b00000000, + 0b10101000, + 0b00000000, + 0b10001000, + 0b00000000, + 0b10101000, + 0b00000000, + }, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + // space + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // exclam + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + 0b00100000, + 0b00000000, + }, + // quotedbl + (const uint8_t[]){ + 0b01010000, + 0b01010000, + 0b01010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // numbersign + (const uint8_t[]){ + 0b00000000, + 0b01010000, + 0b11111000, + 0b01010000, + 0b11111000, + 0b01010000, + 0b00000000, + }, + // dollar + (const uint8_t[]){ + 0b00000000, + 0b01110000, + 0b10100000, + 0b01110000, + 0b00101000, + 0b01110000, + 0b00000000, + }, + // percent + (const uint8_t[]){ + 0b10000000, + 0b10010000, + 0b00100000, + 0b01000000, + 0b10010000, + 0b00010000, + 0b00000000, + }, + // ampersand + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b10100000, + 0b01000000, + 0b10100000, + 0b01010000, + 0b00000000, + }, + // quotesingle + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // parenleft + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00000000, + }, + // parenright + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01000000, + 0b00000000, + }, + // asterisk + (const uint8_t[]){ + 0b00000000, + 0b01010000, + 0b00100000, + 0b01110000, + 0b00100000, + 0b01010000, + 0b00000000, + }, + // plus + (const uint8_t[]){ + 0b00000000, + 0b00100000, + 0b00100000, + 0b11111000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // comma + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00110000, + 0b00100000, + 0b01000000, + }, + // hyphen + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b11110000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // period + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + }, + // slash + (const uint8_t[]){ + 0b00000000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000000, + 0b00000000, + }, + // zero + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b01010000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00000000, + }, + // one + (const uint8_t[]){ + 0b00100000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // two + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b11110000, + 0b00000000, + }, + // three + (const uint8_t[]){ + 0b11110000, + 0b00010000, + 0b01100000, + 0b00010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // four + (const uint8_t[]){ + 0b00100000, + 0b01100000, + 0b10100000, + 0b11110000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // five + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b00010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // six + (const uint8_t[]){ + 0b01100000, + 0b10000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // seven + (const uint8_t[]){ + 0b11110000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // eight + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // nine + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00010000, + 0b01100000, + 0b00000000, + }, + // colon + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + }, + // semicolon + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + 0b01100000, + 0b01000000, + 0b10000000, + }, + // less + (const uint8_t[]){ + 0b00000000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00000000, + }, + // equal + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11110000, + 0b00000000, + 0b11110000, + 0b00000000, + 0b00000000, + }, + // greater + (const uint8_t[]){ + 0b00000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b00000000, + }, + // question + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b00010000, + 0b00100000, + 0b00000000, + 0b00100000, + 0b00000000, + }, + // at + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10110000, + 0b10110000, + 0b10000000, + 0b01100000, + 0b00000000, + }, + // A + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // B + (const uint8_t[]){ + 0b11100000, + 0b10010000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b00000000, + }, + // C + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10000000, + 0b10000000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // D + (const uint8_t[]){ + 0b11100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b00000000, + }, + // E + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // F + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // G + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10000000, + 0b10110000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // H + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // I + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // J + (const uint8_t[]){ + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // K + (const uint8_t[]){ + 0b10010000, + 0b10100000, + 0b11000000, + 0b11000000, + 0b10100000, + 0b10010000, + 0b00000000, + }, + // L + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // M + (const uint8_t[]){ + 0b10010000, + 0b11110000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // N + (const uint8_t[]){ + 0b10010000, + 0b11010000, + 0b11010000, + 0b10110000, + 0b10110000, + 0b10010000, + 0b00000000, + }, + // O + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // P + (const uint8_t[]){ + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // Q + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b11010000, + 0b01100000, + 0b00010000, + }, + // R + (const uint8_t[]){ + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b10100000, + 0b10010000, + 0b00000000, + }, + // S + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b01000000, + 0b00100000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // T + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // U + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // V + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b01100000, + 0b00000000, + }, + // W + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b11110000, + 0b10010000, + 0b00000000, + }, + // X + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b01100000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Y + (const uint8_t[]){ + 0b01010000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // Z + (const uint8_t[]){ + 0b11110000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // bracketleft + (const uint8_t[]){ + 0b01110000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01110000, + 0b00000000, + }, + // backslash + (const uint8_t[]){ + 0b00000000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00000000, + 0b00000000, + }, + // bracketright + (const uint8_t[]){ + 0b01110000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b01110000, + 0b00000000, + }, + // asciicircum + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // underscore + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11110000, + 0b00000000, + }, + // grave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // a + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // b + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b00000000, + }, + // c + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01100000, + 0b10000000, + 0b10000000, + 0b01100000, + 0b00000000, + }, + // d + (const uint8_t[]){ + 0b00010000, + 0b00010000, + 0b01110000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // e + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01100000, + 0b10110000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // f + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00000000, + }, + // g + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b10010000, + 0b01100000, + 0b10000000, + 0b01110000, + }, + // h + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // i + (const uint8_t[]){ + 0b00100000, + 0b00000000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // j + (const uint8_t[]){ + 0b00010000, + 0b00000000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b01010000, + 0b00100000, + }, + // k + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10100000, + 0b11000000, + 0b10100000, + 0b10010000, + 0b00000000, + }, + // l + (const uint8_t[]){ + 0b01100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // m + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10100000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // n + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // o + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // p + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b10000000, + }, + // q + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00010000, + }, + // r + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11100000, + 0b10010000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // s + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b11000000, + 0b00110000, + 0b11100000, + 0b00000000, + }, + // t + (const uint8_t[]){ + 0b01000000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b00110000, + 0b00000000, + }, + // u + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // v + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01010000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00000000, + }, + // w + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b11110000, + 0b00000000, + }, + // x + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b01100000, + 0b01100000, + 0b10010000, + 0b00000000, + }, + // y + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b01010000, + 0b00100000, + 0b01000000, + }, + // z + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b11110000, + 0b00100000, + 0b01000000, + 0b11110000, + 0b00000000, + }, + // braceleft + (const uint8_t[]){ + 0b00010000, + 0b00100000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b00010000, + 0b00000000, + }, + // bar + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // braceright + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b00110000, + 0b00100000, + 0b00100000, + 0b01000000, + 0b00000000, + }, + // asciitilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + // space + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // exclamdown + (const uint8_t[]){ + 0b00100000, + 0b00000000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // cent + (const uint8_t[]){ + 0b00000000, + 0b00100000, + 0b01110000, + 0b10100000, + 0b10100000, + 0b01110000, + 0b00100000, + }, + // sterling + (const uint8_t[]){ + 0b00000000, + 0b00110000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b10110000, + 0b00000000, + }, + // currency + (const uint8_t[]){ + 0b00000000, + 0b10001000, + 0b01110000, + 0b01010000, + 0b01110000, + 0b10001000, + 0b00000000, + }, + // yen + (const uint8_t[]){ + 0b01010000, + 0b01010000, + 0b00100000, + 0b01110000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // brokenbar + (const uint8_t[]){ + 0b00000000, + 0b00100000, + 0b00100000, + 0b00000000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // section + (const uint8_t[]){ + 0b00110000, + 0b01000000, + 0b01100000, + 0b01010000, + 0b00110000, + 0b00010000, + 0b01100000, + }, + // dieresis + (const uint8_t[]){ + 0b01010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // copyright + (const uint8_t[]){ + 0b01110000, + 0b10001000, + 0b10101000, + 0b11001000, + 0b10101000, + 0b10001000, + 0b01110000, + }, + // ordfeminine + (const uint8_t[]){ + 0b01100000, + 0b10100000, + 0b01100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // guillemotleft + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01001000, + 0b10010000, + 0b01001000, + 0b00000000, + 0b00000000, + }, + // logicalnot + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b11110000, + 0b00010000, + 0b00000000, + 0b00000000, + }, + // hyphen + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // registered + (const uint8_t[]){ + 0b01110000, + 0b10001000, + 0b11101000, + 0b11001000, + 0b11001000, + 0b10001000, + 0b01110000, + }, + // macron + (const uint8_t[]){ + 0b11110000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // degree + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // plusminus + (const uint8_t[]){ + 0b00100000, + 0b00100000, + 0b11111000, + 0b00100000, + 0b00100000, + 0b11111000, + 0b00000000, + }, + // twosuperior + (const uint8_t[]){ + 0b01100000, + 0b00100000, + 0b01000000, + 0b01100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // threesuperior + (const uint8_t[]){ + 0b01100000, + 0b01100000, + 0b00100000, + 0b01100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // acute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // mu + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b10000000, + }, + // paragraph + (const uint8_t[]){ + 0b01110000, + 0b11010000, + 0b11010000, + 0b01010000, + 0b01010000, + 0b01010000, + 0b00000000, + }, + // periodcentered + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // cedilla + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00100000, + 0b01000000, + }, + // onesuperior + (const uint8_t[]){ + 0b00100000, + 0b01100000, + 0b00100000, + 0b01110000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // ordmasculine + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + }, + // guillemotright + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b01001000, + 0b10010000, + 0b00000000, + 0b00000000, + }, + // onequarter + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10000000, + 0b10010000, + 0b00110000, + 0b01110000, + 0b00010000, + }, + // onehalf + (const uint8_t[]){ + 0b10000000, + 0b10000000, + 0b10000000, + 0b10110000, + 0b00010000, + 0b00100000, + 0b00110000, + }, + // threequarters + (const uint8_t[]){ + 0b11000000, + 0b11000000, + 0b01000000, + 0b11010000, + 0b00110000, + 0b01110000, + 0b00010000, + }, + // questiondown + (const uint8_t[]){ + 0b00100000, + 0b00000000, + 0b00100000, + 0b01000000, + 0b01010000, + 0b00100000, + 0b00000000, + }, + // Agrave + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Aacute + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Acircumflex + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Atilde + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Adieresis + (const uint8_t[]){ + 0b10010000, + 0b01100000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // Aring + (const uint8_t[]){ + 0b01100000, + 0b01100000, + 0b10010000, + 0b11110000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // AE + (const uint8_t[]){ + 0b01110000, + 0b10100000, + 0b10110000, + 0b11100000, + 0b10100000, + 0b10110000, + 0b00000000, + }, + // Ccedilla + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10000000, + 0b10000000, + 0b10010000, + 0b01100000, + 0b01000000, + }, + // Egrave + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // Eacute + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // Ecircumflex + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // Edieresis + (const uint8_t[]){ + 0b11110000, + 0b10000000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b00000000, + }, + // Igrave + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // Iacute + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // Icircumflex + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // Idieresis + (const uint8_t[]){ + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // Eth + (const uint8_t[]){ + 0b11100000, + 0b01010000, + 0b11010000, + 0b01010000, + 0b01010000, + 0b11100000, + 0b00000000, + }, + // Ntilde + (const uint8_t[]){ + 0b10110000, + 0b10010000, + 0b11010000, + 0b10110000, + 0b10110000, + 0b10010000, + 0b00000000, + }, + // Ograve + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Oacute + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Ocircumflex + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Otilde + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Odieresis + (const uint8_t[]){ + 0b10010000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // multiply + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b10010000, + 0b01100000, + 0b01100000, + 0b10010000, + 0b00000000, + }, + // Oslash + (const uint8_t[]){ + 0b01110000, + 0b10110000, + 0b10110000, + 0b11010000, + 0b11010000, + 0b11100000, + 0b00000000, + }, + // Ugrave + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Uacute + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Ucircumflex + (const uint8_t[]){ + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Udieresis + (const uint8_t[]){ + 0b10010000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // Yacute + (const uint8_t[]){ + 0b01010000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + }, + // Thorn + (const uint8_t[]){ + 0b10000000, + 0b11100000, + 0b10010000, + 0b11100000, + 0b10000000, + 0b10000000, + 0b00000000, + }, + // germandbls + (const uint8_t[]){ + 0b01100000, + 0b10010000, + 0b10100000, + 0b10010000, + 0b10010000, + 0b10100000, + 0b00000000, + }, + // agrave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // aacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // acircumflex + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // atilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // adieresis + (const uint8_t[]){ + 0b01010000, + 0b00000000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // aring + (const uint8_t[]){ + 0b01100000, + 0b01100000, + 0b01110000, + 0b10010000, + 0b10110000, + 0b01010000, + 0b00000000, + }, + // ae + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b10110000, + 0b10100000, + 0b01110000, + 0b00000000, + }, + // ccedilla + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b00110000, + 0b01000000, + 0b01000000, + 0b00110000, + 0b00100000, + }, + // egrave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b01100000, + 0b10110000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // eacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01100000, + 0b10110000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // ecircumflex + (const uint8_t[]){ + 0b01000000, + 0b10100000, + 0b01100000, + 0b10110000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // edieresis + (const uint8_t[]){ + 0b10100000, + 0b00000000, + 0b01100000, + 0b10110000, + 0b11000000, + 0b01100000, + 0b00000000, + }, + // igrave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // iacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // icircumflex + (const uint8_t[]){ + 0b00100000, + 0b01010000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // idieresis + (const uint8_t[]){ + 0b01010000, + 0b00000000, + 0b01100000, + 0b00100000, + 0b00100000, + 0b01110000, + 0b00000000, + }, + // eth + (const uint8_t[]){ + 0b01000000, + 0b00110000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // ntilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + }, + // ograve + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // oacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // ocircumflex + (const uint8_t[]){ + 0b01100000, + 0b00000000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // otilde + (const uint8_t[]){ + 0b01010000, + 0b10100000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // odieresis + (const uint8_t[]){ + 0b01010000, + 0b00000000, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 0b00000000, + }, + // divide + (const uint8_t[]){ + 0b00000000, + 0b01100000, + 0b00000000, + 0b11110000, + 0b00000000, + 0b01100000, + 0b00000000, + }, + // oslash + (const uint8_t[]){ + 0b00000000, + 0b00000000, + 0b01110000, + 0b10110000, + 0b11010000, + 0b11100000, + 0b00000000, + }, + // ugrave + (const uint8_t[]){ + 0b01000000, + 0b00100000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // uacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // ucircumflex + (const uint8_t[]){ + 0b01100000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // udieresis + (const uint8_t[]){ + 0b01010000, + 0b00000000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b01110000, + 0b00000000, + }, + // yacute + (const uint8_t[]){ + 0b00100000, + 0b01000000, + 0b10010000, + 0b10010000, + 0b01010000, + 0b00100000, + 0b01000000, + }, + // thorn + (const uint8_t[]){ + 0b00000000, + 0b10000000, + 0b11100000, + 0b10010000, + 0b10010000, + 0b11100000, + 0b10000000, + }, + } +}; + diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/HasIncludeArduinoGraphics.h b/software/firmware/source/libraries/ArduinoGraphics/src/HasIncludeArduinoGraphics.h new file mode 100644 index 000000000..cc279700c --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/HasIncludeArduinoGraphics.h @@ -0,0 +1,4 @@ +/* +This file is intentionally left blank. +Do not remove this comment. +*/ \ No newline at end of file diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/Image.cpp b/software/firmware/source/libraries/ArduinoGraphics/src/Image.cpp new file mode 100644 index 000000000..e7ad1a279 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/Image.cpp @@ -0,0 +1,74 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "Image.h" + +Image::Image() : + Image(ENCODING_NONE, (const uint8_t*)NULL, 0, 0) +{ +} + +Image::Image(int encoding, const uint8_t* data, int width, int height) : + _encoding(encoding), + _data(data), + _width(width), + _height(height) +{ +} + +Image::Image(int encoding, const uint16_t* data, int width, int height) : + Image(encoding, (const uint8_t*)data, width, height) +{ +} + +Image::Image(int encoding, const uint32_t* data, int width, int height) : + Image(encoding, (const uint8_t*)data, width, height) +{ +} + +Image::~Image() +{ +} + +int Image::encoding() const +{ + return _encoding; +} + +const uint8_t* Image::data() const +{ + return _data; +} + +int Image::width() const +{ + return _width; +} + +int Image::height() const +{ + return _height; +} + +Image::operator bool() const +{ + return (_encoding != ENCODING_NONE && _data != NULL && _width > 0 && _height > 0); +} diff --git a/software/firmware/source/libraries/ArduinoGraphics/src/Image.h b/software/firmware/source/libraries/ArduinoGraphics/src/Image.h new file mode 100644 index 000000000..0483e8ea1 --- /dev/null +++ b/software/firmware/source/libraries/ArduinoGraphics/src/Image.h @@ -0,0 +1,54 @@ +/* + This file is part of the ArduinoGraphics library. + Copyright (c) 2019 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _IMAGE_H +#define _IMAGE_H + +#include + +enum { + ENCODING_NONE = -1, + ENCODING_RGB, + ENCODING_RGB24, + ENCODING_RGB16 +}; + +class Image { +public: + Image(); + Image(int encoding, const uint8_t* data, int width, int height); + Image(int encoding, const uint16_t* data, int width, int height); + Image(int encoding, const uint32_t* data, int width, int height); + virtual ~Image(); + + int encoding() const; + const uint8_t* data() const; + int width() const; + int height() const; + + virtual operator bool() const; + +private: + int _encoding; + const uint8_t* _data; + int _width; + int _height; +}; + +#endif diff --git a/software/firmware/source/libraries/OGN/manchester.h b/software/firmware/source/libraries/OGN/manchester.h index f574ce23b..5bc3eea7f 100644 --- a/software/firmware/source/libraries/OGN/manchester.h +++ b/software/firmware/source/libraries/OGN/manchester.h @@ -3,7 +3,8 @@ #if defined(__AVR__) || \ defined(ENERGIA_ARCH_CC13XX) || defined(ENERGIA_ARCH_CC13X2) || \ - (defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_ARCH_MBED)) + (defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_ARCH_MBED)) || \ + defined(ARDUINO_ARCH_RENESAS) #include #endif diff --git a/software/firmware/source/libraries/arduino-basicmac/src/hal/target-config.h b/software/firmware/source/libraries/arduino-basicmac/src/hal/target-config.h index 113bdb12f..00dc42612 100644 --- a/software/firmware/source/libraries/arduino-basicmac/src/hal/target-config.h +++ b/software/firmware/source/libraries/arduino-basicmac/src/hal/target-config.h @@ -101,6 +101,12 @@ #endif /* ARDUINO_ARCH_RP2040 */ +#if defined(ARDUINO_ARCH_RENESAS) +#ifndef SPI_HAS_TRANSACTION +#define SPI_HAS_TRANSACTION 1 +#endif +#endif /* ARDUINO_ARCH_RENESAS */ + #if defined(CFG_eu868) enum _dr_eu868_t { DR_SF12=0, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B, DR_FSK, DR_NONE }; diff --git a/software/firmware/source/libraries/arduino-basicmac/src/lmic/debug.h b/software/firmware/source/libraries/arduino-basicmac/src/lmic/debug.h index 691d6b3ba..fbdcda563 100644 --- a/software/firmware/source/libraries/arduino-basicmac/src/lmic/debug.h +++ b/software/firmware/source/libraries/arduino-basicmac/src/lmic/debug.h @@ -22,7 +22,8 @@ #else #if defined(__AVR__) || defined(ARDUINO_ARCH_STM32) || \ - defined(ENERGIA_ARCH_CC13XX) || defined(ENERGIA_ARCH_CC13X2) + defined(ENERGIA_ARCH_CC13XX) || defined(ENERGIA_ARCH_CC13X2) || \ + defined(ARDUINO_ARCH_RENESAS) #include #endif diff --git a/software/firmware/source/libraries/arduino-lmic/src/lmic/config.h b/software/firmware/source/libraries/arduino-lmic/src/lmic/config.h index 5075d3145..1b06b42de 100644 --- a/software/firmware/source/libraries/arduino-lmic/src/lmic/config.h +++ b/software/firmware/source/libraries/arduino-lmic/src/lmic/config.h @@ -141,6 +141,12 @@ extern SPIClass SPI0; #endif #endif /* ARDUINO_ARCH_NRF52 */ +#if defined(ARDUINO_ARCH_RENESAS) +#ifndef SPI_HAS_TRANSACTION +#define SPI_HAS_TRANSACTION 1 +#endif +#endif /* ARDUINO_ARCH_RENESAS */ + #if defined(USE_ORIGINAL_AES) && defined(USE_IDEETRON_AES) # error "You may define at most one of USE_ORIGINAL_AES and USE_IDEETRON_AES" #endif