Compare commits

...

134 Commits

Author SHA1 Message Date
SQFMI 667d86737d
Update main.actions.yml 2024-04-03 16:15:58 -04:00
SQFMI d65738fbaa
Update main.actions.yml 2024-04-03 16:09:29 -04:00
SQFMI 2dd98737fb
Update main.actions.yml 2024-04-03 16:08:09 -04:00
SQFMI 5a5b343737
fix path in GH actions 2024-04-03 15:57:14 -04:00
sqfmi 2da3fd9ede add board revision function 2024-04-03 15:10:09 -04:00
SQFMI acbb6eeece
Compile for different board revisions 2024-04-03 14:55:30 -04:00
sqfmi c1c95f9587 use chip icon 2024-04-02 22:59:02 -04:00
sqfmi bd1657e9c7 Save last used IP and SSID 2024-04-02 22:55:19 -04:00
sqfmi fbbcaabbd1 updated IP 2024-04-02 14:56:24 -04:00
SQFMI e9854a7fa2
Merge pull request #230 from denics/master
Check if wifi and change weather icon
2024-04-02 14:23:00 -04:00
sqfmi fddbe504c1 Merge branch 'pr/233' 2024-04-02 14:13:44 -04:00
sqfmi aa3528371d getWeatherData to accept cityID or lat lon 2024-04-02 14:13:15 -04:00
sqfmi 3ffb0f8697 Update version and use WIFI_CONFIGURED 2024-04-01 18:10:51 -04:00
sqfmi b786f24240 Use WIFI_CONFIGURED 2024-04-01 18:08:12 -04:00
sqfmi 2528878570 Merge branch 'pr/231' 2024-04-01 18:06:59 -04:00
sqfmi 1b15c1b5fe bump version 2024-03-31 14:27:07 -04:00
Daniel Ansorregui be185cbd54 Remove delay after hard reset
* Implemented by overloading the
  virtual method _reset() in GxEPD2_EPD
* Tested to write straight away
  and works ok. Seems unnecessary.
* 10ms might look like little but the
  ESP is not sleeping and CPUs are on.
  This is probably using 0.1 uAh
  (10% of display update total cost)
2024-01-16 23:15:29 +00:00
Daniel Ansorregui f369b6f207 Allow AsyncPowerOn
* The display takes 16ms to power on
  During this time we can render the
  content and finally display it
* The call is optional if we do not call
  it then the old code path is used
* Moved the init to constructor
2024-01-13 19:11:22 +00:00
Daniel Ansorregui 8103df1499 Refactor DarkBorder
* Allow to be changed dynamically between
  display updated.
2024-01-13 19:08:52 +00:00
Daniel Ansorregui 84c0cd106c Set boosters configuration
* Reduce the phase on times from 40ms->10ms
* Increase the driving strength, this reduces
  a little the power usage as well
* Reduces 220ms the display update
  -80ms the power on of the display
  -140ms the display partial update
- Note: This may have side effects, but I saw none
  tested on Watchy v1.0, display should be same on
  other Watchy boards
2024-01-13 18:24:19 +00:00
Daniel Ansorregui 3ce125247d No soft reset after reset
* Avoid a redundant reset after a reset
  The display is always reset after a hard reset
  and there is no need to re-reset it
2024-01-13 18:24:04 +00:00
Daniel Ansorregui f2c0c91a61 Refactor Display Init
* It makes more sense to put it in the Display class
* The reset should be 2ms, 10ms is worst case
* Also there was a disable call based on display
  that makes more sense to put in the default
  boot switch statement
2024-01-13 18:23:45 +00:00
Daniel Ansorregui 2b21e50c2f Move Display specifics
* Move BusyCallback
* Move constructor pins
2024-01-13 18:19:37 +00:00
Sudrien b84ab91c6b Switch from CityID to Lat an Lon, expose sunrise and sunset 2023-06-16 00:17:20 -04:00
Sean M. Collins b8eeda70c6 Fix indenting 2023-05-25 13:42:34 +01:00
Sean M. Collins a719bfa116 Switch wifi off after info display 2023-05-24 20:55:47 +01:00
Sean M. Collins 459cc2a18f Display WiFi information in About screen 2023-05-24 20:42:31 +01:00
Denis Pitzalis df5fce8d40 fix issue #229 2023-05-15 16:07:03 +02:00
SQFMI 342eb48a49
Merge pull request #221 from wjgeorge/dev
bump lib version number
2023-04-25 14:37:44 -04:00
wjgeorge 98fd0abfeb bump lib version number 2023-04-24 17:02:44 -04:00
SQFMI 1d5605c0e9 Update dev.actions.yml 2023-04-23 23:36:49 -04:00
SQFMI 704ef60470 Update dev.actions.yml 2023-04-23 23:32:27 -04:00
SQFMI cc6c196e37 Create main.actions.yml 2023-04-23 23:28:57 -04:00
SQFMI 35e65a1972 update 2023-04-23 18:18:39 -04:00
SQFMI 65061fd30f updated 2023-04-23 18:16:57 -04:00
SQFMI b1b5eeb890
Merge pull request #217 from wjgeorge/dev
'WIDTH_VISIBLE' is not a member of 'WatchyDisplay'
2023-04-22 22:23:05 -04:00
SQFMI 2b327c64b8
remove dstOffset from watchySettings struct 2023-04-22 22:21:12 -04:00
wjgeorge 3c73c7e2c8 Add new static member WIDTH_VISIBLE 2023-04-21 23:13:53 -04:00
SQFMI cc1ff02123 Update test-compilation.yml 2023-04-11 16:19:06 -04:00
SQFMI 0e1aa800dd Update test-compilation.yml 2023-04-11 13:01:36 -04:00
SQFMI cc882cd9f7 Update test-compilation.yml 2023-04-11 11:01:48 -04:00
SQFMI 6682d501a6 test compile 2023-04-11 10:33:50 -04:00
SQFMI dc2795dcd9
Merge pull request #209 from aminch/weather-fix
Reset weather counter on Wifi connection
2023-04-11 09:48:25 -04:00
SQFMI 9177aee6d6 Merge branch 'master' into dev 2023-04-11 09:46:53 -04:00
SQFMI c2bbf8a01a
Update README.md 2023-04-10 20:14:46 -04:00
Adam Minchinton 0e319fe3e7 Reset weather counter on Wifi connection 2023-02-14 20:22:05 +01:00
SQFMI f6f7a38c8e
fix path 2023-02-09 16:32:16 -05:00
SQFMI 266ae56458
fix path 2023-02-09 15:57:01 -05:00
SQFMI 96c4465924
fix path 2023-02-09 13:57:40 -05:00
SQFMI b48408be6e
Upload bins 2023-02-09 01:08:57 -05:00
SQFMI c0e814d269
Update test-compilation.yml 2023-02-08 21:15:51 -05:00
SQFMI 3300f6f271
Merge pull request #204 from khenderick/feature/virtual-button-press
Allow button press overrides
2023-02-08 20:57:03 -05:00
SQFMI e125f85926
Update test-compilation.yml 2023-02-08 20:40:20 -05:00
SQFMI ce8c5d4f78
Update test-compilation.yml 2023-02-08 20:34:25 -05:00
SQFMI 851467cc86
Merge pull request #122 from Meptl/auto-compile-check
Compile example programs on push with Github Actions
2023-02-08 17:00:21 -05:00
sqfmi c3587d04a7 Update config.h 2023-01-12 07:43:09 -05:00
sqfmi ce71292ea9 Add new watchface and uptime 2023-01-12 07:40:27 -05:00
Kenneth Henderick 3a3a926c2a
Allow button press overrides 2022-12-30 17:14:13 +01:00
sqfmi e5556cb700 Merge branch 'dev' 2022-12-30 02:01:35 -05:00
SQFMI 83aada6452
Merge pull request #201 from sukhpalhub/wifi-feature
Issue #89 Added mac address and local ip
2022-12-30 01:57:52 -05:00
Sukhpal Singh 3a7eff4a8e Remove wifi setup guide from readme 2022-12-30 14:23:32 +10:00
SQFMI aaa3d91113
Merge pull request #202 from khenderick/feature/weather-source
Keep track on weather source
2022-12-29 18:34:06 -05:00
Kenneth Henderick f49e1a5fab
Keep track on whether weather data was fetched from external source 2022-12-29 14:08:24 +01:00
Sukhpal Singh 9ac9aeded9 Issue #89 Added mac address and local ip
- Displayed mac address when setting up wifi
- Display local ip when wifi is connected from the setup
2022-12-28 01:12:48 +10:00
SQFMI ef0534e92b Update to version 1.4.5 2022-12-27 03:39:09 +00:00
SQFMI 2cdfeaa0d1
Merge pull request #199 from sqfmi/dev
Dev
2022-12-26 12:53:02 -05:00
SQFMI 7333873f08
Merge pull request #193 from Alex-K37/ambig_overload
fixed compilation error: ambiguous overload for 'operator='
2022-12-26 12:51:10 -05:00
SQFMI 9a64af8b3d
Merge pull request #178 from DarkZeros/OptimizeDisplay
Optimise GxEPD2 Display
2022-12-26 12:21:00 -05:00
SQFMI 5921655691
Merge pull request #188 from shtrom/fix/gmtOffset_from_weather
Set GMT offset from weatherdata. Will override GMT offset in settings after API call.
2022-12-26 12:16:40 -05:00
SQFMI 472eee733d
Merge branch 'master' into fix/gmtOffset_from_weather 2022-12-26 12:15:56 -05:00
SQFMI 6e41b9c982
Merge pull request #190 from shtrom/feature/exit-inactive-menu
Exit menu after some inactive time
2022-12-26 12:07:11 -05:00
Olivier Mehani dd3797f2d5
Exit menu after some inactive time
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2022-12-07 22:27:34 +11:00
Alex-K37 5e451fbf04 fixed compilation error: ambiguous overload for 'operator='
.pio/libdeps/watchy/Watchy/src/Watchy.cpp: In member function 'weatherData Watchy::getWeatherData(String, String, String, String, String, uint8_t)':
.pio/libdeps/watchy/Watchy/src/Watchy.cpp:620:48: error: ambiguous overload for 'operator=' (operand types are 'String' and 'JSONVar')
             responseObject["weather"][0]["main"];
                                                ^
In file included from /home/krupp/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:166,
                 from .pio/libdeps/watchy/Watchy/src/Watchy.h:4,
                 from .pio/libdeps/watchy/Watchy/src/Watchy.cpp:1:
/home/build/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:102:18: note: candidate: 'String& String::operator=(const String&)'
         String & operator =(const String &rhs);
                  ^~~~~~~~
/home/build/.platformio/packages/framework-arduinoespressif32/cores/esp32/WString.h:103:18: note: candidate: 'String& String::operator=(const char*)'
         String & operator =(const char *cstr);
                  ^~~~~~~~
2022-11-26 22:07:29 +01:00
SQFMI c5344d9d42
Merge pull request #189 from shtrom/feature/vibrate-o-clock
Vibrate every hour on the dot
2022-11-13 04:18:05 -05:00
Olivier Mehani cbb4820d85
fixup! Add opion to vibrate every hour (and on reset) 2022-10-26 23:31:36 +11:00
Olivier Mehani c750754e8a
fixup! Get gmtOffset from weather data, for use in all NTP requests 2022-10-24 22:20:12 +11:00
Olivier Mehani 5f07f2ec63
Add opion to vibrate every hour (and on reset)
Set watchySettings.vibrateOClock to true

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2022-10-16 22:30:49 +11:00
Olivier Mehani b0e405e187
Use designated initialisers for watchySettings
This [0] allows to skip obsolete fields, and generally not have to rely
on field ordering.

[0] https://www.cppstories.com/2021/designated-init-cpp20/

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2022-10-16 22:30:21 +11:00
Olivier Mehani 2bd89ef250
Get gmtOffset from weather data, for use in all NTP requests
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2022-10-16 22:29:21 +11:00
SQFMI eb43be0634
Update README.md 2022-10-14 22:37:50 -04:00
sqfmi 9e5d7ad19c Merge branch 'master' into dev 2022-10-14 22:23:24 -04:00
sqfmi 99158e19d4 v1.4.3
- add ntp sync to weather call
- removed dst param since it's not used
2022-10-14 22:23:06 -04:00
sqfmi a24b1d0945 Merge branch 'master' into dev 2022-10-08 16:23:36 -04:00
sqfmi 8adde783be update library 2022-10-08 16:22:33 -04:00
SQFMI 4c56a38f34
Merge pull request #181 from ITCactus/fix-version-about-screen
fix "LibVer" info on "About Watchy" screen
2022-10-08 02:55:25 -04:00
SQFMI 53acbe6929
Merge pull request #179 from DarkZeros/Arduino_2.0.3+_fix
Tentative fixes for 2.0.3+
2022-10-07 22:17:27 -04:00
sqfmi c5ceab1a49 Merge branch 'pr/178' into dev 2022-08-27 16:09:25 -04:00
sqfmi 5e0834f309 Merge branch 'master' into dev 2022-08-27 16:06:03 -04:00
SQFMI fdfe7ee2be
Merge pull request #177 from DarkZeros/SPI20MHz
SPI set to 20MHz
2022-08-27 16:05:25 -04:00
ITCactus 819606e892 fix "LibVer" info on "About Watchy" screen 2022-08-05 15:07:56 +02:00
Daniel Ansorregui 04126ce5f6 Tentative fixes for 2.0.3+
* Found that the Resets were caused
  by the timer wakeup being set
* Also, some pins will crash the
  device if we access them.
  Maybe they were protected in 2.0.2
  and now they are not.
2022-08-03 18:21:27 +01:00
Daniel Ansorregui 5c27f4721f Optimise GxEPD2 Display
* This change implements certain
  speed improvements on top of
  upstream GxEPD2 that are not fully
  accepted by the upstream maintainer.
* The change Adds a new WatchyDisplay class
  and implements the mods in there.

* Using transactions for SPI communication
* Remove extra delays for yield()
* Remove 10ms active waits in resets

* This reduces (874ms -> 657ms) the display
  update. Making it more responsive and
  Saving 21mJ/update or 2.6mAh/day
2022-08-03 17:08:12 +01:00
Daniel Ansorregui 561673927c Set SPI to 20MHz
* Speed up SPI transfer to the display
  by using 20Mhz instead of default 4Mhz
  This saves around 16ms = 1.5mJ/refresh
  or 2160mJ/day = 0.6mWh/day = 0.2mAh/day
  (890ms -> 874ms)
2022-08-03 11:52:52 +01:00
sqfmi 2e957fb80b Merge branch 'master' into dev 2022-07-10 12:10:28 -04:00
SQFMI 5690db077f
Merge pull request #168 from stuartpb/patch-1
PCF8563: Call rtc_pcf.getDateTime in WatchyRTC::read
2022-07-10 12:09:53 -04:00
sqfmi 44c51fce90 Merge branch 'master' into dev 2022-07-10 12:09:04 -04:00
Stuart P. Bentley 37ea6135da
PCF8563: Call rtc_pcf.getDateTime in WatchyRTC::read
Fixes #128 as noted by @neaket
2022-05-17 11:22:54 -07:00
SQFMI 3e3a8859a9
Update README.md 2022-05-07 00:06:06 -04:00
sqfmi 715a0e1bd3 fix include order 2022-05-06 23:58:07 -04:00
SQFMI 00dc02fe21
Merge pull request #162 from ajraymond/fix_missing_defines
Fix missing defines breaking compilation
2022-05-06 23:54:33 -04:00
SQFMI 4b739afbd0
Merge branch 'master' into fix_missing_defines 2022-05-06 23:54:27 -04:00
SQFMI c5ddfb4e7b
Update library.json 2022-05-06 22:29:08 -04:00
SQFMI 8440fc7960
Update library.properties 2022-05-06 22:28:55 -04:00
SQFMI 0bdbcbc348
Update README.md 2022-05-06 22:16:54 -04:00
SQFMI 433050a63a
Merge pull request #161 from aneeshdurg/formatter
Introduce and use a consistent style
2022-05-06 22:12:03 -04:00
Alexandre J. Raymond 170029672a Fix missing defines breaking compilation 2022-05-03 21:41:35 -04:00
Aneesh Durg 8f55e2f694 Format all files 2022-04-28 20:17:00 -05:00
Aneesh Durg 3a6af55a6f Add formatter script 2022-04-28 20:16:09 -05:00
SQFMI 48c796ec27
Merge pull request #160 from sqfmi/dev
Dev
2022-04-25 12:51:24 -04:00
SQFMI 6fc2c3ec21
Merge pull request #159 from Batchyx/compilefix
Various compilation fixes
2022-04-25 12:41:53 -04:00
Batchyx ccef29a679 Fix compilation of Watchy_Tetris
Inheriting the constructor is enough, no need to declare another
constructor that does not compile.
2022-04-20 18:09:03 +02:00
Batchyx 6e9a6a8c05 Fix compilation with latest version of DS3232RTC
The ALARM_2, SQWAVE_NONE and ALM2_EVERY_MINUTE definitions were moved
inside DS3232RTC.
2022-04-20 18:08:11 +02:00
sqfmi cd17d2046d Merge branch 'dev' 2022-01-23 18:32:50 -05:00
sqfmi ee57707698 Revert "Update config.h"
This reverts commit da92b9d4a1.
2022-01-23 16:15:12 -05:00
SQFMI ce7b6bf2f3
Merge pull request #144 from lifton/dev
Add link to purchase Watchy at Crowd Supply
2022-01-23 16:07:48 -05:00
Joshua Harlan Lifton 8e2582f02a Fix typo and light copy edits 2022-01-22 12:11:56 -05:00
Joshua Harlan Lifton 266fb8ea95 Add link to purchase Watchy at Crowd Supply 2022-01-22 12:06:00 -05:00
SQFMI da92b9d4a1
Update config.h 2022-01-21 17:46:39 -05:00
SQFMI cd743e5ebf
Update config.h 2022-01-19 21:39:43 -05:00
sqfmi 3c9afbb6d2 update to 1.4.0
moved pin definitions to pins_arduino.h
2022-01-19 21:38:26 -05:00
SQFMI 083b2d90d8
Merge pull request #142 from rastagraffix/dev
Tag lib version with 'dev' for the dev branch and tighten up the
2022-01-18 21:44:19 -05:00
Lyndon Nerenberg 7bd9cf3ab0 Tag lib version with 'dev' for the dev branch and tighten up the
About menu to allow for longer lib version strings.
2022-01-15 19:58:58 -08:00
sqfmi f79f7482c1 use units params so it can be overridden 2022-01-12 19:23:02 -05:00
наб a7637604b4
Properly handle metric temperature w/o wifi 2022-01-11 00:09:58 +01:00
sqfmi c5b43d2eac small tweaks to "About Watchy" 2022-01-06 17:20:57 -05:00
Lyndon Nerenberg bf7425c7dc Add an "About Watchy" menu item.
This replaces "Check Battery" and adds the following info:

  * Firmware version
  * RTC chip type

The firmware version is #defined in Watchy.h.  There might be a
way to do this that's friendlier to the library release process,
but I'll leave that up to the people who actually build the releases.

