mirror of https://github.com/sqfmi/Watchy.git
Compare commits
No commits in common. "master" and "1.2.1" have entirely different histories.
|
@ -1,28 +0,0 @@
|
||||||
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
|
|
||||||
arduino-platform: esp32:esp32@2.0.17
|
|
||||||
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
|
|
|
@ -1,39 +0,0 @@
|
||||||
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=huge_app,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
|
|
||||||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
|
||||||
arduino-platform: esp32:esp32@2.0.17
|
|
||||||
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
|
|
|
@ -1,39 +0,0 @@
|
||||||
name: ReleaseV3
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: Build and Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
board-revisions: [v30]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@master
|
|
||||||
- uses: ArminJo/arduino-test-compile@v3
|
|
||||||
with:
|
|
||||||
arduino-board-fqbn: esp32:esp32:esp32s3:FlashSize=8M,PartitionScheme=default_8MB,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
|
|
||||||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
|
||||||
arduino-platform: esp32:esp32@2.0.17
|
|
||||||
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
|
|
|
@ -67,4 +67,3 @@ avr-toolchain-*.zip
|
||||||
manifest.mf
|
manifest.mf
|
||||||
nbbuild.xml
|
nbbuild.xml
|
||||||
nbproject
|
nbproject
|
||||||
.vscode
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# How to contribute
|
|
||||||
|
|
||||||
### Check out the issue tracker
|
|
||||||
|
|
||||||
Search through [Issue tracker](https://github.com/sqfmi/Watchy/issues) for matching topics. It is also recommended to check with current [Pull requests](https://github.com/sqfmi/Watchy/pulls).
|
|
||||||
|
|
||||||
### Issue Pull Request
|
|
||||||
|
|
||||||
1. Fork this repo and branch out from `dev`.
|
|
||||||
2. Push commits.
|
|
||||||
3. Issue pull request.
|
|
||||||
|
|
||||||
## Community
|
|
||||||
|
|
||||||
- [Discord](https://discord.gg/ZXDegGV8E7)
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 SQFMI
|
Copyright (c) 2020 SQFMI
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
18
README.md
18
README.md
|
@ -2,17 +2,19 @@
|
||||||
|
|
||||||
![Watchy](https://watchy.sqfmi.com/img/watchy_render.png)
|
![Watchy](https://watchy.sqfmi.com/img/watchy_render.png)
|
||||||
|
|
||||||
**Buy Watchy from [Mouser](https://www.mouser.com/ProductDetail/SQFMI/SQFMI-WATCHY-10?qs=DRkmTr78QARN9VSJRzqRxw%3D%3D), [The Pi Hut](https://thepihut.com/collections/sqfmi), and [Crowd Supply](https://www.crowdsupply.com/sqfmi/watchy)**
|
Visit [**https://watchy.sqfmi.com**](https://watchy.sqfmi.com) for documentation, hardware design files, and more!
|
||||||
|
|
||||||
[**Watchy Case & Accessories**](https://shop.sqfmi.com)
|
## Setup
|
||||||
|
1. In the Arduino IDE Boards Manager, install support for the ESP32. You can find instructions here: https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md
|
||||||
|
2. Install this library (search for **Watchy** in the library manager), and any other depdencies 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"
|
||||||
|
* All Other Settings: leave to default
|
||||||
|
|
||||||
## Getting Started Guide
|
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
|
||||||
Follow the instructions here https://watchy.sqfmi.com/docs/getting-started
|
|
||||||
|
|
||||||
### Have Fun! :)
|
### Have Fun! :)
|
||||||
|
|
||||||
### Got Questions?
|
|
||||||
|
|
||||||
Join our [Discord](https://discord.gg/ZXDegGV8E7)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include "Watchy_7_SEG.h"
|
#include "Watchy_7_SEG.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
Watchy7SEG watchy(settings);
|
Watchy7SEG watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
To toggle between Dark Mode/Light Mode, change `#define DARKMODE true` in `Watchy_7_SEG.cpp`
|
|
|
@ -1,45 +1,33 @@
|
||||||
#include "Watchy_7_SEG.h"
|
#include "Watchy_7_SEG.h"
|
||||||
|
|
||||||
#define DARKMODE true
|
|
||||||
|
|
||||||
const uint8_t BATTERY_SEGMENT_WIDTH = 7;
|
const uint8_t BATTERY_SEGMENT_WIDTH = 7;
|
||||||
const uint8_t BATTERY_SEGMENT_HEIGHT = 11;
|
const uint8_t BATTERY_SEGMENT_HEIGHT = 11;
|
||||||
const uint8_t BATTERY_SEGMENT_SPACING = 9;
|
const uint8_t BATTERY_SEGMENT_SPACING = 9;
|
||||||
const uint8_t WEATHER_ICON_WIDTH = 48;
|
const uint8_t WEATHER_ICON_WIDTH = 48;
|
||||||
const uint8_t WEATHER_ICON_HEIGHT = 32;
|
const uint8_t WEATHER_ICON_HEIGHT = 32;
|
||||||
|
|
||||||
|
Watchy7SEG::Watchy7SEG(){} //constructor
|
||||||
|
|
||||||
void Watchy7SEG::drawWatchFace(){
|
void Watchy7SEG::drawWatchFace(){
|
||||||
display.fillScreen(DARKMODE ? GxEPD_BLACK : GxEPD_WHITE);
|
display.fillScreen(GxEPD_BLACK);
|
||||||
display.setTextColor(DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
|
||||||
drawTime();
|
drawTime();
|
||||||
drawDate();
|
drawDate();
|
||||||
drawSteps();
|
drawSteps();
|
||||||
drawWeather();
|
drawWeather();
|
||||||
drawBattery();
|
drawBattery();
|
||||||
display.drawBitmap(116, 75, WIFI_CONFIGURED ? wifi : wifioff, 26, 18, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.drawBitmap(120, 77, WIFI_CONFIGURED ? wifi : wifioff, 26, 18, GxEPD_WHITE);
|
||||||
if(BLE_CONFIGURED){
|
if(BLE_CONFIGURED){
|
||||||
display.drawBitmap(100, 73, bluetooth, 13, 21, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.drawBitmap(100, 75, bluetooth, 13, 21, GxEPD_WHITE);
|
||||||
}
|
}
|
||||||
#ifdef ARDUINO_ESP32S3_DEV
|
|
||||||
if(USB_PLUGGED_IN){
|
|
||||||
display.drawBitmap(140, 75, charge, 16, 18, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watchy7SEG::drawTime(){
|
void Watchy7SEG::drawTime(){
|
||||||
display.setFont(&DSEG7_Classic_Bold_53);
|
display.setFont(&DSEG7_Classic_Bold_53);
|
||||||
display.setCursor(5, 53+5);
|
display.setCursor(5, 53+5);
|
||||||
int displayHour;
|
if(currentTime.Hour < 10){
|
||||||
if(HOUR_12_24==12){
|
|
||||||
displayHour = ((currentTime.Hour+11)%12)+1;
|
|
||||||
} else {
|
|
||||||
displayHour = currentTime.Hour;
|
|
||||||
}
|
|
||||||
if(displayHour < 10){
|
|
||||||
display.print("0");
|
display.print("0");
|
||||||
}
|
}
|
||||||
display.print(displayHour);
|
display.print(currentTime.Hour);
|
||||||
display.print(":");
|
display.print(":");
|
||||||
if(currentTime.Minute < 10){
|
if(currentTime.Minute < 10){
|
||||||
display.print("0");
|
display.print("0");
|
||||||
|
@ -55,9 +43,6 @@ void Watchy7SEG::drawDate(){
|
||||||
|
|
||||||
String dayOfWeek = dayStr(currentTime.Wday);
|
String dayOfWeek = dayStr(currentTime.Wday);
|
||||||
display.getTextBounds(dayOfWeek, 5, 85, &x1, &y1, &w, &h);
|
display.getTextBounds(dayOfWeek, 5, 85, &x1, &y1, &w, &h);
|
||||||
if(currentTime.Wday == 4){
|
|
||||||
w = w - 5;
|
|
||||||
}
|
|
||||||
display.setCursor(85 - w, 85);
|
display.setCursor(85 - w, 85);
|
||||||
display.println(dayOfWeek);
|
display.println(dayOfWeek);
|
||||||
|
|
||||||
|
@ -73,64 +58,52 @@ void Watchy7SEG::drawDate(){
|
||||||
}
|
}
|
||||||
display.println(currentTime.Day);
|
display.println(currentTime.Day);
|
||||||
display.setCursor(5, 150);
|
display.setCursor(5, 150);
|
||||||
display.println(tmYearToCalendar(currentTime.Year));// offset from 1970, since year is stored in uint8_t
|
display.println(currentTime.Year + YEAR_OFFSET);// offset from 1970, since year is stored in uint8_t
|
||||||
}
|
}
|
||||||
void Watchy7SEG::drawSteps(){
|
void Watchy7SEG::drawSteps(){
|
||||||
// reset step counter at midnight
|
|
||||||
if (currentTime.Hour == 0 && currentTime.Minute == 0){
|
|
||||||
sensor.resetStepCounter();
|
|
||||||
}
|
|
||||||
uint32_t stepCount = sensor.getCounter();
|
uint32_t stepCount = sensor.getCounter();
|
||||||
display.drawBitmap(10, 165, steps, 19, 23, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.drawBitmap(10, 165, steps, 19, 23, GxEPD_WHITE);
|
||||||
display.setCursor(35, 190);
|
display.setCursor(35, 190);
|
||||||
display.println(stepCount);
|
display.println(stepCount);
|
||||||
}
|
}
|
||||||
void Watchy7SEG::drawBattery(){
|
void Watchy7SEG::drawBattery(){
|
||||||
display.drawBitmap(158, 73, battery, 37, 21, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.drawBitmap(154, 73, battery, 37, 21, GxEPD_WHITE);
|
||||||
display.fillRect(163, 78, 27, BATTERY_SEGMENT_HEIGHT, DARKMODE ? GxEPD_BLACK : GxEPD_WHITE);//clear battery segments
|
display.fillRect(159, 78, 27, BATTERY_SEGMENT_HEIGHT, GxEPD_BLACK);//clear battery segments
|
||||||
int8_t batteryLevel = 0;
|
int8_t batteryLevel = 0;
|
||||||
float VBAT = getBatteryVoltage();
|
float VBAT = getBatteryVoltage();
|
||||||
if(VBAT > 4.0){
|
if(VBAT > 4.1){
|
||||||
batteryLevel = 3;
|
batteryLevel = 3;
|
||||||
}
|
}
|
||||||
else if(VBAT > 3.6 && VBAT <= 4.0){
|
else if(VBAT > 3.95 && VBAT <= 4.1){
|
||||||
batteryLevel = 2;
|
batteryLevel = 2;
|
||||||
}
|
}
|
||||||
else if(VBAT > 3.20 && VBAT <= 3.6){
|
else if(VBAT > 3.80 && VBAT <= 3.95){
|
||||||
batteryLevel = 1;
|
batteryLevel = 1;
|
||||||
}
|
}
|
||||||
else if(VBAT <= 3.20){
|
else if(VBAT <= 3.80){
|
||||||
batteryLevel = 0;
|
batteryLevel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int8_t batterySegments = 0; batterySegments < batteryLevel; batterySegments++){
|
for(int8_t batterySegments = 0; batterySegments < batteryLevel; batterySegments++){
|
||||||
display.fillRect(163 + (batterySegments * BATTERY_SEGMENT_SPACING), 78, BATTERY_SEGMENT_WIDTH, BATTERY_SEGMENT_HEIGHT, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.fillRect(159 + (batterySegments * BATTERY_SEGMENT_SPACING), 78, BATTERY_SEGMENT_WIDTH, BATTERY_SEGMENT_HEIGHT, GxEPD_WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Watchy7SEG::drawWeather(){
|
void Watchy7SEG::drawWeather(){
|
||||||
|
|
||||||
weatherData currentWeather = getWeatherData();
|
weatherData currentWeather = getWeatherData();
|
||||||
|
|
||||||
int8_t temperature = currentWeather.temperature;
|
int8_t temperature = currentWeather.temperature;
|
||||||
int16_t weatherConditionCode = currentWeather.weatherConditionCode;
|
int16_t weatherConditionCode = currentWeather.weatherConditionCode;
|
||||||
|
|
||||||
display.setFont(&DSEG7_Classic_Regular_39);
|
display.setFont(&DSEG7_Classic_Regular_39);
|
||||||
int16_t x1, y1;
|
int16_t x1, y1;
|
||||||
uint16_t w, h;
|
uint16_t w, h;
|
||||||
display.getTextBounds(String(temperature), 0, 0, &x1, &y1, &w, &h);
|
display.getTextBounds(String(temperature), 100, 150, &x1, &y1, &w, &h);
|
||||||
if(159 - w - x1 > 87){
|
display.setCursor(155 - w, 150);
|
||||||
display.setCursor(159 - w - x1, 150);
|
|
||||||
}else{
|
|
||||||
display.setFont(&DSEG7_Classic_Bold_25);
|
|
||||||
display.getTextBounds(String(temperature), 0, 0, &x1, &y1, &w, &h);
|
|
||||||
display.setCursor(159 - w - x1, 136);
|
|
||||||
}
|
|
||||||
display.println(temperature);
|
display.println(temperature);
|
||||||
display.drawBitmap(165, 110, currentWeather.isMetric ? celsius : fahrenheit, 26, 20, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
display.drawBitmap(165, 110, TEMP_UNIT == "metric" ? celsius : fahrenheit, 26, 20, GxEPD_WHITE);
|
||||||
const unsigned char* weatherIcon;
|
const unsigned char* weatherIcon;
|
||||||
|
|
||||||
if(WIFI_CONFIGURED){
|
|
||||||
//https://openweathermap.org/weather-conditions
|
//https://openweathermap.org/weather-conditions
|
||||||
if(weatherConditionCode > 801){//Cloudy
|
if(weatherConditionCode > 801){//Cloudy
|
||||||
weatherIcon = cloudy;
|
weatherIcon = cloudy;
|
||||||
|
@ -139,20 +112,15 @@ void Watchy7SEG::drawWeather(){
|
||||||
}else if(weatherConditionCode == 800){//Clear
|
}else if(weatherConditionCode == 800){//Clear
|
||||||
weatherIcon = sunny;
|
weatherIcon = sunny;
|
||||||
}else if(weatherConditionCode >=700){//Atmosphere
|
}else if(weatherConditionCode >=700){//Atmosphere
|
||||||
weatherIcon = atmosphere;
|
weatherIcon = cloudy;
|
||||||
}else if(weatherConditionCode >=600){//Snow
|
}else if(weatherConditionCode >=600){//Snow
|
||||||
weatherIcon = snow;
|
weatherIcon = snow;
|
||||||
}else if(weatherConditionCode >=500){//Rain
|
}else if(weatherConditionCode >=500){//Rain
|
||||||
weatherIcon = rain;
|
weatherIcon = rain;
|
||||||
}else if(weatherConditionCode >=300){//Drizzle
|
}else if(weatherConditionCode >=300){//Drizzle
|
||||||
weatherIcon = drizzle;
|
weatherIcon = rain;
|
||||||
}else if(weatherConditionCode >=200){//Thunderstorm
|
}else if(weatherConditionCode >=200){//Thunderstorm
|
||||||
weatherIcon = thunderstorm;
|
weatherIcon = rain;
|
||||||
}else
|
|
||||||
return;
|
|
||||||
}else{
|
|
||||||
weatherIcon = chip;
|
|
||||||
}
|
}
|
||||||
|
display.drawBitmap(145, 158, weatherIcon, WEATHER_ICON_WIDTH, WEATHER_ICON_HEIGHT, GxEPD_WHITE);
|
||||||
display.drawBitmap(145, 158, weatherIcon, WEATHER_ICON_WIDTH, WEATHER_ICON_HEIGHT, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
|
||||||
}
|
}
|
|
@ -9,8 +9,8 @@
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
|
|
||||||
class Watchy7SEG : public Watchy{
|
class Watchy7SEG : public Watchy{
|
||||||
using Watchy::Watchy;
|
|
||||||
public:
|
public:
|
||||||
|
Watchy7SEG();
|
||||||
void drawWatchFace();
|
void drawWatchFace();
|
||||||
void drawTime();
|
void drawTime();
|
||||||
void drawDate();
|
void drawDate();
|
||||||
|
|
|
@ -105,66 +105,6 @@ const unsigned char sunny [] PROGMEM = {
|
||||||
0xc0, 0x00, 0x00, 0x18, 0x20, 0x10, 0x60, 0x00, 0x00, 0x00, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00,
|
0xc0, 0x00, 0x00, 0x18, 0x20, 0x10, 0x60, 0x00, 0x00, 0x00, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
// 'atmosphere', 48x32px
|
|
||||||
const unsigned char atmosphere[] PROGMEM = {
|
|
||||||
0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x60,
|
|
||||||
0x00, 0x00, 0x00, 0x08, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x30,
|
|
||||||
0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00,
|
|
||||||
0x00, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x07, 0x80, 0x00, 0xc0, 0x00, 0x00,
|
|
||||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08,
|
|
||||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x04, 0x07, 0xff, 0xf8, 0xf0, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x80,
|
|
||||||
0x00, 0x00, 0x00, 0x60, 0x00, 0x9f, 0x1f, 0xff, 0xfc, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0xff, 0xfc, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
// 'drizzle', 48x32px
|
|
||||||
const unsigned char drizzle[] PROGMEM = {
|
|
||||||
0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x60,
|
|
||||||
0x00, 0x00, 0x00, 0x08, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x30,
|
|
||||||
0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00,
|
|
||||||
0x00, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x07, 0x80, 0x00, 0xc0, 0x00, 0x00,
|
|
||||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08,
|
|
||||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x80,
|
|
||||||
0x00, 0x00, 0x00, 0x60, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x08, 0x00, 0x00
|
|
||||||
};
|
|
||||||
// 'thunderstorm', 48x32px
|
|
||||||
const unsigned char thunderstorm[] PROGMEM = {
|
|
||||||
0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x60,
|
|
||||||
0x00, 0x00, 0x00, 0x08, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x30,
|
|
||||||
0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00,
|
|
||||||
0x00, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x07, 0x80, 0x00, 0xc0, 0x0f, 0x80,
|
|
||||||
0x00, 0xc0, 0x03, 0x00, 0x0f, 0x80, 0x00, 0x20, 0x02, 0x00, 0x1f, 0x00, 0x00, 0x10, 0x04, 0x00,
|
|
||||||
0x1e, 0x00, 0x00, 0x18, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x08, 0x08, 0x00, 0x3c, 0x00, 0x00, 0x08,
|
|
||||||
0x08, 0x00, 0x7c, 0x00, 0x00, 0x08, 0x04, 0x00, 0x78, 0x00, 0x00, 0x08, 0x04, 0x00, 0xf8, 0x00,
|
|
||||||
0x00, 0x08, 0x04, 0x00, 0xff, 0x00, 0x00, 0x10, 0x02, 0x00, 0x1f, 0x00, 0x00, 0x30, 0x01, 0x80,
|
|
||||||
0x1e, 0x00, 0x00, 0x60, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
|
|
||||||
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
|
// 'steps', 19x23px
|
||||||
const unsigned char steps [] PROGMEM = {
|
const unsigned char steps [] PROGMEM = {
|
||||||
0x00, 0x03, 0xc0, 0x00, 0x07, 0xe0, 0x00, 0x07, 0xe0, 0x00, 0x0f, 0xe0, 0x78, 0x0f, 0xe0, 0xfc,
|
0x00, 0x03, 0xc0, 0x00, 0x07, 0xe0, 0x00, 0x07, 0xe0, 0x00, 0x0f, 0xe0, 0x78, 0x0f, 0xe0, 0xfc,
|
||||||
|
@ -189,27 +129,3 @@ const unsigned char wifioff [] PROGMEM = {
|
||||||
0x01, 0xff, 0xc0, 0x00, 0x07, 0xe1, 0xc0, 0x00, 0x0f, 0xc0, 0x80, 0x00, 0x1f, 0x0c, 0x00, 0x00,
|
0x01, 0xff, 0xc0, 0x00, 0x07, 0xe1, 0xc0, 0x00, 0x0f, 0xc0, 0x80, 0x00, 0x1f, 0x0c, 0x00, 0x00,
|
||||||
0x3c, 0x1e, 0x00, 0x00, 0xf8, 0x0c, 0x00, 0x00
|
0x3c, 0x1e, 0x00, 0x00, 0xf8, 0x0c, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
// 'charge', 16x18px
|
|
||||||
const unsigned char charge [] PROGMEM = {
|
|
||||||
0x00, 0x10, 0x00, 0x70, 0x00, 0xe0, 0x01, 0xe0, 0x03, 0xe0, 0x07, 0xc0, 0x0f, 0xc0, 0x1f, 0xff,
|
|
||||||
0x3f, 0xfe, 0x7f, 0xfc, 0x7f, 0xf8, 0x03, 0xf0, 0x03, 0xe0, 0x07, 0xc0, 0x07, 0x80, 0x07, 0x00,
|
|
||||||
0x0e, 0x00, 0x0c, 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
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include <Watchy.h>
|
#include <Watchy.h>
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
Watchy watchy(settings);
|
Watchy watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include "Watchy_DOS.h"
|
#include "Watchy_DOS.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
WatchyDOS watchy(settings);
|
WatchyDOS watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "Watchy_DOS.h"
|
#include "Watchy_DOS.h"
|
||||||
|
|
||||||
|
WatchyDOS::WatchyDOS(){} //constructor
|
||||||
|
|
||||||
void WatchyDOS::drawWatchFace(){
|
void WatchyDOS::drawWatchFace(){
|
||||||
char time[6];
|
char time[6];
|
||||||
time[0] = '0' + ((currentTime.Hour/10)%10);
|
time[0] = '0' + ((currentTime.Hour/10)%10);
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include "Px437_IBM_BIOS5pt7b.h"
|
#include "Px437_IBM_BIOS5pt7b.h"
|
||||||
|
|
||||||
class WatchyDOS : public Watchy{
|
class WatchyDOS : public Watchy{
|
||||||
using Watchy::Watchy;
|
|
||||||
public:
|
public:
|
||||||
|
WatchyDOS();
|
||||||
void drawWatchFace();
|
void drawWatchFace();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include "Watchy_MacPaint.h"
|
#include "Watchy_MacPaint.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
WatchyMacPaint watchy(settings);
|
WatchyMacPaint watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
const unsigned char *numbers [10] = {numbers0, numbers1, numbers2, numbers3, numbers4, numbers5, numbers6, numbers7, numbers8, numbers9};
|
const unsigned char *numbers [10] = {numbers0, numbers1, numbers2, numbers3, numbers4, numbers5, numbers6, numbers7, numbers8, numbers9};
|
||||||
|
|
||||||
|
WatchyMacPaint::WatchyMacPaint(){} //constructor
|
||||||
|
|
||||||
void WatchyMacPaint::drawWatchFace(){
|
void WatchyMacPaint::drawWatchFace(){
|
||||||
display.fillScreen(GxEPD_WHITE);
|
display.fillScreen(GxEPD_WHITE);
|
||||||
display.drawBitmap(0, 0, window, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
display.drawBitmap(0, 0, window, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include "macpaint.h"
|
#include "macpaint.h"
|
||||||
|
|
||||||
class WatchyMacPaint : public Watchy{
|
class WatchyMacPaint : public Watchy{
|
||||||
using Watchy::Watchy;
|
|
||||||
public:
|
public:
|
||||||
|
WatchyMacPaint();
|
||||||
void drawWatchFace();
|
void drawWatchFace();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
|
@ -1,10 +0,0 @@
|
||||||
#include "Watchy_Mario.h"
|
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
WatchyMario watchy(settings);
|
|
||||||
|
|
||||||
void setup(){
|
|
||||||
watchy.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop(){}
|
|
|
@ -1,65 +0,0 @@
|
||||||
#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
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
#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
|
|
|
@ -1,600 +0,0 @@
|
||||||
// '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
|
|
||||||
};
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include "Watchy_Pokemon.h"
|
#include "Watchy_Pokemon.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
WatchyPokemon watchy(settings);
|
WatchyPokemon watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "Watchy_Pokemon.h"
|
#include "Watchy_Pokemon.h"
|
||||||
|
|
||||||
|
WatchyPokemon::WatchyPokemon(){} //constructor
|
||||||
|
|
||||||
void WatchyPokemon::drawWatchFace(){
|
void WatchyPokemon::drawWatchFace(){
|
||||||
display.fillScreen(GxEPD_WHITE);
|
display.fillScreen(GxEPD_WHITE);
|
||||||
display.drawBitmap(0, 0, pokemon, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
display.drawBitmap(0, 0, pokemon, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
#include "pokemon.h"
|
#include "pokemon.h"
|
||||||
|
|
||||||
class WatchyPokemon : public Watchy{
|
class WatchyPokemon : public Watchy{
|
||||||
using Watchy::Watchy;
|
|
||||||
public:
|
public:
|
||||||
|
WatchyPokemon();
|
||||||
void drawWatchFace();
|
void drawWatchFace();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -6,7 +6,6 @@
|
||||||
#include <Fonts/FreeSansBold9pt7b.h> //include any fonts you want to use
|
#include <Fonts/FreeSansBold9pt7b.h> //include any fonts you want to use
|
||||||
#include "MadeSunflower39pt7b.h"
|
#include "MadeSunflower39pt7b.h"
|
||||||
#include "stars.h"
|
#include "stars.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
#define STAR_COUNT 900
|
#define STAR_COUNT 900
|
||||||
|
|
||||||
|
@ -51,9 +50,9 @@ struct xyPoint rotatePointAround(int x, int y, int ox, int oy, double angle) {
|
||||||
|
|
||||||
class StarryHorizon : public Watchy {
|
class StarryHorizon : public Watchy {
|
||||||
public:
|
public:
|
||||||
StarryHorizon(const watchySettings& s) : Watchy(s) {
|
StarryHorizon() {
|
||||||
// uncomment to re-generate stars
|
// uncomment to re-generate stars
|
||||||
// initStars();
|
// initStars();
|
||||||
}
|
}
|
||||||
void drawWatchFace(){
|
void drawWatchFace(){
|
||||||
display.fillScreen(GxEPD_BLACK);
|
display.fillScreen(GxEPD_BLACK);
|
||||||
|
@ -117,7 +116,7 @@ class StarryHorizon : public Watchy {
|
||||||
display.setTextColor(GxEPD_WHITE);
|
display.setTextColor(GxEPD_WHITE);
|
||||||
display.setTextWrap(false);
|
display.setTextWrap(false);
|
||||||
char* dateStr;
|
char* dateStr;
|
||||||
asprintf(&dateStr, "%s %s %d", dayOfWeek.c_str(), monthStr.c_str(), currentTime.Day);
|
asprintf(&dateStr, "%s %s %d", dayOfWeek, monthStr, currentTime.Day);
|
||||||
drawCenteredString(dateStr, 100, 140, true);
|
drawCenteredString(dateStr, 100, 140, true);
|
||||||
free(dateStr);
|
free(dateStr);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +139,7 @@ class StarryHorizon : public Watchy {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
StarryHorizon face(settings); //instantiate watchface
|
StarryHorizon face; //instantiate watchface
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
face.init(); //call init in setup
|
face.init(); //call init in setup
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
|
@ -1,7 +1,6 @@
|
||||||
#include "Watchy_Tetris.h"
|
#include "Watchy_Tetris.h"
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
WatchyTetris watchy(settings);
|
WatchyTetris watchy;
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
watchy.init();
|
watchy.init();
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
const unsigned char *tetris_nums [10] = {tetris0, tetris1, tetris2, tetris3, tetris4, tetris5, tetris6, tetris7, tetris8, tetris9};
|
const unsigned char *tetris_nums [10] = {tetris0, tetris1, tetris2, tetris3, tetris4, tetris5, tetris6, tetris7, tetris8, tetris9};
|
||||||
|
|
||||||
|
WatchyTetris::WatchyTetris(){} //constructor
|
||||||
|
|
||||||
void WatchyTetris::drawWatchFace(){
|
void WatchyTetris::drawWatchFace(){
|
||||||
display.fillScreen(GxEPD_WHITE);
|
display.fillScreen(GxEPD_WHITE);
|
||||||
display.drawBitmap(0, 0, tetrisbg, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
display.drawBitmap(0, 0, tetrisbg, DISPLAY_WIDTH, DISPLAY_HEIGHT, GxEPD_BLACK);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
class WatchyTetris : public Watchy{
|
class WatchyTetris : public Watchy{
|
||||||
public:
|
public:
|
||||||
using Watchy::Watchy;
|
WatchyTetris();
|
||||||
void drawWatchFace();
|
void drawWatchFace();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#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
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.0 KiB |
|
@ -16,14 +16,6 @@
|
||||||
"source" : "https://github.com/sqfmi/Watchy/tree/master/examples/WatchFaces/7_SEG",
|
"source" : "https://github.com/sqfmi/Watchy/tree/master/examples/WatchFaces/7_SEG",
|
||||||
"version" : "1.0.0"
|
"version" : "1.0.0"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id" : "2A",
|
|
||||||
"name" : "7_SEG_LIGHT",
|
|
||||||
"author" : "SQFMI",
|
|
||||||
"screenshot" : "https://raw.githubusercontent.com/sqfmi/Watchy/master/extras/WatchFaces/2_7_SEG_LIGHT.png",
|
|
||||||
"source" : "https://github.com/sqfmi/Watchy/tree/master/examples/WatchFaces/7_SEG",
|
|
||||||
"version" : "1.0.0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id" : "3",
|
"id" : "3",
|
||||||
"name" : "DOS",
|
"name" : "DOS",
|
||||||
|
@ -60,17 +52,9 @@
|
||||||
"id" : "7",
|
"id" : "7",
|
||||||
"name" : "MacPaint",
|
"name" : "MacPaint",
|
||||||
"author" : "SQFMI",
|
"author" : "SQFMI",
|
||||||
"screenshot" : "https://raw.githubusercontent.com/sqfmi/Watchy/master/extras/WatchFaces/7_MacPaint.png",
|
"screenshot" : "https://raw.githubusercontent.com/sqfmi/Watchy/master/extras/WatchFaces/6_MacPaint.png",
|
||||||
"source" : "https://github.com/sqfmi/Watchy/tree/master/examples/WatchFaces/MacPaint",
|
"source" : "https://github.com/sqfmi/Watchy/tree/master/examples/WatchFaces/MacPaint",
|
||||||
"version" : "1.0.0"
|
"version" : "1.0.0"
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "8",
|
|
||||||
"name" : "Bahn",
|
|
||||||
"author" : "BraininaBowl",
|
|
||||||
"screenshot" : "https://raw.githubusercontent.com/sqfmi/Watchy/master/extras/WatchFaces/8_Bahn.png",
|
|
||||||
"source" : "https://github.com/BraininaBowl/Bahn-for-Watchy",
|
|
||||||
"version" : "1.0.0"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
36
library.json
36
library.json
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Watchy",
|
|
||||||
"version": "1.4.14",
|
|
||||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "SQFMI",
|
|
||||||
"url": "https://github.com/sqfmi"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"homepage": "https://watchy.sqfmi.com",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/sqfmi/Watchy.git"
|
|
||||||
},
|
|
||||||
"frameworks": "arduino",
|
|
||||||
"platforms": ["espressif32"],
|
|
||||||
"dependencies": [
|
|
||||||
{ "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",
|
|
||||||
"version": "https://github.com/ZinggJM/GxEPD2.git#master"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "WiFiManager",
|
|
||||||
"version": "https://github.com/tzapu/WiFiManager.git#master"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
name=Watchy
|
name=Watchy
|
||||||
version=1.4.14
|
version=1.2.1
|
||||||
author=SQFMI
|
author=SQFMI
|
||||||
maintainer=SQFMI
|
maintainer=SQFMI
|
||||||
sentence=Watchy - An Open Source E-Paper Watch by 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
|
category=Other
|
||||||
url=https://watchy.sqfmi.com
|
url=https://watchy.sqfmi.com
|
||||||
architectures=esp32
|
architectures=esp32
|
||||||
depends=Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
|
depends=Adafruit GFX Library,Arduino_JSON,DS3232RTC,GxEPD2,WiFiManager
|
||||||
|
|
99
src/BLE.cpp
99
src/BLE.cpp
|
@ -6,8 +6,7 @@
|
||||||
#define SERVICE_UUID_OTA "86b12865-4b70-4893-8ce6-9864fc00374d"
|
#define SERVICE_UUID_OTA "86b12865-4b70-4893-8ce6-9864fc00374d"
|
||||||
#define CHARACTERISTIC_UUID_FW "86b12866-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_HW_VERSION "86b12867-4b70-4893-8ce6-9864fc00374d"
|
||||||
#define CHARACTERISTIC_UUID_WATCHFACE_NAME \
|
#define CHARACTERISTIC_UUID_WATCHFACE_NAME "86b12868-4b70-4893-8ce6-9864fc00374d"
|
||||||
"86b12868-4b70-4893-8ce6-9864fc00374d"
|
|
||||||
|
|
||||||
#define FULL_PACKET 512
|
#define FULL_PACKET 512
|
||||||
#define CHARPOS_UPDATE_FLAG 5
|
#define CHARPOS_UPDATE_FLAG 5
|
||||||
|
@ -23,63 +22,78 @@ int status = -1;
|
||||||
int bytesReceived = 0;
|
int bytesReceived = 0;
|
||||||
bool updateFlag = false;
|
bool updateFlag = false;
|
||||||
|
|
||||||
class BLECustomServerCallbacks : public BLEServerCallbacks {
|
|
||||||
void onConnect(BLEServer *pServer) { status = STATUS_CONNECTED; };
|
|
||||||
|
|
||||||
void onDisconnect(BLEServer *pServer) { status = STATUS_DISCONNECTED; }
|
class BLECustomServerCallbacks: public BLEServerCallbacks {
|
||||||
|
void onConnect(BLEServer* pServer) {
|
||||||
|
status = STATUS_CONNECTED;
|
||||||
|
};
|
||||||
|
|
||||||
|
void onDisconnect(BLEServer* pServer) {
|
||||||
|
status = STATUS_DISCONNECTED;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class otaCallback : public BLECharacteristicCallbacks {
|
class otaCallback: public BLECharacteristicCallbacks {
|
||||||
public:
|
public:
|
||||||
otaCallback(BLE *ble) { _p_ble = ble; }
|
otaCallback(BLE* ble) {
|
||||||
BLE *_p_ble;
|
_p_ble = ble;
|
||||||
|
}
|
||||||
|
BLE* _p_ble;
|
||||||
|
|
||||||
void onWrite(BLECharacteristic *pCharacteristic);
|
void onWrite(BLECharacteristic *pCharacteristic);
|
||||||
};
|
};
|
||||||
|
|
||||||
void otaCallback::onWrite(BLECharacteristic *pCharacteristic) {
|
void otaCallback::onWrite(BLECharacteristic *pCharacteristic)
|
||||||
auto rxData = pCharacteristic->getValue();
|
{
|
||||||
if (!updateFlag) { // If it's the first packet of OTA since bootup, begin OTA
|
std::string rxData = pCharacteristic->getValue();
|
||||||
// Serial.println("Begin FW Update");
|
if (!updateFlag) { //If it's the first packet of OTA since bootup, begin OTA
|
||||||
esp_ota_begin(esp_ota_get_next_update_partition(NULL), OTA_SIZE_UNKNOWN,
|
//Serial.println("Begin FW Update");
|
||||||
&otaHandler);
|
esp_ota_begin(esp_ota_get_next_update_partition(NULL), OTA_SIZE_UNKNOWN, &otaHandler);
|
||||||
updateFlag = true;
|
updateFlag = true;
|
||||||
status = STATUS_UPDATING;
|
status = STATUS_UPDATING;
|
||||||
}
|
}
|
||||||
if (_p_ble != NULL) {
|
if (_p_ble != NULL)
|
||||||
if (rxData.length() > 0) {
|
{
|
||||||
|
if (rxData.length() > 0)
|
||||||
|
{
|
||||||
esp_ota_write(otaHandler, rxData.c_str(), rxData.length());
|
esp_ota_write(otaHandler, rxData.c_str(), rxData.length());
|
||||||
bytesReceived = bytesReceived + rxData.length();
|
bytesReceived = bytesReceived + rxData.length();
|
||||||
if (rxData.length() != FULL_PACKET) {
|
if (rxData.length() != FULL_PACKET)
|
||||||
|
{
|
||||||
esp_ota_end(otaHandler);
|
esp_ota_end(otaHandler);
|
||||||
// Serial.println("End FW Update");
|
//Serial.println("End FW Update");
|
||||||
if (ESP_OK == esp_ota_set_boot_partition(
|
if (ESP_OK == esp_ota_set_boot_partition(esp_ota_get_next_update_partition(NULL))) {
|
||||||
esp_ota_get_next_update_partition(NULL))) {
|
|
||||||
status = STATUS_READY;
|
status = STATUS_READY;
|
||||||
} else {
|
}
|
||||||
// Serial.println("Upload Error");
|
else {
|
||||||
|
//Serial.println("Upload Error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t txData[5] = {1, 2, 3, 4, 5};
|
uint8_t txData[5] = {1, 2, 3, 4, 5};
|
||||||
// delay(1000);
|
//delay(1000);
|
||||||
pCharacteristic->setValue((uint8_t *)txData, 5);
|
pCharacteristic->setValue((uint8_t*)txData, 5);
|
||||||
pCharacteristic->notify();
|
pCharacteristic->notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor
|
// Constructor
|
||||||
BLE::BLE(void) {}
|
BLE::BLE(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Destructor
|
// Destructor
|
||||||
BLE::~BLE(void) {}
|
BLE::~BLE(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// begin
|
// begin
|
||||||
bool BLE::begin(const char *localName = "Watchy BLE OTA") {
|
bool BLE::begin(const char* localName = "Watchy BLE OTA") {
|
||||||
// Create the BLE Device
|
// Create the BLE Device
|
||||||
BLEDevice::init(localName);
|
BLEDevice::init(localName);
|
||||||
|
|
||||||
|
@ -93,17 +107,24 @@ bool BLE::begin(const char *localName = "Watchy BLE OTA") {
|
||||||
|
|
||||||
// Create a BLE Characteristic
|
// Create a BLE Characteristic
|
||||||
pESPOTAIdCharacteristic = pESPOTAService->createCharacteristic(
|
pESPOTAIdCharacteristic = pESPOTAService->createCharacteristic(
|
||||||
CHARACTERISTIC_UUID_ID, BLECharacteristic::PROPERTY_READ);
|
CHARACTERISTIC_UUID_ID,
|
||||||
|
BLECharacteristic::PROPERTY_READ
|
||||||
|
);
|
||||||
|
|
||||||
pVersionCharacteristic = pService->createCharacteristic(
|
pVersionCharacteristic = pService->createCharacteristic(
|
||||||
CHARACTERISTIC_UUID_HW_VERSION, BLECharacteristic::PROPERTY_READ);
|
CHARACTERISTIC_UUID_HW_VERSION,
|
||||||
|
BLECharacteristic::PROPERTY_READ
|
||||||
|
);
|
||||||
|
|
||||||
pWatchFaceNameCharacteristic = pService->createCharacteristic(
|
pWatchFaceNameCharacteristic = pService->createCharacteristic(
|
||||||
CHARACTERISTIC_UUID_WATCHFACE_NAME, BLECharacteristic::PROPERTY_READ);
|
CHARACTERISTIC_UUID_WATCHFACE_NAME,
|
||||||
|
BLECharacteristic::PROPERTY_READ
|
||||||
|
);
|
||||||
|
|
||||||
pOtaCharacteristic = pService->createCharacteristic(
|
pOtaCharacteristic = pService->createCharacteristic(
|
||||||
CHARACTERISTIC_UUID_FW,
|
CHARACTERISTIC_UUID_FW,
|
||||||
BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE);
|
BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
pOtaCharacteristic->addDescriptor(new BLE2902());
|
pOtaCharacteristic->addDescriptor(new BLE2902());
|
||||||
pOtaCharacteristic->setCallbacks(new otaCallback(this));
|
pOtaCharacteristic->setCallbacks(new otaCallback(this));
|
||||||
|
@ -116,15 +137,17 @@ bool BLE::begin(const char *localName = "Watchy BLE OTA") {
|
||||||
pServer->getAdvertising()->addServiceUUID(SERVICE_UUID_ESPOTA);
|
pServer->getAdvertising()->addServiceUUID(SERVICE_UUID_ESPOTA);
|
||||||
pServer->getAdvertising()->start();
|
pServer->getAdvertising()->start();
|
||||||
|
|
||||||
uint8_t hardwareVersion[5] = {HARDWARE_VERSION_MAJOR, HARDWARE_VERSION_MINOR,
|
uint8_t hardwareVersion[5] = {HARDWARE_VERSION_MAJOR, HARDWARE_VERSION_MINOR, SOFTWARE_VERSION_MAJOR, SOFTWARE_VERSION_MINOR, SOFTWARE_VERSION_PATCH};
|
||||||
SOFTWARE_VERSION_MAJOR, SOFTWARE_VERSION_MINOR,
|
pVersionCharacteristic->setValue((uint8_t*)hardwareVersion, 5);
|
||||||
SOFTWARE_VERSION_PATCH};
|
|
||||||
pVersionCharacteristic->setValue((uint8_t *)hardwareVersion, 5);
|
|
||||||
pWatchFaceNameCharacteristic->setValue("Watchy 7 Segment");
|
pWatchFaceNameCharacteristic->setValue("Watchy 7 Segment");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BLE::updateStatus() { return status; }
|
int BLE::updateStatus(){
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
int BLE::howManyBytes() { return bytesReceived; }
|
int BLE::howManyBytes(){
|
||||||
|
return bytesReceived;
|
||||||
|
}
|
20
src/BLE.h
20
src/BLE.h
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
|
|
||||||
#include <BLE2902.h>
|
|
||||||
#include <BLEDevice.h>
|
#include <BLEDevice.h>
|
||||||
#include <BLEServer.h>
|
#include <BLEServer.h>
|
||||||
#include <BLEUtils.h>
|
#include <BLEUtils.h>
|
||||||
|
#include <BLE2902.h>
|
||||||
|
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
|
|
||||||
|
@ -14,27 +14,29 @@
|
||||||
|
|
||||||
class BLE;
|
class BLE;
|
||||||
|
|
||||||
class BLE {
|
class BLE
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
BLE(void);
|
BLE(void);
|
||||||
~BLE(void);
|
~BLE(void);
|
||||||
|
|
||||||
bool begin(const char *localName);
|
bool begin(const char* localName);
|
||||||
int updateStatus();
|
int updateStatus();
|
||||||
int howManyBytes();
|
int howManyBytes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
String local_name;
|
String local_name;
|
||||||
|
|
||||||
BLEServer *pServer = NULL;
|
BLEServer *pServer = NULL;
|
||||||
|
|
||||||
BLEService *pESPOTAService = NULL;
|
BLEService *pESPOTAService = NULL;
|
||||||
BLECharacteristic *pESPOTAIdCharacteristic = NULL;
|
BLECharacteristic * pESPOTAIdCharacteristic = NULL;
|
||||||
|
|
||||||
BLEService *pService = NULL;
|
BLEService *pService = NULL;
|
||||||
BLECharacteristic *pVersionCharacteristic = NULL;
|
BLECharacteristic * pVersionCharacteristic = NULL;
|
||||||
BLECharacteristic *pOtaCharacteristic = NULL;
|
BLECharacteristic * pOtaCharacteristic = NULL;
|
||||||
BLECharacteristic *pWatchFaceNameCharacteristic = NULL;
|
BLECharacteristic * pWatchFaceNameCharacteristic = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
504
src/Display.cpp
504
src/Display.cpp
|
@ -1,504 +0,0 @@
|
||||||
// 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"
|
|
||||||
|
|
||||||
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
|
|
||||||
#ifdef ARDUINO_ESP32S3_DEV
|
|
||||||
SPI.begin(WATCHY_V3_SCK,WATCHY_V3_MISO,WATCHY_V3_MOSI,WATCHY_V3_SS);
|
|
||||||
#endif
|
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,99 +0,0 @@
|
||||||
// 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>
|
|
||||||
#include "driver/gpio.h"
|
|
||||||
#include "config.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);
|
|
||||||
};
|
|
810
src/Watchy.cpp
810
src/Watchy.cpp
File diff suppressed because it is too large
Load Diff
92
src/Watchy.h
92
src/Watchy.h
|
@ -4,94 +4,39 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <WiFiManager.h>
|
#include <WiFiManager.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
#include <NTPClient.h>
|
|
||||||
#include <WiFiUdp.h>
|
|
||||||
#include <Arduino_JSON.h>
|
#include <Arduino_JSON.h>
|
||||||
|
#include <DS3232RTC.h>
|
||||||
#include <GxEPD2_BW.h>
|
#include <GxEPD2_BW.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <Fonts/FreeMonoBold9pt7b.h>
|
#include <Fonts/FreeMonoBold9pt7b.h>
|
||||||
#include "DSEG7_Classic_Bold_53.h"
|
#include "DSEG7_Classic_Bold_53.h"
|
||||||
#include "Display.h"
|
|
||||||
#include "BLE.h"
|
#include "BLE.h"
|
||||||
#include "bma.h"
|
#include "bma.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "esp_chip_info.h"
|
|
||||||
#ifdef ARDUINO_ESP32S3_DEV
|
|
||||||
#include "Watchy32KRTC.h"
|
|
||||||
#include "soc/rtc.h"
|
|
||||||
#include "soc/rtc_io_reg.h"
|
|
||||||
#include "soc/sens_reg.h"
|
|
||||||
#include "esp_sleep.h"
|
|
||||||
#include "rom/rtc.h"
|
|
||||||
#include "soc/soc.h"
|
|
||||||
#include "soc/rtc_cntl_reg.h"
|
|
||||||
#include "time.h"
|
|
||||||
#include "esp_sntp.h"
|
|
||||||
#include "hal/rtc_io_types.h"
|
|
||||||
#include "driver/rtc_io.h"
|
|
||||||
#define uS_TO_S_FACTOR 1000000ULL //Conversion factor for micro seconds to seconds
|
|
||||||
#define ADC_VOLTAGE_DIVIDER ((360.0f+100.0f)/360.0f) //Voltage divider at battery ADC
|
|
||||||
#else
|
|
||||||
#include "WatchyRTC.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct weatherData {
|
typedef struct weatherData{
|
||||||
int8_t temperature;
|
int8_t temperature;
|
||||||
int16_t weatherConditionCode;
|
int16_t weatherConditionCode;
|
||||||
bool isMetric;
|
}weatherData;
|
||||||
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;
|
|
||||||
String weatherLang;
|
|
||||||
int8_t weatherUpdateInterval;
|
|
||||||
// NTP Settings
|
|
||||||
String ntpServer;
|
|
||||||
int gmtOffset;
|
|
||||||
//
|
|
||||||
bool vibrateOClock;
|
|
||||||
} watchySettings;
|
|
||||||
|
|
||||||
class Watchy {
|
class Watchy {
|
||||||
public:
|
public:
|
||||||
#ifdef ARDUINO_ESP32S3_DEV
|
static DS3232RTC RTC;
|
||||||
static Watchy32KRTC RTC;
|
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
||||||
#else
|
|
||||||
static WatchyRTC RTC;
|
|
||||||
#endif
|
|
||||||
static GxEPD2_BW<WatchyDisplay, WatchyDisplay::HEIGHT> display;
|
|
||||||
tmElements_t currentTime;
|
tmElements_t currentTime;
|
||||||
watchySettings settings;
|
public:
|
||||||
|
Watchy();
|
||||||
public:
|
void init();
|
||||||
explicit Watchy(const watchySettings &s) : settings(s) {} // constructor
|
|
||||||
void init(String datetime = "");
|
|
||||||
void deepSleep();
|
void deepSleep();
|
||||||
float getBatteryVoltage();
|
float getBatteryVoltage();
|
||||||
uint8_t getBoardRevision();
|
|
||||||
void vibMotor(uint8_t intervalMs = 100, uint8_t length = 20);
|
void vibMotor(uint8_t intervalMs = 100, uint8_t length = 20);
|
||||||
|
|
||||||
virtual void handleButtonPress();
|
void handleButtonPress();
|
||||||
void showMenu(byte menuIndex, bool partialRefresh);
|
void showMenu(byte menuIndex, bool partialRefresh);
|
||||||
void showFastMenu(byte menuIndex);
|
void showBattery();
|
||||||
void showAbout();
|
|
||||||
void showBuzz();
|
void showBuzz();
|
||||||
void showAccelerometer();
|
void showAccelerometer();
|
||||||
void showUpdateFW();
|
void showUpdateFW();
|
||||||
void showSyncNTP();
|
|
||||||
bool syncNTP();
|
|
||||||
bool syncNTP(long gmt);
|
|
||||||
bool syncNTP(long gmt, String ntpServer);
|
|
||||||
void setTime();
|
void setTime();
|
||||||
void setupWifi();
|
void setupWifi();
|
||||||
bool connectWiFi();
|
bool connectWiFi();
|
||||||
|
@ -99,18 +44,14 @@ public:
|
||||||
void updateFWBegin();
|
void updateFWBegin();
|
||||||
|
|
||||||
void showWatchFace(bool partialRefresh);
|
void showWatchFace(bool partialRefresh);
|
||||||
virtual void drawWatchFace(); // override this method for different watch
|
virtual void drawWatchFace(); //override this method for different watch faces
|
||||||
// faces
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void _rtcConfig();
|
||||||
void _bmaConfig();
|
void _bmaConfig();
|
||||||
static void _configModeCallback(WiFiManager *myWiFiManager);
|
static void _configModeCallback(WiFiManager *myWiFiManager);
|
||||||
static uint16_t _readRegister(uint8_t address, uint8_t reg, uint8_t *data,
|
static uint16_t _readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len);
|
||||||
uint16_t len);
|
static uint16_t _writeRegister(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;
|
extern RTC_DATA_ATTR int guiState;
|
||||||
|
@ -118,6 +59,5 @@ extern RTC_DATA_ATTR int menuIndex;
|
||||||
extern RTC_DATA_ATTR BMA423 sensor;
|
extern RTC_DATA_ATTR BMA423 sensor;
|
||||||
extern RTC_DATA_ATTR bool WIFI_CONFIGURED;
|
extern RTC_DATA_ATTR bool WIFI_CONFIGURED;
|
||||||
extern RTC_DATA_ATTR bool BLE_CONFIGURED;
|
extern RTC_DATA_ATTR bool BLE_CONFIGURED;
|
||||||
extern RTC_DATA_ATTR bool USB_PLUGGED_IN;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,103 +0,0 @@
|
||||||
#include "Watchy32KRTC.h"
|
|
||||||
|
|
||||||
Watchy32KRTC::Watchy32KRTC(){}
|
|
||||||
|
|
||||||
void Watchy32KRTC::init() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
setenv("TZ", "", 1);
|
|
||||||
tzset();
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
void Watchy32KRTC::config(String datetime) { // String datetime format is YYYY:MM:DD:HH:MM:SS
|
|
||||||
struct tm timeInfo;
|
|
||||||
memset(&timeInfo, 0, sizeof(timeInfo));
|
|
||||||
|
|
||||||
// Parse the time string
|
|
||||||
if (strptime(datetime.c_str(), "%Y:%m:%d:%H:%M:%S", &timeInfo) == NULL) {
|
|
||||||
// Failed to parse the time string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert tm to timeval
|
|
||||||
struct timeval tv;
|
|
||||||
tv.tv_sec = mktime(&timeInfo);
|
|
||||||
tv.tv_usec = 0;
|
|
||||||
|
|
||||||
// Set the time using settimeofday
|
|
||||||
if (settimeofday(&tv, NULL) != 0) {
|
|
||||||
// Error setting the time
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Watchy32KRTC::clearAlarm() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Watchy32KRTC::read(tmElements_t &tm) {
|
|
||||||
time_t now;
|
|
||||||
struct tm timeInfo;
|
|
||||||
time(&now);
|
|
||||||
// Set timezone to China Standard Time
|
|
||||||
//setenv("TZ", "CST-8", 1);
|
|
||||||
//tzset();
|
|
||||||
localtime_r(&now, &timeInfo);
|
|
||||||
tm.Year = timeInfo.tm_year - 70;
|
|
||||||
tm.Month = timeInfo.tm_mon + 1;
|
|
||||||
tm.Day = timeInfo.tm_mday;
|
|
||||||
tm.Wday = timeInfo.tm_wday + 1;
|
|
||||||
tm.Hour = timeInfo.tm_hour;
|
|
||||||
tm.Minute = timeInfo.tm_min;
|
|
||||||
tm.Second = timeInfo.tm_sec;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Watchy32KRTC::set(tmElements_t tm) {
|
|
||||||
struct tm timeInfo;
|
|
||||||
timeInfo.tm_year = tm.Year + 70;
|
|
||||||
timeInfo.tm_mon = tm.Month - 1;
|
|
||||||
timeInfo.tm_mday = tm.Day;
|
|
||||||
timeInfo.tm_hour = tm.Hour;
|
|
||||||
timeInfo.tm_min = tm.Minute;
|
|
||||||
timeInfo.tm_sec = tm.Second;
|
|
||||||
|
|
||||||
// Convert tm to timeval
|
|
||||||
struct timeval tv;
|
|
||||||
tv.tv_sec = mktime(&timeInfo);
|
|
||||||
tv.tv_usec = 0;
|
|
||||||
|
|
||||||
// Set the time using settimeofday
|
|
||||||
if (settimeofday(&tv, NULL) != 0) {
|
|
||||||
// Error setting the time
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Watchy32KRTC::temperature() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
String Watchy32KRTC::_getValue(String data, char separator, int index) {
|
|
||||||
int found = 0;
|
|
||||||
int strIndex[] = {0, -1};
|
|
||||||
int maxIndex = data.length() - 1;
|
|
||||||
|
|
||||||
for (int i = 0; i <= maxIndex && found <= index; i++) {
|
|
||||||
if (data.charAt(i) == separator || i == maxIndex) {
|
|
||||||
found++;
|
|
||||||
strIndex[0] = strIndex[1] + 1;
|
|
||||||
strIndex[1] = (i == maxIndex) ? i + 1 : i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
void Watchy32KRTC::_timeval_to_tm(struct timeval *tv, struct tm *tm) {
|
|
||||||
// Get the seconds and microseconds from the timeval struct
|
|
||||||
time_t seconds = tv->tv_sec;
|
|
||||||
int microseconds = tv->tv_usec;
|
|
||||||
// Convert the seconds to a tm struct
|
|
||||||
*tm = *localtime(&seconds);
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
#ifndef WATCHY_32K_RTC_H
|
|
||||||
#define WATCHY_32K_RTC_H
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <TimeLib.h>
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
class Watchy32KRTC {
|
|
||||||
public:
|
|
||||||
Watchy32KRTC();
|
|
||||||
void init();
|
|
||||||
void config(String datetime); //datetime format is YYYY:MM:DD:HH:MM:SS
|
|
||||||
void clearAlarm();
|
|
||||||
void read(tmElements_t &tm);
|
|
||||||
void set(tmElements_t tm);
|
|
||||||
uint8_t temperature();
|
|
||||||
|
|
||||||
private:
|
|
||||||
String _getValue(String data, char separator, int index);
|
|
||||||
void _timeval_to_tm(struct timeval *tv, struct tm *tm);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,150 +0,0 @@
|
||||||
#include "WatchyRTC.h"
|
|
||||||
|
|
||||||
WatchyRTC::WatchyRTC() : rtc_ds(false) {}
|
|
||||||
|
|
||||||
void WatchyRTC::init() {
|
|
||||||
byte error;
|
|
||||||
Wire.beginTransmission(RTC_DS_ADDR);
|
|
||||||
error = Wire.endTransmission();
|
|
||||||
if (error == 0) {
|
|
||||||
rtcType = DS3231;
|
|
||||||
} else {
|
|
||||||
Wire.beginTransmission(RTC_PCF_ADDR);
|
|
||||||
error = Wire.endTransmission();
|
|
||||||
if (error == 0) {
|
|
||||||
rtcType = PCF8563;
|
|
||||||
} else {
|
|
||||||
// RTC Error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WatchyRTC::config(
|
|
||||||
String datetime) { // String datetime format is YYYY:MM:DD:HH:MM:SS
|
|
||||||
if (rtcType == DS3231) {
|
|
||||||
_DSConfig(datetime);
|
|
||||||
} else {
|
|
||||||
_PCFConfig(datetime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WatchyRTC::clearAlarm() {
|
|
||||||
if (rtcType == DS3231) {
|
|
||||||
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
|
|
||||||
rtc_pcf.setAlarm(nextAlarmMinute, 99, 99, 99);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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.Hour = rtc_pcf.getHour();
|
|
||||||
tm.Minute = rtc_pcf.getMinute();
|
|
||||||
tm.Second = rtc_pcf.getSecond();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WatchyRTC::set(tmElements_t tm) {
|
|
||||||
if (rtcType == DS3231) {
|
|
||||||
time_t t = makeTime(tm);
|
|
||||||
rtc_ds.set(t);
|
|
||||||
} else {
|
|
||||||
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
|
|
||||||
// hr, min, sec
|
|
||||||
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
|
|
||||||
clearAlarm();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t WatchyRTC::temperature() {
|
|
||||||
if (rtcType == DS3231) {
|
|
||||||
return rtc_ds.temperature();
|
|
||||||
} else {
|
|
||||||
return 255; // error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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.Month = _getValue(datetime, ':', 1).toInt();
|
|
||||||
tm.Day = _getValue(datetime, ':', 2).toInt();
|
|
||||||
tm.Hour = _getValue(datetime, ':', 3).toInt();
|
|
||||||
tm.Minute = _getValue(datetime, ':', 4).toInt();
|
|
||||||
tm.Second = _getValue(datetime, ':', 5).toInt();
|
|
||||||
time_t t = makeTime(tm);
|
|
||||||
rtc_ds.set(t);
|
|
||||||
}
|
|
||||||
// https://github.com/JChristensen/DS3232RTC
|
|
||||||
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
|
|
||||||
if (datetime != "") {
|
|
||||||
tmElements_t tm;
|
|
||||||
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();
|
|
||||||
tm.Minute = _getValue(datetime, ':', 4).toInt();
|
|
||||||
tm.Second = _getValue(datetime, ':', 5).toInt();
|
|
||||||
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
|
|
||||||
// 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
|
|
||||||
clearAlarm();
|
|
||||||
}
|
|
||||||
|
|
||||||
String WatchyRTC::_getValue(String data, char separator, int index) {
|
|
||||||
int found = 0;
|
|
||||||
int strIndex[] = {0, -1};
|
|
||||||
int maxIndex = data.length() - 1;
|
|
||||||
|
|
||||||
for (int i = 0; i <= maxIndex && found <= index; i++) {
|
|
||||||
if (data.charAt(i) == separator || i == maxIndex) {
|
|
||||||
found++;
|
|
||||||
strIndex[0] = strIndex[1] + 1;
|
|
||||||
strIndex[1] = (i == maxIndex) ? i + 1 : i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
#ifndef WATCHY_RTC_H
|
|
||||||
#define WATCHY_RTC_H
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "time.h"
|
|
||||||
#include <DS3232RTC.h>
|
|
||||||
#include <Rtc_Pcf8563.h>
|
|
||||||
|
|
||||||
#define DS3231 1
|
|
||||||
#define PCF8563 2
|
|
||||||
#define RTC_DS_ADDR 0x68
|
|
||||||
#define RTC_PCF_ADDR 0x51
|
|
||||||
#define YEAR_OFFSET_DS 1970
|
|
||||||
#define YEAR_OFFSET_PCF 2000
|
|
||||||
|
|
||||||
class WatchyRTC {
|
|
||||||
public:
|
|
||||||
DS3232RTC rtc_ds;
|
|
||||||
Rtc_Pcf8563 rtc_pcf;
|
|
||||||
uint8_t rtcType;
|
|
||||||
|
|
||||||
public:
|
|
||||||
WatchyRTC();
|
|
||||||
void init();
|
|
||||||
void config(String datetime); // String datetime format is YYYY:MM:DD:HH:MM:SS
|
|
||||||
void clearAlarm();
|
|
||||||
void read(tmElements_t &tm);
|
|
||||||
void set(tmElements_t tm);
|
|
||||||
uint8_t temperature();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void _DSConfig(String datetime);
|
|
||||||
void _PCFConfig(String datetime);
|
|
||||||
int _getDayOfWeek(int d, int m, int y);
|
|
||||||
String _getValue(String data, char separator, int index);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
178
src/bma.cpp
178
src/bma.cpp
|
@ -7,20 +7,28 @@
|
||||||
#define DEBUG(...)
|
#define DEBUG(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BMA423::BMA423() {
|
BMA423::BMA423()
|
||||||
|
{
|
||||||
__readRegisterFptr = nullptr;
|
__readRegisterFptr = nullptr;
|
||||||
__writeRegisterFptr = nullptr;
|
__writeRegisterFptr = nullptr;
|
||||||
__delayCallBlackFptr = nullptr;
|
__delayCallBlackFptr = nullptr;
|
||||||
__init = false;
|
__init = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BMA423::~BMA423() {}
|
BMA423::~BMA423()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool BMA423::begin(bma4_com_fptr_t readCallBlack,
|
bool BMA423::begin(bma4_com_fptr_t readCallBlack,
|
||||||
bma4_com_fptr_t writeCallBlack,
|
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) {
|
delayCallBlack == nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,13 +62,14 @@ bool BMA423::begin(bma4_com_fptr_t readCallBlack,
|
||||||
|
|
||||||
__init = true;
|
__init = true;
|
||||||
|
|
||||||
struct bma4_int_pin_config config;
|
struct bma4_int_pin_config config ;
|
||||||
config.edge_ctrl = BMA4_LEVEL_TRIGGER;
|
config.edge_ctrl = BMA4_LEVEL_TRIGGER;
|
||||||
config.lvl = BMA4_ACTIVE_HIGH;
|
config.lvl = BMA4_ACTIVE_HIGH;
|
||||||
config.od = BMA4_PUSH_PULL;
|
config.od = BMA4_PUSH_PULL;
|
||||||
config.output_en = BMA4_OUTPUT_ENABLE;
|
config.output_en = BMA4_OUTPUT_ENABLE;
|
||||||
config.input_en = BMA4_INPUT_DISABLE;
|
config.input_en = BMA4_INPUT_DISABLE;
|
||||||
|
|
||||||
|
|
||||||
if (bma4_set_int_pin_config(&config, BMA4_INTR1_MAP, &__devFptr) != BMA4_OK) {
|
if (bma4_set_int_pin_config(&config, BMA4_INTR1_MAP, &__devFptr) != BMA4_OK) {
|
||||||
DEBUG("BMA423 SET INT FAIL\n");
|
DEBUG("BMA423 SET INT FAIL\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -68,41 +77,50 @@ bool BMA423::begin(bma4_com_fptr_t readCallBlack,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BMA423::softReset() {
|
void BMA423::softReset()
|
||||||
|
{
|
||||||
uint8_t reg = BMA4_RESET_ADDR;
|
uint8_t reg = BMA4_RESET_ADDR;
|
||||||
__writeRegisterFptr(BMA4_I2C_ADDR_PRIMARY, BMA4_RESET_SET_MASK, ®, 1);
|
__writeRegisterFptr(BMA4_I2C_ADDR_PRIMARY, BMA4_RESET_SET_MASK, ®, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BMA423::shutDown() {
|
void BMA423::shutDown()
|
||||||
|
{
|
||||||
bma4_set_advance_power_save(BMA4_DISABLE, &__devFptr);
|
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;
|
struct bma4_err_reg err;
|
||||||
uint16_t rslt = bma4_get_error_status(&err, &__devFptr);
|
uint16_t rslt = bma4_get_error_status(&err, &__devFptr);
|
||||||
return rslt;
|
return rslt;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t BMA423::getStatus() {
|
uint16_t BMA423::getStatus()
|
||||||
|
{
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
bma4_get_status(&status, &__devFptr);
|
bma4_get_status(&status, &__devFptr);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t BMA423::getSensorTime() {
|
uint32_t BMA423::getSensorTime()
|
||||||
|
{
|
||||||
uint32_t ms;
|
uint32_t ms;
|
||||||
bma4_get_sensor_time(&ms, &__devFptr);
|
bma4_get_sensor_time(&ms, &__devFptr);
|
||||||
return ms;
|
return ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::selfTest() {
|
bool BMA423::selfTest()
|
||||||
return (BMA4_OK ==
|
{
|
||||||
bma4_selftest_config(BMA4_ACCEL_SELFTEST_ENABLE_MSK, &__devFptr));
|
return (BMA4_OK == bma4_selftest_config(BMA4_ACCEL_SELFTEST_ENABLE_MSK, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t BMA423::getDirection() {
|
uint8_t BMA423::getDirection()
|
||||||
|
{
|
||||||
Accel acc;
|
Accel acc;
|
||||||
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
|
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -132,7 +150,8 @@ uint8_t BMA423::getDirection() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float BMA423::readTemperature() {
|
float BMA423::readTemperature()
|
||||||
|
{
|
||||||
int32_t data = 0;
|
int32_t data = 0;
|
||||||
bma4_get_temperature(&data, BMA4_DEG, &__devFptr);
|
bma4_get_temperature(&data, BMA4_DEG, &__devFptr);
|
||||||
float res = (float)data / (float)BMA4_SCALE_TEMP;
|
float res = (float)data / (float)BMA4_SCALE_TEMP;
|
||||||
|
@ -145,7 +164,9 @@ float BMA423::readTemperature() {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
float BMA423::readTemperatureF() {
|
|
||||||
|
float BMA423::readTemperatureF()
|
||||||
|
{
|
||||||
float temp = readTemperature();
|
float temp = readTemperature();
|
||||||
if (temp != 0) {
|
if (temp != 0) {
|
||||||
temp = temp * 1.8 + 32.0;
|
temp = temp * 1.8 + 32.0;
|
||||||
|
@ -153,7 +174,8 @@ float BMA423::readTemperatureF() {
|
||||||
return (temp);
|
return (temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::getAccel(Accel &acc) {
|
bool BMA423::getAccel(Accel &acc)
|
||||||
|
{
|
||||||
memset(&acc, 0, sizeof(acc));
|
memset(&acc, 0, sizeof(acc));
|
||||||
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
|
if (bma4_read_accel_xyz(&acc, &__devFptr) != BMA4_OK) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -161,36 +183,45 @@ bool BMA423::getAccel(Accel &acc) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::getAccelEnable() {
|
bool BMA423::getAccelEnable()
|
||||||
|
{
|
||||||
uint8_t en;
|
uint8_t en;
|
||||||
bma4_get_accel_enable(&en, &__devFptr);
|
bma4_get_accel_enable(&en, &__devFptr);
|
||||||
return (en & BMA4_ACCEL_ENABLE_POS) == BMA4_ACCEL_ENABLE_POS;
|
return (en & BMA4_ACCEL_ENABLE_POS) == BMA4_ACCEL_ENABLE_POS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::disableAccel() { return enableAccel(false); }
|
bool BMA423::disableAccel()
|
||||||
|
{
|
||||||
bool BMA423::enableAccel(bool en) {
|
return enableAccel(false);
|
||||||
return (BMA4_OK ==
|
|
||||||
bma4_set_accel_enable(en ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::setAccelConfig(Acfg &cfg) {
|
bool BMA423::enableAccel(bool en)
|
||||||
|
{
|
||||||
|
return (BMA4_OK == bma4_set_accel_enable(en ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BMA423::setAccelConfig(Acfg &cfg)
|
||||||
|
{
|
||||||
return (BMA4_OK == bma4_set_accel_config(&cfg, &__devFptr));
|
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));
|
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));
|
return (BMA4_OK == bma423_set_remap_axes(remap_data, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::resetStepCounter() {
|
bool BMA423::resetStepCounter()
|
||||||
return BMA4_OK == bma423_reset_step_counter(&__devFptr);
|
{
|
||||||
|
return BMA4_OK == bma423_reset_step_counter(&__devFptr) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t BMA423::getCounter() {
|
uint32_t BMA423::getCounter()
|
||||||
|
{
|
||||||
uint32_t stepCount;
|
uint32_t stepCount;
|
||||||
if (bma423_step_counter_output(&stepCount, &__devFptr) == BMA4_OK) {
|
if (bma423_step_counter_output(&stepCount, &__devFptr) == BMA4_OK) {
|
||||||
return stepCount;
|
return stepCount;
|
||||||
|
@ -198,76 +229,91 @@ uint32_t BMA423::getCounter() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::setINTPinConfig(struct bma4_int_pin_config config,
|
bool BMA423::setINTPinConfig(struct bma4_int_pin_config config, uint8_t pinMap)
|
||||||
uint8_t pinMap) {
|
{
|
||||||
return BMA4_OK == bma4_set_int_pin_config(&config, pinMap, &__devFptr);
|
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;
|
return bma423_read_int_status(&__IRQ_MASK, &__devFptr) == BMA4_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t BMA423::getIRQMASK() { return __IRQ_MASK; }
|
uint8_t BMA423::getIRQMASK()
|
||||||
|
{
|
||||||
bool BMA423::disableIRQ(uint16_t int_map) {
|
return __IRQ_MASK;
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_DISABLE,
|
|
||||||
&__devFptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableIRQ(uint16_t int_map) {
|
bool BMA423::disableIRQ(uint16_t int_map)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_ENABLE,
|
{
|
||||||
&__devFptr));
|
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, int_map, BMA4_DISABLE, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableFeature(uint8_t feature, uint8_t enable) {
|
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)
|
||||||
|
{
|
||||||
if ((feature & BMA423_STEP_CNTR) == BMA423_STEP_CNTR) {
|
if ((feature & BMA423_STEP_CNTR) == BMA423_STEP_CNTR) {
|
||||||
bma423_step_detector_enable(enable ? BMA4_ENABLE : BMA4_DISABLE,
|
bma423_step_detector_enable(enable ? BMA4_ENABLE : BMA4_DISABLE, &__devFptr);
|
||||||
&__devFptr);
|
|
||||||
}
|
}
|
||||||
return (BMA4_OK == bma423_feature_enable(feature, enable, &__devFptr));
|
return (BMA4_OK == bma423_feature_enable(feature, enable, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::isStepCounter() {
|
bool BMA423::isStepCounter()
|
||||||
|
{
|
||||||
return (bool)(BMA423_STEP_CNTR_INT & __IRQ_MASK);
|
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);
|
return (bool)(BMA423_ANY_NO_MOTION_INT & __IRQ_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableStepCountInterrupt(bool en) {
|
bool BMA423::enableStepCountInterrupt(bool en)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT,
|
{
|
||||||
en, &__devFptr));
|
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, en, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableTiltInterrupt(bool en) {
|
bool BMA423::enableTiltInterrupt(bool en)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_TILT_INT, en,
|
{
|
||||||
&__devFptr));
|
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_TILT_INT, en, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableWakeupInterrupt(bool en) {
|
bool BMA423::enableWakeupInterrupt(bool en)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_WAKEUP_INT, en,
|
{
|
||||||
&__devFptr));
|
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_WAKEUP_INT, en, &__devFptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableAnyNoMotionInterrupt(bool en) {
|
bool BMA423::enableAnyNoMotionInterrupt(bool en)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP,
|
{
|
||||||
BMA423_ANY_NO_MOTION_INT, en,
|
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_ANY_NO_MOTION_INT, en, &__devFptr));
|
||||||
&__devFptr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BMA423::enableActivityInterrupt(bool en) {
|
bool BMA423::enableActivityInterrupt(bool en)
|
||||||
return (BMA4_OK == bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_ACTIVITY_INT,
|
{
|
||||||
en, &__devFptr));
|
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;
|
uint8_t activity;
|
||||||
bma423_activity_output(&activity, &__devFptr);
|
bma423_activity_output(&activity, &__devFptr);
|
||||||
if (activity & BMA423_USER_STATIONARY) {
|
if (activity & BMA423_USER_STATIONARY) {
|
||||||
|
|
11
src/bma.h
11
src/bma.h
|
@ -15,19 +15,19 @@ enum {
|
||||||
DIRECTION_RIGHT_EDGE = 3,
|
DIRECTION_RIGHT_EDGE = 3,
|
||||||
DIRECTION_DISP_UP = 4,
|
DIRECTION_DISP_UP = 4,
|
||||||
DIRECTION_DISP_DOWN = 5
|
DIRECTION_DISP_DOWN = 5
|
||||||
};
|
} ;
|
||||||
|
|
||||||
typedef struct bma4_accel Accel;
|
typedef struct bma4_accel Accel;
|
||||||
typedef struct bma4_accel_config Acfg;
|
typedef struct bma4_accel_config Acfg;
|
||||||
|
|
||||||
class BMA423 {
|
class BMA423
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BMA423();
|
BMA423();
|
||||||
~BMA423();
|
~BMA423();
|
||||||
|
|
||||||
bool begin(bma4_com_fptr_t readCallBlack, bma4_com_fptr_t writeCallBlack,
|
bool begin(bma4_com_fptr_t readCallBlack, bma4_com_fptr_t writeCallBlack, bma4_delay_fptr_t delayCallBlack,
|
||||||
bma4_delay_fptr_t delayCallBlack,
|
|
||||||
uint8_t address = BMA4_I2C_ADDR_PRIMARY);
|
uint8_t address = BMA4_I2C_ADDR_PRIMARY);
|
||||||
|
|
||||||
void softReset();
|
void softReset();
|
||||||
|
@ -65,10 +65,11 @@ public:
|
||||||
uint16_t getStatus();
|
uint16_t getStatus();
|
||||||
uint32_t getSensorTime();
|
uint32_t getSensorTime();
|
||||||
|
|
||||||
|
|
||||||
const char *getActivity();
|
const char *getActivity();
|
||||||
bool setRemapAxes(struct bma423_axes_remap *remap_data);
|
bool setRemapAxes(struct bma423_axes_remap *remap_data);
|
||||||
|
|
||||||
bool enableFeature(uint8_t feature, uint8_t enable);
|
bool enableFeature(uint8_t feature, uint8_t enable );
|
||||||
bool enableStepCountInterrupt(bool en = true);
|
bool enableStepCountInterrupt(bool en = true);
|
||||||
bool enableTiltInterrupt(bool en = true);
|
bool enableTiltInterrupt(bool en = true);
|
||||||
bool enableWakeupInterrupt(bool en = true);
|
bool enableWakeupInterrupt(bool en = true);
|
||||||
|
|
794
src/bma4.c
794
src/bma4.c
File diff suppressed because it is too large
Load Diff
255
src/bma4.h
255
src/bma4.h
|
@ -1,87 +1,87 @@
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
* Copyright (C) 2015 - 2016 Bosch Sensortec GmbH
|
* Copyright (C) 2015 - 2016 Bosch Sensortec GmbH
|
||||||
*
|
*
|
||||||
* File : bma4.h
|
* File : bma4.h
|
||||||
*
|
*
|
||||||
* Date: 12 Oct 2017
|
* Date: 12 Oct 2017
|
||||||
*
|
*
|
||||||
* Revision: 2.1.9 $
|
* Revision: 2.1.9 $
|
||||||
*
|
*
|
||||||
* Usage: Sensor Driver for BMA4 family of sensors
|
* Usage: Sensor Driver for BMA4 family of sensors
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Disclaimer
|
* Disclaimer
|
||||||
*
|
*
|
||||||
* Common:
|
* Common:
|
||||||
* Bosch Sensortec products are developed for the consumer goods industry.
|
* Bosch Sensortec products are developed for the consumer goods industry.
|
||||||
* They may only be used within the parameters of the respective valid
|
* They may only be used within the parameters of the respective valid
|
||||||
* product data sheet. Bosch Sensortec products are provided with the
|
* product data sheet. Bosch Sensortec products are provided with the
|
||||||
* express understanding that there is no warranty of fitness for a
|
* express understanding that there is no warranty of fitness for a
|
||||||
* particular purpose.They are not fit for use in life-sustaining,
|
* particular purpose.They are not fit for use in life-sustaining,
|
||||||
* safety or security sensitive systems or any system or device
|
* safety or security sensitive systems or any system or device
|
||||||
* that may lead to bodily harm or property damage if the system
|
* that may lead to bodily harm or property damage if the system
|
||||||
* or device malfunctions. In addition,Bosch Sensortec products are
|
* or device malfunctions. In addition,Bosch Sensortec products are
|
||||||
* not fit for use in products which interact with motor vehicle systems.
|
* not fit for use in products which interact with motor vehicle systems.
|
||||||
* The resale and or use of products are at the purchasers own risk and
|
* The resale and or use of products are at the purchasers own risk and
|
||||||
* his own responsibility. The examination of fitness for the intended use
|
* his own responsibility. The examination of fitness for the intended use
|
||||||
* is the sole responsibility of the Purchaser.
|
* is the sole responsibility of the Purchaser.
|
||||||
*
|
*
|
||||||
* The purchaser shall indemnify Bosch Sensortec from all third party
|
* The purchaser shall indemnify Bosch Sensortec from all third party
|
||||||
* claims, including any claims for incidental, or consequential damages,
|
* claims, including any claims for incidental, or consequential damages,
|
||||||
* arising from any product use not covered by the parameters of
|
* arising from any product use not covered by the parameters of
|
||||||
* the respective valid product data sheet or not approved by
|
* the respective valid product data sheet or not approved by
|
||||||
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
||||||
* connection with such claims.
|
* connection with such claims.
|
||||||
*
|
*
|
||||||
* The purchaser must monitor the market for the purchased products,
|
* The purchaser must monitor the market for the purchased products,
|
||||||
* particularly with regard to product safety and inform Bosch Sensortec
|
* particularly with regard to product safety and inform Bosch Sensortec
|
||||||
* without delay of all security relevant incidents.
|
* without delay of all security relevant incidents.
|
||||||
*
|
*
|
||||||
* Engineering Samples are marked with an asterisk (*) or (e).
|
* Engineering Samples are marked with an asterisk (*) or (e).
|
||||||
* Samples may vary from the valid technical specifications of the product
|
* Samples may vary from the valid technical specifications of the product
|
||||||
* series. They are therefore not intended or fit for resale to third
|
* series. They are therefore not intended or fit for resale to third
|
||||||
* parties or for use in end products. Their sole purpose is internal
|
* parties or for use in end products. Their sole purpose is internal
|
||||||
* client testing. The testing of an engineering sample may in no way
|
* client testing. The testing of an engineering sample may in no way
|
||||||
* replace the testing of a product series. Bosch Sensortec assumes
|
* replace the testing of a product series. Bosch Sensortec assumes
|
||||||
* no liability for the use of engineering samples.
|
* no liability for the use of engineering samples.
|
||||||
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
||||||
* Bosch Sensortec from all claims arising from the use of engineering
|
* Bosch Sensortec from all claims arising from the use of engineering
|
||||||
* samples.
|
* samples.
|
||||||
*
|
*
|
||||||
* Special:
|
* Special:
|
||||||
* This software module (hereinafter called "Software") and any information
|
* This software module (hereinafter called "Software") and any information
|
||||||
* on application-sheets (hereinafter called "Information") is provided
|
* on application-sheets (hereinafter called "Information") is provided
|
||||||
* free of charge for the sole purpose to support your application work.
|
* free of charge for the sole purpose to support your application work.
|
||||||
* The Software and Information is subject to the following
|
* The Software and Information is subject to the following
|
||||||
* terms and conditions:
|
* terms and conditions:
|
||||||
*
|
*
|
||||||
* The Software is specifically designed for the exclusive use for
|
* The Software is specifically designed for the exclusive use for
|
||||||
* Bosch Sensortec products by personnel who have special experience
|
* Bosch Sensortec products by personnel who have special experience
|
||||||
* and training. Do not use this Software if you do not have the
|
* and training. Do not use this Software if you do not have the
|
||||||
* proper experience or training.
|
* proper experience or training.
|
||||||
*
|
*
|
||||||
* This Software package is provided `` as is `` and without any expressed
|
* This Software package is provided `` as is `` and without any expressed
|
||||||
* or implied warranties,including without limitation, the implied warranties
|
* or implied warranties,including without limitation, the implied warranties
|
||||||
* of merchantability and fitness for a particular purpose.
|
* of merchantability and fitness for a particular purpose.
|
||||||
*
|
*
|
||||||
* Bosch Sensortec and their representatives and agents deny any liability
|
* Bosch Sensortec and their representatives and agents deny any liability
|
||||||
* for the functional impairment
|
* for the functional impairment
|
||||||
* of this Software in terms of fitness, performance and safety.
|
* of this Software in terms of fitness, performance and safety.
|
||||||
* Bosch Sensortec and their representatives and agents shall not be liable
|
* Bosch Sensortec and their representatives and agents shall not be liable
|
||||||
* for any direct or indirect damages or injury, except as
|
* for any direct or indirect damages or injury, except as
|
||||||
* otherwise stipulated in mandatory applicable law.
|
* otherwise stipulated in mandatory applicable law.
|
||||||
*
|
*
|
||||||
* The Information provided is believed to be accurate and reliable.
|
* The Information provided is believed to be accurate and reliable.
|
||||||
* Bosch Sensortec assumes no responsibility for the consequences of use
|
* Bosch Sensortec assumes no responsibility for the consequences of use
|
||||||
* of such Information nor for any infringement of patents or
|
* of such Information nor for any infringement of patents or
|
||||||
* other rights of third parties which may result from its use.
|
* other rights of third parties which may result from its use.
|
||||||
* No license is granted by implication or otherwise under any patent or
|
* No license is granted by implication or otherwise under any patent or
|
||||||
* patent rights of Bosch. Specifications mentioned in the Information are
|
* patent rights of Bosch. Specifications mentioned in the Information are
|
||||||
* subject to change without notice.
|
* subject to change without notice.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/*! \file bma4.h
|
/*! \file bma4.h
|
||||||
\brief Sensor Driver for BMA4 family of sensors */
|
\brief Sensor Driver for BMA4 family of sensors */
|
||||||
#ifndef BMA4_H__
|
#ifndef BMA4_H__
|
||||||
|
@ -157,8 +157,7 @@ uint16_t bma4_write_config_file(struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len,
|
uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API checks whether the read operation requested is for
|
* @brief This API checks whether the read operation requested is for
|
||||||
|
@ -173,8 +172,7 @@ uint16_t bma4_write_regs(uint8_t addr, uint8_t *data, uint8_t len,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len,
|
uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the error status from the sensor.
|
* @brief This API reads the error status from the sensor.
|
||||||
|
@ -213,8 +211,7 @@ uint16_t bma4_read_regs(uint8_t addr, uint8_t *data, uint8_t len,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_error_status(struct bma4_err_reg *err_reg,
|
uint16_t bma4_get_error_status(struct bma4_err_reg *err_reg, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the sensor status from the dev sensor.
|
* @brief This API reads the sensor status from the dev sensor.
|
||||||
|
@ -294,8 +291,7 @@ uint16_t bma4_get_sensor_time(uint32_t *sensor_time, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit,
|
uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the Output data rate, Bandwidth, perf_mode
|
* @brief This API reads the Output data rate, Bandwidth, perf_mode
|
||||||
|
@ -346,8 +342,7 @@ uint16_t bma4_get_temperature(int32_t *temp, uint8_t temp_unit,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel,
|
uint16_t bma4_get_accel_config(struct bma4_accel_config *accel, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the output_data_rate, bandwidth, perf_mode
|
* @brief This API sets the output_data_rate, bandwidth, perf_mode
|
||||||
|
@ -398,8 +393,7 @@ uint16_t bma4_get_accel_config(struct bma4_accel_config *accel,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_accel_config(const struct bma4_accel_config *accel,
|
uint16_t bma4_set_accel_config(const struct bma4_accel_config *accel, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the advance power save mode in the sensor.
|
* @brief This API sets the advance power save mode in the sensor.
|
||||||
|
@ -435,8 +429,7 @@ uint16_t bma4_set_advance_power_save(uint8_t adv_pwr_save,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save,
|
uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the FIFO self wake up functionality in the sensor.
|
* @brief This API sets the FIFO self wake up functionality in the sensor.
|
||||||
|
@ -453,8 +446,7 @@ uint16_t bma4_get_advance_power_save(uint8_t *adv_pwr_save,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup,
|
uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API gets the status of FIFO self wake up functionality from
|
* @brief This API gets the status of FIFO self wake up functionality from
|
||||||
|
@ -472,8 +464,7 @@ uint16_t bma4_set_fifo_self_wakeup(uint8_t fifo_self_wakeup,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_fifo_self_wakeup(uint8_t *fifo_self_wake_up,
|
uint16_t bma4_get_fifo_self_wakeup(uint8_t *fifo_self_wake_up, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API enables or disables the Accel in the sensor.
|
* @brief This API enables or disables the Accel in the sensor.
|
||||||
|
@ -571,7 +562,7 @@ uint16_t bma4_get_spi_interface(uint8_t *spi, struct bma4_dev *dev);
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_spi_interface(uint8_t spi, struct bma4_dev *dev);
|
uint16_t bma4_set_spi_interface(uint8_t spi, struct bma4_dev *dev);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API writes the available sensor specific commands
|
* @brief This API writes the available sensor specific commands
|
||||||
* to the sensor.
|
* to the sensor.
|
||||||
*
|
*
|
||||||
|
@ -860,8 +851,7 @@ uint16_t bma4_set_fifo_wm(uint16_t fifo_wm, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter,
|
uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the condition of Accel FIFO data either to
|
* @brief This API sets the condition of Accel FIFO data either to
|
||||||
|
@ -880,8 +870,7 @@ uint16_t bma4_get_accel_fifo_filter_data(uint8_t *accel_fifo_filter,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter,
|
uint16_t bma4_set_accel_fifo_filter_data(uint8_t accel_fifo_filter, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the down sampling rates which is configured
|
* @brief This API reads the down sampling rates which is configured
|
||||||
|
@ -950,8 +939,7 @@ uint16_t bma4_get_fifo_length(uint16_t *fifo_length, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_data,
|
||||||
bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_data,
|
|
||||||
uint8_t mag_second_if,
|
uint8_t mag_second_if,
|
||||||
struct bma4_mag *compensated_mag_data);
|
struct bma4_mag *compensated_mag_data);
|
||||||
|
|
||||||
|
@ -975,8 +963,7 @@ bma4_second_if_mag_compensate_xyz(struct bma4_mag_fifo_data mag_fifo_data,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_read_mag_xyz(struct bma4_mag *mag, uint8_t sensor_select,
|
uint16_t bma4_read_mag_xyz(struct bma4_mag *mag, uint8_t sensor_select, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the auxiliary I2C interface configuration which
|
* @brief This API reads the auxiliary I2C interface configuration which
|
||||||
|
@ -1069,8 +1056,7 @@ uint16_t bma4_get_mag_data_rdy(uint8_t *data_rdy, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_asic_status(struct bma4_asic_status *asic_status,
|
uint16_t bma4_get_asic_status(struct bma4_asic_status *asic_status, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API enables the offset compensation for filtered and
|
* @brief This API enables the offset compensation for filtered and
|
||||||
|
@ -1136,8 +1122,7 @@ uint16_t bma4_get_offset_comp(uint8_t *offset_en, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_extract_accel(struct bma4_accel *accel_data,
|
uint16_t bma4_extract_accel(struct bma4_accel *accel_data, uint16_t *accel_length, const struct bma4_dev *dev);
|
||||||
uint16_t *accel_length, const struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API parses and extracts the magnetometer frames from
|
* @brief This API parses and extracts the magnetometer frames from
|
||||||
|
@ -1163,8 +1148,7 @@ uint16_t bma4_extract_accel(struct bma4_accel *accel_data,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length,
|
uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length, const struct bma4_dev *dev);
|
||||||
const struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API performs Fast Offset Compensation for Accel.
|
* @brief This API performs Fast Offset Compensation for Accel.
|
||||||
|
@ -1186,8 +1170,7 @@ uint16_t bma4_extract_mag(struct bma4_mag *mag_data, uint16_t *mag_length,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_perform_accel_foc(const int32_t accel_g_value[3],
|
uint16_t bma4_perform_accel_foc(const int32_t accel_g_value[3], struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API checks whether the self test functionality of the sensor
|
* @brief This API checks whether the self test functionality of the sensor
|
||||||
* is working or not
|
* is working or not
|
||||||
|
@ -1247,8 +1230,7 @@ uint16_t bma4_selftest_config(uint8_t sign, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable,
|
uint16_t bma4_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the interrupt mode in the sensor.
|
* @brief This API sets the interrupt mode in the sensor.
|
||||||
|
@ -1323,8 +1305,7 @@ uint16_t bma4_get_interrupt_mode(uint8_t *mode, struct bma4_dev *dev);
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag,
|
uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the auxiliary Mag(BMM150 or AKM9916) output data
|
* @brief This API reads the auxiliary Mag(BMM150 or AKM9916) output data
|
||||||
|
@ -1362,8 +1343,7 @@ uint16_t bma4_set_aux_mag_config(const struct bma4_aux_mag_config *aux_mag,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag,
|
uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*! @brief This API sets the FIFO configuration in the sensor.
|
/*! @brief This API sets the FIFO configuration in the sensor.
|
||||||
*
|
*
|
||||||
|
@ -1392,8 +1372,7 @@ uint16_t bma4_get_aux_mag_config(struct bma4_aux_mag_config *aux_mag,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_set_fifo_config(uint8_t config, uint8_t enable,
|
uint16_t bma4_set_fifo_config(uint8_t config, uint8_t enable, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*! @brief This API reads the FIFO configuration from the sensor.
|
/*! @brief This API reads the FIFO configuration from the sensor.
|
||||||
*
|
*
|
||||||
|
@ -1462,9 +1441,8 @@ uint16_t bma4_get_fifo_config(uint8_t *fifo_config, struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_config, uint8_t int_line,
|
||||||
bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_config,
|
struct bma4_dev *dev);
|
||||||
uint8_t int_line, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*! @brief This API reads the electrical behavior of interrupt pin1 or pin2
|
/*! @brief This API reads the electrical behavior of interrupt pin1 or pin2
|
||||||
* from the sensor.
|
* from the sensor.
|
||||||
|
@ -1505,12 +1483,10 @@ bma4_set_int_pin_config(const struct bma4_int_pin_config *int_pin_config,
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_get_int_pin_config(struct bma4_int_pin_config *int_pin_config,
|
uint16_t bma4_get_int_pin_config(struct bma4_int_pin_config *int_pin_config, uint8_t int_line, struct bma4_dev *dev);
|
||||||
uint8_t int_line, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the Feature and Hardware interrupt status from the
|
* @brief This API reads the Feature and Hardware interrupt status from the sensor.
|
||||||
*sensor.
|
|
||||||
*
|
*
|
||||||
* @param[out] int_status : Variable used to get the interrupt status.
|
* @param[out] int_status : Variable used to get the interrupt status.
|
||||||
* @param[in] dev : Structure instance of bma4_dev.
|
* @param[in] dev : Structure instance of bma4_dev.
|
||||||
|
@ -1568,16 +1544,14 @@ uint16_t bma4_aux_interface_init(struct bma4_dev *dev);
|
||||||
* @param[in] len : User specified data length
|
* @param[in] len : User specified data length
|
||||||
* @param[out] aux_data : Pointer variable to store data read
|
* @param[out] aux_data : Pointer variable to store data read
|
||||||
* @param[in] aux_reg_addr : Variable to pass address from where
|
* @param[in] aux_reg_addr : Variable to pass address from where
|
||||||
* data is to be
|
* data is to be read
|
||||||
*read
|
|
||||||
*
|
*
|
||||||
* @return Result of API execution status
|
* @return Result of API execution status
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len,
|
uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API writes the data into the auxiliary sensor
|
* @brief This API writes the data into the auxiliary sensor
|
||||||
|
@ -1586,16 +1560,15 @@ uint16_t bma4_aux_read(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len,
|
||||||
* @param[in] len : User specified data length
|
* @param[in] len : User specified data length
|
||||||
* @param[out] aux_data : Pointer variable to store data read
|
* @param[out] aux_data : Pointer variable to store data read
|
||||||
* @param[in] aux_reg_addr : Variable to pass address from where
|
* @param[in] aux_reg_addr : Variable to pass address from where
|
||||||
* data is to be
|
* data is to be written
|
||||||
*written
|
|
||||||
*
|
*
|
||||||
* @return Result of API execution status
|
* @return Result of API execution status
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint16_t bma4_aux_write(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len,
|
uint16_t bma4_aux_write(uint8_t aux_reg_addr, uint8_t *aux_data, uint16_t len, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* End of __BMA4_H__ */
|
/* End of __BMA4_H__ */
|
||||||
|
|
382
src/bma423.c
382
src/bma423.c
|
@ -1,87 +1,87 @@
|
||||||
/**\mainpage
|
/**\mainpage
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
||||||
*
|
*
|
||||||
* File : bma423.c
|
* File : bma423.c
|
||||||
*
|
*
|
||||||
* Date: 12 Oct 2017
|
* Date: 12 Oct 2017
|
||||||
*
|
*
|
||||||
* Revision : 1.1.4 $
|
* Revision : 1.1.4 $
|
||||||
*
|
*
|
||||||
* Usage: Sensor Driver for BMA423 sensor
|
* Usage: Sensor Driver for BMA423 sensor
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* \section Disclaimer
|
* \section Disclaimer
|
||||||
*
|
*
|
||||||
* Common:
|
* Common:
|
||||||
* Bosch Sensortec products are developed for the consumer goods industry.
|
* Bosch Sensortec products are developed for the consumer goods industry.
|
||||||
* They may only be used within the parameters of the respective valid
|
* They may only be used within the parameters of the respective valid
|
||||||
* product data sheet. Bosch Sensortec products are provided with the
|
* product data sheet. Bosch Sensortec products are provided with the
|
||||||
* express understanding that there is no warranty of fitness for a
|
* express understanding that there is no warranty of fitness for a
|
||||||
* particular purpose.They are not fit for use in life-sustaining,
|
* particular purpose.They are not fit for use in life-sustaining,
|
||||||
* safety or security sensitive systems or any system or device
|
* safety or security sensitive systems or any system or device
|
||||||
* that may lead to bodily harm or property damage if the system
|
* that may lead to bodily harm or property damage if the system
|
||||||
* or device malfunctions. In addition,Bosch Sensortec products are
|
* or device malfunctions. In addition,Bosch Sensortec products are
|
||||||
* not fit for use in products which interact with motor vehicle systems.
|
* not fit for use in products which interact with motor vehicle systems.
|
||||||
* The resale and or use of products are at the purchasers own risk and
|
* The resale and or use of products are at the purchasers own risk and
|
||||||
* his own responsibility. The examination of fitness for the intended use
|
* his own responsibility. The examination of fitness for the intended use
|
||||||
* is the sole responsibility of the Purchaser.
|
* is the sole responsibility of the Purchaser.
|
||||||
*
|
*
|
||||||
* The purchaser shall indemnify Bosch Sensortec from all third party
|
* The purchaser shall indemnify Bosch Sensortec from all third party
|
||||||
* claims, including any claims for incidental, or consequential damages,
|
* claims, including any claims for incidental, or consequential damages,
|
||||||
* arising from any product use not covered by the parameters of
|
* arising from any product use not covered by the parameters of
|
||||||
* the respective valid product data sheet or not approved by
|
* the respective valid product data sheet or not approved by
|
||||||
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
||||||
* connection with such claims.
|
* connection with such claims.
|
||||||
*
|
*
|
||||||
* The purchaser must monitor the market for the purchased products,
|
* The purchaser must monitor the market for the purchased products,
|
||||||
* particularly with regard to product safety and inform Bosch Sensortec
|
* particularly with regard to product safety and inform Bosch Sensortec
|
||||||
* without delay of all security relevant incidents.
|
* without delay of all security relevant incidents.
|
||||||
*
|
*
|
||||||
* Engineering Samples are marked with an asterisk (*) or (e).
|
* Engineering Samples are marked with an asterisk (*) or (e).
|
||||||
* Samples may vary from the valid technical specifications of the product
|
* Samples may vary from the valid technical specifications of the product
|
||||||
* series. They are therefore not intended or fit for resale to third
|
* series. They are therefore not intended or fit for resale to third
|
||||||
* parties or for use in end products. Their sole purpose is internal
|
* parties or for use in end products. Their sole purpose is internal
|
||||||
* client testing. The testing of an engineering sample may in no way
|
* client testing. The testing of an engineering sample may in no way
|
||||||
* replace the testing of a product series. Bosch Sensortec assumes
|
* replace the testing of a product series. Bosch Sensortec assumes
|
||||||
* no liability for the use of engineering samples.
|
* no liability for the use of engineering samples.
|
||||||
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
||||||
* Bosch Sensortec from all claims arising from the use of engineering
|
* Bosch Sensortec from all claims arising from the use of engineering
|
||||||
* samples.
|
* samples.
|
||||||
*
|
*
|
||||||
* Special:
|
* Special:
|
||||||
* This software module (hereinafter called "Software") and any information
|
* This software module (hereinafter called "Software") and any information
|
||||||
* on application-sheets (hereinafter called "Information") is provided
|
* on application-sheets (hereinafter called "Information") is provided
|
||||||
* free of charge for the sole purpose to support your application work.
|
* free of charge for the sole purpose to support your application work.
|
||||||
* The Software and Information is subject to the following
|
* The Software and Information is subject to the following
|
||||||
* terms and conditions:
|
* terms and conditions:
|
||||||
*
|
*
|
||||||
* The Software is specifically designed for the exclusive use for
|
* The Software is specifically designed for the exclusive use for
|
||||||
* Bosch Sensortec products by personnel who have special experience
|
* Bosch Sensortec products by personnel who have special experience
|
||||||
* and training. Do not use this Software if you do not have the
|
* and training. Do not use this Software if you do not have the
|
||||||
* proper experience or training.
|
* proper experience or training.
|
||||||
*
|
*
|
||||||
* This Software package is provided `` as is `` and without any expressed
|
* This Software package is provided `` as is `` and without any expressed
|
||||||
* or implied warranties,including without limitation, the implied warranties
|
* or implied warranties,including without limitation, the implied warranties
|
||||||
* of merchantability and fitness for a particular purpose.
|
* of merchantability and fitness for a particular purpose.
|
||||||
*
|
*
|
||||||
* Bosch Sensortec and their representatives and agents deny any liability
|
* Bosch Sensortec and their representatives and agents deny any liability
|
||||||
* for the functional impairment
|
* for the functional impairment
|
||||||
* of this Software in terms of fitness, performance and safety.
|
* of this Software in terms of fitness, performance and safety.
|
||||||
* Bosch Sensortec and their representatives and agents shall not be liable
|
* Bosch Sensortec and their representatives and agents shall not be liable
|
||||||
* for any direct or indirect damages or injury, except as
|
* for any direct or indirect damages or injury, except as
|
||||||
* otherwise stipulated in mandatory applicable law.
|
* otherwise stipulated in mandatory applicable law.
|
||||||
*
|
*
|
||||||
* The Information provided is believed to be accurate and reliable.
|
* The Information provided is believed to be accurate and reliable.
|
||||||
* Bosch Sensortec assumes no responsibility for the consequences of use
|
* Bosch Sensortec assumes no responsibility for the consequences of use
|
||||||
* of such Information nor for any infringement of patents or
|
* of such Information nor for any infringement of patents or
|
||||||
* other rights of third parties which may result from its use.
|
* other rights of third parties which may result from its use.
|
||||||
* No license is granted by implication or otherwise under any patent or
|
* No license is granted by implication or otherwise under any patent or
|
||||||
* patent rights of Bosch. Specifications mentioned in the Information are
|
* patent rights of Bosch. Specifications mentioned in the Information are
|
||||||
* subject to change without notice.
|
* subject to change without notice.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/*! \file bma423.c
|
/*! \file bma423.c
|
||||||
\brief Sensor Driver for BMA423 sensor */
|
\brief Sensor Driver for BMA423 sensor */
|
||||||
|
|
||||||
|
@ -600,7 +600,8 @@ 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,
|
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
|
/*! Static Function Declarations
|
||||||
|
@ -637,8 +638,7 @@ static void update_len(uint8_t *len, uint8_t feature, uint8_t enable);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any positive value mentioned in ERROR CODES -> Fail
|
* @retval Any positive value mentioned in ERROR CODES -> Fail
|
||||||
*/
|
*/
|
||||||
static uint16_t feature_enable(uint8_t feature, uint8_t len,
|
static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
|
||||||
uint8_t *feature_config, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API disables the features of sensor.
|
* @brief This API disables the features of sensor.
|
||||||
|
@ -654,8 +654,7 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any positive value mentioned in ERROR CODES -> Fail
|
* @retval Any positive value mentioned in ERROR CODES -> Fail
|
||||||
*/
|
*/
|
||||||
static uint16_t feature_disable(uint8_t feature, uint8_t len,
|
static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
|
||||||
uint8_t *feature_config, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API update the settings of step counter into write array.
|
* @brief This API update the settings of step counter into write array.
|
||||||
|
@ -667,8 +666,7 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len,
|
||||||
*
|
*
|
||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
static void
|
static void update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
||||||
update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
|
||||||
uint8_t index, uint8_t *feature_config);
|
uint8_t index, uint8_t *feature_config);
|
||||||
/*!
|
/*!
|
||||||
* @brief This API copy the settings of step counter into the
|
* @brief This API copy the settings of step counter into the
|
||||||
|
@ -680,9 +678,7 @@ update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
||||||
*
|
*
|
||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
static void
|
static void extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting, const uint16_t *data_p);
|
||||||
extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting,
|
|
||||||
const uint16_t *data_p);
|
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
/**\name Function definitions
|
/**\name Function definitions
|
||||||
|
@ -694,7 +690,8 @@ extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting,
|
||||||
* This API reads the chip-id of the sensor and sets the resolution.
|
* This API reads the chip-id of the sensor and sets the resolution.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
uint16_t bma423_init(struct bma4_dev *dev) {
|
uint16_t bma423_init(struct bma4_dev *dev)
|
||||||
|
{
|
||||||
uint16_t rslt;
|
uint16_t rslt;
|
||||||
|
|
||||||
rslt = bma4_init(dev);
|
rslt = bma4_init(dev);
|
||||||
|
@ -717,7 +714,8 @@ uint16_t bma423_init(struct bma4_dev *dev) {
|
||||||
* @brief This API is used to upload the config file to enable
|
* @brief This API is used to upload the config file to enable
|
||||||
* the features of the sensor.
|
* 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;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
|
@ -746,7 +744,8 @@ uint16_t bma423_write_config_file(struct bma4_dev *dev) {
|
||||||
/*!
|
/*!
|
||||||
* @brief This API is used to get the configuration id of the sensor.
|
* @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 feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_CONFIG_ID_OFFSET;
|
uint8_t index = BMA423_CONFIG_ID_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
@ -755,8 +754,7 @@ uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev) {
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
config_id_lsb = (uint16_t)feature_config[index];
|
config_id_lsb = (uint16_t)feature_config[index];
|
||||||
config_id_msb = ((uint16_t)feature_config[index + 1]) << 8;
|
config_id_msb = ((uint16_t)feature_config[index + 1]) << 8;
|
||||||
|
@ -776,8 +774,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
|
* @brief This API sets/unsets the user provided interrupt to either
|
||||||
* interrupt pin1 or pin2 in the sensor.
|
* interrupt pin1 or pin2 in the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map,
|
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev)
|
||||||
uint8_t enable, struct bma4_dev *dev) {
|
{
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
|
@ -801,7 +799,8 @@ uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the bma423 interrupt status from the sensor.
|
* @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;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
|
@ -821,8 +820,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.
|
* @brief This API enables/disables the features of the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
|
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
uint8_t len;
|
uint8_t len;
|
||||||
|
@ -854,8 +853,8 @@ uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API performs x, y and z axis remapping in the sensor.
|
* @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,
|
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_AXES_REMAP_OFFSET;
|
uint8_t index = BMA423_AXES_REMAP_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
@ -867,18 +866,15 @@ uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data,
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
x_axis = remap_data->x_axis & BMA423_X_AXIS_MASK;
|
x_axis = remap_data->x_axis & BMA423_X_AXIS_MASK;
|
||||||
x_axis_sign = (remap_data->x_axis_sign << 2) & BMA423_X_AXIS_SIGN_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 = (remap_data->y_axis << 3) & BMA423_Y_AXIS_MASK;
|
||||||
y_axis_sign = (remap_data->y_axis_sign << 5) & BMA423_Y_AXIS_SIGN_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;
|
z_axis = (remap_data->z_axis << 6) & BMA423_Z_AXIS_MASK;
|
||||||
feature_config[index] =
|
feature_config[index] = x_axis | x_axis_sign | y_axis | y_axis_sign | z_axis;
|
||||||
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 + 1] =
|
|
||||||
remap_data->z_axis_sign & BMA423_Z_AXIS_SIGN_MASK;
|
|
||||||
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
}
|
}
|
||||||
|
@ -895,26 +891,22 @@ uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the x, y and z axis remap data from the sensor.
|
* @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,
|
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_AXES_REMAP_OFFSET;
|
uint8_t index = BMA423_AXES_REMAP_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
remap_data->x_axis = feature_config[index] & BMA423_X_AXIS_MASK;
|
remap_data->x_axis = feature_config[index] & BMA423_X_AXIS_MASK;
|
||||||
remap_data->x_axis_sign =
|
remap_data->x_axis_sign = (feature_config[index] & BMA423_X_AXIS_SIGN_MASK) >> 2;
|
||||||
(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 = (feature_config[index] & BMA423_Y_AXIS_MASK) >> 3;
|
||||||
remap_data->y_axis_sign =
|
remap_data->y_axis_sign = (feature_config[index] & BMA423_Y_AXIS_SIGN_MASK) >> 5;
|
||||||
(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 = (feature_config[index] & BMA423_Z_AXIS_MASK) >> 6;
|
||||||
remap_data->z_axis_sign =
|
remap_data->z_axis_sign = (feature_config[index + 1] & BMA423_Z_AXIS_SIGN_MASK);
|
||||||
(feature_config[index + 1] & BMA423_Z_AXIS_SIGN_MASK);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rslt = BMA4_E_INVALID_SENSOR;
|
rslt = BMA4_E_INVALID_SENSOR;
|
||||||
|
@ -930,7 +922,8 @@ uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data,
|
||||||
* @brief This API enables the any motion feature according to the axis
|
* @brief This API enables the any motion feature according to the axis
|
||||||
* set by the user in the sensor.
|
* 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};
|
uint8_t feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
|
||||||
/* Anymotion axis enable bit pos. is 3 byte ahead of the
|
/* Anymotion axis enable bit pos. is 3 byte ahead of the
|
||||||
anymotion base address(0x00) */
|
anymotion base address(0x00) */
|
||||||
|
@ -942,8 +935,8 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_ANYMOTION_EN_LEN + 2, dev);
|
BMA423_ANYMOTION_EN_LEN + 2, dev);
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
feature_config[index] = BMA4_SET_BITSLICE(
|
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
||||||
feature_config[index], BMA423_ANY_NO_MOTION_AXIS_EN, axis);
|
BMA423_ANY_NO_MOTION_AXIS_EN, axis);
|
||||||
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_ANYMOTION_EN_LEN + 2, dev);
|
BMA423_ANYMOTION_EN_LEN + 2, dev);
|
||||||
}
|
}
|
||||||
|
@ -960,9 +953,8 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev) {
|
||||||
/*! @brief This API sets the configuration of Any motion feature in
|
/*! @brief This API sets the configuration of Any motion feature in
|
||||||
* the sensor.
|
* the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion, struct bma4_dev *dev)
|
||||||
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 feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
|
||||||
uint8_t index = BMA423_ANY_NO_MOTION_OFFSET;
|
uint8_t index = BMA423_ANY_NO_MOTION_OFFSET;
|
||||||
uint16_t duration_lsb = 0;
|
uint16_t duration_lsb = 0;
|
||||||
|
@ -979,15 +971,15 @@ bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion,
|
||||||
feature_config[index++] = BMA4_GET_LSB(any_motion->threshold);
|
feature_config[index++] = BMA4_GET_LSB(any_motion->threshold);
|
||||||
feature_config[index] = BMA4_GET_MSB(any_motion->threshold);
|
feature_config[index] = BMA4_GET_MSB(any_motion->threshold);
|
||||||
/* Assign no motion selection value in feature config array*/
|
/* Assign no motion selection value in feature config array*/
|
||||||
feature_config[index++] |=
|
feature_config[index++] |= (uint8_t)
|
||||||
(uint8_t)(any_motion->nomotion_sel << BMA423_ANY_NO_MOTION_SEL_POS);
|
(any_motion->nomotion_sel << BMA423_ANY_NO_MOTION_SEL_POS);
|
||||||
|
|
||||||
/* Extract duration */
|
/* Extract duration */
|
||||||
duration_lsb = feature_config[index];
|
duration_lsb = feature_config[index];
|
||||||
duration_msb = feature_config[index + 1] << 8;
|
duration_msb = feature_config[index + 1] << 8;
|
||||||
duration = duration_lsb | duration_msb;
|
duration = duration_lsb | duration_msb;
|
||||||
duration = BMA4_SET_BITS_POS_0(duration, BMA423_ANY_NO_MOTION_DUR,
|
duration = BMA4_SET_BITS_POS_0(duration,
|
||||||
any_motion->duration);
|
BMA423_ANY_NO_MOTION_DUR, any_motion->duration);
|
||||||
/* Assign duration value in feature config array*/
|
/* Assign duration value in feature config array*/
|
||||||
feature_config[index++] = BMA4_GET_LSB(duration);
|
feature_config[index++] = BMA4_GET_LSB(duration);
|
||||||
feature_config[index] = BMA4_GET_MSB(duration);
|
feature_config[index] = BMA4_GET_MSB(duration);
|
||||||
|
@ -1009,9 +1001,8 @@ bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion,
|
||||||
/*! @brief This API gets the configuration of any motion feature from
|
/*! @brief This API gets the configuration of any motion feature from
|
||||||
* the sensor.
|
* the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion, struct bma4_dev *dev)
|
||||||
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 feature_config[BMA423_ANYMOTION_EN_LEN + 2] = {0};
|
||||||
uint8_t anymotion = 0;
|
uint8_t anymotion = 0;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
@ -1026,10 +1017,10 @@ bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion,
|
||||||
any_motion->threshold = (*data_p) & BMA423_ANY_NO_MOTION_THRES_MSK;
|
any_motion->threshold = (*data_p) & BMA423_ANY_NO_MOTION_THRES_MSK;
|
||||||
/* Extract threshold & nomotion selection
|
/* Extract threshold & nomotion selection
|
||||||
* data */
|
* data */
|
||||||
anymotion =
|
anymotion = ((uint8_t)(*(data_p++) >> 8)) & BMA423_ANY_NO_MOTION_SEL_MSK;
|
||||||
((uint8_t)(*(data_p++) >> 8)) & BMA423_ANY_NO_MOTION_SEL_MSK;
|
|
||||||
/* Extract no motion field */
|
/* 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 */
|
/* Extract duration value */
|
||||||
any_motion->duration = (*(data_p)) & BMA423_ANY_NO_MOTION_DUR_MSK;
|
any_motion->duration = (*(data_p)) & BMA423_ANY_NO_MOTION_DUR_MSK;
|
||||||
}
|
}
|
||||||
|
@ -1047,7 +1038,8 @@ bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion,
|
||||||
* @brief This API enables or disables the step detector feature in the
|
* @brief This API enables or disables the step detector feature in the
|
||||||
* sensor.
|
* 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};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
/* Step detector enable bit pos. is 1 byte ahead of the base address */
|
/* Step detector enable bit pos. is 1 byte ahead of the base address */
|
||||||
|
@ -1058,8 +1050,8 @@ uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
feature_config[index] = BMA4_SET_BITSLICE(
|
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
||||||
feature_config[index], BMA423_STEP_DETECTOR_EN, enable);
|
BMA423_STEP_DETECTOR_EN, enable);
|
||||||
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
}
|
}
|
||||||
|
@ -1077,8 +1069,8 @@ uint16_t bma423_step_detector_enable(uint8_t enable, struct bma4_dev *dev) {
|
||||||
* @brief This API sets the watermark level for step counter
|
* @brief This API sets the watermark level for step counter
|
||||||
* interrupt in the sensor.
|
* interrupt in the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
|
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_STEP_CNTR_OFFSET;
|
uint8_t index = BMA423_STEP_CNTR_OFFSET;
|
||||||
uint16_t wm_lsb = 0;
|
uint16_t wm_lsb = 0;
|
||||||
|
@ -1120,8 +1112,8 @@ uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
|
||||||
* @brief This API gets the water mark level set for step counter interrupt
|
* @brief This API gets the water mark level set for step counter interrupt
|
||||||
* in the sensor
|
* in the sensor
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm,
|
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_STEP_CNTR_OFFSET;
|
uint8_t index = BMA423_STEP_CNTR_OFFSET;
|
||||||
uint16_t wm_lsb = 0;
|
uint16_t wm_lsb = 0;
|
||||||
|
@ -1152,7 +1144,8 @@ uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API resets the counted steps of step counter.
|
* @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};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
/* Reset bit is 1 byte ahead of base address */
|
/* Reset bit is 1 byte ahead of base address */
|
||||||
uint8_t index = BMA423_STEP_CNTR_OFFSET + 1;
|
uint8_t index = BMA423_STEP_CNTR_OFFSET + 1;
|
||||||
|
@ -1164,8 +1157,8 @@ uint16_t bma423_reset_step_counter(struct bma4_dev *dev) {
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
feature_config[index] =
|
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
||||||
BMA4_SET_BITSLICE(feature_config[index], BMA423_STEP_CNTR_RST, 1);
|
BMA423_STEP_CNTR_RST, 1);
|
||||||
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
}
|
}
|
||||||
|
@ -1182,8 +1175,8 @@ uint16_t bma423_reset_step_counter(struct bma4_dev *dev) {
|
||||||
* @brief This API gets the number of counted steps of the step counter
|
* @brief This API gets the number of counted steps of the step counter
|
||||||
* feature from the sensor.
|
* feature from the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_step_counter_output(uint32_t *step_count,
|
uint16_t bma423_step_counter_output(uint32_t *step_count, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t data[BMA423_STEP_CNTR_DATA_SIZE] = {0};
|
uint8_t data[BMA423_STEP_CNTR_DATA_SIZE] = {0};
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
uint32_t step_count_0 = 0;
|
uint32_t step_count_0 = 0;
|
||||||
|
@ -1218,7 +1211,8 @@ uint16_t bma423_step_counter_output(uint32_t *step_count,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API gets the output for activity feature.
|
* @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;
|
uint8_t data = 0;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
|
@ -1241,7 +1235,8 @@ uint16_t bma423_activity_output(uint8_t *activity, struct bma4_dev *dev) {
|
||||||
/*!
|
/*!
|
||||||
* @brief This API select the platform configuration wrist(Default) or phone.
|
* @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;
|
uint16_t rslt = BMA4_OK;
|
||||||
struct bma423_stepcounter_settings sc_settings = {0};
|
struct bma423_stepcounter_settings sc_settings = {0};
|
||||||
|
|
||||||
|
@ -1327,21 +1322,19 @@ uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev) {
|
||||||
* @brief This API gets the parameter1 to parameter7 settings of the
|
* @brief This API gets the parameter1 to parameter7 settings of the
|
||||||
* step counter feature.
|
* step counter feature.
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting, struct bma4_dev *dev)
|
||||||
bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
|
{
|
||||||
struct bma4_dev *dev) {
|
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint16_t *data_p = (uint16_t *)feature_config;
|
uint16_t *data_p = (uint16_t *)feature_config;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
/* To convert 8bit to 16 bit address */
|
/* To convert 8bit to 16 bit address */
|
||||||
data_p = data_p + BMA423_STEP_CNTR_PARAM_OFFSET / 2;
|
data_p = data_p + BMA423_STEP_CNTR_PARAM_OFFSET/2;
|
||||||
extract_stepcounter_parameter(setting, data_p);
|
extract_stepcounter_parameter(setting, data_p);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1358,16 +1351,15 @@ bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
|
||||||
* @brief This API sets the parameter1 to parameter7 settings of the
|
* @brief This API sets the parameter1 to parameter7 settings of the
|
||||||
* step counter feature in the sensor.
|
* step counter feature in the sensor.
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_stepcounter_set_parameter(
|
uint16_t bma423_stepcounter_set_parameter(const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev)
|
||||||
const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_STEP_CNTR_PARAM_OFFSET;
|
uint8_t index = BMA423_STEP_CNTR_PARAM_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
update_stepcounter_parameter(setting, index, feature_config);
|
update_stepcounter_parameter(setting, index, feature_config);
|
||||||
/* Writes stepcounter parameter settings
|
/* Writes stepcounter parameter settings
|
||||||
|
@ -1388,19 +1380,18 @@ uint16_t bma423_stepcounter_set_parameter(
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the sensitivity of wake up feature in the sensor
|
* @brief This API sets the sensitivity of wake up feature in the sensor
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
|
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_WAKEUP_OFFSET;
|
uint8_t index = BMA423_WAKEUP_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
feature_config[index] = BMA4_SET_BITSLICE(
|
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
||||||
feature_config[index], BMA423_WAKEUP_SENS, sensitivity);
|
BMA423_WAKEUP_SENS, sensitivity);
|
||||||
/* Writes sensitivity settings in the sensor */
|
/* Writes sensitivity settings in the sensor */
|
||||||
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt |= bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
||||||
BMA423_FEATURE_SIZE, dev);
|
BMA423_FEATURE_SIZE, dev);
|
||||||
|
@ -1418,20 +1409,18 @@ uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API gets the sensitivity of wake up feature in the sensor
|
* @brief This API gets the sensitivity of wake up feature in the sensor
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity,
|
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity, struct bma4_dev *dev)
|
||||||
struct bma4_dev *dev) {
|
{
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0};
|
||||||
uint8_t index = BMA423_WAKEUP_OFFSET;
|
uint8_t index = BMA423_WAKEUP_OFFSET;
|
||||||
uint16_t rslt = BMA4_OK;
|
uint16_t rslt = BMA4_OK;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
/* Extracts sensitivity data */
|
/* Extracts sensitivity data */
|
||||||
*sensitivity =
|
*sensitivity = BMA4_GET_BITSLICE(feature_config[index], BMA423_WAKEUP_SENS);
|
||||||
BMA4_GET_BITSLICE(feature_config[index], BMA423_WAKEUP_SENS);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rslt = BMA4_E_INVALID_SENSOR;
|
rslt = BMA4_E_INVALID_SENSOR;
|
||||||
|
@ -1447,17 +1436,15 @@ uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity,
|
||||||
* @brief This API is used to select single/double tap
|
* @brief This API is used to select single/double tap
|
||||||
* feature in the sensor
|
* 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;
|
uint16_t rslt = BMA4_OK;
|
||||||
uint8_t feature_config[BMA423_FEATURE_SIZE] = {
|
uint8_t feature_config[BMA423_FEATURE_SIZE] = {0,};
|
||||||
0,
|
|
||||||
};
|
|
||||||
uint8_t index = BMA423_WAKEUP_OFFSET;
|
uint8_t index = BMA423_WAKEUP_OFFSET;
|
||||||
|
|
||||||
if (dev != NULL) {
|
if (dev != NULL) {
|
||||||
if (dev->chip_id == BMA423_CHIP_ID) {
|
if (dev->chip_id == BMA423_CHIP_ID) {
|
||||||
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
|
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA423_FEATURE_SIZE, dev);
|
||||||
BMA423_FEATURE_SIZE, dev);
|
|
||||||
if (rslt == BMA4_OK) {
|
if (rslt == BMA4_OK) {
|
||||||
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
|
||||||
BMA423_TAP_SEL, tap_select);
|
BMA423_TAP_SEL, tap_select);
|
||||||
|
@ -1476,7 +1463,8 @@ uint16_t bma423_tap_selection(const uint8_t tap_select, struct bma4_dev *dev) {
|
||||||
/*!
|
/*!
|
||||||
* @brief This API update the length for read and write.
|
* @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;
|
uint8_t length = BMA423_FEATURE_SIZE;
|
||||||
|
|
||||||
if ((feature == BMA423_ANY_MOTION) || (feature == BMA423_NO_MOTION)) {
|
if ((feature == BMA423_ANY_MOTION) || (feature == BMA423_NO_MOTION)) {
|
||||||
|
@ -1499,8 +1487,8 @@ static void update_len(uint8_t *len, uint8_t feature, uint8_t enable) {
|
||||||
/*!
|
/*!
|
||||||
* @brief This API enables the features of the sensor.
|
* @brief This API enables the features of the sensor.
|
||||||
*/
|
*/
|
||||||
static uint16_t feature_enable(uint8_t feature, uint8_t len,
|
static uint16_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
|
||||||
uint8_t *feature_config, struct bma4_dev *dev) {
|
{
|
||||||
uint8_t index = 0;
|
uint8_t index = 0;
|
||||||
uint16_t rslt;
|
uint16_t rslt;
|
||||||
|
|
||||||
|
@ -1541,12 +1529,10 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len,
|
||||||
|
|
||||||
if ((feature & BMA423_ANY_MOTION) > 0) {
|
if ((feature & BMA423_ANY_MOTION) > 0) {
|
||||||
/* Enable anymotion */
|
/* Enable anymotion */
|
||||||
feature_config[index] =
|
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
|
||||||
feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
|
|
||||||
} else {
|
} else {
|
||||||
/* Enable nomotion */
|
/* Enable nomotion */
|
||||||
feature_config[index] =
|
feature_config[index] = feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
|
||||||
feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,8 +1545,8 @@ static uint16_t feature_enable(uint8_t feature, uint8_t len,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API disables the features of the sensor.
|
* @brief This API disables the features of the sensor.
|
||||||
*/
|
*/
|
||||||
static uint16_t feature_disable(uint8_t feature, uint8_t len,
|
static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
|
||||||
uint8_t *feature_config, struct bma4_dev *dev) {
|
{
|
||||||
uint8_t index = 0;
|
uint8_t index = 0;
|
||||||
uint16_t rslt;
|
uint16_t rslt;
|
||||||
|
|
||||||
|
@ -1601,18 +1587,15 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len,
|
||||||
|
|
||||||
if ((feature & BMA423_ANY_MOTION) > 0) {
|
if ((feature & BMA423_ANY_MOTION) > 0) {
|
||||||
/* Disable anymotion */
|
/* Disable anymotion */
|
||||||
feature_config[index] =
|
feature_config[index] = feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
|
||||||
feature_config[index] | BMA423_ANY_NO_MOTION_SEL_MSK;
|
|
||||||
} else {
|
} else {
|
||||||
/* Disable nomotion */
|
/* Disable nomotion */
|
||||||
feature_config[index] =
|
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
|
||||||
feature_config[index] & (~BMA423_ANY_NO_MOTION_SEL_MSK);
|
|
||||||
}
|
}
|
||||||
/* Any/Nomotion axis enable bit pos. is 3 byte ahead of the
|
/* Any/Nomotion axis enable bit pos. is 3 byte ahead of the
|
||||||
any/nomotion base address(0x00) */
|
any/nomotion base address(0x00) */
|
||||||
index = 3;
|
index = 3;
|
||||||
feature_config[index] =
|
feature_config[index] = feature_config[index] & (~BMA423_ANY_NO_MOTION_AXIS_EN_MSK);
|
||||||
feature_config[index] & (~BMA423_ANY_NO_MOTION_AXIS_EN_MSK);
|
|
||||||
}
|
}
|
||||||
/* Write the configured settings in the sensor */
|
/* Write the configured settings in the sensor */
|
||||||
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
|
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
|
||||||
|
@ -1623,9 +1606,9 @@ static uint16_t feature_disable(uint8_t feature, uint8_t len,
|
||||||
/*!
|
/*!
|
||||||
* @brief This API update the settings of step counter.
|
* @brief This API update the settings of step counter.
|
||||||
*/
|
*/
|
||||||
static void
|
static void update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
||||||
update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
uint8_t index, uint8_t *feature_config)
|
||||||
uint8_t index, uint8_t *feature_config) {
|
{
|
||||||
feature_config[index++] = BMA4_GET_LSB(setting->param1);
|
feature_config[index++] = BMA4_GET_LSB(setting->param1);
|
||||||
feature_config[index++] = BMA4_GET_MSB(setting->param1);
|
feature_config[index++] = BMA4_GET_MSB(setting->param1);
|
||||||
feature_config[index++] = BMA4_GET_LSB(setting->param2);
|
feature_config[index++] = BMA4_GET_LSB(setting->param2);
|
||||||
|
@ -1682,9 +1665,8 @@ update_stepcounter_parameter(const struct bma423_stepcounter_settings *setting,
|
||||||
* @brief This API copy the settings of step counter into the
|
* @brief This API copy the settings of step counter into the
|
||||||
* structure of bma423_stepcounter_settings, which is read from sensor.
|
* structure of bma423_stepcounter_settings, which is read from sensor.
|
||||||
*/
|
*/
|
||||||
static void
|
static void extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting, const uint16_t *data_p)
|
||||||
extract_stepcounter_parameter(struct bma423_stepcounter_settings *setting,
|
{
|
||||||
const uint16_t *data_p) {
|
|
||||||
setting->param1 = *(data_p++);
|
setting->param1 = *(data_p++);
|
||||||
setting->param2 = *(data_p++);
|
setting->param2 = *(data_p++);
|
||||||
setting->param3 = *(data_p++);
|
setting->param3 = *(data_p++);
|
||||||
|
|
209
src/bma423.h
209
src/bma423.h
|
@ -1,87 +1,87 @@
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
||||||
*
|
*
|
||||||
* File : bma423.h
|
* File : bma423.h
|
||||||
*
|
*
|
||||||
* Date: 12 Oct 2017
|
* Date: 12 Oct 2017
|
||||||
*
|
*
|
||||||
* Revision : 1.1.4 $
|
* Revision : 1.1.4 $
|
||||||
*
|
*
|
||||||
* Usage: Sensor Driver for BMA423 sensor
|
* Usage: Sensor Driver for BMA423 sensor
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Disclaimer
|
* Disclaimer
|
||||||
*
|
*
|
||||||
* Common:
|
* Common:
|
||||||
* Bosch Sensortec products are developed for the consumer goods industry.
|
* Bosch Sensortec products are developed for the consumer goods industry.
|
||||||
* They may only be used within the parameters of the respective valid
|
* They may only be used within the parameters of the respective valid
|
||||||
* product data sheet. Bosch Sensortec products are provided with the
|
* product data sheet. Bosch Sensortec products are provided with the
|
||||||
* express understanding that there is no warranty of fitness for a
|
* express understanding that there is no warranty of fitness for a
|
||||||
* particular purpose.They are not fit for use in life-sustaining,
|
* particular purpose.They are not fit for use in life-sustaining,
|
||||||
* safety or security sensitive systems or any system or device
|
* safety or security sensitive systems or any system or device
|
||||||
* that may lead to bodily harm or property damage if the system
|
* that may lead to bodily harm or property damage if the system
|
||||||
* or device malfunctions. In addition,Bosch Sensortec products are
|
* or device malfunctions. In addition,Bosch Sensortec products are
|
||||||
* not fit for use in products which interact with motor vehicle systems.
|
* not fit for use in products which interact with motor vehicle systems.
|
||||||
* The resale and or use of products are at the purchasers own risk and
|
* The resale and or use of products are at the purchasers own risk and
|
||||||
* his own responsibility. The examination of fitness for the intended use
|
* his own responsibility. The examination of fitness for the intended use
|
||||||
* is the sole responsibility of the Purchaser.
|
* is the sole responsibility of the Purchaser.
|
||||||
*
|
*
|
||||||
* The purchaser shall indemnify Bosch Sensortec from all third party
|
* The purchaser shall indemnify Bosch Sensortec from all third party
|
||||||
* claims, including any claims for incidental, or consequential damages,
|
* claims, including any claims for incidental, or consequential damages,
|
||||||
* arising from any product use not covered by the parameters of
|
* arising from any product use not covered by the parameters of
|
||||||
* the respective valid product data sheet or not approved by
|
* the respective valid product data sheet or not approved by
|
||||||
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
||||||
* connection with such claims.
|
* connection with such claims.
|
||||||
*
|
*
|
||||||
* The purchaser must monitor the market for the purchased products,
|
* The purchaser must monitor the market for the purchased products,
|
||||||
* particularly with regard to product safety and inform Bosch Sensortec
|
* particularly with regard to product safety and inform Bosch Sensortec
|
||||||
* without delay of all security relevant incidents.
|
* without delay of all security relevant incidents.
|
||||||
*
|
*
|
||||||
* Engineering Samples are marked with an asterisk (*) or (e).
|
* Engineering Samples are marked with an asterisk (*) or (e).
|
||||||
* Samples may vary from the valid technical specifications of the product
|
* Samples may vary from the valid technical specifications of the product
|
||||||
* series. They are therefore not intended or fit for resale to third
|
* series. They are therefore not intended or fit for resale to third
|
||||||
* parties or for use in end products. Their sole purpose is internal
|
* parties or for use in end products. Their sole purpose is internal
|
||||||
* client testing. The testing of an engineering sample may in no way
|
* client testing. The testing of an engineering sample may in no way
|
||||||
* replace the testing of a product series. Bosch Sensortec assumes
|
* replace the testing of a product series. Bosch Sensortec assumes
|
||||||
* no liability for the use of engineering samples.
|
* no liability for the use of engineering samples.
|
||||||
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
||||||
* Bosch Sensortec from all claims arising from the use of engineering
|
* Bosch Sensortec from all claims arising from the use of engineering
|
||||||
* samples.
|
* samples.
|
||||||
*
|
*
|
||||||
* Special:
|
* Special:
|
||||||
* This software module (hereinafter called "Software") and any information
|
* This software module (hereinafter called "Software") and any information
|
||||||
* on application-sheets (hereinafter called "Information") is provided
|
* on application-sheets (hereinafter called "Information") is provided
|
||||||
* free of charge for the sole purpose to support your application work.
|
* free of charge for the sole purpose to support your application work.
|
||||||
* The Software and Information is subject to the following
|
* The Software and Information is subject to the following
|
||||||
* terms and conditions:
|
* terms and conditions:
|
||||||
*
|
*
|
||||||
* The Software is specifically designed for the exclusive use for
|
* The Software is specifically designed for the exclusive use for
|
||||||
* Bosch Sensortec products by personnel who have special experience
|
* Bosch Sensortec products by personnel who have special experience
|
||||||
* and training. Do not use this Software if you do not have the
|
* and training. Do not use this Software if you do not have the
|
||||||
* proper experience or training.
|
* proper experience or training.
|
||||||
*
|
*
|
||||||
* This Software package is provided `` as is `` and without any expressed
|
* This Software package is provided `` as is `` and without any expressed
|
||||||
* or implied warranties,including without limitation, the implied warranties
|
* or implied warranties,including without limitation, the implied warranties
|
||||||
* of merchantability and fitness for a particular purpose.
|
* of merchantability and fitness for a particular purpose.
|
||||||
*
|
*
|
||||||
* Bosch Sensortec and their representatives and agents deny any liability
|
* Bosch Sensortec and their representatives and agents deny any liability
|
||||||
* for the functional impairment
|
* for the functional impairment
|
||||||
* of this Software in terms of fitness, performance and safety.
|
* of this Software in terms of fitness, performance and safety.
|
||||||
* Bosch Sensortec and their representatives and agents shall not be liable
|
* Bosch Sensortec and their representatives and agents shall not be liable
|
||||||
* for any direct or indirect damages or injury, except as
|
* for any direct or indirect damages or injury, except as
|
||||||
* otherwise stipulated in mandatory applicable law.
|
* otherwise stipulated in mandatory applicable law.
|
||||||
*
|
*
|
||||||
* The Information provided is believed to be accurate and reliable.
|
* The Information provided is believed to be accurate and reliable.
|
||||||
* Bosch Sensortec assumes no responsibility for the consequences of use
|
* Bosch Sensortec assumes no responsibility for the consequences of use
|
||||||
* of such Information nor for any infringement of patents or
|
* of such Information nor for any infringement of patents or
|
||||||
* other rights of third parties which may result from its use.
|
* other rights of third parties which may result from its use.
|
||||||
* No license is granted by implication or otherwise under any patent or
|
* No license is granted by implication or otherwise under any patent or
|
||||||
* patent rights of Bosch. Specifications mentioned in the Information are
|
* patent rights of Bosch. Specifications mentioned in the Information are
|
||||||
* subject to change without notice.
|
* subject to change without notice.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/*! \file bma423.h
|
/*! \file bma423.h
|
||||||
\brief Sensor Driver for BMA423 sensor */
|
\brief Sensor Driver for BMA423 sensor */
|
||||||
#ifndef BMA423_H
|
#ifndef BMA423_H
|
||||||
|
@ -109,6 +109,7 @@ extern "C" {
|
||||||
#define BMA423_CONFIG_ID_OFFSET UINT8_C(0x3C)
|
#define BMA423_CONFIG_ID_OFFSET UINT8_C(0x3C)
|
||||||
#define BMA423_AXES_REMAP_OFFSET UINT8_C(0x3E)
|
#define BMA423_AXES_REMAP_OFFSET UINT8_C(0x3E)
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
/**\name Remap Axes */
|
/**\name Remap Axes */
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
@ -384,6 +385,7 @@ uint16_t bma423_write_config_file(struct bma4_dev *dev);
|
||||||
*/
|
*/
|
||||||
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);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets/unsets the user provided interrupt to either
|
* @brief This API sets/unsets the user provided interrupt to either
|
||||||
* interrupt pin1 or pin2 in the sensor.
|
* interrupt pin1 or pin2 in the sensor.
|
||||||
|
@ -420,8 +422,7 @@ uint16_t bma423_get_config_id(uint16_t *config_id, struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map,
|
uint16_t bma423_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev);
|
||||||
uint8_t enable, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the bma423 interrupt status from the sensor.
|
* @brief This API reads the bma423 interrupt status from the sensor.
|
||||||
|
@ -478,8 +479,8 @@ uint16_t bma423_read_int_status(uint16_t *int_status, struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
|
uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API performs x, y and z axis remapping in the sensor.
|
* @brief This API performs x, y and z axis remapping in the sensor.
|
||||||
|
@ -491,8 +492,7 @@ uint16_t bma423_feature_enable(uint8_t feature, uint8_t enable,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data,
|
uint16_t bma423_set_remap_axes(const struct bma423_axes_remap *remap_data, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API reads the x, y and z axis remap data from the sensor.
|
* @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,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data,
|
uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the watermark level for step counter
|
* @brief This API sets the watermark level for step counter
|
||||||
|
@ -522,8 +522,7 @@ uint16_t bma423_get_remap_axes(struct bma423_axes_remap *remap_data,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
|
uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API gets the water mark level set for step counter interrupt
|
* @brief This API gets the water mark level set for step counter interrupt
|
||||||
|
@ -539,8 +538,7 @@ uint16_t bma423_step_counter_set_watermark(uint16_t step_counter_wm,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm,
|
uint16_t bma423_step_counter_get_watermark(uint16_t *step_counter_wm, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API resets the counted steps of step counter.
|
* @brief This API resets the counted steps of step counter.
|
||||||
|
@ -615,9 +613,7 @@ uint16_t bma423_select_platform(uint8_t platform, struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
|
||||||
bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
|
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API sets the parameter1 to parameter7 settings of the
|
* @brief This API sets the parameter1 to parameter7 settings of the
|
||||||
|
@ -631,8 +627,7 @@ bma423_stepcounter_get_parameter(struct bma423_stepcounter_settings *setting,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_stepcounter_set_parameter(
|
uint16_t bma423_stepcounter_set_parameter(const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
|
||||||
const struct bma423_stepcounter_settings *setting, struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API enables or disables the step detector feature in the
|
* @brief This API enables or disables the step detector feature in the
|
||||||
|
@ -708,9 +703,7 @@ uint16_t bma423_anymotion_enable_axis(uint8_t axis, struct bma4_dev *dev);
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion, struct bma4_dev *dev);
|
||||||
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
|
/*! @brief This API gets the configuration of any motion feature from
|
||||||
* the sensor.
|
* the sensor.
|
||||||
|
@ -748,9 +741,7 @@ bma423_set_any_motion_config(const struct bma423_anymotion_config *any_motion,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t
|
uint16_t bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion, struct bma4_dev *dev);
|
||||||
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
|
* @brief This API sets the sensitivity of wake up feature in the sensor
|
||||||
|
@ -767,8 +758,7 @@ bma423_get_any_motion_config(struct bma423_anymotion_config *any_motion,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
|
uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API gets the sensitivity of wake up feature in the sensor
|
* @brief This API gets the sensitivity of wake up feature in the sensor
|
||||||
|
@ -785,8 +775,7 @@ uint16_t bma423_wakeup_set_sensitivity(uint8_t sensitivity,
|
||||||
* @retval 0 -> Success
|
* @retval 0 -> Success
|
||||||
* @retval Any non zero value -> Fail
|
* @retval Any non zero value -> Fail
|
||||||
*/
|
*/
|
||||||
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity,
|
uint16_t bma423_wakeup_get_sensitivity(uint8_t *sensitivity, struct bma4_dev *dev);
|
||||||
struct bma4_dev *dev);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief This API is used to select single/double tap
|
* @brief This API is used to select single/double tap
|
||||||
|
|
192
src/bma4_defs.h
192
src/bma4_defs.h
|
@ -1,87 +1,87 @@
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
* Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
|
||||||
*
|
*
|
||||||
* File : bma4_defs.h
|
* File : bma4_defs.h
|
||||||
*
|
*
|
||||||
* Date: 12 Oct 2017
|
* Date: 12 Oct 2017
|
||||||
*
|
*
|
||||||
* Revision: 2.1.9 $
|
* Revision: 2.1.9 $
|
||||||
*
|
*
|
||||||
* Usage: Sensor Driver for BMA4 family of sensors
|
* Usage: Sensor Driver for BMA4 family of sensors
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Disclaimer
|
* Disclaimer
|
||||||
*
|
*
|
||||||
* Common:
|
* Common:
|
||||||
* Bosch Sensortec products are developed for the consumer goods industry.
|
* Bosch Sensortec products are developed for the consumer goods industry.
|
||||||
* They may only be used within the parameters of the respective valid
|
* They may only be used within the parameters of the respective valid
|
||||||
* product data sheet. Bosch Sensortec products are provided with the
|
* product data sheet. Bosch Sensortec products are provided with the
|
||||||
* express understanding that there is no warranty of fitness for a
|
* express understanding that there is no warranty of fitness for a
|
||||||
* particular purpose.They are not fit for use in life-sustaining,
|
* particular purpose.They are not fit for use in life-sustaining,
|
||||||
* safety or security sensitive systems or any system or device
|
* safety or security sensitive systems or any system or device
|
||||||
* that may lead to bodily harm or property damage if the system
|
* that may lead to bodily harm or property damage if the system
|
||||||
* or device malfunctions. In addition,Bosch Sensortec products are
|
* or device malfunctions. In addition,Bosch Sensortec products are
|
||||||
* not fit for use in products which interact with motor vehicle systems.
|
* not fit for use in products which interact with motor vehicle systems.
|
||||||
* The resale and or use of products are at the purchasers own risk and
|
* The resale and or use of products are at the purchasers own risk and
|
||||||
* his own responsibility. The examination of fitness for the intended use
|
* his own responsibility. The examination of fitness for the intended use
|
||||||
* is the sole responsibility of the Purchaser.
|
* is the sole responsibility of the Purchaser.
|
||||||
*
|
*
|
||||||
* The purchaser shall indemnify Bosch Sensortec from all third party
|
* The purchaser shall indemnify Bosch Sensortec from all third party
|
||||||
* claims, including any claims for incidental, or consequential damages,
|
* claims, including any claims for incidental, or consequential damages,
|
||||||
* arising from any product use not covered by the parameters of
|
* arising from any product use not covered by the parameters of
|
||||||
* the respective valid product data sheet or not approved by
|
* the respective valid product data sheet or not approved by
|
||||||
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
* Bosch Sensortec and reimburse Bosch Sensortec for all costs in
|
||||||
* connection with such claims.
|
* connection with such claims.
|
||||||
*
|
*
|
||||||
* The purchaser must monitor the market for the purchased products,
|
* The purchaser must monitor the market for the purchased products,
|
||||||
* particularly with regard to product safety and inform Bosch Sensortec
|
* particularly with regard to product safety and inform Bosch Sensortec
|
||||||
* without delay of all security relevant incidents.
|
* without delay of all security relevant incidents.
|
||||||
*
|
*
|
||||||
* Engineering Samples are marked with an asterisk (*) or (e).
|
* Engineering Samples are marked with an asterisk (*) or (e).
|
||||||
* Samples may vary from the valid technical specifications of the product
|
* Samples may vary from the valid technical specifications of the product
|
||||||
* series. They are therefore not intended or fit for resale to third
|
* series. They are therefore not intended or fit for resale to third
|
||||||
* parties or for use in end products. Their sole purpose is internal
|
* parties or for use in end products. Their sole purpose is internal
|
||||||
* client testing. The testing of an engineering sample may in no way
|
* client testing. The testing of an engineering sample may in no way
|
||||||
* replace the testing of a product series. Bosch Sensortec assumes
|
* replace the testing of a product series. Bosch Sensortec assumes
|
||||||
* no liability for the use of engineering samples.
|
* no liability for the use of engineering samples.
|
||||||
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
* By accepting the engineering samples, the Purchaser agrees to indemnify
|
||||||
* Bosch Sensortec from all claims arising from the use of engineering
|
* Bosch Sensortec from all claims arising from the use of engineering
|
||||||
* samples.
|
* samples.
|
||||||
*
|
*
|
||||||
* Special:
|
* Special:
|
||||||
* This software module (hereinafter called "Software") and any information
|
* This software module (hereinafter called "Software") and any information
|
||||||
* on application-sheets (hereinafter called "Information") is provided
|
* on application-sheets (hereinafter called "Information") is provided
|
||||||
* free of charge for the sole purpose to support your application work.
|
* free of charge for the sole purpose to support your application work.
|
||||||
* The Software and Information is subject to the following
|
* The Software and Information is subject to the following
|
||||||
* terms and conditions:
|
* terms and conditions:
|
||||||
*
|
*
|
||||||
* The Software is specifically designed for the exclusive use for
|
* The Software is specifically designed for the exclusive use for
|
||||||
* Bosch Sensortec products by personnel who have special experience
|
* Bosch Sensortec products by personnel who have special experience
|
||||||
* and training. Do not use this Software if you do not have the
|
* and training. Do not use this Software if you do not have the
|
||||||
* proper experience or training.
|
* proper experience or training.
|
||||||
*
|
*
|
||||||
* This Software package is provided `` as is `` and without any expressed
|
* This Software package is provided `` as is `` and without any expressed
|
||||||
* or implied warranties,including without limitation, the implied warranties
|
* or implied warranties,including without limitation, the implied warranties
|
||||||
* of merchantability and fitness for a particular purpose.
|
* of merchantability and fitness for a particular purpose.
|
||||||
*
|
*
|
||||||
* Bosch Sensortec and their representatives and agents deny any liability
|
* Bosch Sensortec and their representatives and agents deny any liability
|
||||||
* for the functional impairment
|
* for the functional impairment
|
||||||
* of this Software in terms of fitness, performance and safety.
|
* of this Software in terms of fitness, performance and safety.
|
||||||
* Bosch Sensortec and their representatives and agents shall not be liable
|
* Bosch Sensortec and their representatives and agents shall not be liable
|
||||||
* for any direct or indirect damages or injury, except as
|
* for any direct or indirect damages or injury, except as
|
||||||
* otherwise stipulated in mandatory applicable law.
|
* otherwise stipulated in mandatory applicable law.
|
||||||
*
|
*
|
||||||
* The Information provided is believed to be accurate and reliable.
|
* The Information provided is believed to be accurate and reliable.
|
||||||
* Bosch Sensortec assumes no responsibility for the consequences of use
|
* Bosch Sensortec assumes no responsibility for the consequences of use
|
||||||
* of such Information nor for any infringement of patents or
|
* of such Information nor for any infringement of patents or
|
||||||
* other rights of third parties which may result from its use.
|
* other rights of third parties which may result from its use.
|
||||||
* No license is granted by implication or otherwise under any patent or
|
* No license is granted by implication or otherwise under any patent or
|
||||||
* patent rights of Bosch. Specifications mentioned in the Information are
|
* patent rights of Bosch. Specifications mentioned in the Information are
|
||||||
* subject to change without notice.
|
* subject to change without notice.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/*! \file bma4_defs.h
|
/*! \file bma4_defs.h
|
||||||
\brief Sensor Driver for BMA4 family of sensors */
|
\brief Sensor Driver for BMA4 family of sensors */
|
||||||
#ifndef BMA4_DEFS_H__
|
#ifndef BMA4_DEFS_H__
|
||||||
|
@ -91,9 +91,9 @@
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#else
|
#else
|
||||||
#include <math.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
@ -611,6 +611,7 @@
|
||||||
#define BMA4_MAG_DATA_RDY_INT UINT16_C(0x2000)
|
#define BMA4_MAG_DATA_RDY_INT UINT16_C(0x2000)
|
||||||
#define BMA4_ACCEL_DATA_RDY_INT UINT16_C(0x8000)
|
#define BMA4_ACCEL_DATA_RDY_INT UINT16_C(0x8000)
|
||||||
|
|
||||||
|
|
||||||
/**\name AKM POWER MODE SELECTION */
|
/**\name AKM POWER MODE SELECTION */
|
||||||
#define AKM_POWER_DOWN_MODE UINT8_C(0)
|
#define AKM_POWER_DOWN_MODE UINT8_C(0)
|
||||||
#define AKM_SINGLE_MEAS_MODE UINT8_C(1)
|
#define AKM_SINGLE_MEAS_MODE UINT8_C(1)
|
||||||
|
@ -659,6 +660,7 @@
|
||||||
/* BMA4_KELVIN_SCALED = 273.15 * 1000 */
|
/* BMA4_KELVIN_SCALED = 273.15 * 1000 */
|
||||||
#define BMA4_KELVIN_SCALED INT32_C(273150)
|
#define BMA4_KELVIN_SCALED INT32_C(273150)
|
||||||
|
|
||||||
|
|
||||||
/**\name MAP BURST READ LENGTHS */
|
/**\name MAP BURST READ LENGTHS */
|
||||||
#define BMA4_AUX_READ_LEN_0 0
|
#define BMA4_AUX_READ_LEN_0 0
|
||||||
#define BMA4_AUX_READ_LEN_1 1
|
#define BMA4_AUX_READ_LEN_1 1
|
||||||
|
@ -670,10 +672,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**\name BIT SLICE GET AND SET FUNCTIONS */
|
/**\name BIT SLICE GET AND SET FUNCTIONS */
|
||||||
#define BMA4_GET_BITSLICE(regvar, bitname) \
|
#define BMA4_GET_BITSLICE(regvar, bitname)\
|
||||||
((regvar & bitname##_MSK) >> bitname##_POS)
|
((regvar & bitname##_MSK) >> bitname##_POS)
|
||||||
#define BMA4_SET_BITSLICE(regvar, bitname, val) \
|
#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_DIFF(x, y) ((x) - (y))
|
||||||
|
|
||||||
#define BMA4_GET_LSB(var) (uint8_t)(var & BMA4_SET_LOW_BYTE)
|
#define BMA4_GET_LSB(var) (uint8_t)(var & BMA4_SET_LOW_BYTE)
|
||||||
|
@ -682,7 +685,8 @@
|
||||||
#define BMA4_SET_BIT_VAL_0(reg_data, bitname) (reg_data & ~(bitname##_MSK))
|
#define BMA4_SET_BIT_VAL_0(reg_data, bitname) (reg_data & ~(bitname##_MSK))
|
||||||
|
|
||||||
#define BMA4_SET_BITS_POS_0(reg_data, bitname, data) \
|
#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))
|
#define BMA4_GET_BITS_POS_0(reg_data, bitname) (reg_data & (bitname##_MSK))
|
||||||
|
|
||||||
|
@ -691,8 +695,7 @@
|
||||||
* @brief Bus communication function pointer which should be mapped to
|
* @brief Bus communication function pointer which should be mapped to
|
||||||
* the platform specific read and write functions of the user
|
* 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,
|
typedef uint16_t (*bma4_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr, uint8_t *read_data, uint16_t len);
|
||||||
uint8_t *read_data, uint16_t len);
|
|
||||||
|
|
||||||
/*! delay function pointer */
|
/*! delay function pointer */
|
||||||
typedef void (*bma4_delay_fptr_t)(uint32_t);
|
typedef void (*bma4_delay_fptr_t)(uint32_t);
|
||||||
|
@ -702,7 +705,10 @@ typedef void (*bma4_delay_fptr_t)(uint32_t);
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
/*! @name Enum to define BMA4 variants */
|
/*! @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*/
|
/**\name STRUCTURE DEFINITIONS*/
|
||||||
|
|
||||||
|
@ -853,7 +859,7 @@ struct bma4_int_pin_config {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Accelerometer configuration structure */
|
* @brief Accelerometer configuration structure */
|
||||||
struct bma4_accel_config {
|
struct bma4_accel_config {
|
||||||
/*! Output data rate in Hz */
|
/*! Output data rate in Hz */
|
||||||
uint8_t odr;
|
uint8_t odr;
|
||||||
|
|
117
src/config.h
117
src/config.h
|
@ -1,114 +1,53 @@
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
// Versioning
|
|
||||||
#define WATCHY_LIB_VER "1.4.14"
|
|
||||||
|
|
||||||
//pins
|
//pins
|
||||||
|
#define SDA 21
|
||||||
#ifdef ARDUINO_ESP32S3_DEV //V3
|
#define SCL 22
|
||||||
|
#define ADC_PIN 33
|
||||||
#define WATCHY_V3_SDA 12
|
#define RTC_PIN GPIO_NUM_27
|
||||||
#define WATCHY_V3_SCL 11
|
#define CS 5
|
||||||
|
#define DC 10
|
||||||
#define WATCHY_V3_SS 33
|
#define RESET 9
|
||||||
#define WATCHY_V3_MOSI 48
|
#define BUSY 19
|
||||||
#define WATCHY_V3_MISO 46
|
#define VIB_MOTOR_PIN 13
|
||||||
#define WATCHY_V3_SCK 47
|
|
||||||
|
|
||||||
#define MENU_BTN_PIN 7
|
|
||||||
#define BACK_BTN_PIN 6
|
|
||||||
#define UP_BTN_PIN 0
|
|
||||||
#define DOWN_BTN_PIN 8
|
|
||||||
|
|
||||||
#define DISPLAY_CS 33
|
|
||||||
#define DISPLAY_DC 34
|
|
||||||
#define DISPLAY_RES 35
|
|
||||||
#define DISPLAY_BUSY 36
|
|
||||||
#define ACC_INT_1_PIN 14
|
|
||||||
#define ACC_INT_2_PIN 13
|
|
||||||
#define VIB_MOTOR_PIN 17
|
|
||||||
#define BATT_ADC_PIN 9
|
|
||||||
#define CHRG_STATUS_PIN 10
|
|
||||||
#define USB_DET_PIN 21
|
|
||||||
#define RTC_INT_PIN -1 //not used
|
|
||||||
|
|
||||||
#define MENU_BTN_MASK (BIT64(7))
|
|
||||||
#define BACK_BTN_MASK (BIT64(6))
|
|
||||||
#define UP_BTN_MASK (BIT64(0))
|
|
||||||
#define DOWN_BTN_MASK (BIT64(8))
|
|
||||||
#define ACC_INT_MASK (BIT64(14))
|
|
||||||
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
|
|
||||||
|
|
||||||
#else //V1,V1.5,V2
|
|
||||||
|
|
||||||
#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"
|
|
||||||
|
|
||||||
#define ARDUINO_WATCHY_V20
|
|
||||||
|
|
||||||
#define MENU_BTN_PIN 26
|
#define MENU_BTN_PIN 26
|
||||||
#define BACK_BTN_PIN 25
|
#define BACK_BTN_PIN 25
|
||||||
|
#define UP_BTN_PIN 32
|
||||||
#define DOWN_BTN_PIN 4
|
#define DOWN_BTN_PIN 4
|
||||||
#define DISPLAY_CS 5
|
#define MENU_BTN_MASK GPIO_SEL_26
|
||||||
#define DISPLAY_RES 9
|
#define BACK_BTN_MASK GPIO_SEL_25
|
||||||
#define DISPLAY_DC 10
|
#define UP_BTN_MASK GPIO_SEL_32
|
||||||
#define DISPLAY_BUSY 19
|
#define DOWN_BTN_MASK GPIO_SEL_4
|
||||||
#define ACC_INT_1_PIN 14
|
#define ACC_INT_MASK GPIO_SEL_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 (BIT64(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 (BIT64(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 (BIT64(35))
|
|
||||||
#define RTC_TYPE 2 //PCF8563
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MENU_BTN_MASK (BIT64(26))
|
|
||||||
#define BACK_BTN_MASK (BIT64(25))
|
|
||||||
#define DOWN_BTN_MASK (BIT64(4))
|
|
||||||
#define ACC_INT_MASK (BIT64(14))
|
|
||||||
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
|
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//display
|
//display
|
||||||
#define DISPLAY_WIDTH 200
|
#define DISPLAY_WIDTH 200
|
||||||
#define DISPLAY_HEIGHT 200
|
#define DISPLAY_HEIGHT 200
|
||||||
// wifi
|
//weather api
|
||||||
|
#define CITY_NAME "NEW+YORK" //if your city name has a space, replace with '+'
|
||||||
|
#define COUNTRY_CODE "US"
|
||||||
|
#define OPENWEATHERMAP_APIKEY "f058fe1cad2afe8e2ddc5d063a64cecb" //use your own API key :)
|
||||||
|
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?q="
|
||||||
|
#define TEMP_UNIT "metric" //use "imperial" for Fahrenheit"
|
||||||
|
//wifi
|
||||||
#define WIFI_AP_TIMEOUT 60
|
#define WIFI_AP_TIMEOUT 60
|
||||||
#define WIFI_AP_SSID "Watchy AP"
|
#define WIFI_AP_SSID "Watchy AP"
|
||||||
// menu
|
//menu
|
||||||
#define WATCHFACE_STATE -1
|
#define WATCHFACE_STATE -1
|
||||||
#define MAIN_MENU_STATE 0
|
#define MAIN_MENU_STATE 0
|
||||||
#define APP_STATE 1
|
#define APP_STATE 1
|
||||||
#define FW_UPDATE_STATE 2
|
#define FW_UPDATE_STATE 2
|
||||||
#define MENU_HEIGHT 25
|
#define MENU_HEIGHT 30
|
||||||
#define MENU_LENGTH 7
|
#define MENU_LENGTH 6
|
||||||
// set time
|
//set time
|
||||||
#define SET_HOUR 0
|
#define SET_HOUR 0
|
||||||
#define SET_MINUTE 1
|
#define SET_MINUTE 1
|
||||||
#define SET_YEAR 2
|
#define SET_YEAR 2
|
||||||
#define SET_MONTH 3
|
#define SET_MONTH 3
|
||||||
#define SET_DAY 4
|
#define SET_DAY 4
|
||||||
#define HOUR_12_24 24
|
#define YEAR_OFFSET 1970
|
||||||
// BLE OTA
|
//BLE OTA
|
||||||
#define BLE_DEVICE_NAME "Watchy BLE OTA"
|
#define BLE_DEVICE_NAME "Watchy BLE OTA"
|
||||||
#define WATCHFACE_NAME "Watchy 7 Segment"
|
#define WATCHFACE_NAME "Watchy 7 Segment"
|
||||||
#define SOFTWARE_VERSION_MAJOR 1
|
#define SOFTWARE_VERSION_MAJOR 1
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/ bin / bash
|
|
||||||
STYLE_OPT = "{BasedOnStyle: llvm, AlignConsecutiveMacros: true, "
|
|
||||||
"AlignConsecutiveAssignments: true}" clang -
|
|
||||||
format-- style = "$STYLE_OPT" - i *
|
|
Loading…
Reference in New Issue