I plan to extend the About menu with some radio-related info as
I work on getting BLE pairing working with my iPhone.
2022-01-05 00:25:22 -08:00
sqfmi 26f5ac20c0 Add NTPClient dependency 2022-01-03 21:55:50 -05:00
sqfmi de126cd292 Updated NTP to use NTPClient.h 2022-01-03 21:41:36 -05:00
SQFMI 5f1aeabff6
Merge pull request #138 from sqfmi/dev
Dev
2022-01-01 21:29:04 -05:00
SQFMI 623c1e0ac1
Merge pull request #137 from anielsen001/fix-comma-warning-in-library-json
Fix comma warning in library json
2022-01-01 21:28:31 -05:00
Aaron Nielsen df37a3b9ef fix warning in library.json due to missing comman 2022-01-01 14:54:42 -05:00
SQFMI 8ace9dba96
Merge pull request #135 from sqfmi/dev
change line endings
2021-12-30 23:17:33 -05:00
SQFMI 2bfe297e7b change line endings 2021-12-30 23:16:03 -05:00
Christopher Chin 20dd8a26e0 Auto compile using Github Action. 2021-12-20 01:12:12 +00:00
55 changed files with 15513 additions and 12573 deletions

27
.github/workflows/dev.actions.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Build Example Watchfaces
on:
push:
branches:
- "dev"
pull_request:
branches:
- "dev"
jobs:
build:
name: Build Example Watchfaces
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: esp32:esp32:watchy:Revision=v20,PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
required-libraries: Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
set-build-path: true
- uses: actions/upload-artifact@v3
with:
name: binaries
path: ${{ github.workspace }}/examples/WatchFaces/**/build/*.bin
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R

38
.github/workflows/main.actions.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
strategy:
matrix:
board-revisions: [v10, v15, v20]
steps:
- uses: actions/checkout@master
- uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: esp32:esp32:watchy:Revision=${{ matrix.board-revisions }},PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
required-libraries: Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
set-build-path: true
- name: Rename binaries with board revision
run: |
parent_dir="${{ github.workspace }}/examples/WatchFaces"
for dir in "$parent_dir"/*; do
if [ -d "$dir" ]; then
cd "$dir/build"
for file in *; do
name="${file%%.*}"
ext="${file#$name.}"
mv "$file" "$name-${{ matrix.board-revisions }}.$ext"
done
cd -
fi
done
- uses: softprops/action-gh-release@v1
with:
name: "Watchy Arduino Library ${{ github.ref_name }}"
files: ${{ github.workspace }}/examples/WatchFaces/**/build/*.bin

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 SQFMI
Copyright (c) 2023 SQFMI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -2,27 +2,31 @@
![Watchy](https://watchy.sqfmi.com/img/watchy_render.png)
[**Buy Watchy!**](https://www.mouser.com/ProductDetail/SQFMI/SQFMI-WATCHY-10?qs=DRkmTr78QARN9VSJRzqRxw%3D%3D)
**Buy Watchy from [The Pi Hut](https://thepihut.com/collections/sqfmi), [Crowd Supply](https://www.crowdsupply.com/sqfmi/watchy), and [Mouser](https://www.mouser.com/ProductDetail/SQFMI/SQFMI-WATCHY-10?qs=DRkmTr78QARN9VSJRzqRxw%3D%3D)!**
[**Watchy Case & Accessories**](https://shop.sqfmi.com)
Visit [**https://watchy.sqfmi.com**](https://watchy.sqfmi.com) for documentation, hardware design files, and more!
## Setup
1. In the Arduino IDE Boards Manager, install support for the ESP32. You can find instructions here: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
* Arduino > Preferences > Additional Board Manager URL's
1. In the Arduino IDE Boards Manager, [install support for the ESP32](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html).
* Arduino > Preferences > Additional Board Manager URLs
* ```https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json```
2. Install this library (search for **Watchy** in the library manager), and any other depdencies when prompted
2. Install this library (search for **Watchy** in the library manager), and any other dependencies when prompted
3. Check out the examples under ```Examples``` -> ```Watchy```
4. Compile & Upload with these board settings:
* Board: "ESP32 Dev Module"
* Partition Scheme: "Minimal SPIFFS"
* Board: "Watchy"
* Partition Scheme: "Huge App"
* Board Revision: Choose your Watchy version
* All Other Settings: leave to default
You may also have to install the [CP2104 USB to Serial drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) if the port is not automatically detected
You may also have to install the [CP2104 USB to Serial drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) if the port is not automatically detected.
### Have Fun! :)
### Got Questions?
Join our [Discord](https://discord.gg/ZXDegGV8E7)

View File

@ -125,6 +125,7 @@ void Watchy7SEG::drawWeather(){
display.drawBitmap(165, 110, currentWeather.isMetric ? celsius : fahrenheit, 26, 20, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
const unsigned char* weatherIcon;
if(WIFI_CONFIGURED){
//https://openweathermap.org/weather-conditions
if(weatherConditionCode > 801){//Cloudy
weatherIcon = cloudy;
@ -144,5 +145,9 @@ void Watchy7SEG::drawWeather(){
weatherIcon = thunderstorm;
}else
return;
}else{
weatherIcon = chip;
}
display.drawBitmap(145, 158, weatherIcon, WEATHER_ICON_WIDTH, WEATHER_ICON_HEIGHT, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
}

View File

@ -150,6 +150,21 @@ const unsigned char thunderstorm[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x01,
0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// 'cputemp', 48x32px
const unsigned char cputemp [] PROGMEM = {
0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7,
0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xef, 0xff, 0xff, 0xef, 0x80,
0x03, 0xef, 0xff, 0xff, 0xef, 0x80, 0x03, 0xef, 0xff, 0xff, 0xe7, 0x80, 0x00, 0x0f, 0xff, 0xff,
0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xef, 0xff, 0xff, 0xef, 0x80, 0x03, 0xef,
0xff, 0xff, 0xef, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00,
0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xef, 0xff, 0xff, 0xef, 0x80, 0x03, 0xef, 0xff, 0xff,
0xef, 0x80, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f,
0xff, 0xff, 0xe0, 0x00, 0x03, 0xef, 0xff, 0xff, 0xef, 0x80, 0x03, 0xef, 0xff, 0xff, 0xef, 0x80,
0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00, 0x00, 0x01,
0x8c, 0xe7, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00, 0x00, 0x01, 0x8c, 0xe7, 0x00, 0x00
};
// 'steps', 19x23px
const unsigned char steps [] PROGMEM = {
0x00, 0x03, 0xc0, 0x00, 0x07, 0xe0, 0x00, 0x07, 0xe0, 0x00, 0x0f, 0xe0, 0x78, 0x0f, 0xe0, 0xfc,
@ -174,3 +189,19 @@ const unsigned char wifioff [] PROGMEM = {
0x01, 0xff, 0xc0, 0x00, 0x07, 0xe1, 0xc0, 0x00, 0x0f, 0xc0, 0x80, 0x00, 0x1f, 0x0c, 0x00, 0x00,
0x3c, 0x1e, 0x00, 0x00, 0xf8, 0x0c, 0x00, 0x00
};
// 'chip', 48x32px
const unsigned char chip [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00,
0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01,
0x00, 0x00, 0x00, 0x0f, 0x87, 0xf9, 0xf0, 0x00, 0x00, 0x00, 0x88, 0x09, 0x00, 0x00, 0x00, 0x00,
0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x90, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x90, 0x09, 0x00, 0x00,
0x00, 0x00, 0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x90, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x90, 0x09,
0x00, 0x00, 0x00, 0x00, 0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x9f, 0xf9, 0xf0, 0x00, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48,
0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -0,0 +1,10 @@
#include "Watchy_Mario.h"
#include "settings.h"
WatchyMario watchy(settings);
void setup(){
watchy.init();
}
void loop(){}

View File

@ -0,0 +1,65 @@
#include "Watchy_Mario.h"
#define NUM_W 44
#define NUM_H 44
#define COIN_W 24
#define COIN_H 30
#define PIPE_W 42
#define PIPE_H 47
#define MARIO_W 56
#define MARIO_H 54
#define NUM_SPACING 4
#define COIN_SPACING 4
#define FLOOR_H 19
#define PIPE_PADDING DISPLAY_HEIGHT - FLOOR_H - PIPE_H
#define X_PADDING (DISPLAY_WIDTH - (4*NUM_W) - (3*NUM_SPACING))/2
#define Y_PADDING 2*COIN_SPACING+COIN_H
const unsigned char *numbers [10] = {mario0, mario1, mario2, mario3, mario4, mario5, mario6, mario7, mario8, mario9};
void WatchyMario::drawWatchFace(){
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(0, 0, mariobg, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
int hour10 = currentTime.Hour/10;
int hour01 = currentTime.Hour%10;
int minute10 = currentTime.Minute/10;
int minute01 = currentTime.Minute%10;
int pos = 0;
if(hour01 == 0 && minute10 == 0 && minute01 == 0){
pos = 0;
}
else if(minute10 == 0 && minute01 == 0){
pos = 1;
}
else if(minute01 == 0){
pos = 2;
}else{
pos = 3;
}
display.drawBitmap(X_PADDING + pos*(NUM_SPACING + NUM_W) + (NUM_W/2 - MARIO_W/2) + (pos < 2 ? 8 : -8), Y_PADDING+NUM_H + 4, pos < 2 ? mariomariol : mariomarior, MARIO_W, MARIO_H, GxEPD_BLACK); //mario
display.drawBitmap(X_PADDING + pos*(NUM_SPACING + NUM_W) + (NUM_W/2 - COIN_W/2), COIN_SPACING, mariocoin, COIN_W, COIN_H, GxEPD_BLACK); //coin
if(pos == 0){
display.drawBitmap(DISPLAY_WIDTH - 2*PIPE_W, PIPE_PADDING, mariopipe, PIPE_W, PIPE_H, GxEPD_BLACK); //pipe
}
else if(pos == 1 || pos == 2){
display.drawBitmap(X_PADDING, PIPE_PADDING, mariopipe, PIPE_W, PIPE_H, GxEPD_BLACK); //pipe
display.drawBitmap(DISPLAY_WIDTH - PIPE_W - X_PADDING, PIPE_PADDING, mariopipe, PIPE_W, PIPE_H, GxEPD_BLACK); //pipe
}
else{
display.drawBitmap(2*PIPE_W, PIPE_PADDING, mariopipe, PIPE_W, PIPE_H, GxEPD_BLACK); //pipe
}
//Hour
display.drawBitmap(X_PADDING, pos == 0 ? Y_PADDING : Y_PADDING + 20, numbers[hour10], NUM_W, NUM_H, GxEPD_BLACK); //first digit
display.drawBitmap(X_PADDING+NUM_SPACING+NUM_W, pos == 1 ? Y_PADDING : Y_PADDING + 20, numbers[hour01], NUM_W, NUM_H, GxEPD_BLACK); //second digit
//Minute
display.drawBitmap(X_PADDING+2*(NUM_SPACING+NUM_W), pos == 2 ? Y_PADDING : Y_PADDING + 20, numbers[minute10], NUM_W, NUM_H, GxEPD_BLACK); //first digit
display.drawBitmap(X_PADDING+3*(NUM_SPACING+NUM_W), pos == 3 ? Y_PADDING : Y_PADDING + 20, numbers[minute01], NUM_W, NUM_H, GxEPD_BLACK); //second digit
}

View File

@ -0,0 +1,13 @@
#ifndef WATCHY_MARIO_H
#define WATCHY_MARIO_H
#include <Watchy.h>
#include "mario.h"
class WatchyMario: public Watchy{
using Watchy::Watchy;
public:
void drawWatchFace();
};
#endif

View File

@ -0,0 +1,600 @@
// '0', 44x44px
const unsigned char mario0 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xfc, 0x00, 0x0f,
0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0,
0xd0, 0xfc, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '1', 44x44px
const unsigned char mario1 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x00, 0xff, 0xc0, 0x01, 0x70, 0xe0, 0x00, 0xff, 0xc0, 0x02, 0xb0,
0xd0, 0x00, 0xc0, 0xc0, 0x01, 0x70, 0xe0, 0x00, 0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x03, 0x00, 0xc0,
0x01, 0x70, 0xe0, 0x03, 0x00, 0xc0, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0xc0, 0x01, 0x70, 0xe0, 0x0c,
0x00, 0xc0, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0xc0, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0xc0, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0xc0, 0x01, 0x70, 0xe0, 0x0f, 0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x0f, 0xc0, 0xc0,
0x01, 0x70, 0xe0, 0x00, 0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x00, 0xc0, 0xc0, 0x01, 0x70, 0xe0, 0x00,
0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x00, 0xc0, 0xc0, 0x01, 0x70, 0xe0, 0x00, 0xc0, 0xc0, 0x02, 0xb0,
0xd0, 0x00, 0xc0, 0xc0, 0x01, 0x70, 0xe0, 0x00, 0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x00, 0xc0, 0xc0,
0x01, 0x70, 0xe0, 0x00, 0xc0, 0xc0, 0x02, 0xb0, 0xd0, 0x00, 0xc0, 0xc0, 0x01, 0x70, 0xe0, 0x0f,
0xc0, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xc0, 0xfc, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '2', 44x44px
const unsigned char mario2 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xfc, 0x00, 0x0f,
0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xff, 0xe1, 0x80, 0xc1, 0x70, 0xe0, 0xff, 0xe1, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x01, 0x80,
0xc1, 0x70, 0xe0, 0x00, 0x07, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x07, 0x80, 0xc1, 0x70, 0xe0, 0x00,
0x38, 0x0f, 0xc2, 0xb0, 0xd0, 0x00, 0x38, 0x0f, 0xc1, 0x70, 0xe0, 0x00, 0xc0, 0x0c, 0x02, 0xb0,
0xd0, 0x00, 0xc0, 0x0c, 0x01, 0x70, 0xe0, 0x0f, 0x00, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0x00, 0xfc,
0x01, 0x70, 0xe0, 0x30, 0x00, 0xc0, 0x02, 0xb0, 0xd0, 0x30, 0x00, 0xc0, 0x01, 0x70, 0xe0, 0xc0,
0x00, 0xff, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0xff, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0,
0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00,
0xc1, 0x70, 0xe0, 0xff, 0xff, 0xff, 0xc2, 0xb0, 0xd0, 0xff, 0xff, 0xff, 0xc1, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '3', 44x44px
const unsigned char mario3 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xfc, 0x00, 0x0f,
0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xff, 0xe1, 0x80, 0xc1, 0x70, 0xe0, 0xff, 0xe1, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x07, 0x80,
0xc1, 0x70, 0xe0, 0x00, 0x07, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x18, 0x03, 0xc1, 0x70, 0xe0, 0x00,
0x18, 0x03, 0xc2, 0xb0, 0xd0, 0x00, 0x18, 0x03, 0xc1, 0x70, 0xe0, 0x00, 0x07, 0x83, 0xc2, 0xb0,
0xd0, 0x00, 0x07, 0x80, 0xc1, 0x70, 0xe0, 0xff, 0xe1, 0x80, 0xc2, 0xb0, 0xd0, 0xff, 0xe1, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0,
0xd0, 0xfc, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '4', 44x44px
const unsigned char mario4 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x00, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x00, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x03, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x03, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x30, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x30,
0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x30, 0x1e, 0x0c, 0x01, 0x70, 0xe0, 0x30, 0x1e, 0x0c, 0x02, 0xb0,
0xd0, 0x30, 0x66, 0x0c, 0x01, 0x70, 0xe0, 0x30, 0x66, 0x0c, 0x02, 0xb0, 0xd0, 0x30, 0x7e, 0x0f,
0xc1, 0x70, 0xe0, 0x30, 0x7e, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0,
0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0,
0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00,
0xc1, 0x70, 0xe0, 0xff, 0xfc, 0x0f, 0xc2, 0xb0, 0xd0, 0xff, 0xfc, 0x0f, 0xc1, 0x70, 0xe0, 0x00,
0x0c, 0x0c, 0x02, 0xb0, 0xd0, 0x00, 0x0c, 0x0c, 0x01, 0x70, 0xe0, 0x00, 0x0c, 0x0c, 0x02, 0xb0,
0xd0, 0x00, 0x0c, 0x0c, 0x01, 0x70, 0xe0, 0x00, 0x0c, 0x0c, 0x02, 0xb0, 0xd0, 0x00, 0x0c, 0x0c,
0x01, 0x70, 0xe0, 0x00, 0x0f, 0xfc, 0x02, 0xb0, 0xd0, 0x00, 0x0f, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '5', 44x44px
const unsigned char mario5 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0xff, 0xff, 0xff, 0xc1, 0x70, 0xe0, 0xff, 0xff, 0xff, 0xc2, 0xb0,
0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00,
0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0xff, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0xff, 0xc2, 0xb0, 0xd0, 0xc0, 0x60, 0x00, 0x01, 0x70, 0xe0, 0xc0, 0x60, 0x00, 0x02, 0xb0,
0xd0, 0xc0, 0x7f, 0xfc, 0x01, 0x70, 0xe0, 0xc0, 0x7f, 0xfc, 0x02, 0xb0, 0xd0, 0xc0, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0xc0, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xc0, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0xff,
0xfe, 0x0f, 0xc2, 0xb0, 0xd0, 0x3f, 0xff, 0x80, 0xc1, 0x70, 0xe0, 0x00, 0x01, 0x80, 0xc2, 0xb0,
0xd0, 0x00, 0x01, 0x80, 0xc1, 0x70, 0xe0, 0xff, 0xe1, 0x80, 0xc2, 0xb0, 0xd0, 0xff, 0xe1, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0,
0xd0, 0xfc, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '6', 44x44px
const unsigned char mario6 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x03, 0xff, 0xff, 0xc1, 0x70, 0xe0, 0x03, 0xff, 0xff, 0xc2, 0xb0,
0xd0, 0x0c, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0x30, 0x00, 0x00,
0xc1, 0x70, 0xe0, 0x30, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0xff, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0xff, 0xc2, 0xb0, 0xd0, 0xc0, 0x60, 0x00, 0x01, 0x70, 0xe0, 0xc0, 0x60, 0x00, 0x02, 0xb0,
0xd0, 0xc0, 0x7f, 0xfc, 0x01, 0x70, 0xe0, 0xc0, 0x7f, 0xfc, 0x02, 0xb0, 0xd0, 0xc0, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0xc0, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xc0, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0xc0,
0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x7f, 0x80, 0xc2, 0xb0,
0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0,
0xd0, 0xfc, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '7', 44x44px
const unsigned char mario7 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0xff, 0xff, 0xff, 0xc1, 0x70, 0xe0, 0xff, 0xff, 0xff, 0xc2, 0xb0,
0xd0, 0xc0, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xc0, 0x00, 0x00,
0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xff, 0xff, 0x80, 0xc1, 0x70, 0xe0, 0xff,
0xff, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x01, 0x80, 0xc1, 0x70, 0xe0, 0x00, 0x01, 0x80, 0xc2, 0xb0,
0xd0, 0x00, 0x06, 0x03, 0x01, 0x70, 0xe0, 0x00, 0x06, 0x03, 0x02, 0xb0, 0xd0, 0x00, 0x18, 0x0c,
0x01, 0x70, 0xe0, 0x00, 0x18, 0x0c, 0x02, 0xb0, 0xd0, 0x00, 0x60, 0x30, 0x01, 0x70, 0xe0, 0x00,
0x60, 0x30, 0x02, 0xb0, 0xd0, 0x01, 0x80, 0xc0, 0x01, 0x70, 0xe0, 0x01, 0x80, 0xc0, 0x02, 0xb0,
0xd0, 0x01, 0x80, 0xc0, 0x01, 0x70, 0xe0, 0x01, 0x80, 0xc0, 0x02, 0xb0, 0xd0, 0x01, 0x80, 0xc0,
0x01, 0x70, 0xe0, 0x01, 0x80, 0xc0, 0x02, 0xb0, 0xd0, 0x01, 0x80, 0xc0, 0x01, 0x70, 0xe0, 0x01,
0x80, 0xc0, 0x02, 0xb0, 0xd0, 0x01, 0x80, 0xc0, 0x01, 0x70, 0xe0, 0x01, 0x80, 0xc0, 0x02, 0xb0,
0xd0, 0x01, 0x80, 0xc0, 0x01, 0x70, 0xe0, 0x01, 0x80, 0xc0, 0x02, 0xb0, 0xd0, 0x01, 0x80, 0xc0,
0x01, 0x70, 0xe0, 0x01, 0xff, 0xc0, 0x02, 0xb0, 0xd0, 0x01, 0xff, 0xc0, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '8', 44x44px
const unsigned char mario8 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xfc, 0x00, 0x0f,
0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xf0, 0x00, 0x03, 0xc1, 0x70, 0xe0, 0xf0,
0x00, 0x03, 0xc2, 0xb0, 0xd0, 0xf0, 0x00, 0x03, 0xc1, 0x70, 0xe0, 0xf0, 0x7f, 0x83, 0xc2, 0xb0,
0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0,
0xd0, 0xfc, 0x00, 0x0f, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0x0c, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// '9', 44x44px
const unsigned char mario9 [] PROGMEM = {
0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x35, 0x55, 0x55, 0x55,
0x55, 0xc0, 0x38, 0x00, 0x00, 0x00, 0x0a, 0xc0, 0xd0, 0x00, 0x00, 0x00, 0x05, 0x70, 0xe0, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd0, 0x0f, 0xff, 0xfc, 0x01, 0x70, 0xe0, 0x0f, 0xff, 0xfc, 0x02, 0xb0,
0xd0, 0x0c, 0x00, 0x0c, 0x01, 0x70, 0xe0, 0x0c, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xfc, 0x00, 0x0f,
0xc1, 0x70, 0xe0, 0xfc, 0x00, 0x0f, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xc0,
0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0,
0xd0, 0xc0, 0x61, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x61, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x61, 0x80,
0xc1, 0x70, 0xe0, 0xc0, 0x7f, 0x80, 0xc2, 0xb0, 0xd0, 0xc0, 0x7f, 0x80, 0xc1, 0x70, 0xe0, 0xfc,
0x00, 0x00, 0xc2, 0xb0, 0xd0, 0xfc, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0x0c, 0x00, 0x00, 0xc2, 0xb0,
0xd0, 0x0c, 0x00, 0x00, 0xc1, 0x70, 0xe0, 0x0f, 0xff, 0x80, 0xc2, 0xb0, 0xd0, 0x0f, 0xff, 0x80,
0xc1, 0x70, 0xe0, 0x00, 0x01, 0x80, 0xc2, 0xb0, 0xd0, 0x00, 0x01, 0x80, 0xc1, 0x70, 0xe0, 0xff,
0xff, 0x80, 0xc2, 0xb0, 0xd0, 0xff, 0xff, 0x80, 0xc1, 0x70, 0xe0, 0xc0, 0x00, 0x03, 0x02, 0xb0,
0xd0, 0xc0, 0x00, 0x03, 0x01, 0x70, 0xe0, 0xc0, 0x00, 0x0c, 0x02, 0xb0, 0xd0, 0xc0, 0x00, 0x0c,
0x01, 0x70, 0xe0, 0xff, 0xff, 0xf0, 0x02, 0xb0, 0xd0, 0xff, 0xff, 0xf0, 0x01, 0x70, 0xe8, 0x00,
0x00, 0x00, 0x02, 0xb0, 0xd4, 0x00, 0x00, 0x00, 0x05, 0x70, 0xea, 0x00, 0x00, 0x00, 0x0a, 0xb0,
0x35, 0x55, 0x55, 0x55, 0x55, 0xc0, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xc0, 0x0f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00
};
// 'bg', 200x200px
const unsigned char mariobg [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xfe, 0xff, 0xfe, 0xbf,
0xff, 0xaf, 0xff, 0xeb, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0xfe, 0xbf, 0xff, 0xaf, 0xff, 0xef, 0xff,
0xeb, 0xff, 0xfa, 0xe4, 0x7f, 0xfc, 0x7f, 0xfc, 0x4f, 0xff, 0x47, 0xff, 0xc5, 0xff, 0xe4, 0xff,
0xf4, 0x7f, 0xfc, 0x5f, 0xfe, 0x47, 0xff, 0xc7, 0xff, 0xc4, 0xff, 0xf4, 0xaa, 0xaf, 0xea, 0xaf,
0xea, 0xab, 0xfa, 0xaa, 0xfe, 0xaa, 0xbf, 0xaa, 0xbf, 0xaa, 0xaf, 0xea, 0xab, 0xfa, 0xaa, 0xfe,
0xaa, 0xfe, 0xaa, 0xbf, 0xaa, 0x11, 0x17, 0x91, 0x13, 0xd1, 0x11, 0xf1, 0x11, 0x79, 0x11, 0x1f,
0x11, 0x1f, 0x11, 0x13, 0xd1, 0x11, 0xf1, 0x11, 0x79, 0x11, 0x3d, 0x11, 0x1f, 0x11, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44
};
// 'coin', 24x30px
const unsigned char mariocoin [] PROGMEM = {
0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x0f, 0x00, 0xf0, 0x0f, 0x00, 0xf0, 0x30, 0x00, 0x0c, 0x30,
0x00, 0x0c, 0x30, 0x14, 0x0c, 0x30, 0x28, 0x0c, 0xc0, 0x43, 0x03, 0xc0, 0x83, 0x03, 0xc0, 0x43,
0x03, 0xc0, 0x83, 0x03, 0xc0, 0x43, 0x03, 0xc0, 0x83, 0x03, 0xc0, 0x43, 0x03, 0xc0, 0x83, 0x03,
0xc0, 0x43, 0x03, 0xc0, 0x83, 0x03, 0xc0, 0x43, 0x03, 0xc0, 0x83, 0x03, 0xc0, 0x43, 0x03, 0xc0,
0x83, 0x03, 0x30, 0x3c, 0x0c, 0x30, 0x3c, 0x0c, 0x30, 0x00, 0x0c, 0x30, 0x00, 0x0c, 0x0f, 0x00,
0xf0, 0x0f, 0x00, 0xf0, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00
};
// 'mario', 56x54px
const unsigned char mariomarior [] PROGMEM = {
0x00, 0x00, 0x03, 0xfc, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x3f, 0x00, 0x00, 0x00,
0x03, 0x03, 0x3f, 0xf3, 0xfc, 0x00, 0x00, 0x03, 0x03, 0x3f, 0xf3, 0xfc, 0x00, 0x00, 0x03, 0x00,
0xff, 0xf3, 0x03, 0x00, 0x00, 0x03, 0x00, 0xff, 0xf3, 0x03, 0x00, 0x00, 0x03, 0x00, 0xff, 0xfc,
0x03, 0x00, 0x00, 0x03, 0x00, 0xff, 0xfc, 0x03, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xcc, 0x00,
0x00, 0x03, 0x03, 0xff, 0xff, 0xcc, 0x00, 0x00, 0x03, 0x03, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x03,
0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x03, 0xff, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x03, 0xff, 0x00,
0x03, 0xc0, 0x00, 0x00, 0x0f, 0xfc, 0x0c, 0xc3, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x0c, 0xc3, 0x00,
0x00, 0x00, 0x3c, 0xfc, 0x0c, 0xc3, 0x00, 0x00, 0x00, 0x3c, 0xfc, 0x0c, 0xc3, 0x00, 0x00, 0x00,
0x30, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x30, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x30, 0x00,
0x30, 0x00, 0xc0, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0xff, 0x03,
0xf0, 0x00, 0x00, 0x3c, 0x00, 0xff, 0x03, 0xf0, 0x00, 0x00, 0x03, 0xc0, 0x0f, 0xff, 0x00, 0x00,
0x00, 0x03, 0xc0, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
0xff, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0f, 0x03, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x0f, 0x03, 0xff,
0xfc, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0xf0, 0xfc, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0xf0, 0xfc, 0x00,
0x00, 0x3c, 0x03, 0x00, 0x3c, 0x0f, 0x00, 0x00, 0x3c, 0x03, 0x00, 0x3c, 0x0f, 0x00, 0x00, 0x3c,
0x00, 0xc0, 0x3c, 0x03, 0xc0, 0x00, 0x3c, 0x00, 0xc0, 0x3c, 0x03, 0xc0, 0x00, 0x3f, 0xf0, 0xc3,
0xff, 0xff, 0xc0, 0x3f, 0xff, 0xf0, 0xc3, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xf0, 0xfc,
0xf0, 0xfc, 0x3f, 0xff, 0xff, 0xf0, 0xfc, 0xf0, 0xfc, 0x3f, 0xc3, 0xff, 0xf0, 0xff, 0x0c, 0xfc,
0x3f, 0xc3, 0xff, 0xf0, 0xff, 0x0c, 0xfc, 0x3f, 0xcc, 0x0f, 0xff, 0xfc, 0x0c, 0xfc, 0x3f, 0xcc,
0x0f, 0xff, 0xfc, 0x0c, 0xfc, 0x3f, 0xfc, 0xff, 0xff, 0xfc, 0x0c, 0xfc, 0x3f, 0xfc, 0xff, 0xff,
0xfc, 0x0c, 0x3f, 0xff, 0xf0, 0xff, 0xff, 0xfc, 0x0c, 0x3f, 0xff, 0xf0, 0xff, 0xff, 0xfc, 0x0c,
0x00, 0x00, 0x30, 0xff, 0xc0, 0x06, 0x3c, 0x00, 0x00, 0x30, 0xff, 0xc0, 0x06, 0x3c, 0x00, 0x00,
0x30, 0xc0, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x01, 0xf8, 0x00, 0x00, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00
};
// 'mariol', 56x54px
const unsigned char mariomariol [] PROGMEM = {
0x00, 0xfc, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x3f, 0xcf,
0xfc, 0xc0, 0xc0, 0x00, 0x00, 0x3f, 0xcf, 0xfc, 0xc0, 0xc0, 0x00, 0x00, 0xc0, 0xcf, 0xff, 0x00,
0xc0, 0x00, 0x00, 0xc0, 0xcf, 0xff, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x3f, 0xff, 0x00, 0xc0, 0x00,
0x00, 0xc0, 0x3f, 0xff, 0x00, 0xc0, 0x00, 0x00, 0x33, 0xff, 0xff, 0x00, 0xc0, 0x00, 0x00, 0x33,
0xff, 0xff, 0xc0, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff,
0xff, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 0xff, 0xc0,
0x00, 0x00, 0x00, 0xc3, 0x30, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0xc3, 0x30, 0x3f, 0xf0, 0x00, 0x00,
0x00, 0xc3, 0x30, 0x3f, 0x3c, 0x00, 0x00, 0x00, 0xc3, 0x30, 0x3f, 0x3c, 0x00, 0x00, 0x03, 0x00,
0x00, 0xff, 0x0c, 0x00, 0x00, 0x03, 0x00, 0x00, 0xff, 0x0c, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x00,
0x0c, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x0f, 0xc0, 0xff, 0x00, 0x3c, 0x00,
0x00, 0x0f, 0xc0, 0xff, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00,
0xff, 0xf0, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x30, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc0, 0xf0, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc0, 0xf0,
0x00, 0x00, 0x00, 0x3f, 0x0f, 0x00, 0x3f, 0xf0, 0x00, 0x00, 0x3f, 0x0f, 0x00, 0x3f, 0xf0, 0x00,
0x00, 0xf0, 0x3c, 0x00, 0xc0, 0x3c, 0x00, 0x00, 0xf0, 0x3c, 0x00, 0xc0, 0x3c, 0x00, 0x03, 0xc0,
0x3c, 0x03, 0x00, 0x3c, 0x00, 0x03, 0xc0, 0x3c, 0x03, 0x00, 0x3c, 0x00, 0x03, 0xff, 0xff, 0xc3,
0x0f, 0xfc, 0x00, 0x03, 0xff, 0xff, 0xc3, 0x0f, 0xff, 0xfc, 0x0f, 0x3f, 0x0f, 0xff, 0xff, 0xff,
0xfc, 0x0f, 0x3f, 0x0f, 0xff, 0xff, 0xfc, 0x3f, 0x30, 0xff, 0x0f, 0xff, 0xc3, 0xfc, 0x3f, 0x30,
0xff, 0x0f, 0xff, 0xc3, 0xfc, 0x3f, 0x30, 0x3f, 0xff, 0xf0, 0x33, 0xfc, 0x3f, 0x30, 0x3f, 0xff,
0xf0, 0x33, 0xfc, 0x3f, 0x30, 0x3f, 0xff, 0xff, 0x3f, 0xfc, 0x3f, 0x30, 0x3f, 0xff, 0xff, 0x3f,
0xfc, 0x3f, 0x30, 0x3f, 0xff, 0xff, 0x0f, 0xff, 0xfc, 0x30, 0x3f, 0xff, 0xff, 0x0f, 0xff, 0xfc,
0x3c, 0x60, 0x03, 0xff, 0x0c, 0x00, 0x00, 0x3c, 0x60, 0x03, 0xff, 0x0c, 0x00, 0x00, 0x1f, 0x80,
0x00, 0x03, 0x0c, 0x00, 0x00, 0x1f, 0x80, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00
};
// 'pipe', 42x47px
const unsigned char mariopipe [] PROGMEM = {
0x3f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, 0x01, 0x11, 0x15, 0x55, 0x80, 0xa8, 0x02, 0xaa, 0xaa,
0xab, 0xc0, 0xd0, 0x04, 0x44, 0x45, 0x55, 0xc0, 0xa8, 0x02, 0xaa, 0xaa, 0xab, 0xc0, 0xd0, 0x01,
0x11, 0x15, 0x55, 0xc0, 0xa8, 0x02, 0xaa, 0xaa, 0xab, 0xc0, 0xd0, 0x04, 0x44, 0x45, 0x55, 0xc0,
0xa8, 0x02, 0xaa, 0xaa, 0xab, 0xc0, 0xd0, 0x01, 0x11, 0x15, 0x55, 0xc0, 0xa8, 0x02, 0xaa, 0xaa,
0xab, 0xc0, 0xd0, 0x04, 0x44, 0x45, 0x55, 0xc0, 0xa8, 0x02, 0xaa, 0xaa, 0xab, 0xc0, 0xd0, 0x01,
0x11, 0x15, 0x55, 0xc0, 0xa8, 0x02, 0xaa, 0xaa, 0xab, 0xc0, 0xd0, 0x04, 0x44, 0x45, 0x55, 0xc0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x2a, 0x05, 0x55, 0x55,
0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02,
0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00,
0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02, 0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55,
0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02,
0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00,
0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02, 0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55,
0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02,
0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00,
0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02, 0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55,
0x57, 0x00, 0x34, 0x08, 0x88, 0x8a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00, 0x34, 0x02,
0x22, 0x2a, 0xaf, 0x00, 0x2a, 0x05, 0x55, 0x55, 0x57, 0x00
};

View File

@ -0,0 +1,43 @@
#ifndef SETTINGS_H
#define SETTINGS_H
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -2,8 +2,6 @@
const unsigned char *tetris_nums [10] = {tetris0, tetris1, tetris2, tetris3, tetris4, tetris5, tetris6, tetris7, tetris8, tetris9};
WatchyTetris::WatchyTetris(){} //constructor
void WatchyTetris::drawWatchFace(){
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(0, 0, tetrisbg, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);

View File

@ -5,9 +5,8 @@
#include "tetris.h"
class WatchyTetris : public Watchy{
using Watchy::Watchy;
public:
WatchyTetris();
using Watchy::Watchy;
void drawWatchFace();
};

View File

@ -3,26 +3,41 @@
//Weather Settings
#define CITY_ID "5128581" //New York City https://openweathermap.org/current#cityid
//You can also use LAT,LON for your location instead of CITY_ID, but not both
//#define LAT "40.7127" //New York City, Looked up on https://www.latlong.net/
//#define LON "-74.0059"
#ifdef CITY_ID
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id={cityID}&lang={lang}&units={units}&appid={apiKey}" //open weather api using city ID
#else
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&lang={lang}&units={units}&appid={apiKey}" //open weather api using lat lon
#endif
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "metric" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
#ifdef CITY_ID
.cityID = CITY_ID,
#else
.cityID = "",
.lat = LAT,
.lon = LON,
#endif
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
.weatherURL = OPENWEATHERMAP_URL,
.weatherUnit = TEMP_UNIT,
.weatherLang = TEMP_LANG,
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
.ntpServer = NTP_SERVER,
.gmtOffset = GMT_OFFSET_SEC,
.vibrateOClock = true,
};
#endif

View File

@ -1,6 +1,6 @@
{
"name": "Watchy",
"version": "1.3.1",
"version": "1.4.10",
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
"authors": [
{
@ -19,12 +19,13 @@
{ "name": "Adafruit GFX Library" },
{ "name": "Arduino_JSON" },
{ "name": "DS3232RTC" },
{ "name": "NTPClient" },
{
"name": "Rtc_Pcf8563",
"version": "https://github.com/orbitalair/Rtc_Pcf8563.git#master"
},
{
"name": "GxEPD2"
"name": "GxEPD2",
"version": "https://github.com/ZinggJM/GxEPD2.git#master"
},
{

View File

@ -1,5 +1,5 @@
name=Watchy
version=1.3.1
version=1.4.10
author=SQFMI
maintainer=SQFMI
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
@ -7,4 +7,4 @@ paragraph=This library contains drivers and code samples for Watchy
category=Other
url=https://watchy.sqfmi.com
architectures=esp32
depends=Adafruit GFX Library,Arduino_JSON,DS3232RTC,Rtc_Pcf8563,GxEPD2,WiFiManager
depends=Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager

View File

@ -6,7 +6,8 @@
#define SERVICE_UUID_OTA "86b12865-4b70-4893-8ce6-9864fc00374d"
#define CHARACTERISTIC_UUID_FW "86b12866-4b70-4893-8ce6-9864fc00374d"
#define CHARACTERISTIC_UUID_HW_VERSION "86b12867-4b70-4893-8ce6-9864fc00374d"
#define CHARACTERISTIC_UUID_WATCHFACE_NAME "86b12868-4b70-4893-8ce6-9864fc00374d"
#define CHARACTERISTIC_UUID_WATCHFACE_NAME \
"86b12868-4b70-4893-8ce6-9864fc00374d"
#define FULL_PACKET 512
#define CHARPOS_UPDATE_FLAG 5
@ -22,50 +23,40 @@ int status = -1;
int bytesReceived = 0;
bool updateFlag = false;
class BLECustomServerCallbacks : public BLEServerCallbacks {
void onConnect(BLEServer* pServer) {
status = STATUS_CONNECTED;
};
void onConnect(BLEServer *pServer) { status = STATUS_CONNECTED; };
void onDisconnect(BLEServer* pServer) {
status = STATUS_DISCONNECTED;
}
void onDisconnect(BLEServer *pServer) { status = STATUS_DISCONNECTED; }
};
class otaCallback : public BLECharacteristicCallbacks {
public:
otaCallback(BLE* ble) {
_p_ble = ble;
}
otaCallback(BLE *ble) { _p_ble = ble; }
BLE *_p_ble;
void onWrite(BLECharacteristic *pCharacteristic);
};
void otaCallback::onWrite(BLECharacteristic *pCharacteristic)
{
void otaCallback::onWrite(BLECharacteristic *pCharacteristic) {
std::string rxData = pCharacteristic->getValue();
if (!updateFlag) { // If it's the first packet of OTA since bootup, begin OTA
// Serial.println("Begin FW Update");
esp_ota_begin(esp_ota_get_next_update_partition(NULL), OTA_SIZE_UNKNOWN, &otaHandler);
esp_ota_begin(esp_ota_get_next_update_partition(NULL), OTA_SIZE_UNKNOWN,
&otaHandler);
updateFlag = true;
status = STATUS_UPDATING;
}
if (_p_ble != NULL)
{
if (rxData.length() > 0)
{
if (_p_ble != NULL) {
if (rxData.length() > 0) {
esp_ota_write(otaHandler, rxData.c_str(), rxData.length());
bytesReceived = bytesReceived + rxData.length();
if (rxData.length() != FULL_PACKET)
{
if (rxData.length() != FULL_PACKET) {
esp_ota_end(otaHandler);
// Serial.println("End FW Update");
if (ESP_OK == esp_ota_set_boot_partition(esp_ota_get_next_update_partition(NULL))) {
if (ESP_OK == esp_ota_set_boot_partition(
esp_ota_get_next_update_partition(NULL))) {
status = STATUS_READY;
}
else {
} else {
// Serial.println("Upload Error");
}
}
@ -80,16 +71,11 @@ void otaCallback::onWrite(BLECharacteristic *pCharacteristic)
//
// Constructor
BLE::BLE(void) {
}
BLE::BLE(void) {}
//
// Destructor
BLE::~BLE(void)
{
}
BLE::~BLE(void) {}
//
// begin
@ -107,24 +93,17 @@ bool BLE::begin(const char* localName = "Watchy BLE OTA") {
// Create a BLE Characteristic
pESPOTAIdCharacteristic = pESPOTAService->createCharacteristic(
CHARACTERISTIC_UUID_ID,
BLECharacteristic::PROPERTY_READ
);
CHARACTERISTIC_UUID_ID, BLECharacteristic::PROPERTY_READ);
pVersionCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_HW_VERSION,
BLECharacteristic::PROPERTY_READ
);
CHARACTERISTIC_UUID_HW_VERSION, BLECharacteristic::PROPERTY_READ);
pWatchFaceNameCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_WATCHFACE_NAME,
BLECharacteristic::PROPERTY_READ
);
CHARACTERISTIC_UUID_WATCHFACE_NAME, BLECharacteristic::PROPERTY_READ);
pOtaCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_FW,
BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE
);
BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE);
pOtaCharacteristic->addDescriptor(new BLE2902());
pOtaCharacteristic->setCallbacks(new otaCallback(this));
@ -137,17 +116,15 @@ bool BLE::begin(const char* localName = "Watchy BLE OTA") {
pServer->getAdvertising()->addServiceUUID(SERVICE_UUID_ESPOTA);
pServer->getAdvertising()->start();
uint8_t hardwareVersion[5] = {HARDWARE_VERSION_MAJOR, HARDWARE_VERSION_MINOR, SOFTWARE_VERSION_MAJOR, SOFTWARE_VERSION_MINOR, SOFTWARE_VERSION_PATCH};
uint8_t hardwareVersion[5] = {HARDWARE_VERSION_MAJOR, HARDWARE_VERSION_MINOR,
SOFTWARE_VERSION_MAJOR, SOFTWARE_VERSION_MINOR,
SOFTWARE_VERSION_PATCH};
pVersionCharacteristic->setValue((uint8_t *)hardwareVersion, 5);
pWatchFaceNameCharacteristic->setValue("Watchy 7 Segment");
return true;
}
int BLE::updateStatus(){
return status;
}
int BLE::updateStatus() { return status; }
int BLE::howManyBytes(){
return bytesReceived;
}
int BLE::howManyBytes() { return bytesReceived; }

View File

@ -3,10 +3,10 @@
#include "Arduino.h"
#include <BLE2902.h>
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#include "esp_ota_ops.h"
@ -14,10 +14,8 @@
class BLE;
class BLE
{
class BLE {
public:
BLE(void);
~BLE(void);

File diff suppressed because it is too large Load Diff

502
src/Display.cpp Normal file
View File

@ -0,0 +1,502 @@
// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
//
// based on Demo Example from Good Display, available here: http://www.e-paper-display.com/download_detail/downloadsId=806.html
// Panel: GDEH0154D67 : http://www.e-paper-display.com/products_detail/productId=455.html
// Controller : SSD1681 : http://www.e-paper-display.com/download_detail/downloadsId=825.html
//
// Author: Jean-Marc Zingg
//
// Version: see library.properties
//
// Library: https://github.com/ZinggJM/GxEPD2
//
// The original code from the author has been slightly modified to improve the performance for Watchy Project:
// Link: https://github.com/sqfmi/Watchy
#include "Display.h"
#include "config.h"
RTC_DATA_ATTR bool displayFullInit = true;
void WatchyDisplay::busyCallback(const void *) {
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
esp_light_sleep_start();
}
WatchyDisplay::WatchyDisplay() :
GxEPD2_EPD(DISPLAY_CS, DISPLAY_DC, DISPLAY_RES, DISPLAY_BUSY, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
{
// Setup callback and SPI by default
selectSPI(SPI, SPISettings(20000000, MSBFIRST, SPI_MODE0));
setBusyCallback(busyCallback);
}
void WatchyDisplay::initWatchy() {
// Watchy default initialization
init(0, displayFullInit, 2, true);
}
void WatchyDisplay::asyncPowerOn() {
// This is expensive if unused
if (!waitingPowerOn && !_hibernating) {
_InitDisplay();
_PowerOnAsync();
}
}
void WatchyDisplay::setDarkBorder(bool dark) {
if (_hibernating) return;
darkBorder = dark;
_startTransfer();
_transferCommand(0x3C); // BorderWavefrom
_transfer(dark ? 0x02 : 0x05);
_endTransfer();
}
void WatchyDisplay::clearScreen(uint8_t value)
{
writeScreenBuffer(value);
refresh(true);
writeScreenBufferAgain(value);
}
void WatchyDisplay::writeScreenBuffer(uint8_t value)
{
if (!_using_partial_mode) _Init_Part();
if (_initial_write) _writeScreenBuffer(0x26, value); // set previous
_writeScreenBuffer(0x24, value); // set current
_initial_write = false; // initial full screen buffer clean done
}
void WatchyDisplay::writeScreenBufferAgain(uint8_t value)
{
if (!_using_partial_mode) _Init_Part();
_writeScreenBuffer(0x24, value); // set current
}
void WatchyDisplay::_writeScreenBuffer(uint8_t command, uint8_t value)
{
_startTransfer();
_transferCommand(command);
for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++)
{
_transfer(value);
}
_endTransfer();
}
void WatchyDisplay::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
_writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
_writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm);
_writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
_writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::_writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
#if defined(ESP8266) || defined(ESP32)
yield(); // avoid wdt
#endif
int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded
x -= x % 8; // byte boundary
w = wb * 8; // byte boundary
int16_t x1 = x < 0 ? 0 : x; // limit
int16_t y1 = y < 0 ? 0 : y; // limit
int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
int16_t dx = x1 - x;
int16_t dy = y1 - y;
w1 -= dx;
h1 -= dy;
if ((w1 <= 0) || (h1 <= 0)) return;
if (!_using_partial_mode) _Init_Part();
_setPartialRamArea(x1, y1, w1, h1);
_startTransfer();
_transferCommand(command);
for (int16_t i = 0; i < h1; i++)
{
for (int16_t j = 0; j < w1 / 8; j++)
{
uint8_t data;
// use wb, h of bitmap for index!
int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb;
if (pgm)
{
#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
data = pgm_read_byte(&bitmap[idx]);
#else
data = bitmap[idx];
#endif
}
else
{
data = bitmap[idx];
}
if (invert) data = ~data;
_transfer(data);
}
}
_endTransfer();
#if defined(ESP8266) || defined(ESP32)
yield(); // avoid wdt
#endif
}
void WatchyDisplay::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
_writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
_writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::_writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
#if defined(ESP8266) || defined(ESP32)
yield(); // avoid wdt
#endif
if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return;
if ((x_part < 0) || (x_part >= w_bitmap)) return;
if ((y_part < 0) || (y_part >= h_bitmap)) return;
int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded
x_part -= x_part % 8; // byte boundary
w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit
h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit
x -= x % 8; // byte boundary
w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded
int16_t x1 = x < 0 ? 0 : x; // limit
int16_t y1 = y < 0 ? 0 : y; // limit
int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
int16_t dx = x1 - x;
int16_t dy = y1 - y;
w1 -= dx;
h1 -= dy;
if ((w1 <= 0) || (h1 <= 0)) return;
if (!_using_partial_mode) _Init_Part();
_setPartialRamArea(x1, y1, w1, h1);
_startTransfer();
_transferCommand(command);
for (int16_t i = 0; i < h1; i++)
{
for (int16_t j = 0; j < w1 / 8; j++)
{
uint8_t data;
// use wb_bitmap, h_bitmap of bitmap for index!
int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap;
if (pgm)
{
#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
data = pgm_read_byte(&bitmap[idx]);
#else
data = bitmap[idx];
#endif
}
else
{
data = bitmap[idx];
}
if (invert) data = ~data;
_transfer(data);
}
}
_endTransfer();
#if defined(ESP8266) || defined(ESP32)
yield(); // avoid wdt
#endif
}
void WatchyDisplay::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (black)
{
writeImage(black, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (black)
{
writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (data1)
{
writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
refresh(x, y, w, h);
writeImageAgain(bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
refresh(x, y, w, h);
writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
}
void WatchyDisplay::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (black)
{
drawImage(black, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (black)
{
drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
if (data1)
{
drawImage(data1, x, y, w, h, invert, mirror_y, pgm);
}
}
void WatchyDisplay::refresh(bool partial_update_mode)
{
if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT);
else
{
if (_using_partial_mode) _Init_Full();
_Update_Full();
_initial_refresh = false; // initial full update done
}
}
void WatchyDisplay::refresh(int16_t x, int16_t y, int16_t w, int16_t h)
{
if (_initial_refresh) return refresh(false); // initial update needs be full update
// intersection with screen
int16_t w1 = x < 0 ? w + x : w; // reduce
int16_t h1 = y < 0 ? h + y : h; // reduce
int16_t x1 = x < 0 ? 0 : x; // limit
int16_t y1 = y < 0 ? 0 : y; // limit
w1 = x1 + w1 < int16_t(WIDTH) ? w1 : int16_t(WIDTH) - x1; // limit
h1 = y1 + h1 < int16_t(HEIGHT) ? h1 : int16_t(HEIGHT) - y1; // limit
if ((w1 <= 0) || (h1 <= 0)) return;
// make x1, w1 multiple of 8
w1 += x1 % 8;
if (w1 % 8 > 0) w1 += 8 - w1 % 8;
x1 -= x1 % 8;
if (!_using_partial_mode) _Init_Part();
_setPartialRamArea(x1, y1, w1, h1);
_Update_Part();
}
void WatchyDisplay::powerOff()
{
_PowerOff();
}
void WatchyDisplay::hibernate()
{
//_PowerOff(); // Not needed before entering deep sleep
if (_rst >= 0)
{
_writeCommand(0x10); // deep sleep mode
_writeData(0x1); // enter deep sleep
_hibernating = true;
}
}
void WatchyDisplay::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
{
_startTransfer();
_transferCommand(0x11); // set ram entry mode
_transfer(0x03); // x increase, y increase : normal mode
_transferCommand(0x44);
_transfer(x / 8);
_transfer((x + w - 1) / 8);
_transferCommand(0x45);
_transfer(y % 256);
_transfer(y / 256);
_transfer((y + h - 1) % 256);
_transfer((y + h - 1) / 256);
_transferCommand(0x4e);
_transfer(x / 8);
_transferCommand(0x4f);
_transfer(y % 256);
_transfer(y / 256);
_endTransfer();
}
void WatchyDisplay::_PowerOnAsync()
{
if (_power_is_on)
return;
_startTransfer();
_transferCommand(0x22);
_transfer(0xf8);
_transferCommand(0x20);
_endTransfer();
waitingPowerOn = true;
_power_is_on = true;
}
void WatchyDisplay::_PowerOn()
{
if (waitingPowerOn)
{
waitingPowerOn = false;
_waitWhileBusy("_PowerOn", power_on_time);
}
if (_power_is_on)
return;
_startTransfer();
_transferCommand(0x22);
_transfer(0xf8);
_transferCommand(0x20);
_endTransfer();
_waitWhileBusy("_PowerOn", power_on_time);
_power_is_on = true;
}
void WatchyDisplay::_PowerOff()
{
if (waitingPowerOn)
{
waitingPowerOn = false;
_waitWhileBusy("_PowerOn", power_on_time);
}
if (!_power_is_on)
return;
_startTransfer();
_transferCommand(0x22);
_transfer(0x83);
_transferCommand(0x20);
_endTransfer();
_waitWhileBusy("_PowerOff", power_off_time);
_power_is_on = false;
_using_partial_mode = false;
}
void WatchyDisplay::_InitDisplay()
{
if (_hibernating) _reset();
// No need to soft reset, the Display goes to same state after hard reset
// _writeCommand(0x12); // soft reset
// _waitWhileBusy("_SoftReset", 10); // 10ms max according to specs*/
_startTransfer();
_transferCommand(0x01); // Driver output control
_transfer(0xC7);
_transfer(0x00);
_transfer(0x00);
if (reduceBoosterTime) {
// SSD1675B controller datasheet
_transferCommand(0x0C); // BOOSTER_SOFT_START_CONTROL
// Set the driving strength of GDR for all phases to maximun 0b111 -> 0xF
// Set the minimum off time of GDR to minimum 0x4 (values below sould be same)
_transfer(0xF4); // Phase1 Default value 0x8B
_transfer(0xF4); // Phase2 Default value 0x9C
_transfer(0xF4); // Phase3 Default value 0x96
_transfer(0x00); // Duration of phases, Default 0xF = 0b00 11 11 (40ms Phase 1/2, 10ms Phase 3)
}
_transferCommand(0x18); // Read built-in temperature sensor
_transfer(0x80);
_endTransfer();
setDarkBorder(darkBorder);
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
}
void WatchyDisplay::_reset()
{
// Call default method if not configured the same way
if (_rst < 0 || !_pulldown_rst_mode) {
GxEPD2_EPD::_reset();
return;
}
digitalWrite(_rst, LOW);
pinMode(_rst, OUTPUT);
delay(_reset_duration);
pinMode(_rst, INPUT_PULLUP);
// Tested calling _powerOn() inmediately, and works ok, no need to sleep
// delay(_reset_duration > 10 ? _reset_duration : 0);
_hibernating = false;
}
void WatchyDisplay::_Init_Full()
{
_InitDisplay();
_PowerOn();
_using_partial_mode = false;
}
void WatchyDisplay::_Init_Part()
{
_InitDisplay();
_PowerOn();
_using_partial_mode = true;
}
void WatchyDisplay::_Update_Full()
{
_startTransfer();
_transferCommand(0x22);
_transfer(0xf4);
_transferCommand(0x20);
_endTransfer();
_waitWhileBusy("_Update_Full", full_refresh_time);
displayFullInit = false;
}
void WatchyDisplay::_Update_Part()
{
_startTransfer();
_transferCommand(0x22);
//_transfer(0xcc); // skip temperature load (-5ms)
_transfer(0xfc);
_transferCommand(0x20);
_endTransfer();
_waitWhileBusy("_Update_Part", partial_refresh_time);
}
void WatchyDisplay::_transferCommand(uint8_t value)
{
if (_dc >= 0) digitalWrite(_dc, LOW);
SPI.transfer(value);
if (_dc >= 0) digitalWrite(_dc, HIGH);
}

97
src/Display.h Normal file
View File

@ -0,0 +1,97 @@
// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
//
// based on Demo Example from Good Display, available here: http://www.e-paper-display.com/download_detail/downloadsId=806.html
// Panel: GDEH0154D67 : http://www.e-paper-display.com/products_detail/productId=455.html
// Controller : SSD1681 : http://www.e-paper-display.com/download_detail/downloadsId=825.html
//
// Author: Jean-Marc Zingg
//
// Version: see library.properties
//
// Library: https://github.com/ZinggJM/GxEPD2
//
// The original code from the author has been slightly modified to improve the performance for Watchy Project:
// Link: https://github.com/sqfmi/Watchy
#pragma once
#include <GxEPD2_EPD.h>
class WatchyDisplay : public GxEPD2_EPD
{
public:
// attributes
static const uint16_t WIDTH = 200;
static const uint16_t WIDTH_VISIBLE = WIDTH;
static const uint16_t HEIGHT = 200;
static const GxEPD2::Panel panel = GxEPD2::GDEH0154D67;
static const bool hasColor = false;
static const bool hasPartialUpdate = true;
static const bool hasFastPartialUpdate = true;
static const uint16_t power_on_time = 100; // ms, e.g. 95583us
static const uint16_t power_off_time = 150; // ms, e.g. 140621us
static const uint16_t full_refresh_time = 2600; // ms, e.g. 2509602us
static const uint16_t partial_refresh_time = 500; // ms, e.g. 457282us
// constructor
WatchyDisplay();
void initWatchy();
void setDarkBorder(bool darkBorder);
void asyncPowerOn();
void _PowerOnAsync();
bool waitingPowerOn = false;
static void busyCallback(const void *);
// methods (virtual)
// Support for Bitmaps (Sprites) to Controller Buffer and to Screen
void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white)
void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white)
// write to controller memory, without screen refresh; x and w should be multiple of 8
void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
// for differential update: set current and previous buffers equal (for fast partial update to work correctly)
void writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
// write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
// write to controller memory, with screen refresh; x and w should be multiple of 8
void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
// write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
bool darkBorder = false; // adds a dark border outside the normal screen area
static constexpr bool reduceBoosterTime = true; // Saves ~200ms
private:
void _writeScreenBuffer(uint8_t command, uint8_t value);
void _writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void _writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
void _PowerOn();
void _PowerOff();
void _InitDisplay();
void _Init_Full();
void _Init_Part();
void _Update_Full();
void _Update_Part();
void _reset();
void _transferCommand(uint8_t command);
};

View File

@ -1,7 +1,8 @@
#include "Watchy.h"
WatchyRTC Watchy::RTC;
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> Watchy::display(GxEPD2_154_D67(CS, DC, RESET, BUSY));
GxEPD2_BW<WatchyDisplay, WatchyDisplay::HEIGHT> Watchy::display(
WatchyDisplay{});
RTC_DATA_ATTR int guiState;
RTC_DATA_ATTR int menuIndex;
@ -10,7 +11,11 @@ RTC_DATA_ATTR bool WIFI_CONFIGURED;
RTC_DATA_ATTR bool BLE_CONFIGURED;
RTC_DATA_ATTR weatherData currentWeather;
RTC_DATA_ATTR int weatherIntervalCounter = -1;
RTC_DATA_ATTR bool displayFullInit = true;
RTC_DATA_ATTR long gmtOffset = 0;
RTC_DATA_ATTR bool alreadyInMenu = true;
RTC_DATA_ATTR tmElements_t bootTime;
RTC_DATA_ATTR uint32_t lastIPAddress;
RTC_DATA_ATTR char lastSSID[30];
void Watchy::init(String datetime) {
esp_sleep_wakeup_cause_t wakeup_reason;
@ -18,16 +23,31 @@ void Watchy::init(String datetime){
Wire.begin(SDA, SCL); // init i2c
RTC.init();
// Init the display here for all cases, if unused, it will do nothing
display.init(0, displayFullInit, 10, true); // 10ms by spec, and fast pulldown reset
display.epd2.setBusyCallback(displayBusyCallback);
// Init the display since is almost sure we will use it
display.epd2.initWatchy();
switch (wakeup_reason)
{
switch (wakeup_reason) {
case ESP_SLEEP_WAKEUP_EXT0: // RTC Alarm
if(guiState == WATCHFACE_STATE){
RTC.read(currentTime);
switch (guiState) {
case WATCHFACE_STATE:
showWatchFace(true); // partial updates on tick
if (settings.vibrateOClock) {
if (currentTime.Minute == 0) {
// The RTC wakes us up once per minute
vibMotor(75, 4);
}
}
break;
case MAIN_MENU_STATE:
// Return to watchface if in menu for more than one tick
if (alreadyInMenu) {
guiState = WATCHFACE_STATE;
showWatchFace(false);
} else {
alreadyInMenu = true;
}
break;
}
break;
case ESP_SLEEP_WAKEUP_EXT1: // button Press
@ -36,29 +56,33 @@ void Watchy::init(String datetime){
default: // reset
RTC.config(datetime);
_bmaConfig();
gmtOffset = settings.gmtOffset;
RTC.read(currentTime);
RTC.read(bootTime);
showWatchFace(false); // full update on reset
vibMotor(75, 4);
// For some reason, seems to be enabled on first boot
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
break;
}
deepSleep();
}
void Watchy::displayBusyCallback(const void*){
gpio_wakeup_enable((gpio_num_t)BUSY, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
esp_light_sleep_start();
}
void Watchy::deepSleep() {
display.hibernate();
displayFullInit = false; // Notify not to init it again
RTC.clearAlarm(); // resets the alarm flag in the RTC
// Set pins 0-39 to input to avoid power leaking out
for(int i=0; i<40; i++) {
// Set GPIOs 0-39 to input to avoid power leaking out
const uint64_t ignore = 0b11110001000000110000100111000010; // Ignore some GPIOs due to resets
for (int i = 0; i < GPIO_NUM_MAX; i++) {
if ((ignore >> i) & 0b1)
continue;
pinMode(i, INPUT);
}
esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
esp_sleep_enable_ext0_wakeup((gpio_num_t)RTC_INT_PIN,
0); // enable deep sleep wake on RTC interrupt
esp_sleep_enable_ext1_wakeup(
BTN_PIN_MASK,
ESP_EXT1_WAKEUP_ANY_HIGH); // enable deep sleep wake on button press
esp_deep_sleep_start();
}
@ -66,13 +90,14 @@ void Watchy::handleButtonPress(){
uint64_t wakeupBit = esp_sleep_get_ext1_wakeup_status();
// Menu Button
if (wakeupBit & MENU_BTN_MASK) {
if(guiState == WATCHFACE_STATE){//enter menu state if coming from watch face
if (guiState ==
WATCHFACE_STATE) { // enter menu state if coming from watch face
showMenu(menuIndex, false);
}else if(guiState == MAIN_MENU_STATE){//if already in menu, then select menu item
switch(menuIndex)
{
} else if (guiState ==
MAIN_MENU_STATE) { // if already in menu, then select menu item
switch (menuIndex) {
case 0:
showBattery();
showAbout();
break;
case 1:
showBuzz();
@ -150,11 +175,11 @@ void Watchy::handleButtonPress(){
} else {
if (digitalRead(MENU_BTN_PIN) == 1) {
lastTimeout = millis();
if(guiState == MAIN_MENU_STATE){//if already in menu, then select menu item
switch(menuIndex)
{
if (guiState ==
MAIN_MENU_STATE) { // if already in menu, then select menu item
switch (menuIndex) {
case 0:
showBattery();
showAbout();
break;
case 1:
showBuzz();
@ -182,7 +207,8 @@ void Watchy::handleButtonPress(){
}
} else if (digitalRead(BACK_BTN_PIN) == 1) {
lastTimeout = millis();
if(guiState == MAIN_MENU_STATE){//exit to watch face if already in menu
if (guiState ==
MAIN_MENU_STATE) { // exit to watch face if already in menu
RTC.read(currentTime);
showWatchFace(false);
break; // leave loop
@ -223,7 +249,10 @@ void Watchy::showMenu(byte menuIndex, bool partialRefresh){
uint16_t w, h;
int16_t yPos;
const char *menuItems[] = {"Check Battery", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
const char *menuItems[] = {
"About Watchy", "Vibrate Motor", "Show Accelerometer",
"Set Time", "Setup WiFi", "Update Firmware",
"Sync NTP"};
for (int i = 0; i < MENU_LENGTH; i++) {
yPos = MENU_HEIGHT + (MENU_HEIGHT * i);
display.setCursor(0, yPos);
@ -241,6 +270,7 @@ void Watchy::showMenu(byte menuIndex, bool partialRefresh){
display.display(partialRefresh);
guiState = MAIN_MENU_STATE;
alreadyInMenu = false;
}
void Watchy::showFastMenu(byte menuIndex) {
@ -252,7 +282,10 @@ void Watchy::showFastMenu(byte menuIndex){
uint16_t w, h;
int16_t yPos;
const char *menuItems[] = {"Check Battery", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
const char *menuItems[] = {
"About Watchy", "Vibrate Motor", "Show Accelerometer",
"Set Time", "Setup WiFi", "Update Firmware",
"Sync NTP"};
for (int i = 0; i < MENU_LENGTH; i++) {
yPos = MENU_HEIGHT + (MENU_HEIGHT * i);
display.setCursor(0, yPos);
@ -272,17 +305,47 @@ void Watchy::showFastMenu(byte menuIndex){
guiState = MAIN_MENU_STATE;
}
void Watchy::showBattery(){
void Watchy::showAbout() {
display.setFullWindow();
display.fillScreen(GxEPD_BLACK);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_WHITE);
display.setCursor(20, 30);
display.println("Battery Voltage:");
display.setCursor(0, 20);
display.print("LibVer: ");
display.println(WATCHY_LIB_VER);
display.print("Rev: v");
display.println(getBoardRevision());
display.print("Batt: ");
float voltage = getBatteryVoltage();
display.setCursor(70, 80);
display.print(voltage);
display.println("V");
display.print("Uptime: ");
RTC.read(currentTime);
time_t b = makeTime(bootTime);
time_t c = makeTime(currentTime);
int totalSeconds = c-b;
//int seconds = (totalSeconds % 60);
int minutes = (totalSeconds % 3600) / 60;
int hours = (totalSeconds % 86400) / 3600;
int days = (totalSeconds % (86400 * 30)) / 86400;
display.print(days);
display.print("d");
display.print(hours);
display.print("h");
display.print(minutes);
display.println("m");
if(WIFI_CONFIGURED){
display.print("SSID: ");
display.println(lastSSID);
display.print("IP: ");
display.println(IPAddress(lastIPAddress).toString());
}else{
display.println("WiFi Not Connected");
}
display.display(false); // full refresh
guiState = APP_STATE;
@ -464,7 +527,6 @@ void Watchy::setTime(){
RTC.set(tm);
showMenu(menuIndex, false);
}
void Watchy::showAccelerometer() {
@ -500,9 +562,12 @@ void Watchy::showAccelerometer(){
if (res == false) {
display.println("getAccel FAIL");
} else {
display.print(" X:"); display.println(acc.x);
display.print(" Y:"); display.println(acc.y);
display.print(" Z:"); display.println(acc.z);
display.print(" X:");
display.println(acc.x);
display.print(" Y:");
display.println(acc.y);
display.print(" Z:");
display.println(acc.z);
display.setCursor(30, 130);
switch (direction) {
@ -528,7 +593,6 @@ void Watchy::showAccelerometer(){
display.println("ERROR!!!");
break;
}
}
display.display(true); // full refresh
}
@ -539,6 +603,8 @@ void Watchy::showAccelerometer(){
void Watchy::showWatchFace(bool partialRefresh) {
display.setFullWindow();
// At this point it is sure we are going to update
display.epd2.asyncPowerOn();
drawWatchFace();
display.display(partialRefresh); // partial refresh
guiState = WATCHFACE_STATE;
@ -559,27 +625,50 @@ void Watchy::drawWatchFace(){
}
weatherData Watchy::getWeatherData() {
return getWeatherData(settings.cityID, settings.weatherUnit, settings.weatherLang, settings.weatherURL, settings.weatherAPIKey, settings.weatherUpdateInterval);
return _getWeatherData(settings.cityID, settings.lat, settings.lon,
settings.weatherUnit, settings.weatherLang, settings.weatherURL,
settings.weatherAPIKey, settings.weatherUpdateInterval);
}
weatherData Watchy::getWeatherData(String cityID, String units, String lang, String url, String apiKey, uint8_t updateInterval){
weatherData Watchy::_getWeatherData(String cityID, String lat, String lon, String units, String lang,
String url, String apiKey,
uint8_t updateInterval) {
currentWeather.isMetric = units == String("metric");
if (weatherIntervalCounter < 0) { //-1 on first run, set to updateInterval
weatherIntervalCounter = updateInterval;
}
if(weatherIntervalCounter >= updateInterval){ //only update if WEATHER_UPDATE_INTERVAL has elapsed i.e. 30 minutes
if (weatherIntervalCounter >=
updateInterval) { // only update if WEATHER_UPDATE_INTERVAL has elapsed
// i.e. 30 minutes
if (connectWiFi()) {
HTTPClient http; // Use Weather API for live data if WiFi is connected
http.setConnectTimeout(3000); // 3 second max timeout
String weatherQueryURL = url + cityID + String("&units=") + units + String("&lang=") + lang + String("&appid=") + apiKey;
String weatherQueryURL = url;
if(cityID != ""){
weatherQueryURL.replace("{cityID}", cityID);
}else{
weatherQueryURL.replace("{lat}", lat);
weatherQueryURL.replace("{lon}", lon);
}
weatherQueryURL.replace("{units}", units);
weatherQueryURL.replace("{lang}", lang);
weatherQueryURL.replace("{apiKey}", apiKey);
http.begin(weatherQueryURL.c_str());
int httpResponseCode = http.GET();
if (httpResponseCode == 200) {
String payload = http.getString();
JSONVar responseObject = JSON.parse(payload);
currentWeather.temperature = int(responseObject["main"]["temp"]);
currentWeather.isMetric = settings.weatherUnit == String("metric");
currentWeather.weatherConditionCode = int(responseObject["weather"][0]["id"]);
currentWeather.weatherDescription = responseObject["weather"][0]["main"];
currentWeather.weatherConditionCode =
int(responseObject["weather"][0]["id"]);
currentWeather.weatherDescription =
JSONVar::stringify(responseObject["weather"][0]["main"]);
currentWeather.external = true;
breakTime((time_t)(int)responseObject["sys"]["sunrise"], currentWeather.sunrise);
breakTime((time_t)(int)responseObject["sys"]["sunset"], currentWeather.sunset);
// sync NTP during weather API call and use timezone of lat & lon
gmtOffset = int(responseObject["timezone"]);
syncNTP(gmtOffset);
} else {
// http error
}
@ -589,11 +678,12 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, Str
btStop();
} else { // No WiFi, use internal temperature sensor
uint8_t temperature = sensor.readTemperature(); // celsius
if(units != String("metric")){
if (!currentWeather.isMetric) {
temperature = temperature * 9. / 5. + 32.; // fahrenheit
}
currentWeather.temperature = temperature;
currentWeather.weatherConditionCode = 800;
currentWeather.external = false;
}
weatherIntervalCounter = 0;
} else {
@ -604,14 +694,40 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, Str
float Watchy::getBatteryVoltage() {
if (RTC.rtcType == DS3231) {
return analogReadMilliVolts(V10_ADC_PIN) / 1000.0f * 2.0f; // Battery voltage goes through a 1/2 divider.
return analogReadMilliVolts(BATT_ADC_PIN) / 1000.0f *
2.0f; // Battery voltage goes through a 1/2 divider.
} else {
return analogReadMilliVolts(V15_ADC_PIN) / 1000.0f * 2.0f;
return analogReadMilliVolts(BATT_ADC_PIN) / 1000.0f * 2.0f;
}
}
uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len)
{
uint8_t Watchy::getBoardRevision() {
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
if(chip_info.model == CHIP_ESP32){ //Revision 1.0 - 2.0
Wire.beginTransmission(0x68); //v1.0 has DS3231
if (Wire.endTransmission() == 0){
return 10;
}
delay(1);
Wire.beginTransmission(0x51); //v1.5 and v2.0 have PCF8563
if (Wire.endTransmission() == 0){
pinMode(35, INPUT);
if(digitalRead(35) == 0){
return 20; //in rev 2.0, pin 35 is BTN 3 and has a pulldown
}else{
return 15; //in rev 1.5, pin 35 is the battery ADC
}
}
}
if(chip_info.model == CHIP_ESP32S3){ //Revision 3.0
return 30;
}
return -1;
}
uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data,
uint16_t len) {
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
@ -623,8 +739,8 @@ uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint
return 0;
}
uint16_t Watchy::_writeRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len)
{
uint16_t Watchy::_writeRegister(uint8_t address, uint8_t reg, uint8_t *data,
uint16_t len) {
Wire.beginTransmission(address);
Wire.write(reg);
Wire.write(data, len);
@ -741,14 +857,20 @@ void Watchy::setupWifi(){
display.println("Setup failed &");
display.println("timed out!");
} else {
display.println("Connected to");
display.println("Connected to:");
display.println(WiFi.SSID());
display.println("Local IP:");
display.println(WiFi.localIP());
weatherIntervalCounter = -1; // Reset to force weather to be read again
lastIPAddress = WiFi.localIP();
WiFi.SSID().toCharArray(lastSSID, 30);
}
display.display(false); // full refresh
// turn off radios
WiFi.mode(WIFI_OFF);
btStop();
display.epd2.setBusyCallback(displayBusyCallback); //enable lightsleep on busy
// enable lightsleep on busy
display.epd2.setBusyCallback(WatchyDisplay::busyCallback);
guiState = APP_STATE;
}
@ -763,14 +885,21 @@ void Watchy::_configModeCallback (WiFiManager *myWiFiManager) {
display.println(WIFI_AP_SSID);
display.print("IP: ");
display.println(WiFi.softAPIP());
display.println("MAC address:");
display.println(WiFi.softAPmacAddress().c_str());
display.display(false); // full refresh
}
bool Watchy::connectWiFi() {
if(WL_CONNECT_FAILED == WiFi.begin()){//WiFi not setup, you can also use hard coded credentials with WiFi.begin(SSID,PASS);
if (WL_CONNECT_FAILED ==
WiFi.begin()) { // WiFi not setup, you can also use hard coded credentials
// with WiFi.begin(SSID,PASS);
WIFI_CONFIGURED = false;
} else {
if(WL_CONNECTED == WiFi.waitForConnectResult()){//attempt to connect for 10s
if (WL_CONNECTED ==
WiFi.waitForConnectResult()) { // attempt to connect for 10s
lastIPAddress = WiFi.localIP();
WiFi.SSID().toCharArray(lastSSID, 30);
WIFI_CONFIGURED = true;
} else { // connection failed, time out
WIFI_CONFIGURED = false;
@ -895,10 +1024,32 @@ void Watchy::showSyncNTP(){
display.setTextColor(GxEPD_WHITE);
display.setCursor(0, 30);
display.println("Syncing NTP... ");
display.print("GMT offset: ");
display.println(gmtOffset);
display.display(false); // full refresh
if (connectWiFi()) {
if (syncNTP()) {
display.println("NTP Sync Success");
display.println("NTP Sync Success\n");
display.println("Current Time Is:");
RTC.read(currentTime);
display.print(tmYearToCalendar(currentTime.Year));
display.print("/");
display.print(currentTime.Month);
display.print("/");
display.print(currentTime.Day);
display.print(" - ");
if (currentTime.Hour < 10) {
display.print("0");
}
display.print(currentTime.Hour);
display.print(":");
if (currentTime.Minute < 10) {
display.print("0");
}
display.println(currentTime.Minute);
} else {
display.println("NTP Sync Failed");
}
@ -906,63 +1057,31 @@ void Watchy::showSyncNTP(){
display.println("WiFi Not Configured");
}
display.display(true); // full refresh
delay(1000);
delay(3000);
showMenu(menuIndex, false);
}
bool Watchy::syncNTP(){ //NTP sync - call after connecting to WiFi and remember to turn it back off
return syncNTP(settings.gmtOffset, settings.dstOffset, settings.ntpServer.c_str());
bool Watchy::syncNTP() { // NTP sync - call after connecting to WiFi and
// remember to turn it back off
return syncNTP(gmtOffset,
settings.ntpServer.c_str());
}
bool Watchy::syncNTP(long gmt, int dst, String ntpServer){ //NTP sync - call after connecting to WiFi and remember to turn it back off
configTime(gmt, dst, ntpServer.c_str());
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
bool Watchy::syncNTP(long gmt) {
return syncNTP(gmt, settings.ntpServer.c_str());
}
bool Watchy::syncNTP(long gmt, String ntpServer) {
// NTP sync - call after connecting to
// WiFi and remember to turn it back off
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, ntpServer.c_str(), gmt);
timeClient.begin();
if (!timeClient.forceUpdate()) {
return false; // NTP sync failed
}
/****************************************************
struct tm
{
int tm_sec; // Seconds [0,60].
int tm_min; // Minutes [0,59].
int tm_hour; // Hour [0,23].
int tm_mday; // Day of month [1,31].
int tm_mon; // Month of year [0,11].
int tm_year; // Years since 1900.
int tm_wday; // Day of week [0,6] (Sunday =0).
int tm_yday; // Day of year [0,365].
int tm_isdst; // Daylight Savings flag.
}
****************************************************/
tmElements_t tm;
tm.Year = CalendarYrToTm(timeinfo.tm_year + 1900);
tm.Month = timeinfo.tm_mon + 1; //tm.Month 1 - 12
tm.Day = timeinfo.tm_mday;
tm.Hour = timeinfo.tm_hour;
tm.Minute = timeinfo.tm_min;
tm.Second = timeinfo.tm_sec;
breakTime((time_t)timeClient.getEpochTime(), tm);
RTC.set(tm);
return true;
}
// time_t compileTime()
// {
// const time_t FUDGE(10); //fudge factor to allow for upload time, etc. (seconds, YMMV)
// const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec";
// char compMon[3], *m;
// strncpy(compMon, compDate, 3);
// compMon[3] = '\0';
// m = strstr(months, compMon);
// tmElements_t tm;
// tm.Month = ((m - months) / 3 + 1);
// tm.Day = atoi(compDate + 4);
// tm.Year = atoi(compDate + 7) - YEAR_OFFSET; // offset from 1970, since year is stored in uint8_t
// tm.Hour = atoi(compTime);
// tm.Minute = atoi(compTime + 3);
// tm.Second = atoi(compTime + 6);
// time_t t = makeTime(tm);
// return t + FUDGE; //add fudge factor to allow for compile time
// }

View File

@ -4,26 +4,35 @@
#include <Arduino.h>
#include <WiFiManager.h>
#include <HTTPClient.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <Arduino_JSON.h>
#include <GxEPD2_BW.h>
#include <Wire.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include "DSEG7_Classic_Bold_53.h"
#include "Display.h"
#include "WatchyRTC.h"
#include "BLE.h"
#include "bma.h"
#include "config.h"
#include "esp_chip_info.h"
typedef struct weatherData {
int8_t temperature;
int16_t weatherConditionCode;
bool isMetric;
String weatherDescription;
bool external;
tmElements_t sunrise;
tmElements_t sunset;
} weatherData;
typedef struct watchySettings {
// Weather Settings
String cityID;
String lat;
String lon;
String weatherAPIKey;
String weatherURL;
String weatherUnit;
@ -32,48 +41,55 @@ typedef struct watchySettings{
// NTP Settings
String ntpServer;
int gmtOffset;
int dstOffset;
//
bool vibrateOClock;
} watchySettings;
class Watchy {
public:
static WatchyRTC RTC;
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
static GxEPD2_BW<WatchyDisplay, WatchyDisplay::HEIGHT> display;
tmElements_t currentTime;
watchySettings settings;
public:
explicit Watchy(const watchySettings &s) : settings(s) {} // constructor
void init(String datetime = "");
void deepSleep();
static void displayBusyCallback(const void*);
float getBatteryVoltage();
uint8_t getBoardRevision();
void vibMotor(uint8_t intervalMs = 100, uint8_t length = 20);
void handleButtonPress();
virtual void handleButtonPress();
void showMenu(byte menuIndex, bool partialRefresh);
void showFastMenu(byte menuIndex);
void showBattery();
void showAbout();
void showBuzz();
void showAccelerometer();
void showUpdateFW();
void showSyncNTP();
bool syncNTP();
bool syncNTP(long gmt, int dst, String ntpServer);
bool syncNTP(long gmt);
bool syncNTP(long gmt, String ntpServer);
void setTime();
void setupWifi();
bool connectWiFi();
weatherData getWeatherData();
weatherData getWeatherData(String cityID, String units, String lang, String url, String apiKey, uint8_t updateInterval);
void updateFWBegin();
void showWatchFace(bool partialRefresh);
virtual void drawWatchFace(); //override this method for different watch faces
virtual void drawWatchFace(); // override this method for different watch
// faces
private:
void _bmaConfig();
static void _configModeCallback(WiFiManager *myWiFiManager);
static uint16_t _readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len);
static uint16_t _writeRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len);
static uint16_t _readRegister(uint8_t address, uint8_t reg, uint8_t *data,
uint16_t len);
static uint16_t _writeRegister(uint8_t address, uint8_t reg, uint8_t *data,
uint16_t len);
weatherData _getWeatherData(String cityID, String lat, String lon, String units, String lang,
String url, String apiKey, uint8_t updateInterval);
};
extern RTC_DATA_ATTR int guiState;

View File

@ -1,7 +1,6 @@
#include "WatchyRTC.h"
WatchyRTC::WatchyRTC()
: rtc_ds(false) {}
WatchyRTC::WatchyRTC() : rtc_ds(false) {}
void WatchyRTC::init() {
byte error;
@ -20,7 +19,8 @@ void WatchyRTC::init(){
}
}
void WatchyRTC::config(String datetime){ //String datetime format is YYYY:MM:DD:HH:MM:SS
void WatchyRTC::config(
String datetime) { // String datetime format is YYYY:MM:DD:HH:MM:SS
if (rtcType == DS3231) {
_DSConfig(datetime);
} else {
@ -30,12 +30,15 @@ void WatchyRTC::config(String datetime){ //String datetime format is YYYY:MM:DD:
void WatchyRTC::clearAlarm() {
if (rtcType == DS3231) {
rtc_ds.alarm(ALARM_2);
rtc_ds.alarm(DS3232RTC::ALARM_2);
} else {
int nextAlarmMinute = 0;
rtc_pcf.clearAlarm(); // resets the alarm flag in the RTC
nextAlarmMinute = rtc_pcf.getMinute();
nextAlarmMinute = (nextAlarmMinute == 59) ? 0 : (nextAlarmMinute + 1); //set alarm to trigger 1 minute from now
nextAlarmMinute =
(nextAlarmMinute == 59)
? 0
: (nextAlarmMinute + 1); // set alarm to trigger 1 minute from now
rtc_pcf.setAlarm(nextAlarmMinute, 99, 99, 99);
}
}
@ -44,10 +47,13 @@ void WatchyRTC::read(tmElements_t &tm){
if (rtcType == DS3231) {
rtc_ds.read(tm);
} else {
rtc_pcf.getDate();
tm.Year = y2kYearToTm(rtc_pcf.getYear());
tm.Month = rtc_pcf.getMonth();
tm.Day = rtc_pcf.getDay();
tm.Wday = rtc_pcf.getWeekday() + 1; //TimeLib & DS3231 has Wday range of 1-7, but PCF8563 stores day of week in 0-6 range
tm.Wday =
rtc_pcf.getWeekday() + 1; // TimeLib & DS3231 has Wday range of 1-7, but
// PCF8563 stores day of week in 0-6 range
tm.Hour = rtc_pcf.getHour();
tm.Minute = rtc_pcf.getMinute();
tm.Second = rtc_pcf.getSecond();
@ -62,7 +68,10 @@ void WatchyRTC::set(tmElements_t tm){
time_t t = makeTime(tm); // make and break to calculate tm.Wday
breakTime(t, tm);
// day, weekday, month, century(1=1900, 0=2000), year(0-99)
rtc_pcf.setDate(tm.Day, tm.Wday - 1, tm.Month, 0, tmYearToY2k(tm.Year)); //TimeLib & DS3231 has Wday range of 1-7, but PCF8563 stores day of week in 0-6 range
rtc_pcf.setDate(
tm.Day, tm.Wday - 1, tm.Month, 0,
tmYearToY2k(tm.Year)); // TimeLib & DS3231 has Wday range of 1-7, but
// PCF8563 stores day of week in 0-6 range
// hr, min, sec
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
clearAlarm();
@ -77,10 +86,12 @@ uint8_t WatchyRTC::temperature(){
}
}
void WatchyRTC::_DSConfig(String datetime){ //String datetime is YYYY:MM:DD:HH:MM:SS
void WatchyRTC::_DSConfig(
String datetime) { // String datetime is YYYY:MM:DD:HH:MM:SS
if (datetime != "") {
tmElements_t tm;
tm.Year = CalendarYrToTm(_getValue(datetime, ':', 0).toInt()); //YYYY - 1970
tm.Year = CalendarYrToTm(_getValue(datetime, ':', 0).toInt()); // YYYY -
// 1970
tm.Month = _getValue(datetime, ':', 1).toInt();
tm.Day = _getValue(datetime, ':', 2).toInt();
tm.Hour = _getValue(datetime, ':', 3).toInt();
@ -90,15 +101,18 @@ void WatchyRTC::_DSConfig(String datetime){ //String datetime is YYYY:MM:DD:HH:M
rtc_ds.set(t);
}
// https://github.com/JChristensen/DS3232RTC
rtc_ds.squareWave(SQWAVE_NONE); //disable square wave output
rtc_ds.setAlarm(ALM2_EVERY_MINUTE, 0, 0, 0, 0); //alarm wakes up Watchy every minute
rtc_ds.alarmInterrupt(ALARM_2, true); //enable alarm interrupt
rtc_ds.squareWave(DS3232RTC::SQWAVE_NONE); // disable square wave output
rtc_ds.setAlarm(DS3232RTC::ALM2_EVERY_MINUTE, 0, 0, 0,
0); // alarm wakes up Watchy every minute
rtc_ds.alarmInterrupt(DS3232RTC::ALARM_2, true); // enable alarm interrupt
}
void WatchyRTC::_PCFConfig(String datetime){ //String datetime is YYYY:MM:DD:HH:MM:SS
void WatchyRTC::_PCFConfig(
String datetime) { // String datetime is YYYY:MM:DD:HH:MM:SS
if (datetime != "") {
tmElements_t tm;
tm.Year = CalendarYrToTm(_getValue(datetime, ':', 0).toInt()); //YYYY - 1970
tm.Year = CalendarYrToTm(_getValue(datetime, ':', 0).toInt()); // YYYY -
// 1970
tm.Month = _getValue(datetime, ':', 1).toInt();
tm.Day = _getValue(datetime, ':', 2).toInt();
tm.Hour = _getValue(datetime, ':', 3).toInt();
@ -107,16 +121,19 @@ void WatchyRTC::_PCFConfig(String datetime){ //String datetime is YYYY:MM:DD:HH:
time_t t = makeTime(tm); // make and break to calculate tm.Wday
breakTime(t, tm);
// day, weekday, month, century(1=1900, 0=2000), year(0-99)
rtc_pcf.setDate(tm.Day, tm.Wday - 1, tm.Month, 0, tmYearToY2k(tm.Year)); //TimeLib & DS3231 has Wday range of 1-7, but PCF8563 stores day of week in 0-6 range
rtc_pcf.setDate(
tm.Day, tm.Wday - 1, tm.Month, 0,
tmYearToY2k(tm.Year)); // TimeLib & DS3231 has Wday range of 1-7, but
// PCF8563 stores day of week in 0-6 range
// hr, min, sec
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
}
//on POR event, PCF8563 sets month to 0, which will give an error since months are 1-12
// on POR event, PCF8563 sets month to 0, which will give an error since
// months are 1-12
clearAlarm();
}
String WatchyRTC::_getValue(String data, char separator, int index)
{
String WatchyRTC::_getValue(String data, char separator, int index) {
int found = 0;
int strIndex[] = {0, -1};
int maxIndex = data.length() - 1;

View File

@ -1,13 +1,13 @@
#ifndef WATCHY_RTC_H
#define WATCHY_RTC_H
#include <DS3232RTC.h>
#include <Rtc_Pcf8563.h>
#include "config.h"
#include "time.h"
#include <DS3232RTC.h>
#include <Rtc_Pcf8563.h>
#define DS3231 0
#define PCF8563 1
#define DS3231 1
#define PCF8563 2
#define RTC_DS_ADDR 0x68
#define RTC_PCF_ADDR 0x51
#define YEAR_OFFSET_DS 1970
@ -18,6 +18,7 @@ class WatchyRTC {
DS3232RTC rtc_ds;
Rtc_Pcf8563 rtc_pcf;
uint8_t rtcType;
public:
WatchyRTC();
void init();
@ -26,6 +27,7 @@ class WatchyRTC {
void read(tmElements_t &tm);
void set(tmElements_t tm);
uint8_t temperature();
private:
void _DSConfig(String datetime);
void _PCFConfig(String datetime);

View File

@ -7,28 +7,20 @@
#define DEBUG(...)
#endif
BMA423::BMA423()
{
BMA423::BMA423() {
__readRegisterFptr = nullptr;
__writeRegisterFptr = nullptr;
__delayCallBlackFptr = nullptr;
__init = false;
}
BMA423::~BMA423()
{
}
BMA423::~BMA423() {}
bool BMA423::begin(bma4_com_fptr_t readCallBlack,
bma4_com_fptr_t writeCallBlack,
bma4_delay_fptr_t delayCallBlack,
uint8_t address)
{
bma4_delay_fptr_t delayCallBlack, uint8_t address) {
if (__init ||
readCallBlack == nullptr ||
writeCallBlack == nullptr ||
if (__init || readCallBlack == nullptr || writeCallBlack == nullptr ||
delayCallBlack == nullptr) {
return true;
}
@ -69,7 +61,6 @@ bool BMA423::begin(bma4_com_fptr_t readCallBlack,
config.output_en = BMA4_OUTPUT_ENABLE;
config.input_en = BMA4_INPUT_DISABLE;
if (bma4_set_int_pin_config(&config, BMA4_INTR1_MAP, &__devFptr) != BMA4_OK) {
DEBUG("BMA423 SET INT FAIL\n");
return false;
@ -77,50 +68,41 @@ bool BMA423::begin(bma4_com_fptr_t readCallBlack,
return true;
}
void BMA423::softReset()
{
void BMA423::softReset() {
uint8_t reg = BMA4_RESET_ADDR;
__writeRegisterFptr(BMA4_I2C_ADDR_PRIMARY, BMA4_RESET_SET_MASK, &reg, 1);
}
void BMA423::shutDown()
{
void BMA423::shutDown() {
bma4_set_advance_power_save(BMA4_DISABLE, &__devFptr);
}
void BMA423::wakeUp()
{
bma4_set_advance_power_save(BMA4_ENABLE, &__devFptr);
}
void BMA423::wakeUp() { bma4_set_advance_power_save(BMA4_ENABLE, &__devFptr); }
uint16_t BMA423::getErrorCode()
{
uint16_t BMA423::getErrorCode() {
struct bma4_err_reg err;
uint16_t rslt = bma4_get_error_status(&err, &__devFptr);
return rslt;
}
uint16_t BMA423::getStatus()
{
uint16_t BMA423::getStatus() {
uint8_t status;
bma4_get_status(&status, &__devFptr);
return status;
}
uint32_t BMA423::getSensorTime()
{
uint32_t BMA423::getSensorTime() {
uint32_t ms;
bma4_get_sensor_time(&ms, &__devFptr);
return ms;
}
bool BMA423::selfTest()
{
return (BMA4_OK == bma4_selftest_config(BMA4_ACCEL_SELFTEST_ENABLE_MSK, &__devFptr));
bool BMA423::selfTest() {
return (BMA4_OK ==
bma4_selftest_config(BMA4_ACCEL_SELFTEST_ENABLE_MSK, &__devFptr));
}
uint8_t BMA423::getDirection()
{
uint8_t BMA423::getDirection() {
Accel acc;
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
return 0;
@ -150,8 +132,7 @@ uint8_t BMA423::getDirection()
}
}
float BMA423::readTemperature()
{
float BMA423::readTemperature() {
int32_t data = 0;
bma4_get_temperature(&data, BMA4_DEG, &__devFptr);
float res = (float)data / (float)BMA4_SCALE_TEMP;
@ -164,9 +145,7 @@ float BMA423::readTemperature()
return res;
}
float BMA423::readTemperatureF()
{
float BMA423::readTemperatureF() {
float temp = readTemperature();
if (temp != 0) {
temp = temp * 1.8 + 32.0;
@ -174,8 +153,7 @@ float BMA423::readTemperatureF()
return (temp);
}
bool BMA423::getAccel(Accel &acc)
{
bool BMA423::getAccel(Accel &acc) {
memset(&acc, 0, sizeof(acc));
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
return false;
@ -183,45 +161,36 @@ bool BMA423::getAccel(Accel &acc)
return true;
}
bool BMA423::getAccelEnable()
{
bool BMA423::getAccelEnable() {
uint8_t en;
bma4_get_accel_enable(&en, &__devFptr);
return (en & BMA4_ACCEL_ENABLE_POS) == BMA4_ACCEL_ENABLE_POS;
}
bool BMA423::disableAccel()
{
return enableAccel(false);
bool BMA423::disableAccel() { return enableAccel(false); }
bool BMA423::enableAccel(bool en) {
return (BMA4_OK ==
bma4_set_accel_enable(en ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr));
}
bool BMA423::enableAccel(bool en)
{
return (BMA4_OK == bma4_set_accel_enable(en ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr));
}
bool BMA423::setAccelConfig(Acfg &cfg)
{
bool BMA423::setAccelConfig(Acfg &cfg) {
return (BMA4_OK == bma4_set_accel_config(&cfg, &__devFptr));
}
bool BMA423::getAccelConfig(Acfg &cfg)
{
bool BMA423::getAccelConfig(Acfg &cfg) {
return (BMA4_OK == bma4_get_accel_config(&cfg, &__devFptr));
}
bool BMA423::setRemapAxes(struct bma423_axes_remap *remap_data)
{
bool BMA423::setRemapAxes(struct bma423_axes_remap *remap_data) {
return (BMA4_OK == bma423_set_remap_axes(remap_data, &__devFptr));
}
bool BMA423::resetStepCounter()
{
bool BMA423::resetStepCounter() {
return BMA4_OK == bma423_reset_step_counter(&__devFptr);
}
uint32_t BMA423::getCounter()
{
uint32_t BMA423::getCounter() {
uint32_t stepCount;
if (bma423_step_counter_output(&stepCount, &__devFptr) == BMA4_OK) {
return stepCount;
@ -229,91 +198,76 @@ uint32_t BMA423::getCounter()
return 0;
}
bool BMA423::setINTPinConfig(struct bma4_int_pin_config config, uint8_t pinMap)
{
bool BMA423::setINTPinConfig(struct bma4_int_pin_config config,
uint8_t pinMap) {
return BMA4_OK == bma4_set_int_pin_config(&config, pinMap, &__devFptr);
}
bool BMA423::getINT()
{
bool BMA423::getINT() {
return bma423_read_int_status(&__IRQ_MASK, &__devFptr) == BMA4_OK;
}
uint8_t BMA423::getIRQMASK()
{
return __IRQ_MASK;
uint8_t BMA423::getIRQMASK() { return __IRQ_MASK; }
bool BMA423::disableIRQ(uint16_t int_map) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_DISABLE,
&__devFptr));
}
bool BMA423::disableIRQ(uint16_t int_map)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_DISABLE, &__devFptr));
bool BMA423::enableIRQ(uint16_t int_map) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_ENABLE,
&__devFptr));
}
bool BMA423::enableIRQ(uint16_t int_map)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_ENABLE, &__devFptr));
}
bool BMA423::enableFeature(uint8_t feature, uint8_t enable)
{
bool BMA423::enableFeature(uint8_t feature, uint8_t enable) {
if ((feature & BMA423_STEP_CNTR) == BMA423_STEP_CNTR) {
bma423_step_detector_enable(enable ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr);
bma423_step_detector_enable(enable ? BMA4_ENABLE : BMA4_DISABLE,
&__devFptr);
}
return (BMA4_OK == bma423_feature_enable(feature, enable, &__devFptr));
}
bool BMA423::isStepCounter()
{
bool BMA423::isStepCounter() {
return (bool)(BMA423_STEP_CNTR_INT & __IRQ_MASK);
}
bool BMA423::isDoubleClick()
{
return (bool)(BMA423_WAKEUP_INT & __IRQ_MASK);
}
bool BMA423::isDoubleClick() { return (bool)(BMA423_WAKEUP_INT & __IRQ_MASK); }
bool BMA423::isTilt()
{
return (bool)(BMA423_TILT_INT & __IRQ_MASK);
}
bool BMA423::isTilt() { return (bool)(BMA423_TILT_INT & __IRQ_MASK); }
bool BMA423::isActivity()
{
return (bool)(BMA423_ACTIVITY_INT & __IRQ_MASK);
}
bool BMA423::isActivity() { return (bool)(BMA423_ACTIVITY_INT & __IRQ_MASK); }
bool BMA423::isAnyNoMotion()
{
bool BMA423::isAnyNoMotion() {
return (bool)(BMA423_ANY_NO_MOTION_INT & __IRQ_MASK);
}
bool BMA423::enableStepCountInterrupt(bool en)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, en, &__devFptr));
bool BMA423::enableStepCountInterrupt(bool en) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT,
en, &__devFptr));
}
bool BMA423::enableTiltInterrupt(bool en)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_TILT_INT, en, &__devFptr));
bool BMA423::enableTiltInterrupt(bool en) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_TILT_INT, en,
&__devFptr));
}
bool BMA423::enableWakeupInterrupt(bool en)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_WAKEUP_INT, en, &__devFptr));
bool BMA423::enableWakeupInterrupt(bool en) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_WAKEUP_INT, en,
&__devFptr));
}
bool BMA423::enableAnyNoMotionInterrupt(bool en)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_ANY_NO_MOTION_INT, en, &__devFptr));
bool BMA423::enableAnyNoMotionInterrupt(bool en) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP,
BMA423_ANY_NO_MOTION_INT, en,
&__devFptr));
}
bool BMA423::enableActivityInterrupt(bool en)
{
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_ACTIVITY_INT, en, &__devFptr));
bool BMA423::enableActivityInterrupt(bool en) {
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_ACTIVITY_INT,
en, &__devFptr));
}
const char *BMA423::getActivity()
{
const char *BMA423::getActivity() {
uint8_t activity;
bma423_activity_output(&activity, &__devFptr);
if (activity & BMA423_USER_STATIONARY) {

View File

@ -20,14 +20,14 @@ enum {
typedef struct bma4_accel Accel;
typedef struct bma4_accel_config Acfg;
class BMA423
{
class BMA423 {
public:
BMA423();
~BMA423();
bool begin(bma4_com_fptr_t readCallBlack, bma4_com_fptr_t writeCallBlack, bma4_delay_fptr_t delayCallBlack,
bool begin(bma4_com_fptr_t readCallBlack, bma4_com_fptr_t writeCallBlack,
bma4_delay_fptr_t delayCallBlack,
uint8_t address = BMA4_I2C_ADDR_PRIMARY);
void softReset();
@ -65,7 +65,6 @@ public:
uint16_t getStatus();
uint32_t getSensorTime();
const char *getActivity();
bool setRemapAxes(struct bma423_axes_remap *remap_data);

File diff suppressed because it is too large Load Diff

View File

@ -157,7 +157,8 @@ uint16_t bma4_write_config_file(struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_dev *dev);
uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len,
struct bma4_dev *dev);
/*!
* @brief This API checks whether the read operation requested is for
@ -172,7 +173,8 @@ uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_d
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_dev *dev);
uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len,
struct bma4_dev *dev);
/*!
* @brief This API reads the error status from the sensor.
@ -211,7 +213,8 @@ uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_de
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma4_get_error_status(struct bma4_err_reg *err_reg, struct bma4_dev *dev);
uint16_t bma4_get_error_status(struct bma4_err_reg *err_reg,
struct bma4_dev *dev);
/*!
* @brief This API reads the sensor status from the dev sensor.
@ -291,7 +294,8 @@ uint16_t bma4_get_sensor_time(uint32_t *sensor_time, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit, struct bma4_dev *dev);
uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit,
struct bma4_dev *dev);
/*!
* @brief This API reads the Output data rate, Bandwidth, perf_mode
@ -342,7 +346,8 @@ uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit, struct bma4_dev
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel, struct bma4_dev *dev);
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel,
struct bma4_dev *dev);
/*!
* @brief This API sets the output_data_rate, bandwidth, perf_mode
@ -393,7 +398,8 @@ uint16_t bma4_get_accel_config(struct bma4_accel_config *accel, struct bma4_dev
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_set_accel_config(const struct bma4_accel_config *accel, struct bma4_dev *dev);
uint16_t bma4_set_accel_config(const struct bma4_accel_config *accel,
struct bma4_dev *dev);
/*!
* @brief This API sets the advance power save mode in the sensor.
@ -429,7 +435,8 @@ uint16_t bma4_set_advance_power_save(uint8_t adv_pwr_save,
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save, struct bma4_dev *dev);
uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save,
struct bma4_dev *dev);
/*!
* @brief This API sets the FIFO self wake up functionality in the sensor.
@ -446,7 +453,8 @@ uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save, struct bma4_dev *dev
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup, struct bma4_dev *dev);
uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup,
struct bma4_dev *dev);
/*!
* @brief This API gets the status of FIFO self wake up functionality from
@ -464,7 +472,8 @@ uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup, struct bma4_dev *de
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_fifo_self_wakeup(uint8_t *fifo_self_wake_up, struct bma4_dev *dev);
uint16_t bma4_get_fifo_self_wakeup(uint8_t *fifo_self_wake_up,
struct bma4_dev *dev);
/*!
* @brief This API enables or disables the Accel in the sensor.
@ -851,7 +860,8 @@ uint16_t bma4_set_fifo_wm(uint16_t fifo_wm, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter, struct bma4_dev *dev);
uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter,
struct bma4_dev *dev);
/*!
* @brief This API sets the condition of Accel FIFO data either to
@ -870,7 +880,8 @@ uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter, struct bma4
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter, struct bma4_dev *dev);
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter,
struct bma4_dev *dev);
/*!
* @brief This API reads the down sampling rates which is configured
@ -939,7 +950,8 @@ uint16_t bma4_get_fifo_length(uint16_t *fifo_length, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_data,
uint16_t
bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_data,
uint8_t mag_second_if,
struct bma4_mag *compensated_mag_data);
@ -963,7 +975,8 @@ uint16_t bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_da
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_read_mag_xyz(struct bma4_mag *mag, uint8_t sensor_select, struct bma4_dev *dev);
uint16_t bma4_read_mag_xyz(struct bma4_mag *mag, uint8_t sensor_select,
struct bma4_dev *dev);
/*!
* @brief This API reads the auxiliary I2C interface configuration which
@ -1056,7 +1069,8 @@ uint16_t bma4_get_mag_data_rdy(uint8_t *data_rdy, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_asic_status(struct bma4_asic_status *asic_status, struct bma4_dev *dev);
uint16_t bma4_get_asic_status(struct bma4_asic_status *asic_status,
struct bma4_dev *dev);
/*!
* @brief This API enables the offset compensation for filtered and
@ -1122,7 +1136,8 @@ uint16_t bma4_get_offset_comp(uint8_t *offset_en, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_extract_accel(struct bma4_accel *accel_data, uint16_t *accel_length, const struct bma4_dev *dev);
uint16_t bma4_extract_accel(struct bma4_accel *accel_data,
uint16_t *accel_length, const struct bma4_dev *dev);
/*!
* @brief This API parses and extracts the magnetometer frames from
@ -1148,7 +1163,8 @@ uint16_t bma4_extract_accel(struct bma4_accel *accel_data, uint16_t *accel_lengt
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length, const struct bma4_dev *dev);
uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length,
const struct bma4_dev *dev);
/*!
* @brief This API performs Fast Offset Compensation for Accel.
@ -1170,7 +1186,8 @@ uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length, const
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_perform_accel_foc(const int32_t accel_g_value[3], struct bma4_dev *dev);
uint16_t bma4_perform_accel_foc(const int32_t accel_g_value[3],
struct bma4_dev *dev);
/*!
* @brief This API checks whether the self test functionality of the sensor
* is working or not
@ -1230,7 +1247,8 @@ uint16_t bma4_selftest_config(uint8_t sign, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev);
uint16_t bma4_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable,
struct bma4_dev *dev);
/*!
* @brief This API sets the interrupt mode in the sensor.
@ -1305,7 +1323,8 @@ uint16_t bma4_get_interrupt_mode(uint8_t *mode, struct bma4_dev *dev);
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag, struct bma4_dev *dev);
uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag,
struct bma4_dev *dev);
/*!
* @brief This API reads the auxiliary Mag(BMM150 or AKM9916) output data
@ -1343,7 +1362,8 @@ uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag, stru
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag, struct bma4_dev *dev);
uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag,
struct bma4_dev *dev);
/*! @brief This API sets the FIFO configuration in the sensor.
*
@ -1372,7 +1392,8 @@ uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag, struct bma
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_set_fifo_config(uint8_t config, uint8_t enable, struct bma4_dev *dev);
uint16_t bma4_set_fifo_config(uint8_t config, uint8_t enable,
struct bma4_dev *dev);
/*! @brief This API reads the FIFO configuration from the sensor.
*
@ -1441,8 +1462,9 @@ uint16_t bma4_get_fifo_config(uint8_t *fifo_config, struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_config, uint8_t int_line,
struct bma4_dev *dev);
uint16_t
bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_config,
uint8_t int_line, struct bma4_dev *dev);
/*! @brief This API reads the electrical behavior of interrupt pin1 or pin2
* from the sensor.
@ -1483,10 +1505,12 @@ uint16_t bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_confi
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_get_int_pin_config(struct bma4_int_pin_config *int_pin_config, uint8_t int_line, struct bma4_dev *dev);
uint16_t bma4_get_int_pin_config(struct bma4_int_pin_config *int_pin_config,
uint8_t int_line, struct bma4_dev *dev);
/*!
* @brief This API reads the Feature and Hardware interrupt status from the sensor.
* @brief This API reads the Feature and Hardware interrupt status from the
*sensor.
*
* @param[out] int_status : Variable used to get the interrupt status.
* @param[in] dev : Structure instance of bma4_dev.
@ -1544,14 +1568,16 @@ uint16_t bma4_aux_interface_init(struct bma4_dev *dev);
* @param[in] len : User specified data length
* @param[out] aux_data : Pointer variable to store data read
* @param[in] aux_reg_addr : Variable to pass address from where
* data is to be read
* data is to be
*read
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, struct bma4_dev *dev);
uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len,
struct bma4_dev *dev);
/*!
* @brief This API writes the data into the auxiliary sensor
@ -1560,15 +1586,16 @@ uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, st
* @param[in] len : User specified data length
* @param[out] aux_data : Pointer variable to store data read
* @param[in] aux_reg_addr : Variable to pass address from where
* data is to be written
* data is to be
*written
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*
*/
uint16_t bma4_aux_write(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, struct bma4_dev *dev);
uint16_t bma4_aux_write(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len,
struct bma4_dev *dev);
#endif
/* End of __BMA4_H__ */

View File

@ -600,8 +600,7 @@ const uint8_t bma423_config_file[] = {
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00
};
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00};
/***************************************************************************/
/*! Static Function Declarations
@ -638,7 +637,8 @@ static void update_len(uint8_t *len, uint8_t feature, uint8_t enable);
* @retval 0 -> Success
* @retval Any positive value mentioned in ERROR CODES -> Fail
*/
static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
static uint16_t feature_enable(uint8_t feature, uint8_t len,
uint8_t *feature_config, struct bma4_dev *dev);
/*!
* @brief This API disables the features of sensor.
@ -654,7 +654,8 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_co
* @retval 0 -> Success
* @retval Any positive value mentioned in ERROR CODES -> Fail
*/
static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
static uint16_t feature_disable(uint8_t feature, uint8_t len,
uint8_t *feature_config, struct bma4_dev *dev);
/*!
* @brief This API update the settings of step counter into write array.
@ -666,7 +667,8 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_c
*
* @return none
*/
static void update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
static void
update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
uint8_t index, uint8_t *feature_config);
/*!
* @brief This API copy the settings of step counter into the
@ -678,7 +680,9 @@ static void update_stepcounter_parameter(const struct bma423_stepcounter_setting
*
* @return none
*/
static void extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting, const uint16_t *data_p);
static void
extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting,
const uint16_t *data_p);
/***************************************************************************/
/**\name Function definitions
@ -690,8 +694,7 @@ static void extract_stepcounter_parameter(struct bma423_stepcounter_settings *se
* This API reads the chip-id of the sensor and sets the resolution.
*/
#include <stdio.h>
uint16_t bma423_init(struct bma4_dev *dev)
{
uint16_t bma423_init(struct bma4_dev *dev) {
uint16_t rslt;
rslt = bma4_init(dev);
@ -714,8 +717,7 @@ uint16_t bma423_init(struct bma4_dev *dev)
* @brief This API is used to upload the config file to enable
* the features of the sensor.
*/
uint16_t bma423_write_config_file(struct bma4_dev *dev)
{
uint16_t bma423_write_config_file(struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
@ -744,8 +746,7 @@ uint16_t bma423_write_config_file(struct bma4_dev *dev)
/*!
* @brief This API is used to get the configuration id of the sensor.
*/
uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev)
{
uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_CONFIG_ID_OFFSET;
uint16_t rslt = BMA4_OK;
@ -754,7 +755,8 @@ uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev)
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
config_id_lsb = (uint16_t)feature_config[index];
config_id_msb = ((uint16_t)feature_config[index + 1]) << 8;
@ -774,8 +776,8 @@ uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev)
* @brief This API sets/unsets the user provided interrupt to either
* interrupt pin1 or pin2 in the sensor.
*/
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev)
{
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map,
uint8_t enable, struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
@ -799,8 +801,7 @@ uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable
/*!
* @brief This API reads the bma423 interrupt status from the sensor.
*/
uint16_t bma423_read_int_status(uint16_t *int_status, struct bma4_dev *dev)
{
uint16_t bma423_read_int_status(uint16_t *int_status, struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
@ -820,8 +821,8 @@ uint16_t bma423_read_int_status(uint16_t *int_status, struct bma4_dev *dev)
/*!
* @brief This API enables/disables the features of the sensor.
*/
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev)
{
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint16_t rslt = BMA4_OK;
uint8_t len;
@ -853,8 +854,8 @@ uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev
/*!
* @brief This API performs x, y and z axis remapping in the sensor.
*/
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struct bma4_dev *dev)
{
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_AXES_REMAP_OFFSET;
uint16_t rslt = BMA4_OK;
@ -866,15 +867,18 @@ uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struc
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
x_axis = remap_data->x_axis & BMA423_X_AXIS_MASK;
x_axis_sign = (remap_data->x_axis_sign << 2) & BMA423_X_AXIS_SIGN_MASK;
y_axis = (remap_data->y_axis << 3) & BMA423_Y_AXIS_MASK;
y_axis_sign = (remap_data->y_axis_sign << 5) & BMA423_Y_AXIS_SIGN_MASK;
z_axis = (remap_data->z_axis << 6) & BMA423_Z_AXIS_MASK;
feature_config[index] = x_axis | x_axis_sign | y_axis | y_axis_sign | z_axis;
feature_config[index + 1] = remap_data->z_axis_sign & BMA423_Z_AXIS_SIGN_MASK;
feature_config[index] =
x_axis | x_axis_sign | y_axis | y_axis_sign | z_axis;
feature_config[index + 1] =
remap_data->z_axis_sign & BMA423_Z_AXIS_SIGN_MASK;
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
}
@ -891,22 +895,26 @@ uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struc
/*!
* @brief This API reads the x, y and z axis remap data from the sensor.
*/
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4_dev *dev)
{
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_AXES_REMAP_OFFSET;
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
remap_data->x_axis = feature_config[index] & BMA423_X_AXIS_MASK;
remap_data->x_axis_sign = (feature_config[index] & BMA423_X_AXIS_SIGN_MASK) >> 2;
remap_data->x_axis_sign =
(feature_config[index] & BMA423_X_AXIS_SIGN_MASK) >> 2;
remap_data->y_axis = (feature_config[index] & BMA423_Y_AXIS_MASK) >> 3;
remap_data->y_axis_sign = (feature_config[index] & BMA423_Y_AXIS_SIGN_MASK) >> 5;
remap_data->y_axis_sign =
(feature_config[index] & BMA423_Y_AXIS_SIGN_MASK) >> 5;
remap_data->z_axis = (feature_config[index] & BMA423_Z_AXIS_MASK) >> 6;
remap_data->z_axis_sign = (feature_config[index + 1] & BMA423_Z_AXIS_SIGN_MASK);
remap_data->z_axis_sign =
(feature_config[index + 1] & BMA423_Z_AXIS_SIGN_MASK);
}
} else {
rslt = BMA4_E_INVALID_SENSOR;
@ -922,8 +930,7 @@ uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4
* @brief This API enables the any motion feature according to the axis
* set by the user in the sensor.
*/
uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev)
{
uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev) {
uint8_t feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
/* Anymotion axis enable bit pos. is 3 byte ahead of the
anymotion base address(0x00) */
@ -935,8 +942,8 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev)
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_ANYMOTION_EN_LEN + 2, dev);
if (rslt == BMA4_OK) {
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
BMA423_ANY_NO_MOTION_AXIS_EN, axis);
feature_config[index] = BMA4_SET_BITSLICE(
feature_config[index], BMA423_ANY_NO_MOTION_AXIS_EN, axis);
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_ANYMOTION_EN_LEN + 2, dev);
}
@ -953,8 +960,9 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev)
/*! @brief This API sets the configuration of Any motion feature in
* the sensor.
*/
uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion, struct bma4_dev *dev)
{
uint16_t
bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
uint8_t index = BMA423_ANY_NO_MOTION_OFFSET;
uint16_t duration_lsb = 0;
@ -971,15 +979,15 @@ uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_
feature_config[index++] = BMA4_GET_LSB(any_motion->threshold);
feature_config[index] = BMA4_GET_MSB(any_motion->threshold);
/* Assign no motion selection value in feature config array*/
feature_config[index++] |= (uint8_t)
(any_motion->nomotion_sel << BMA423_ANY_NO_MOTION_SEL_POS);
feature_config[index++] |=
(uint8_t)(any_motion->nomotion_sel << BMA423_ANY_NO_MOTION_SEL_POS);
/* Extract duration */
duration_lsb = feature_config[index];
duration_msb = feature_config[index + 1] << 8;
duration = duration_lsb | duration_msb;
duration = BMA4_SET_BITS_POS_0(duration,
BMA423_ANY_NO_MOTION_DUR, any_motion->duration);
duration = BMA4_SET_BITS_POS_0(duration, BMA423_ANY_NO_MOTION_DUR,
any_motion->duration);
/* Assign duration value in feature config array*/
feature_config[index++] = BMA4_GET_LSB(duration);
feature_config[index] = BMA4_GET_MSB(duration);
@ -1001,8 +1009,9 @@ uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_
/*! @brief This API gets the configuration of any motion feature from
* the sensor.
*/
uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion, struct bma4_dev *dev)
{
uint16_t
bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
uint8_t anymotion = 0;
uint16_t rslt = BMA4_OK;
@ -1017,10 +1026,10 @@ uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion
any_motion->threshold = (*data_p) & BMA423_ANY_NO_MOTION_THRES_MSK;
/* Extract threshold & nomotion selection
* data */
anymotion = ((uint8_t)(*(data_p++) >> 8)) & BMA423_ANY_NO_MOTION_SEL_MSK;
anymotion =
((uint8_t)(*(data_p++) >> 8)) & BMA423_ANY_NO_MOTION_SEL_MSK;
/* Extract no motion field */
any_motion->nomotion_sel = anymotion >>
BMA423_ANY_NO_MOTION_SEL_POS;
any_motion->nomotion_sel = anymotion >> BMA423_ANY_NO_MOTION_SEL_POS;
/* Extract duration value */
any_motion->duration = (*(data_p)) & BMA423_ANY_NO_MOTION_DUR_MSK;
}
@ -1038,8 +1047,7 @@ uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion
* @brief This API enables or disables the step detector feature in the
* sensor.
*/
uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev)
{
uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint16_t rslt = BMA4_OK;
/* Step detector enable bit pos. is 1 byte ahead of the base address */
@ -1050,8 +1058,8 @@ uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev)
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
BMA423_STEP_DETECTOR_EN, enable);
feature_config[index] = BMA4_SET_BITSLICE(
feature_config[index], BMA423_STEP_DETECTOR_EN, enable);
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
}
@ -1069,8 +1077,8 @@ uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev)
* @brief This API sets the watermark level for step counter
* interrupt in the sensor.
*/
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4_dev *dev)
{
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_STEP_CNTR_OFFSET;
uint16_t wm_lsb = 0;
@ -1112,8 +1120,8 @@ uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4
* @brief This API gets the water mark level set for step counter interrupt
* in the sensor
*/
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm, struct bma4_dev *dev)
{
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_STEP_CNTR_OFFSET;
uint16_t wm_lsb = 0;
@ -1144,8 +1152,7 @@ uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm, struct bma
/*!
* @brief This API resets the counted steps of step counter.
*/
uint16_t bma423_reset_step_counter(struct bma4_dev *dev)
{
uint16_t bma423_reset_step_counter(struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
/* Reset bit is 1 byte ahead of base address */
uint8_t index = BMA423_STEP_CNTR_OFFSET + 1;
@ -1157,8 +1164,8 @@ uint16_t bma423_reset_step_counter(struct bma4_dev *dev)
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
BMA423_STEP_CNTR_RST, 1);
feature_config[index] =
BMA4_SET_BITSLICE(feature_config[index], BMA423_STEP_CNTR_RST, 1);
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
}
@ -1175,8 +1182,8 @@ uint16_t bma423_reset_step_counter(struct bma4_dev *dev)
* @brief This API gets the number of counted steps of the step counter
* feature from the sensor.
*/
uint16_t bma423_step_counter_output(uint32_t *step_count, struct bma4_dev *dev)
{
uint16_t bma423_step_counter_output(uint32_t *step_count,
struct bma4_dev *dev) {
uint8_t data[BMA423_STEP_CNTR_DATA_SIZE] = {0};
uint16_t rslt = BMA4_OK;
uint32_t step_count_0 = 0;
@ -1211,8 +1218,7 @@ uint16_t bma423_step_counter_output(uint32_t *step_count, struct bma4_dev *dev)
/*!
* @brief This API gets the output for activity feature.
*/
uint16_t bma423_activity_output(uint8_t *activity, struct bma4_dev *dev)
{
uint16_t bma423_activity_output(uint8_t *activity, struct bma4_dev *dev) {
uint8_t data = 0;
uint16_t rslt = BMA4_OK;
@ -1235,8 +1241,7 @@ uint16_t bma423_activity_output(uint8_t *activity, struct bma4_dev *dev)
/*!
* @brief This API select the platform configuration wrist(Default) or phone.
*/
uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev)
{
uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
struct bma423_stepcounter_settings sc_settings = {0};
@ -1322,15 +1327,17 @@ uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev)
* @brief This API gets the parameter1 to parameter7 settings of the
* step counter feature.
*/
uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting, struct bma4_dev *dev)
{
uint16_t
bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint16_t *data_p = (uint16_t *)feature_config;
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
/* To convert 8bit to 16 bit address */
@ -1351,15 +1358,16 @@ uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *se
* @brief This API sets the parameter1 to parameter7 settings of the
* step counter feature in the sensor.
*/
uint16_t bma423_stepcounter_set_parameter(const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev)
{
uint16_t bma423_stepcounter_set_parameter(
const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_STEP_CNTR_PARAM_OFFSET;
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
update_stepcounter_parameter(setting, index, feature_config);
/* Writes stepcounter parameter settings
@ -1380,18 +1388,19 @@ uint16_t bma423_stepcounter_set_parameter(const struct bma423_stepcounter_settin
/*!
* @brief This API sets the sensitivity of wake up feature in the sensor
*/
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev)
{
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_WAKEUP_OFFSET;
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
BMA423_WAKEUP_SENS, sensitivity);
feature_config[index] = BMA4_SET_BITSLICE(
feature_config[index], BMA423_WAKEUP_SENS, sensitivity);
/* Writes sensitivity settings in the sensor */
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
@ -1409,18 +1418,20 @@ uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev
/*!
* @brief This API gets the sensitivity of wake up feature in the sensor
*/
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity, struct bma4_dev *dev)
{
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity,
struct bma4_dev *dev) {
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
uint8_t index = BMA423_WAKEUP_OFFSET;
uint16_t rslt = BMA4_OK;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
/* Extracts sensitivity data */
*sensitivity = BMA4_GET_BITSLICE(feature_config[index], BMA423_WAKEUP_SENS);
*sensitivity =
BMA4_GET_BITSLICE(feature_config[index], BMA423_WAKEUP_SENS);
}
} else {
rslt = BMA4_E_INVALID_SENSOR;
@ -1436,15 +1447,17 @@ uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity, struct bma4_dev *de
* @brief This API is used to select single/double tap
* feature in the sensor
*/
uint16_t bma423_tap_selection(const uint8_t tap_select, struct bma4_dev *dev)
{
uint16_t bma423_tap_selection(const uint8_t tap_select, struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0,};
uint8_t feature_config[BMA423_FEATURE_SIZE] = {
0,
};
uint8_t index = BMA423_WAKEUP_OFFSET;
if (dev != NULL) {
if (dev->chip_id == BMA423_CHIP_ID) {
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
BMA423_FEATURE_SIZE, dev);
if (rslt == BMA4_OK) {
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
BMA423_TAP_SEL, tap_select);
@ -1463,8 +1476,7 @@ uint16_t bma423_tap_selection(const uint8_t tap_select, struct bma4_dev *dev)
/*!
* @brief This API update the length for read and write.
*/
static void update_len(uint8_t *len, uint8_t feature, uint8_t enable)
{
static void update_len(uint8_t *len, uint8_t feature, uint8_t enable) {
uint8_t length = BMA423_FEATURE_SIZE;
if ((feature == BMA423_ANY_MOTION) || (feature == BMA423_NO_MOTION)) {
@ -1487,8 +1499,8 @@ static void update_len(uint8_t *len, uint8_t feature, uint8_t enable)
/*!
* @brief This API enables the features of the sensor.
*/
static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
{
static uint16_t feature_enable(uint8_t feature, uint8_t len,
uint8_t *feature_config, struct bma4_dev *dev) {
uint8_t index = 0;
uint16_t rslt;
@ -1529,10 +1541,12 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_co
if ((feature & BMA423_ANY_MOTION) > 0) {
/* Enable anymotion */
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
feature_config[index] =
feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
} else {
/* Enable nomotion */
feature_config[index] = feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
feature_config[index] =
feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
}
}
@ -1545,8 +1559,8 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_co
/*!
* @brief This API disables the features of the sensor.
*/
static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
{
static uint16_t feature_disable(uint8_t feature, uint8_t len,
uint8_t *feature_config, struct bma4_dev *dev) {
uint8_t index = 0;
uint16_t rslt;
@ -1587,15 +1601,18 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_c
if ((feature & BMA423_ANY_MOTION) > 0) {
/* Disable anymotion */
feature_config[index] = feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
feature_config[index] =
feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
} else {
/* Disable nomotion */
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
feature_config[index] =
feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
}
/* Any/Nomotion axis enable bit pos. is 3 byte ahead of the
any/nomotion base address(0x00) */
index = 3;
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_AXIS_EN_MSK);
feature_config[index] =
feature_config[index] & (~BMA423_ANY_NO_MOTION_AXIS_EN_MSK);
}
/* Write the configured settings in the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
@ -1606,9 +1623,9 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_c
/*!
* @brief This API update the settings of step counter.
*/
static void update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
uint8_t index, uint8_t *feature_config)
{
static void
update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
uint8_t index, uint8_t *feature_config) {
feature_config[index++] = BMA4_GET_LSB(setting->param1);
feature_config[index++] = BMA4_GET_MSB(setting->param1);
feature_config[index++] = BMA4_GET_LSB(setting->param2);
@ -1665,8 +1682,9 @@ static void update_stepcounter_parameter(const struct bma423_stepcounter_setting
* @brief This API copy the settings of step counter into the
* structure of bma423_stepcounter_settings, which is read from sensor.
*/
static void extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting, const uint16_t *data_p)
{
static void
extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting,
const uint16_t *data_p) {
setting->param1 = *(data_p++);
setting->param2 = *(data_p++);
setting->param3 = *(data_p++);

View File

@ -109,7 +109,6 @@ extern "C" {
#define BMA423_CONFIG_ID_OFFSET UINT8_C(0x3C)
#define BMA423_AXES_REMAP_OFFSET UINT8_C(0x3E)
/**************************************************************/
/**\name Remap Axes */
/**************************************************************/
@ -385,7 +384,6 @@ uint16_t bma423_write_config_file(struct bma4_dev *dev);
*/
uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev);
/*!
* @brief This API sets/unsets the user provided interrupt to either
* interrupt pin1 or pin2 in the sensor.
@ -422,7 +420,8 @@ uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev);
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map,
uint8_t enable, struct bma4_dev *dev);
/*!
* @brief This API reads the bma423 interrupt status from the sensor.
@ -479,8 +478,8 @@ uint16_t bma423_read_int_status(uint16_t *int_status, struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev);
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
struct bma4_dev *dev);
/*!
* @brief This API performs x, y and z axis remapping in the sensor.
@ -492,7 +491,8 @@ uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struct bma4_dev *dev);
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data,
struct bma4_dev *dev);
/*!
* @brief This API reads the x, y and z axis remap data from the sensor.
@ -505,8 +505,8 @@ uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struc
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4_dev *dev);
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data,
struct bma4_dev *dev);
/*!
* @brief This API sets the watermark level for step counter
@ -522,7 +522,8 @@ uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4_dev *dev);
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
struct bma4_dev *dev);
/*!
* @brief This API gets the water mark level set for step counter interrupt
@ -538,7 +539,8 @@ uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm, struct bma4_dev *dev);
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm,
struct bma4_dev *dev);
/*!
* @brief This API resets the counted steps of step counter.
@ -613,7 +615,9 @@ uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
uint16_t
bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
struct bma4_dev *dev);
/*!
* @brief This API sets the parameter1 to parameter7 settings of the
@ -627,7 +631,8 @@ uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *se
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_stepcounter_set_parameter(const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
uint16_t bma423_stepcounter_set_parameter(
const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
/*!
* @brief This API enables or disables the step detector feature in the
@ -703,7 +708,9 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev);
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion, struct bma4_dev *dev);
uint16_t
bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion,
struct bma4_dev *dev);
/*! @brief This API gets the configuration of any motion feature from
* the sensor.
@ -741,7 +748,9 @@ uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion, struct bma4_dev *dev);
uint16_t
bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion,
struct bma4_dev *dev);
/*!
* @brief This API sets the sensitivity of wake up feature in the sensor
@ -758,7 +767,8 @@ uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev);
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
struct bma4_dev *dev);
/*!
* @brief This API gets the sensitivity of wake up feature in the sensor
@ -775,7 +785,8 @@ uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev
* @retval 0 -> Success
* @retval Any non zero value -> Fail
*/
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity, struct bma4_dev *dev);
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity,
struct bma4_dev *dev);
/*!
* @brief This API is used to select single/double tap

View File

@ -91,9 +91,9 @@
#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <stdint.h>
#include <stddef.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#endif
/*********************************************************************/
@ -611,7 +611,6 @@
#define BMA4_MAG_DATA_RDY_INT UINT16_C(0x2000)
#define BMA4_ACCEL_DATA_RDY_INT UINT16_C(0x8000)
/**\name AKM POWER MODE SELECTION */
#define AKM_POWER_DOWN_MODE UINT8_C(0)
#define AKM_SINGLE_MEAS_MODE UINT8_C(1)
@ -660,7 +659,6 @@
/* BMA4_KELVIN_SCALED = 273.15 * 1000 */
#define BMA4_KELVIN_SCALED INT32_C(273150)
/**\name MAP BURST READ LENGTHS */
#define BMA4_AUX_READ_LEN_0 0
#define BMA4_AUX_READ_LEN_1 1
@ -675,8 +673,7 @@
#define BMA4_GET_BITSLICE(regvar, bitname) \
((regvar & bitname##_MSK) >> bitname##_POS)
#define BMA4_SET_BITSLICE(regvar, bitname, val) \
((regvar & ~bitname##_MSK) | \
((val<<bitname##_POS)&bitname##_MSK))
((regvar & ~bitname##_MSK) | ((val << bitname##_POS) & bitname##_MSK))
#define BMA4_GET_DIFF(x, y) ((x) - (y))
#define BMA4_GET_LSB(var) (uint8_t)(var & BMA4_SET_LOW_BYTE)
@ -685,8 +682,7 @@
#define BMA4_SET_BIT_VAL_0(reg_data, bitname) (reg_data & ~(bitname##_MSK))
#define BMA4_SET_BITS_POS_0(reg_data, bitname, data) \
((reg_data & ~(bitname##_MSK)) | \
(data & bitname##_MSK))
((reg_data & ~(bitname##_MSK)) | (data & bitname##_MSK))
#define BMA4_GET_BITS_POS_0(reg_data, bitname) (reg_data & (bitname##_MSK))
@ -695,7 +691,8 @@
* @brief Bus communication function pointer which should be mapped to
* the platform specific read and write functions of the user
*/
typedef uint16_t (*bma4_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr, uint8_t *read_data, uint16_t len);
typedef uint16_t (*bma4_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr,
uint8_t *read_data, uint16_t len);
/*! delay function pointer */
typedef void (*bma4_delay_fptr_t)(uint32_t);
@ -705,10 +702,7 @@ typedef void (*bma4_delay_fptr_t)(uint32_t);
/******************************************************************************/
/*! @name Enum to define BMA4 variants */
enum bma4_variant {
BMA42X_VARIANT = 1,
BMA45X_VARIANT
};
enum bma4_variant { BMA42X_VARIANT = 1, BMA45X_VARIANT };
/**\name STRUCTURE DEFINITIONS*/

View File

@ -1,27 +1,55 @@
#ifndef CONFIG_H
#define CONFIG_H
// Versioning
#define WATCHY_LIB_VER "1.4.10"
//pins
#define SDA 21
#define SCL 22
#define V10_ADC_PIN 33 //OG v1.0 Watchy
#define V15_ADC_PIN 35 //v1.5 Watchy with PCF8563 RTC
#define RTC_PIN GPIO_NUM_27
#define CS 5
#define DC 10
#define RESET 9
#define BUSY 19
#define VIB_MOTOR_PIN 13
#if !defined(ARDUINO_WATCHY_V10) && !defined(ARDUINO_WATCHY_V15) && !defined(ARDUINO_WATCHY_V20)
#pragma message "Please install the latest ESP32 Arduino Core (2.0.5+) and choose Watchy as the target board"
#pragma message "Hardware revision is not defined at the project level, please define in config.h. Defaulting to ARDUINO_WATCHY_V20"
//Change to your board version
#define ARDUINO_WATCHY_V20
#define MENU_BTN_PIN 26
#define BACK_BTN_PIN 25
#define UP_BTN_PIN 32
#define DOWN_BTN_PIN 4
#define DISPLAY_CS 5
#define DISPLAY_RES 9
#define DISPLAY_DC 10
#define DISPLAY_BUSY 19
#define ACC_INT_1_PIN 14
#define ACC_INT_2_PIN 12
#define VIB_MOTOR_PIN 13
#define RTC_INT_PIN 27
#if defined (ARDUINO_WATCHY_V10)
#define UP_BTN_PIN 32
#define BATT_ADC_PIN 33
#define UP_BTN_MASK GPIO_SEL_32
#define RTC_TYPE 1 //DS3231
#elif defined (ARDUINO_WATCHY_V15)
#define UP_BTN_PIN 32
#define BATT_ADC_PIN 35
#define UP_BTN_MASK GPIO_SEL_32
#define RTC_TYPE 2 //PCF8563
#elif defined (ARDUINO_WATCHY_V20)
#define UP_BTN_PIN 35
#define BATT_ADC_PIN 34
#define UP_BTN_MASK GPIO_SEL_35
#define RTC_TYPE 2 //PCF8563
#endif
#define MENU_BTN_MASK GPIO_SEL_26
#define BACK_BTN_MASK GPIO_SEL_25
#define UP_BTN_MASK GPIO_SEL_32
#define DOWN_BTN_MASK GPIO_SEL_4
#define ACC_INT_MASK GPIO_SEL_14
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
#endif
//display
#define DISPLAY_WIDTH 200
#define DISPLAY_HEIGHT 200
@ -50,5 +78,4 @@
#define SOFTWARE_VERSION_PATCH 0
#define HARDWARE_VERSION_MAJOR 1
#define HARDWARE_VERSION_MINOR 0
#endif

4
src/format.sh Normal file
View File

@ -0,0 +1,4 @@
#!/ bin / bash
STYLE_OPT = "{BasedOnStyle: llvm, AlignConsecutiveMacros: true, "
"AlignConsecutiveAssignments: true}" clang -
format-- style = "$STYLE_OPT" - i *