├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── README.md ├── _config.yml ├── boards.txt ├── cores └── nRF5 │ └── SDK │ └── components │ └── softdevice │ ├── none │ └── hex │ │ ├── .gitkeep │ │ ├── none_nrf51__softdevice.hex │ │ └── none_nrf52__softdevice.hex │ ├── s110 │ └── hex │ │ └── .gitkeep │ ├── s130 │ └── hex │ │ └── .gitkeep │ └── s132 │ └── hex │ └── .gitkeep ├── libraries └── examples │ ├── Examples │ ├── ID107_u8g2_sensors_clock │ │ ├── ID107_OLED.h │ │ ├── ID107_sensors.h │ │ └── ID107_u8g2_sensors_clock.ino │ ├── ID107_u8g2_sensors_clock_bleUart │ │ ├── BLESerial.cpp │ │ ├── BLESerial.h │ │ ├── ID107_OLED.h │ │ ├── ID107_sensors.h │ │ └── ID107_u8g2_sensors_clock_bleUart.ino │ ├── ReverseEngineerSmartwatchPins │ │ ├── ReverseEngineerSmartwatchPins.ino │ │ └── SerialCommands.h │ ├── u8g2 │ │ ├── README.md │ │ └── sys │ │ │ └── sdl │ │ │ └── watch_64x32 │ │ │ ├── Makefile │ │ │ ├── fonts.h │ │ │ ├── main.cpp │ │ │ ├── main.o │ │ │ └── screens.h │ └── u8g2_ScreenTest │ │ └── u8g2_ScreenTest.ino │ ├── README.md │ ├── examples.h │ └── library.properties ├── nrf52_disable_read_protection.txt ├── platform.txt ├── release.sh ├── softdevices.txt └── variants ├── DS_D6 ├── pins_arduino.h ├── variant.cpp └── variant.h ├── ID100HR ├── pins_arduino.h ├── variant.cpp └── variant.h ├── ID107HR ├── pins_arduino.h ├── variant.cpp └── variant.h ├── ID107HRPlus ├── pins_arduino.h ├── variant.cpp └── variant.h ├── IDO003 ├── pins_arduino.h ├── variant.cpp └── variant.h ├── T28 ├── pins_arduino.h ├── variant.cpp └── variant.h ├── Taida_Century_nRF52_minidev ├── pins_arduino.h ├── variant.cpp └── variant.h └── Waveshare_BLE400_HRM ├── pins_arduino.h ├── variant.cpp └── variant.h /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # softdevice files 4 | cores/nRF5/SDK/components/softdevice/s*/hex/*.hex 5 | cores/nRF5/SDK/components/softdevice/s*/hex/*.txt 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libraries/sparkfun_OLED"] 2 | path = libraries/sparkfun_OLED 3 | url = https://github.com/micooke/sparkfun_OLED.git 4 | [submodule "libraries/SoftwareSerial"] 5 | path = libraries/SoftwareSerial 6 | url = https://github.com/micooke/SoftwareSerial.git 7 | [submodule "libraries/Kx022-1020"] 8 | path = libraries/Kx022-1020 9 | url = https://github.com/micooke/Kx022-1020.git 10 | [submodule "libraries/SoftwareI2C"] 11 | path = libraries/SoftwareI2C 12 | url = https://github.com/micooke/SoftwareI2C.git 13 | [submodule "libraries/HP203B"] 14 | path = libraries/HP203B 15 | url = https://github.com/micooke/HP203B 16 | [submodule "libraries/Si1143"] 17 | path = libraries/Si1143 18 | url = https://github.com/micooke/Si1143 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # modified version of sandeep's - https://github.com/sandeepmistry/arduino-nRF5/.travis.yml 2 | language: generic 3 | addons: 4 | apt: 5 | packages: 6 | - libc6:i386 7 | - libstdc++6:i386 8 | env: 9 | global: 10 | - IDE_VERSION=1.8.4 11 | before_install: 12 | - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz 13 | - tar xf arduino-$IDE_VERSION-linux64.tar.xz 14 | - mv arduino-$IDE_VERSION $HOME/arduino-ide 15 | - export PATH=$PATH:$HOME/arduino-ide 16 | - arduino --pref "boardsmanager.additional.urls=https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json,https://micooke.github.io/package_nRF5_smartwatches_index.json" > /dev/null 17 | - arduino --install-boards sandeepmistry:nRF5 18 | - arduino --install-boards micooke:nRF5 19 | - buildExampleSketch() { arduino --verbose-build --verify --board $1 $HOME/arduino-ide/examples/$2/$3/$3.ino; } 20 | install: 21 | # - mkdir -p $HOME/Arduino/hardware/sandeepmistry 22 | # - ln -s $PWD $HOME/Arduino/hardware/sandeepmistry/nRF5 23 | script: 24 | - buildExampleSketch micooke:nRF5:IDO003 01.Basics Blink 25 | - buildExampleSketch micooke:nRF5:ID100HR 01.Basics Blink 26 | - buildExampleSketch micooke:nRF5:ID107HR 01.Basics Blink 27 | - buildExampleSketch micooke:nRF5:ID107HRPlus 01.Basics Blink 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Mark Cooke 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Nordic Semiconductor nRF5 Smartwatches 2 | 3 | This work piggy backs on previous work by many people, mainly : [@goran-mahovlic](https://github.com/goran-mahovlic), [@rogerclarkmelbourne](https://github.com/rogerclarkmelbourne/), [@curtpw](https://github.com/curtpw/), [@Gordon](http://forum.espruino.com/profiles/224/) 4 | 5 | Most of these watches are made by [idoosmart](http://www.idoosmart.com) and can be purchased from their [aliexpress](https://ido-smart.en.alibaba.com/productgrouplist-0/Ungrouped.html?) company site. 6 | 7 | Be careful when purchasing from a third party reseller as there have been instances where the received watch does not contain a nRF5 chip, or you purchase a ID107HR Plus and receive a ID107HR instead. 8 | 9 | Note : I have no affiliation with idoosmart / Shenzhen DO Intelligent Technology Co,. Ltd, nor any aliexpress or smartwatch retailer. 10 | 11 | Included smartwatches: 12 | 1. [IDO003](https://github.com/micooke/micooke.github.io/blob/master/arduino-nRF5-smartwatches/images/IDO003_back.jpg) 13 | 2. [ID100HR](https://github.com/micooke/micooke.github.io/blob/master/arduino-nRF5-smartwatches/images/ID100HR_back.jpg) 14 | 3. [ID107HR](https://github.com/micooke/micooke.github.io/blob/master/arduino-nRF5-smartwatches/images/ID107HR_back.jpg) 15 | 4. [ID107HR Plus](https://github.com/micooke/micooke.github.io/blob/master/arduino-nRF5-smartwatches/images/ID107HRPlus_disected.jpg) (alpha) - dont expect this to work 16 | 5. [LEMDOIE T28](https://github.com/micooke/micooke.github.io/blob/master/nRF52832_Lemdoie_T28.md) 17 | 6. [MyPow DS-D6](https://github.com/fanoush/ds-d6) 18 | 19 | Included Generic development boards: 20 | 6. [Taida Century nRF52 mini board / nRF52832 Gold Core](https://github.com/micooke/micooke.github.io/blob/master/nRF52832_TaidaCentury_GoldCore.md) 21 | 7. [Waveshare BLE400](https://www.waveshare.com/wiki/BLE400) 22 | 23 | I am happy to accept pull requests for any nRF51 or nRF52 based smartwatch, but will be unable to test anything except for the ID107HR (v2.4) and T28 unless you are feeling generous and want to send me one :wink:. 24 | 25 | ### Libraries 26 | The following libraries (which work with this core) have been added as submodules: 27 | 1. U8g2_Arduino (OLED library) https://github.com/olikraus/U8g2_Arduino 28 | 2. sparkfun-based OLED library https://github.com/micooke/sparkfun_OLED 29 | 3. Software I2C https://github.com/micooke/SoftwareI2C 30 | 4. Software Serial https://github.com/micooke/SoftwareSerial - requirement: https://github.com/sandeepmistry/arduino-nRF5/pull/205 31 | 5. Accelerometer https://github.com/micooke/Kx022-1020 32 | 6. (work in progress) Si1143 Heartrate sensor https://github.com/micooke/Si1143 33 | 34 | #### I recommend using the u8g2 library over any of my OLED libraries! 35 | 36 | My Squix78 based OLED [library](https://github.com/micooke/squix78_OLED) also works. 37 | 38 | To get these libraries without using the board manager: 39 | ``` 40 | git clone https://github.com/micooke/arduino-nRF5-smartwatches.git 41 | git submodule update --init --recursive 42 | ``` 43 | 44 | ### Note 45 | Im not sure about the ID100HR variant. The pin mapping has been taken from posts about the ID100HR, as well as posts on the ID107HR which appeared to have the same pin mapping. 46 | 47 | My ID107HR is a v2.4 and it does not match the pin mapping of the ID100HR. So if you have a ID107HR that is a v2.3 or earlier you will need to use the ID100HR (at this stage). 48 | 49 | ### Programming 50 | These watches can be programmed by soldering directly to the SWDIO, SWCLK and GND pins. 51 | You can also connect to the TX and RX pins for debugging. 52 | 53 | The T28 and ID107HR Plus do not label these pads by silkscreen so please see [ID107HR Plus pads](images/ID107HRPlus_pads.jpg), ![T28 Front1](nRF52832_Lemdoie_T28/T28_Front1.jpg), ![T28 Front2](nRF52832_Lemdoie_T28/T28_Front2.jpg) for these pins. 54 | 55 | The ID107HR+ UART Tx,Rx were chosen to be on p23,p24 because the pads are next to the programming pins. 56 | 57 | The T28 UART Tx,Rx were chosen to be on p26,p25 as their pads are near the OLED ribbon. 58 | 59 | Progamming is via a SWD programmer (J-Link, ST-Link etc.) using sandeep's core. 60 | 61 | ### Installing via Board Manager 62 | 1. [Download and install the Arduino IDE](https://www.arduino.cc/en/Main/Software) (At least v1.6.12) 63 | 2. Start the Arduino IDE 64 | 3. Go into Preferences 65 | 4. Install the board package(s) 66 | 4.1 (If you havent already done so) Install @sandeepmistry's nRF5 core [arduino-nRF5](https://github.com/sandeepmistry/arduino-nRF5) 67 | 4.2 Add ```https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json``` as an "Additional Board Manager URL" 68 | 4.3 Install [arduino-nRF5-smartwatches](https://github.com/micooke/arduino-nRF5-smartwatches) 69 | 4.4 Add ```https://micooke.github.io/package_nRF5_smartwatches_index.json``` as an "Additional Board Manager URL" 70 | 5. Open the Boards Manager from the Tools -> Board menu and install "Nordic Semiconductor nRF5 Smartwatches" 71 | 6. Select your nRF5 smartwatch from the Tools -> Board menu 72 | 73 | ### Pin allocation 74 | 75 | The nRF52 based T28 is quite different. Its pin allocation table is located [here](https://github.com/micooke/micooke.github.io/blob/master/nRF52832_Lemdoie_T28.md) 76 | @fanoush has done a great job on getting the DS-D6 pin allocation. It is hosted [here](https://github.com/fanoush/ds-d6) 77 | 78 | 79 | | peripheral type | name | pin | IDO003 | ID100HR | ID107HR | ID107HR Plus 80 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: 81 | | accelerometer | Kx022 | SCL | 14 | 14 | 14 | 5 82 | | | | SDA | 16 | 16 | 16 | 3 83 | | | | INT | --- | --- | --- | 6 84 | | | | ADDR | --- | --- | --- | 4 85 | | | | NCS | --- | --- | --- | 7 86 | | optical HR sensor | Si1143 | SCL | --- | 26 | 22 | 18 87 | | | | SDA | --- | 28 | 23 | 10 88 | | | | INT | --- | --- | 24 | 8 89 | | | | LED | --- | --- | --- | 9 90 | | SPI flash memory | MX25L | MISO | --- | --- | --- | 27 91 | | | | MOSI | --- | --- | --- | 31 92 | | | | SCK | --- | --- | --- | 30 93 | | | | CE | --- | --- | --- | 28 94 | | side tactile button | --- | BUTTON1 | 4 | 4 | 4 | --- 95 | | capacitive touch button | RH6015C| BUTTON2 | 4 | 7 | 7 | ? 96 | | capacitive touch screen | IQS263 | --- | --- | --- | --- | ? 97 | | vibrate motor | --- | VIBRATE -or- | 7 | 8 | 6 | ? 98 | | | | LED_BUILTIN | | | | 99 | | serial UART | --- | Tx | 18 | 18 | 18 | 23 100 | | | | Rx | 17 | 17 | 17 | 24 101 | | OLED | --- | MISO | 31 | 3 | 3 | ? 102 | | | --- | MOSI | 29 | 2 | 2 | ? 103 | | | --- | SCK | 30 | 1 | 1 | ? 104 | | | --- | RST | 1 | 30 | 30 | ? 105 | | | --- | CS | 2 | 29 | 29 | ? 106 | | | --- | DC | 0 | 0 | 0 | ? 107 | | battery voltage level | --- | --- | ? | ? | \* | ? 108 | 109 | * --- : not applicable 110 | * ? : unknown 111 | * \* : unknown (easily found - perform an analog read on each pin), but AIN{0:7} = p{28,27,1,2,3,4,9,10} so it must be one of p9,p10,p27,p28 112 | 113 | ### I2C addresses 114 | 1. 0x1F : Accelerometer (Kx022/Kx023) 115 | 2. 0x5A : Heart Rate Sensor / PPG (Si1143) 116 | 3. 0x76 : Altitude / Pressure / Temperature (HP203B) 117 | 118 | ### References 119 | * nRF5 core is written and maintained by Sandeep Mistry 120 | * Support for these smartwatches originate from Roger's [arduino-nRF5-customised](https://github.com/rogerclarkmelbourne/arduino-nRF5-customised) repo 121 | * [ID100HR picture](http://www.rogerclark.net/wp-content/uploads/2016/09/ID100HR_back_smart_watch-1024x576.jpg) is from Roger, embedded on his website [article](http://www.rogerclark.net/arduino-on-the-id100hr-fitness-tracker/) 122 | * (Modified) [IDO003 picture](https://espruino.microco.sm/api/v1/files/ba591802419c40145d825db2924360eb162cc026.JPG) is from Gordon, embedded in this [conversation](http://forum.espruino.com/conversations/280747/) 123 | * ID107HR picture is my own 124 | * [ID107HR Plus picture](http://www.rogerclark.net/wp-content/uploads/2017/06/id107plus-7-770x1024.jpg) is from Curt, embedded on Roger's website [article](http://www.rogerclark.net/new-nrf52832-based-smart-watch-available/) 125 | * (Modified) [ID107HR Plus pads](http://www.rogerclark.net/wp-content/uploads/2017/06/id107plus-3.jpg) is from Curt, embedded on Roger's website [article](http://www.rogerclark.net/new-nrf52832-based-smart-watch-available/) 126 | * [DS-D6](https://github.com/fanoush/ds-d6) from [@fanoush](https://github.com/fanoush) -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /boards.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 2 | # 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU Lesser General Public 5 | # License as published by the Free Software Foundation; either 6 | # version 2.1 of the License, or (at your option) any later version. 7 | # 8 | # This library is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | # See the GNU Lesser General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public 14 | # License along with this library; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | menu.chip=Chip 18 | menu.softdevice=Softdevice 19 | menu.version=Version 20 | menu.lfclk=Low Frequency Clock 21 | menu.board_variant=Board Variant 22 | menu.gpio_config=GPIO Configuration 23 | 24 | # ----------------------------------------------------------------------------- 25 | IDO003.name=IDO003 26 | 27 | IDO003.upload.tool=sandeepmistry:openocd 28 | IDO003.upload.target=nrf51 29 | IDO003.upload.maximum_size=262144 30 | 31 | IDO003.bootloader.tool=sandeepmistry:openocd 32 | 33 | IDO003.build.mcu=cortex-m0 34 | IDO003.build.f_cpu=16000000 35 | IDO003.build.board=IDO003 36 | IDO003.build.core=sandeepmistry:nRF5 37 | IDO003.build.variant=IDO003 38 | IDO003.build.variant_system_lib= 39 | IDO003.build.extra_flags=-DNRF51 -DIDO003 -I{build.path} 40 | IDO003.build.float_flags= 41 | IDO003.build.ldscript=nrf51_{build.chip}.ld 42 | IDO003.build.chip=xxaa 43 | 44 | IDO003.menu.softdevice.s130=S130 45 | IDO003.menu.softdevice.s130.softdevice=s130 46 | IDO003.menu.softdevice.s130.softdeviceversion=2.0.1 47 | IDO003.menu.softdevice.s130.upload.maximum_size=151552 48 | IDO003.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130 49 | IDO003.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld 50 | 51 | IDO003.menu.softdevice.none=None 52 | IDO003.menu.softdevice.none.softdevice=none 53 | IDO003.menu.softdevice.none.softdeviceversion= 54 | 55 | IDO003.menu.lfclk.lfrc=RC Oscillator 56 | IDO003.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC 57 | 58 | IDO003.menu.lfclk.lfxo=Crystal Oscillator 59 | IDO003.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO 60 | 61 | IDO003.menu.lfclk.lfsynt=Synthesized 62 | IDO003.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT 63 | 64 | # ----------------------------------------------------------------------------- 65 | ID100HR.name=ID100HR 66 | 67 | ID100HR.upload.tool=sandeepmistry:openocd 68 | ID100HR.upload.target=nrf51 69 | ID100HR.upload.maximum_size=262144 70 | 71 | ID100HR.bootloader.tool=sandeepmistry:openocd 72 | 73 | ID100HR.build.mcu=cortex-m0 74 | ID100HR.build.f_cpu=16000000 75 | ID100HR.build.board=ID100HR 76 | ID100HR.build.core=sandeepmistry:nRF5 77 | ID100HR.build.variant=ID100HR 78 | ID100HR.build.variant_system_lib= 79 | ID100HR.build.extra_flags=-DNRF51 -DID100HR -I{build.path} 80 | ID100HR.build.float_flags= 81 | ID100HR.build.lfclk_flags=-DUSE_LFXO 82 | ID100HR.build.ldscript=nrf51_{build.chip}.ld 83 | ID100HR.build.chip=xxac 84 | 85 | ID100HR.menu.softdevice.s130=S130 86 | ID100HR.menu.softdevice.s130.softdevice=s130 87 | ID100HR.menu.softdevice.s130.softdeviceversion=2.0.1 88 | ID100HR.menu.softdevice.s130.upload.maximum_size=151552 89 | ID100HR.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130 90 | ID100HR.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld 91 | 92 | ID100HR.menu.softdevice.none=None 93 | ID100HR.menu.softdevice.none.softdevice=none 94 | ID100HR.menu.softdevice.none.softdeviceversion= 95 | 96 | # ----------------------------------------------------------------------------- 97 | ID107HR.name=ID107HR 98 | 99 | ID107HR.upload.tool=sandeepmistry:openocd 100 | ID107HR.upload.target=nrf51 101 | ID107HR.upload.maximum_size=262144 102 | 103 | ID107HR.bootloader.tool=sandeepmistry:openocd 104 | 105 | ID107HR.build.mcu=cortex-m0 106 | ID107HR.build.f_cpu=16000000 107 | ID107HR.build.board=ID107HR 108 | ID107HR.build.core=sandeepmistry:nRF5 109 | ID107HR.build.variant=ID107HR 110 | ID107HR.build.variant_system_lib= 111 | ID107HR.build.extra_flags=-DNRF51 -DID107HR -I{build.path} 112 | ID107HR.build.float_flags= 113 | ID107HR.build.lfclk_flags=-DUSE_LFXO 114 | ID107HR.build.ldscript=nrf51_{build.chip}.ld 115 | ID107HR.build.chip=xxac 116 | 117 | ID107HR.menu.softdevice.s130=S130 118 | ID107HR.menu.softdevice.s130.softdevice=s130 119 | ID107HR.menu.softdevice.s130.softdeviceversion=2.0.1 120 | ID107HR.menu.softdevice.s130.upload.maximum_size=151552 121 | ID107HR.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130 122 | ID107HR.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld 123 | 124 | ID107HR.menu.softdevice.none=None 125 | ID107HR.menu.softdevice.none.softdevice=none 126 | ID107HR.menu.softdevice.none.softdeviceversion= 127 | 128 | ID107HR.menu.board_variant.accel_hwi2c=I2C:Accel=HW, HeartRate=SW 129 | ID107HR.menu.board_variant.accel_hwi2c.build.lfclk_flags=-DUSE_LFXO -DACCEL_HWI2C 130 | 131 | ID107HR.menu.board_variant.heartrate_hwi2c=I2C:Accel=SW, HeartRate=HW 132 | ID107HR.menu.board_variant.heartrate_hwi2c.build.lfclk_flags=-DUSE_LFXO -DHEARTRATE_HWI2C 133 | 134 | # ----------------------------------------------------------------------------- 135 | ID107HRPlus.name=ID107HR Plus 136 | 137 | 138 | ID107HRPlus.upload.tool=sandeepmistry:openocd 139 | ID107HRPlus.upload.target=nrf52 140 | ID107HRPlus.upload.maximum_size=524288 141 | 142 | ID107HRPlus.bootloader.tool=sandeepmistry:openocd 143 | 144 | ID107HRPlus.build.mcu=cortex-m4 145 | ID107HRPlus.build.f_cpu=16000000 146 | ID107HRPlus.build.board=ID107HRPlus 147 | ID107HRPlus.build.core=sandeepmistry:nRF5 148 | ID107HRPlus.build.variant=ID107HRPlus 149 | ID107HRPlus.build.variant_system_lib= 150 | ID107HRPlus.build.extra_flags=-DNRF52 -DID107HRPlus -I{build.path} 151 | ID107HRPlus.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 152 | ID107HRPlus.build.ldscript=nrf52_{build.chip}.ld 153 | ID107HRPlus.menu.chip.xxaa=64 kB RAM, 512 kB flash (xxaa) 154 | ID107HRPlus.menu.softdevice.s132=S132 155 | ID107HRPlus.menu.softdevice.s132.softdevice=s132 156 | ID107HRPlus.menu.softdevice.s132.softdeviceversion=2.0.1 157 | ID107HRPlus.menu.softdevice.s132.upload.maximum_size=409600 158 | ID107HRPlus.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF52_S132 159 | ID107HRPlus.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_{build.chip}.ld 160 | 161 | ID107HRPlus.menu.softdevice.none=None 162 | ID107HRPlus.menu.softdevice.none.softdevice=none 163 | ID107HRPlus.menu.softdevice.none.softdeviceversion= 164 | 165 | ID107HRPlus.menu.lfclk.lfxo=Crystal Oscillator 166 | ID107HRPlus.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO 167 | 168 | # ----------------------------------------------------------------------------- 169 | T28.name=LEMDOIE T28 170 | 171 | T28.upload.tool=sandeepmistry:openocd 172 | T28.upload.target=nrf52 173 | T28.upload.maximum_size=524288 174 | 175 | T28.bootloader.tool=sandeepmistry:openocd 176 | 177 | T28.build.mcu=cortex-m4 178 | T28.build.f_cpu=16000000 179 | T28.build.board=T28 180 | T28.build.core=sandeepmistry:nRF5 181 | T28.build.variant=T28 182 | T28.build.variant_system_lib= 183 | T28.build.extra_flags=-DCONFIG_NFCT_PINS_AS_GPIOS -DNRF52 -DT28 -I{build.path} 184 | T28.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 185 | T28.build.ldscript=nrf52_{build.chip}.ld 186 | T28.build.chip=xxaa 187 | 188 | T28.menu.softdevice.s132=S132 189 | T28.menu.softdevice.s132.softdevice=s132 190 | T28.menu.softdevice.s132.softdeviceversion=2.0.1 191 | T28.menu.softdevice.s132.upload.maximum_size=409600 192 | T28.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF52_S132 193 | T28.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_{build.chip}.ld 194 | 195 | T28.menu.softdevice.none=None 196 | T28.menu.softdevice.none.softdevice=none 197 | T28.menu.softdevice.none.softdeviceversion= 198 | 199 | T28.menu.lfclk.lfrc=RC Oscillator 200 | T28.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC 201 | 202 | T28.menu.board_variant.accel_hwi2c=I2C:Accel=HW, HeartRate=SW 203 | T28.menu.board_variant.accel_hwi2c.build.lfclk_flags=-DUSE_LFXO -DACCEL_HWI2C 204 | 205 | T28.menu.board_variant.heartrate_hwi2c=I2C:Accel=SW, HeartRate=HW 206 | T28.menu.board_variant.heartrate_hwi2c.build.lfclk_flags=-DUSE_LFXO -DHEARTRATE_HWI2C 207 | 208 | # ----------------------------------------------------------------------------- 209 | DS_D6.name=MPow DS-D6 210 | 211 | DS_D6.upload.tool=sandeepmistry:openocd 212 | DS_D6.upload.target=nrf52 213 | DS_D6.upload.maximum_size=524288 214 | 215 | DS_D6.bootloader.tool=sandeepmistry:openocd 216 | 217 | DS_D6.build.mcu=cortex-m4 218 | DS_D6.build.f_cpu=16000000 219 | DS_D6.build.board=DS_D6 220 | DS_D6.build.core=sandeepmistry:nRF5 221 | DS_D6.build.variant=DS_D6 222 | DS_D6.build.variant_system_lib= 223 | DS_D6.build.extra_flags=-DCONFIG_NFCT_PINS_AS_GPIOS -DNRF52 -DDS_D6 -I{build.path} 224 | DS_D6.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 225 | DS_D6.build.ldscript=nrf52_{build.chip}.ld 226 | DS_D6.build.chip=xxaa 227 | 228 | DS_D6.menu.softdevice.s132=S132 229 | DS_D6.menu.softdevice.s132.softdevice=s132 230 | DS_D6.menu.softdevice.s132.softdeviceversion=2.0.1 231 | DS_D6.menu.softdevice.s132.upload.maximum_size=409600 232 | DS_D6.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF52_S132 233 | DS_D6.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_{build.chip}.ld 234 | 235 | DS_D6.menu.softdevice.none=None 236 | DS_D6.menu.softdevice.none.softdevice=none 237 | DS_D6.menu.softdevice.none.softdeviceversion= 238 | 239 | DS_D6.menu.lfclk.lfrc=RC Oscillator 240 | DS_D6.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC 241 | 242 | DS_D6.menu.board_variant.accel_hwi2c=I2C:Accel=HW, HeartRate=SW 243 | DS_D6.menu.board_variant.accel_hwi2c.build.lfclk_flags=-DUSE_LFXO -DACCEL_HWI2C 244 | 245 | DS_D6.menu.board_variant.heartrate_hwi2c=I2C:Accel=SW, HeartRate=HW 246 | DS_D6.menu.board_variant.heartrate_hwi2c.build.lfclk_flags=-DUSE_LFXO -DHEARTRATE_HWI2C 247 | 248 | # ----------------------------------------------------------------------------- 249 | Waveshare_BLE400_HRM.name=Waveshare BLE400 250 | 251 | Waveshare_BLE400_HRM.upload.tool=sandeepmistry:openocd 252 | Waveshare_BLE400_HRM.upload.target=nrf51 253 | Waveshare_BLE400_HRM.upload.maximum_size=262144 254 | Waveshare_BLE400_HRM.bootloader.tool=sandeepmistry:openocd 255 | Waveshare_BLE400_HRM.build.mcu=cortex-m0 256 | Waveshare_BLE400_HRM.build.f_cpu=16000000 257 | Waveshare_BLE400_HRM.build.board=WAVESHARE_BLE400_HRM 258 | Waveshare_BLE400_HRM.build.core=sandeepmistry:nRF5 259 | Waveshare_BLE400_HRM.build.variant=Waveshare_BLE400_HRM 260 | Waveshare_BLE400_HRM.build.variant_system_lib= 261 | Waveshare_BLE400_HRM.build.extra_flags=-DNRF51 262 | Waveshare_BLE400_HRM.build.float_flags= 263 | Waveshare_BLE400_HRM.build.ldscript=nrf51_{build.chip}.ld 264 | Waveshare_BLE400_HRM.build.lfclk_flags=-DUSE_LFXO 265 | Waveshare_BLE400_HRM.menu.chip.xxac=32 kB RAM, 256 kB flash (xxac) 266 | Waveshare_BLE400_HRM.menu.chip.xxac.build.chip=xxac 267 | Waveshare_BLE400_HRM.menu.softdevice.s130=S130 268 | Waveshare_BLE400_HRM.menu.softdevice.s130.softdevice=s130 269 | Waveshare_BLE400_HRM.menu.softdevice.s130.softdeviceversion=2.0.1 270 | Waveshare_BLE400_HRM.menu.softdevice.s130.upload.maximum_size=151552 271 | Waveshare_BLE400_HRM.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130 272 | Waveshare_BLE400_HRM.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld 273 | Waveshare_BLE400_HRM.menu.softdevice.none=None 274 | Waveshare_BLE400_HRM.menu.softdevice.none.softdevice=none 275 | Waveshare_BLE400_HRM.menu.softdevice.none.softdeviceversion= 276 | 277 | # ----------------------------------------------------------------------------- 278 | STCT_nRF52_minidev.name=Taida Century nRF52 mini board 279 | 280 | STCT_nRF52_minidev.upload.tool=sandeepmistry:openocd 281 | STCT_nRF52_minidev.upload.target=nrf52 282 | STCT_nRF52_minidev.upload.maximum_size=524288 283 | 284 | STCT_nRF52_minidev.bootloader.tool=sandeepmistry:openocd 285 | 286 | STCT_nRF52_minidev.build.mcu=cortex-m4 287 | STCT_nRF52_minidev.build.f_cpu=16000000 288 | STCT_nRF52_minidev.build.board=STCT_NRF52_minidev 289 | STCT_nRF52_minidev.build.core=sandeepmistry:nRF5 290 | STCT_nRF52_minidev.build.variant=Taida_Century_nRF52_minidev 291 | STCT_nRF52_minidev.build.variant_system_lib= 292 | STCT_nRF52_minidev.build.extra_flags=-DNRF52 293 | STCT_nRF52_minidev.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 294 | STCT_nRF52_minidev.build.ldscript=nrf52_xxaa.ld 295 | 296 | STCT_nRF52_minidev.build.lfclk_flags=-DUSE_LFXO 297 | 298 | STCT_nRF52_minidev.menu.gpio_config.default=No Pin Reset, NFC pins as Antenna (default) 299 | STCT_nRF52_minidev.menu.gpio_config.default.build.gpio_flags= 300 | STCT_nRF52_minidev.menu.gpio_config.PinResetNFCAntenna=Pin Reset, NFC pins as Antenna 301 | STCT_nRF52_minidev.menu.gpio_config.PinResetNFCAntenna.build.gpio_flags=-DCONFIG_GPIO_AS_PINRESET 302 | STCT_nRF52_minidev.menu.gpio_config.NoPinResetNFCGPIO=No Pin Reset, NFC pins as GPIO 303 | STCT_nRF52_minidev.menu.gpio_config.NoPinResetNFCGPIO.build.gpio_flags=-DCONFIG_NFCT_PINS_AS_GPIOS 304 | STCT_nRF52_minidev.menu.gpio_config.PinResetNFCGPIO=Pin Reset, NFC pins as GPIO 305 | STCT_nRF52_minidev.menu.gpio_config.PinResetNFCGPIO.build.gpio_flags=-DCONFIG_GPIO_AS_PINRESET -DCONFIG_NFCT_PINS_AS_GPIOS 306 | 307 | STCT_nRF52_minidev.menu.softdevice.none=None 308 | STCT_nRF52_minidev.menu.softdevice.none.softdevice=none 309 | STCT_nRF52_minidev.menu.softdevice.none.softdeviceversion= 310 | 311 | STCT_nRF52_minidev.menu.softdevice.s132=S132 312 | STCT_nRF52_minidev.menu.softdevice.s132.softdevice=s132 313 | STCT_nRF52_minidev.menu.softdevice.s132.softdeviceversion=2.0.1 314 | STCT_nRF52_minidev.menu.softdevice.s132.upload.maximum_size=409600 315 | STCT_nRF52_minidev.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF52_S132 316 | STCT_nRF52_minidev.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld 317 | 318 | STCT_nRF52_minidev.menu.board_variant.none=None 319 | STCT_nRF52_minidev.menu.board_variant.rgz.build.lfclk_flags=-DUSE_LFXO -DSTCT_NRF52_minidev 320 | 321 | STCT_nRF52_minidev.menu.board_variant.rgz=RGZ 322 | STCT_nRF52_minidev.menu.board_variant.rgz.build.lfclk_flags=-DUSE_LFXO -DSTCT_NRF52_minidev_RGZ 323 | 324 | STCT_nRF52_minidev.menu.board_variant.rsm=RSM 325 | STCT_nRF52_minidev.menu.board_variant.rsm.build.lfclk_flags=-DUSE_LFXO -DSTCT_NRF52_minidev_RSM 326 | -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/none/hex/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooke/arduino-nRF5-smartwatches/defb6758ab3467e0512b48fc099fe35d757f9886/cores/nRF5/SDK/components/softdevice/none/hex/.gitkeep -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/none/hex/none_nrf51__softdevice.hex: -------------------------------------------------------------------------------- 1 | :020000040000FA 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/none/hex/none_nrf52__softdevice.hex: -------------------------------------------------------------------------------- 1 | :020000040000FA 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/s110/hex/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooke/arduino-nRF5-smartwatches/defb6758ab3467e0512b48fc099fe35d757f9886/cores/nRF5/SDK/components/softdevice/s110/hex/.gitkeep -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/s130/hex/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooke/arduino-nRF5-smartwatches/defb6758ab3467e0512b48fc099fe35d757f9886/cores/nRF5/SDK/components/softdevice/s130/hex/.gitkeep -------------------------------------------------------------------------------- /cores/nRF5/SDK/components/softdevice/s132/hex/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooke/arduino-nRF5-smartwatches/defb6758ab3467e0512b48fc099fe35d757f9886/cores/nRF5/SDK/components/softdevice/s132/hex/.gitkeep -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock/ID107_OLED.h: -------------------------------------------------------------------------------- 1 | #ifndef ID107_OLED_H 2 | #define ID107_OLED_H 3 | 4 | #include "ID107_sensors.h" 5 | 6 | #include 7 | #include 8 | 9 | U8G2_SH1106_64X32_1_4W_HW_SPI u8g2(U8G2_R0, OLED_CS, OLED_DC, OLED_RST); 10 | 11 | class ID107_OLED{ 12 | private: 13 | const uint8_t _numPages = 4; 14 | uint32_t _splashTime; 15 | uint8_t _pageNum; 16 | time_t compileTime(); 17 | 18 | ID107_sensors _id107_sensors; 19 | 20 | void splash(uint32_t splash_time_ms); 21 | void draw(); 22 | public: 23 | ID107_OLED(uint32_t splash_time_ms = 2000): _splashTime(splash_time_ms), _pageNum(0) {} 24 | ~ID107_OLED() {} 25 | void begin(); 26 | void heartrate(uint8_t ambiant_sensor = 0); 27 | void accelerometer(); 28 | void clock(); 29 | void nextPage(); 30 | uint8_t getPageCount() { return _numPages; } 31 | void drawPage(uint8_t pageNum = 0); 32 | }; 33 | 34 | void ID107_OLED::begin() 35 | { 36 | _id107_sensors.begin(); 37 | 38 | u8g2.begin(); 39 | u8g2.setFont(u8g2_font_6x10_tf); 40 | u8g2.setFontRefHeightExtendedText(); 41 | u8g2.setDrawColor(1); 42 | u8g2.setFontPosTop(); 43 | u8g2.setFontDirection(0); 44 | 45 | splash(_splashTime); 46 | } 47 | 48 | void ID107_OLED::drawPage(uint8_t pageNum) 49 | { 50 | switch(pageNum) { 51 | case 0: 52 | heartrate(0); break; 53 | case 1: 54 | heartrate(1); break; 55 | case 2: 56 | accelerometer(); break; 57 | default: 58 | clock(); 59 | } 60 | } 61 | 62 | void ID107_OLED::draw() 63 | { 64 | u8g2.firstPage(); 65 | do { 66 | u8g2.setFont(u8g2_font_6x10_tf); 67 | u8g2.drawStr( 0, 0, _id107_sensors.row[0].c_str()); 68 | u8g2.drawStr(0, 10, _id107_sensors.row[1].c_str()); 69 | u8g2.drawStr(0, 20, _id107_sensors.row[2].c_str()); 70 | } while ( u8g2.nextPage() ); 71 | } 72 | 73 | void ID107_OLED::nextPage() 74 | { 75 | // increment the page number 76 | _pageNum = (_pageNum < _numPages - 1)?_pageNum + 1:0; 77 | 78 | // draw the page 79 | drawPage(_pageNum); 80 | } 81 | 82 | 83 | void ID107_OLED::heartrate(uint8_t ambiant_sensor) 84 | { 85 | _id107_sensors.get_heartrate(ambiant_sensor); 86 | 87 | draw(); 88 | } 89 | 90 | void ID107_OLED::accelerometer() 91 | { 92 | _id107_sensors.get_accelerometer(); 93 | 94 | draw(); 95 | } 96 | 97 | void ID107_OLED::clock() 98 | { 99 | _id107_sensors.get_clock(); 100 | 101 | draw(); 102 | } 103 | 104 | void ID107_OLED::splash(uint32_t splash_time_ms) 105 | { 106 | _id107_sensors.row[0] = "github.com"; 107 | _id107_sensors.row[1] = "/micooke"; 108 | _id107_sensors.row[2] = __TIME__; 109 | 110 | draw(); 111 | 112 | delay(splash_time_ms); 113 | } 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock/ID107_sensors.h: -------------------------------------------------------------------------------- 1 | #ifndef ID107_SENSORS_H 2 | #define ID107_SENSORS_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include // https://github.com/JChristensen/Timezone 10 | 11 | TimeChangeRule ACST = {"ACST", First, Sun, Apr, 3, 570}; // Australian Central Daylight Time = UTC +9:30 hours 12 | TimeChangeRule ACDT = {"ACDT", First, Sun, Oct, 2, 630}; // Australian Central Standard Time = UTC +10:30 hours 13 | Timezone AdelaideTimezone(ACST, ACDT); 14 | TimeChangeRule *tcr; // pointer to the time change rule, use to get TZ abbrev 15 | 16 | #ifdef ACCEL_HWI2C 17 | // Kx022 - Hardware I2C (Wire) 18 | KX022<> acc(Wire); 19 | 20 | // Si1143 - Software I2C 21 | SoftwareI2C sWire(PIN_WIRE1_SDA, PIN_WIRE1_SCL); 22 | PulsePlug pulse(sWire); 23 | #else 24 | // Kx022 - Software I2C (Wire) 25 | SoftwareI2C sWire(PIN_WIRE1_SDA, PIN_WIRE1_SCL); 26 | KX022 acc(sWire); 27 | 28 | // Si1143 - Hardware I2C 29 | PulsePlug<> pulse(Wire); 30 | #endif 31 | 32 | class ID107_sensors{ 33 | private: 34 | uint8_t _retries; 35 | void float2chars(float &in, char (&out)[5]); 36 | time_t compileTime(); 37 | public: 38 | ID107_sensors(uint8_t retries = 5) : _retries(retries) {} 39 | ~ID107_sensors() {} 40 | void begin(); 41 | void get_heartrate(uint8_t ambiant_sensor = 0); 42 | void get_accelerometer(); 43 | void get_clock(); 44 | String row[3]; 45 | }; 46 | 47 | void ID107_sensors::begin() 48 | { 49 | // Clock 50 | setTime(AdelaideTimezone.toUTC(compileTime())); 51 | 52 | // Si1143 - Heartrate 53 | uint8_t attempts = 0; 54 | while ((pulse.isPresent() == false) & (attempts < _retries)) 55 | { 56 | delay(100); 57 | ++attempts; 58 | } 59 | if (pulse.isPresent()) 60 | { 61 | pulse.init(); 62 | } 63 | 64 | // Kx022 - Accelerometer 65 | acc.init(); 66 | } 67 | 68 | void ID107_sensors::get_heartrate(uint8_t ambiant_sensor) 69 | { 70 | if (pulse.isPresent()) 71 | { 72 | pulse.readSensor(ambiant_sensor + 1); // sensorIdx = 1(HeartRate),2(Ambiant),3(Both) 73 | if (ambiant_sensor) 74 | { 75 | 76 | row[0] = "VIS " + String(pulse.als_vis); 77 | row[1] = "IR " + String(pulse.als_ir); 78 | row[2] = ""; 79 | } 80 | else 81 | { 82 | row[0] = "RED " + String(pulse.led_red); 83 | row[1] = "IR1 " + String(pulse.led_ir1); 84 | row[2] = "IR2 " + String(pulse.led_ir2); 85 | } 86 | } 87 | else 88 | { 89 | row[0] = "Si1143 (HRM)"; 90 | row[1] = "Not"; 91 | row[2] = "Present"; 92 | } 93 | } 94 | 95 | void ID107_sensors::get_accelerometer() 96 | { 97 | row[0] = "X "; 98 | row[1] = "Y "; 99 | row[2] = "Z "; 100 | 101 | char fltBuf[5]; 102 | float xyz[3]; 103 | acc.getAccelXYZ(xyz); 104 | 105 | float2chars(xyz[0],fltBuf); row[0] += String(fltBuf); 106 | float2chars(xyz[1],fltBuf); row[1] += String(fltBuf); 107 | float2chars(xyz[2],fltBuf); row[2] += String(fltBuf); 108 | } 109 | 110 | void ID107_sensors::get_clock() 111 | { 112 | time_t utc = now(); 113 | time_t local = AdelaideTimezone.toLocal(utc, &tcr); 114 | 115 | char timeString[10]; 116 | 117 | sprintf(timeString, "%.2d:%.2d:%.2d", hour(local), minute(local), second(local)); 118 | 119 | char dateString[11]; 120 | 121 | sprintf(dateString, "%.2d/%.2d/%d", day(local), month(local), year(local)); 122 | /* 123 | char dayString[7]; 124 | char monthYearString[9]; 125 | char m[4]; // temporary storage for month string (DateStrings.cpp uses shared buffer) 126 | strcpy(m, monthShortStr(month(local))); 127 | 128 | sprintf(dayString, "%s %.2d", dayShortStr(weekday(local)), day(local)); 129 | sprintf(buf, "%s %d", m, year(local)); 130 | */ 131 | row[0] = timeString; 132 | row[1] = dateString; 133 | row[2] = ""; 134 | } 135 | 136 | // Function to return the compile date and time as a time_t value 137 | time_t ID107_sensors::compileTime() 138 | { 139 | const time_t FUDGE(4); // fudge factor to allow for compile time (seconds, YMMV) 140 | const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec"; 141 | char chMon[3], *m; 142 | tmElements_t tm; 143 | 144 | strncpy(chMon, compDate, 3); 145 | chMon[3] = '\0'; 146 | m = strstr(months, chMon); 147 | tm.Month = ((m - months) / 3 + 1); 148 | 149 | tm.Day = atoi(compDate + 4); 150 | tm.Year = atoi(compDate + 7) - 1970; 151 | tm.Hour = atoi(compTime); 152 | tm.Minute = atoi(compTime + 3); 153 | tm.Second = atoi(compTime + 6); 154 | time_t t = makeTime(tm); 155 | return t + FUDGE; // add fudge factor to allow for compile time 156 | } 157 | 158 | void ID107_sensors::float2chars(float &in, char (&out)[5]) 159 | { 160 | bool sign_bit = (in < 0); 161 | uint16_t tmp = sign_bit?(-in * 10):(in * 10); 162 | out[0] = (sign_bit)?'-':' '; 163 | out[1] = char('0' + (tmp / 10)); 164 | out[2] = '.'; 165 | out[3] = char('0' + (tmp % 10)); 166 | out[4] = '\0'; 167 | } 168 | 169 | #endif 170 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock/ID107_u8g2_sensors_clock.ino: -------------------------------------------------------------------------------- 1 | #include "ID107_OLED.h" 2 | 3 | bool button_wasPressed = false; 4 | 5 | ID107_OLED id107_oled; 6 | uint8_t page_num = 0; 7 | uint32_t tPage; 8 | 9 | void setup() 10 | { 11 | id107_oled.begin(); 12 | 13 | Serial.begin(9600); 14 | Serial.println(__FILE__); 15 | 16 | pinMode(PIN_BUTTON1, INPUT_PULLUP); 17 | 18 | tPage = millis(); 19 | } 20 | 21 | void loop() 22 | { 23 | if (Button_isPressed(PIN_BUTTON1)) 24 | { 25 | page_num = (page_num + 1 < id107_oled.getPageCount())?page_num+1:0; 26 | } 27 | 28 | if (millis() - tPage > 20) // 20ms = 50Hz 29 | { 30 | tPage = millis(); 31 | id107_oled.drawPage(page_num); 32 | } 33 | yield(); 34 | } 35 | 36 | // debounce the button 37 | bool Button_isPressed(uint8_t ButtonPin) 38 | { 39 | bool button_isPressed = (digitalRead(ButtonPin) == 0); 40 | 41 | bool result = (button_wasPressed == false) & (button_isPressed == true); 42 | button_wasPressed = button_isPressed; 43 | return result; 44 | } 45 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock_bleUart/BLESerial.cpp: -------------------------------------------------------------------------------- 1 | #include "BLESerial.h" 2 | 3 | //#define BLE_SERIAL_DEBUG 4 | 5 | BLESerial* BLESerial::_instance = NULL; 6 | 7 | BLESerial::BLESerial(unsigned char req, unsigned char rdy, unsigned char rst) : 8 | BLEPeripheral(req, rdy, rst) 9 | { 10 | this->_txCount = 0; 11 | this->_rxHead = this->_rxTail = 0; 12 | this->_flushed = 0; 13 | BLESerial::_instance = this; 14 | 15 | addAttribute(this->_uartService); 16 | addAttribute(this->_uartNameDescriptor); 17 | setAdvertisedServiceUuid(this->_uartService.uuid()); 18 | addAttribute(this->_rxCharacteristic); 19 | addAttribute(this->_rxNameDescriptor); 20 | this->_rxCharacteristic.setEventHandler(BLEWritten, BLESerial::_received); 21 | addAttribute(this->_txCharacteristic); 22 | addAttribute(this->_txNameDescriptor); 23 | } 24 | 25 | void BLESerial::begin(...) { 26 | BLEPeripheral::begin(); 27 | #ifdef BLE_SERIAL_DEBUG 28 | Serial.println(F("BLESerial::begin()")); 29 | #endif 30 | } 31 | 32 | void BLESerial::poll() { 33 | if (millis() < this->_flushed + 100) { 34 | BLEPeripheral::poll(); 35 | } else { 36 | flush(); 37 | } 38 | } 39 | 40 | void BLESerial::end() { 41 | this->_rxCharacteristic.setEventHandler(BLEWritten, NULL); 42 | this->_rxHead = this->_rxTail = 0; 43 | flush(); 44 | BLEPeripheral::disconnect(); 45 | } 46 | 47 | int BLESerial::available(void) { 48 | BLEPeripheral::poll(); 49 | int retval = (this->_rxHead - this->_rxTail + sizeof(this->_rxBuffer)) % sizeof(this->_rxBuffer); 50 | #ifdef BLE_SERIAL_DEBUG 51 | Serial.print(F("BLESerial::available() = ")); 52 | Serial.println(retval); 53 | #endif 54 | return retval; 55 | } 56 | 57 | int BLESerial::peek(void) { 58 | BLEPeripheral::poll(); 59 | if (this->_rxTail == this->_rxHead) return -1; 60 | uint8_t byte = this->_rxBuffer[this->_rxTail]; 61 | #ifdef BLE_SERIAL_DEBUG 62 | Serial.print(F("BLESerial::peek() = ")); 63 | Serial.print((char) byte); 64 | Serial.print(F(" 0x")); 65 | Serial.println(byte, HEX); 66 | #endif 67 | return byte; 68 | } 69 | 70 | int BLESerial::read(void) { 71 | BLEPeripheral::poll(); 72 | if (this->_rxTail == this->_rxHead) return -1; 73 | this->_rxTail = (this->_rxTail + 1) % sizeof(this->_rxBuffer); 74 | uint8_t byte = this->_rxBuffer[this->_rxTail]; 75 | #ifdef BLE_SERIAL_DEBUG 76 | Serial.print(F("BLESerial::read() = ")); 77 | Serial.print((char) byte); 78 | Serial.print(F(" 0x")); 79 | Serial.println(byte, HEX); 80 | #endif 81 | return byte; 82 | } 83 | 84 | void BLESerial::flush(void) { 85 | if (this->_txCount == 0) return; 86 | this->_txCharacteristic.setValue(this->_txBuffer, this->_txCount); 87 | this->_flushed = millis(); 88 | this->_txCount = 0; 89 | BLEPeripheral::poll(); 90 | #ifdef BLE_SERIAL_DEBUG 91 | Serial.println(F("BLESerial::flush()")); 92 | #endif 93 | } 94 | 95 | size_t BLESerial::write(uint8_t byte) { 96 | BLEPeripheral::poll(); 97 | if (this->_txCharacteristic.subscribed() == false) return 0; 98 | this->_txBuffer[this->_txCount++] = byte; 99 | if (this->_txCount == sizeof(this->_txBuffer)) flush(); 100 | #ifdef BLE_SERIAL_DEBUG 101 | Serial.print(F("BLESerial::write(")); 102 | Serial.print((char) byte); 103 | Serial.print(F(" 0x")); 104 | Serial.print(byte, HEX); 105 | Serial.println(F(") = 1")); 106 | #endif 107 | return 1; 108 | } 109 | 110 | BLESerial::operator bool() { 111 | bool retval = BLEPeripheral::connected(); 112 | #ifdef BLE_SERIAL_DEBUG 113 | Serial.print(F("BLESerial::operator bool() = ")); 114 | Serial.println(retval); 115 | #endif 116 | return retval; 117 | } 118 | 119 | void BLESerial::_received(const uint8_t* data, size_t size) { 120 | for (int i = 0; i < size; i++) { 121 | this->_rxHead = (this->_rxHead + 1) % sizeof(this->_rxBuffer); 122 | this->_rxBuffer[this->_rxHead] = data[i]; 123 | } 124 | #ifdef BLE_SERIAL_DEBUG 125 | Serial.print(F("BLESerial::received(")); 126 | for (int i = 0; i < size; i++) Serial.print((char) data[i]); 127 | Serial.println(F(")")); 128 | #endif 129 | } 130 | 131 | void BLESerial::_received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic) { 132 | BLESerial::_instance->_received(rxCharacteristic.value(), rxCharacteristic.valueLength()); 133 | } 134 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock_bleUart/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | using Print::write; 22 | virtual operator bool(); 23 | 24 | private: 25 | unsigned long _flushed; 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 32 | size_t _txCount; 33 | uint8_t _txBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 34 | 35 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 36 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 37 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 39 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 40 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 41 | 42 | void _received(const uint8_t* data, size_t size); 43 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock_bleUart/ID107_OLED.h: -------------------------------------------------------------------------------- 1 | #ifndef ID107_OLED_H 2 | #define ID107_OLED_H 3 | 4 | #include "ID107_sensors.h" 5 | 6 | #include 7 | #include 8 | 9 | U8G2_SH1106_64X32_1_4W_HW_SPI u8g2(U8G2_R0, OLED_CS, OLED_DC, OLED_RST); 10 | 11 | class ID107_OLED{ 12 | private: 13 | const uint8_t _numPages = 4; 14 | uint32_t _splashTime; 15 | uint8_t _pageNum; 16 | time_t compileTime(); 17 | 18 | ID107_sensors _id107_sensors; 19 | 20 | void splash(uint32_t splash_time_ms); 21 | void draw(); 22 | public: 23 | ID107_OLED(uint32_t splash_time_ms = 2000): _splashTime(splash_time_ms), _pageNum(0) {} 24 | ~ID107_OLED() {} 25 | void begin(); 26 | void heartrate(uint8_t ambiant_sensor = 0); 27 | void accelerometer(); 28 | void clock(); 29 | void nextPage(); 30 | uint8_t getPageCount() { return _numPages; } 31 | void drawPage(uint8_t pageNum = 0); 32 | }; 33 | 34 | void ID107_OLED::begin() 35 | { 36 | _id107_sensors.begin(); 37 | 38 | u8g2.begin(); 39 | u8g2.setFont(u8g2_font_6x10_tf); 40 | u8g2.setFontRefHeightExtendedText(); 41 | u8g2.setDrawColor(1); 42 | u8g2.setFontPosTop(); 43 | u8g2.setFontDirection(0); 44 | 45 | splash(_splashTime); 46 | } 47 | 48 | void ID107_OLED::drawPage(uint8_t pageNum) 49 | { 50 | switch(pageNum) { 51 | case 0: 52 | heartrate(0); break; 53 | case 1: 54 | heartrate(1); break; 55 | case 2: 56 | accelerometer(); break; 57 | default: 58 | clock(); 59 | } 60 | } 61 | 62 | void ID107_OLED::draw() 63 | { 64 | u8g2.firstPage(); 65 | do { 66 | u8g2.setFont(u8g2_font_6x10_tf); 67 | u8g2.drawStr( 0, 0, _id107_sensors.row[0].c_str()); 68 | u8g2.drawStr(0, 10, _id107_sensors.row[1].c_str()); 69 | u8g2.drawStr(0, 20, _id107_sensors.row[2].c_str()); 70 | } while ( u8g2.nextPage() ); 71 | } 72 | 73 | void ID107_OLED::nextPage() 74 | { 75 | // increment the page number 76 | _pageNum = (_pageNum < _numPages - 1)?_pageNum + 1:0; 77 | 78 | // draw the page 79 | drawPage(_pageNum); 80 | } 81 | 82 | 83 | void ID107_OLED::heartrate(uint8_t ambiant_sensor) 84 | { 85 | _id107_sensors.get_heartrate(ambiant_sensor); 86 | 87 | draw(); 88 | } 89 | 90 | void ID107_OLED::accelerometer() 91 | { 92 | _id107_sensors.get_accelerometer(); 93 | 94 | draw(); 95 | } 96 | 97 | void ID107_OLED::clock() 98 | { 99 | _id107_sensors.get_clock(); 100 | 101 | draw(); 102 | } 103 | 104 | void ID107_OLED::splash(uint32_t splash_time_ms) 105 | { 106 | _id107_sensors.row[0] = "github.com"; 107 | _id107_sensors.row[1] = "/micooke"; 108 | _id107_sensors.row[2] = __TIME__; 109 | 110 | draw(); 111 | 112 | delay(splash_time_ms); 113 | } 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock_bleUart/ID107_sensors.h: -------------------------------------------------------------------------------- 1 | #ifndef ID107_SENSORS_H 2 | #define ID107_SENSORS_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include // https://github.com/JChristensen/Timezone 10 | 11 | TimeChangeRule ACST = {"ACST", First, Sun, Apr, 3, 570}; // Australian Central Daylight Time = UTC +9:30 hours 12 | TimeChangeRule ACDT = {"ACDT", First, Sun, Oct, 2, 630}; // Australian Central Standard Time = UTC +10:30 hours 13 | Timezone AdelaideTimezone(ACST, ACDT); 14 | TimeChangeRule *tcr; // pointer to the time change rule, use to get TZ abbrev 15 | 16 | #ifdef ACCEL_HWI2C 17 | // Kx022 - Hardware I2C (Wire) 18 | KX022<> acc(Wire); 19 | 20 | // Si1143 - Software I2C 21 | SoftwareI2C sWire(PIN_WIRE1_SDA, PIN_WIRE1_SCL); 22 | PulsePlug pulse(sWire); 23 | #else 24 | // Kx022 - Software I2C (Wire) 25 | SoftwareI2C sWire(PIN_WIRE1_SDA, PIN_WIRE1_SCL); 26 | KX022 acc(sWire); 27 | 28 | // Si1143 - Hardware I2C 29 | PulsePlug<> pulse(Wire); 30 | #endif 31 | 32 | class ID107_sensors{ 33 | private: 34 | uint8_t _retries; 35 | void float2chars(float &in, char (&out)[5]); 36 | time_t compileTime(); 37 | public: 38 | ID107_sensors(uint8_t retries = 5) : _retries(retries) {} 39 | ~ID107_sensors() {} 40 | void begin(); 41 | void get_heartrate(uint8_t ambiant_sensor = 0); 42 | void get_accelerometer(); 43 | void get_clock(); 44 | String row[3]; 45 | }; 46 | 47 | void ID107_sensors::begin() 48 | { 49 | // Clock 50 | setTime(AdelaideTimezone.toUTC(compileTime())); 51 | 52 | // Si1143 - Heartrate 53 | uint8_t attempts = 0; 54 | while ((pulse.isPresent() == false) & (attempts < _retries)) 55 | { 56 | delay(100); 57 | ++attempts; 58 | } 59 | if (pulse.isPresent()) 60 | { 61 | pulse.init(); 62 | } 63 | 64 | // Kx022 - Accelerometer 65 | acc.init(); 66 | } 67 | 68 | void ID107_sensors::get_heartrate(uint8_t ambiant_sensor) 69 | { 70 | if (pulse.isPresent()) 71 | { 72 | pulse.readSensor(ambiant_sensor + 1); // sensorIdx = 1(HeartRate),2(Ambiant),3(Both) 73 | if (ambiant_sensor) 74 | { 75 | 76 | row[0] = "VIS " + String(pulse.als_vis); 77 | row[1] = "IR " + String(pulse.als_ir); 78 | row[2] = ""; 79 | } 80 | else 81 | { 82 | row[0] = "RED " + String(pulse.led_red); 83 | row[1] = "IR1 " + String(pulse.led_ir1); 84 | row[2] = "IR2 " + String(pulse.led_ir2); 85 | } 86 | } 87 | else 88 | { 89 | row[0] = "Si1143 (HRM)"; 90 | row[1] = "Not"; 91 | row[2] = "Present"; 92 | } 93 | } 94 | 95 | void ID107_sensors::get_accelerometer() 96 | { 97 | row[0] = "X "; 98 | row[1] = "Y "; 99 | row[2] = "Z "; 100 | 101 | char fltBuf[5]; 102 | float xyz[3]; 103 | acc.getAccelXYZ(xyz); 104 | 105 | float2chars(xyz[0],fltBuf); row[0] += String(fltBuf); 106 | float2chars(xyz[1],fltBuf); row[1] += String(fltBuf); 107 | float2chars(xyz[2],fltBuf); row[2] += String(fltBuf); 108 | } 109 | 110 | void ID107_sensors::get_clock() 111 | { 112 | time_t utc = now(); 113 | time_t local = AdelaideTimezone.toLocal(utc, &tcr); 114 | 115 | char timeString[10]; 116 | 117 | sprintf(timeString, "%.2d:%.2d:%.2d", hour(local), minute(local), second(local)); 118 | 119 | char dateString[11]; 120 | 121 | sprintf(dateString, "%.2d/%.2d/%d", day(local), month(local), year(local)); 122 | /* 123 | char dayString[7]; 124 | char monthYearString[9]; 125 | char m[4]; // temporary storage for month string (DateStrings.cpp uses shared buffer) 126 | strcpy(m, monthShortStr(month(local))); 127 | 128 | sprintf(dayString, "%s %.2d", dayShortStr(weekday(local)), day(local)); 129 | sprintf(buf, "%s %d", m, year(local)); 130 | */ 131 | row[0] = timeString; 132 | row[1] = dateString; 133 | row[2] = ""; 134 | } 135 | 136 | // Function to return the compile date and time as a time_t value 137 | time_t ID107_sensors::compileTime() 138 | { 139 | const time_t FUDGE(4); // fudge factor to allow for compile time (seconds, YMMV) 140 | const char *compDate = __DATE__, *compTime = __TIME__, *months = "JanFebMarAprMayJunJulAugSepOctNovDec"; 141 | char chMon[3], *m; 142 | tmElements_t tm; 143 | 144 | strncpy(chMon, compDate, 3); 145 | chMon[3] = '\0'; 146 | m = strstr(months, chMon); 147 | tm.Month = ((m - months) / 3 + 1); 148 | 149 | tm.Day = atoi(compDate + 4); 150 | tm.Year = atoi(compDate + 7) - 1970; 151 | tm.Hour = atoi(compTime); 152 | tm.Minute = atoi(compTime + 3); 153 | tm.Second = atoi(compTime + 6); 154 | time_t t = makeTime(tm); 155 | return t + FUDGE; // add fudge factor to allow for compile time 156 | } 157 | 158 | void ID107_sensors::float2chars(float &in, char (&out)[5]) 159 | { 160 | bool sign_bit = (in < 0); 161 | uint16_t tmp = sign_bit?(-in * 10):(in * 10); 162 | out[0] = (sign_bit)?'-':' '; 163 | out[1] = char('0' + (tmp / 10)); 164 | out[2] = '.'; 165 | out[3] = char('0' + (tmp % 10)); 166 | out[4] = '\0'; 167 | } 168 | 169 | #endif 170 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ID107_u8g2_sensors_clock_bleUart/ID107_u8g2_sensors_clock_bleUart.ino: -------------------------------------------------------------------------------- 1 | #include "ID107_OLED.h" 2 | 3 | bool button_wasPressed = false; 4 | 5 | ID107_OLED id107_oled; 6 | uint8_t page_num = 0; 7 | uint32_t tPage; 8 | 9 | // 10 | #include 11 | #include "BLESerial.h" 12 | BLESerial bleSerial(10, 2, 9); 13 | // 14 | 15 | void setup() 16 | { 17 | id107_oled.begin(); 18 | 19 | Serial.begin(9600); 20 | Serial.println(__FILE__); 21 | 22 | pinMode(PIN_BUTTON1, INPUT_PULLUP); 23 | 24 | // 25 | bleSerial.setLocalName("UART"); 26 | bleSerial.begin(); 27 | // 28 | 29 | tPage = millis(); 30 | } 31 | 32 | void loop() 33 | { 34 | if (Button_isPressed(PIN_BUTTON1)) 35 | { 36 | page_num = (page_num + 1 < id107_oled.getPageCount())?page_num+1:0; 37 | } 38 | 39 | if (millis() - tPage > 20) // 20ms = 50Hz 40 | { 41 | tPage = millis(); 42 | id107_oled.drawPage(page_num); 43 | 44 | // 45 | bleSerial.print("V"); 46 | bleSerial.print(pulse.led_red); 47 | bleSerial.print(","); 48 | bleSerial.print("I"); 49 | bleSerial.print(pulse.led_ir1); 50 | // 51 | } 52 | yield(); 53 | } 54 | 55 | // debounce the button 56 | bool Button_isPressed(uint8_t ButtonPin) 57 | { 58 | bool button_isPressed = (digitalRead(ButtonPin) == 0); 59 | 60 | bool result = (button_wasPressed == false) & (button_isPressed == true); 61 | button_wasPressed = button_isPressed; 62 | return result; 63 | } 64 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ReverseEngineerSmartwatchPins/ReverseEngineerSmartwatchPins.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "SerialCommands.h" 4 | 5 | #include // https://github.com/kroimon/Arduino-SerialCommand 6 | #include // https://github.com/zacsketches/Arduino_Vector 7 | 8 | #define ANALOG_PINS = 8; 9 | #define DIGITAL_PINS = 28; 10 | 11 | DigitalPins[DIGITAL_PINS] = { 12 | PIN_BUTTON1,PIN_BUTTON2,PIN_TOUCH,PIN_VIBRATE,LED_BUILTIN, /*1-5*/ 13 | PIN_HR_ON,PIN_OLED_VPP,PIN_OLED_SW, /*6-8*/ 14 | PIN_SERIAL_RX,PIN_SERIAL_TX,PIN_SERIAL1_RX,PIN_SERIAL1_TX, /*9-12*/ 15 | PIN_SPI_MISO,PIN_SPI_MOSI,PIN_SPI_SCK, /*13-15*/ 16 | PIN_SPI1_MISO,PIN_SPI1_MOSI,PIN_SPI1_SCK, /*16-18*/ 17 | PIN_SPI1_CS,SS,MOSI,MISO,SCK, /*19-23*/ 18 | OLED_RST,OLED_CS,OLED_DC, /*24-26*/ 19 | PIN_WIRE_SDA,PIN_WIRE_SCL}; /*27-28*/ 20 | 21 | AnalogPins[ANALOG_PINS] = { PIN_A0, PIN_A1, PIN_A2, PIN_A3, PIN_A4, PIN_A5, PIN_A6, PIN_A7 }; 22 | 23 | void setup() 24 | { 25 | // turn off the vibration motor 26 | digitalWrite(PIN_VIBRATE, HIGH); 27 | pinMode(PIN_VIBRATE, OUTPUT); 28 | 29 | Serial1.begin(9600); 30 | 31 | populate_UNUSED_PINS(); 32 | 33 | sCmd.addCommand("T", togglePinCommand); 34 | sCmd.addCommand("KX", findKx022IntPinCommand); 35 | sCmd.addCommand("B", findBatteryCommand); 36 | sCmd.addCommand("DO", digitalOutputCommand); 37 | sCmd.addCommand("S", scanCommand); 38 | sCmd.addCommand("S", scanWideCommand); 39 | sCmd.addCommand("P", printCommand); 40 | 41 | sCmd.setDefaultHandler(unrecognized); 42 | 43 | unrecognized(NULL); 44 | } 45 | 46 | void loop(void) { sCmd.readSerial(); } 47 | -------------------------------------------------------------------------------- /libraries/examples/Examples/ReverseEngineerSmartwatchPins/SerialCommands.h: -------------------------------------------------------------------------------- 1 | #ifndef SERIALCOMMANDS_H 2 | #define SERIALCOMMANDS_H 3 | 4 | #include // https://github.com/kroimon/Arduino-SerialCommand 5 | #include // https://github.com/zacsketches/Arduino_Vector 6 | 7 | SerialCommand sCmd; 8 | SoftwareSerial Serial1(PIN_SERIAL1_RX, PIN_SERIAL1_TX); 9 | 10 | Vector UNUSED_PINS; 11 | uint8_t NUM_UNUSED_PINS = 0; 12 | 13 | void populate_UNUSED_PINS() 14 | { 15 | // Note : AnalogPins arent dedicated to a function so will be used by rev eng tools 16 | for (uint8_t p=0; p < PINS_COUNT; ++p) 17 | { 18 | bool isAllocated = false; 19 | for (uint8_t idx=0; idx < DIGITAL_PINS; ++idx) 20 | { 21 | if (p == DigitalPins[idx]) 22 | { 23 | isAllocated = true; 24 | break; 25 | } 26 | } 27 | 28 | // If it isnt one of the digital pins, save it as unused 29 | if (isAllocated == false) 30 | { 31 | UNUSED_PINS.push_back(p); 32 | ++NUM_UNUSED_PINS; 33 | } 34 | } 35 | } 36 | 37 | void unrecognized(const char *c) 38 | { 39 | Serial1.println( 40 | F("Commands are :\n" 41 | "T pin_number - toggle digital pin\n" 42 | "KX - find Kx022/023 interrupt pin\n" 43 | "B - find battery voltage pin\n" 44 | "DO - toggle unused digital output pins (outputs pin number to serial)\n" 45 | "S - scan unused pins, which includes analog pins (outputs pin number and pin value to serial)\n" 46 | "SW - same as scan, but output is in wide format\n" 47 | "P - print all un-allocated (and Analog) pins\n")); 48 | 49 | Serial1.println("Example: T 4 -> toggle D4 high for 3 seconds, then set it low"); 50 | } 51 | 52 | void findBatteryCommand() 53 | { 54 | const uint8_t tolerance = 10; // tolerance on successive measurements (i.e. error margin) 55 | 56 | //pinMode(LED_BUILTIN, OUTPUT); 57 | pinMode(LED_VIBRATE, OUTPUT); 58 | 59 | for (uint8_t p = 0; p < ANALOG_PINS; ++p) 60 | { 61 | pinMode(AnalogPins[p], OUTPUT); 62 | uint8_t val = analogRead(AnalogPins[p]); 63 | 64 | // if we are reading a value, try running down the battery for 1 minute 65 | if (val > 0) 66 | { 67 | Serial1.print(F("Testing pin ")); 68 | Serial1.print(AnalogPins[p]); 69 | Serial1.println(F(" to see if it is the battery pin (test will take approximately 1 minute)")); 70 | 71 | //digitalWrite(LED_BUILTIN, HIGH); 72 | digitalWrite(PIN_VIBRATE, LOW); // vibration motor on 73 | for (uint8_t wait=0; wait < 60; ++wait) 74 | { 75 | delay(1000); 76 | } 77 | //digitalWrite(LED_BUILTIN, LOW); 78 | digitalWrite(PIN_VIBRATE, HIGH); // vibration motor off 79 | 80 | if (analogRead(AnalogPins[p] + tolerance < val)) 81 | { 82 | Serial1.print(F("SUCCESS! Battery pin is ")); 83 | Serial1.println(AnalogPins[p]); 84 | } 85 | else 86 | { 87 | Serial1.print(F("FAIL! Battery pin is not")); 88 | Serial1.println(AnalogPins[p]); 89 | } 90 | } 91 | } 92 | } 93 | 94 | //"W device_address reg_num reg_val - writes 'reg_val' to register 'reg_num'\n" 95 | void findKx022IntPinCommand() 96 | { 97 | // setup the Kx022 98 | // clear the interrupt/s 99 | // set the interrupt/s as sticky bits 100 | // prompt the user to tap the watch and wait for 5 seconds 101 | // check for a change in status 102 | } 103 | 104 | void togglePinCommand() 105 | { 106 | char *arg; 107 | 108 | arg = sCmd.next(); 109 | uint8_t pin_number = strtoul(arg, NULL, 16); 110 | 111 | if (arg != NULL) 112 | { 113 | pinMode(pin_number, OUTPUT); 114 | digitalWrite(pin_number, HIGH); 115 | delay(3000); 116 | digitalWrite(pin_number, LOW); 117 | } 118 | else 119 | { 120 | Serial1.println("One argument is required : T pin_number"); 121 | } 122 | } 123 | 124 | void digitalOutputCommand() 125 | { 126 | for (uint8_t p = 0; p < NUM_UNUSED_PINS; ++p) 127 | { 128 | Serial1.print(F("D")); 129 | Serial1.println(UNUSED_PINS[p]); 130 | pinMode(UNUSED_PINS[p], OUTPUT); 131 | digitalWrite(UNUSED_PINS[p], HIGH); 132 | delay(3000); 133 | digitalWrite(UNUSED_PINS[p], LOW); 134 | } 135 | } 136 | 137 | void scanCommand() 138 | { 139 | for (uint8_t p = 0; p < NUM_UNUSED_PINS; ++p) 140 | { 141 | pinMode(UNUSED_PINS[p], INPUT); 142 | uint8_t val = analogRead(UNUSED_PINS[p], HIGH); 143 | 144 | Serial1.print(F("D")); 145 | Serial1.print(UNUSED_PINS[p]); 146 | Serial1.print(F(" = ")); 147 | Serial1.println(val); 148 | } 149 | } 150 | 151 | void scanWideCommand() 152 | { 153 | for (uint8_t p = 0; p < NUM_UNUSED_PINS; ++p) 154 | { 155 | if (p%5 == 0) 156 | { 157 | Serial1.print(F("\n[")); 158 | print3digits(UNUSED_PINS[p]); 159 | const uint8_t upper_value = min(NUM_UNUSED_PINS, p+4); 160 | for (uint8_t sp = p+1; sp < upper_value; ++sp) 161 | { 162 | Serial1.print(F(" ")); 163 | print3digits(UNUSED_PINS[p]); 164 | } 165 | Serial1.println(F("]")); 166 | } 167 | pinMode(UNUSED_PINS[p], INPUT); 168 | uint8_t val = analogRead(UNUSED_PINS[p], HIGH); 169 | 170 | Serial1.print(F(" ")); 171 | print3digits(val); 172 | } 173 | } 174 | 175 | void printCommand() 176 | { 177 | Serial1.println(F("Unallocated and Analog pins:")); 178 | for (uint8_t p = 0; p < NUM_UNUSED_PINS; p+=4) 179 | { 180 | print3digits(UNUSED_PINS[p]); 181 | const uint8_t upper_value = min(NUM_UNUSED_PINS, p+4); 182 | for (uint8_t sp = p+1; sp < upper_value; ++sp) 183 | { 184 | Serial1.print(F(" ")); 185 | print3digits(UNUSED_PINS[p]); 186 | } 187 | Serial1.println(""); 188 | } 189 | } 190 | 191 | void print3digits(uint8_t val) 192 | { 193 | if (val % 100 > 0) 194 | { 195 | Serial1.print(F("0")); 196 | } 197 | if (val % 10 > 0) 198 | { 199 | Serial1.print(F("0")); 200 | } 201 | Serial1.print(val); 202 | } 203 | 204 | #endif -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/README.md: -------------------------------------------------------------------------------- 1 | Included is a SDL watch example using u8g2 (i.e. not the Arduino version) for a 64x32 screen 2 | 3 | The folder structure used should replicate the u8g2 library : https://github.com/olikraus/u8g2/tree/master/sys/sdl 4 | 5 | This was tested using Ubuntu 14.10 and Ubuntu for Windows 10 6 | -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -std=c++11 -lstdc++ -g -Wall -I../../../csrc/. `sdl-config --cflags` 2 | 3 | SRC = $(shell ls ../../../csrc/*.c) $(shell ls ../common/*.c ) main.cpp 4 | 5 | OBJ = $(SRC:.c=.o) 6 | 7 | main: $(OBJ) 8 | $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) `sdl-config --libs` -o watch_64x32 9 | 10 | clean: 11 | -rm $(OBJ) watch_64x32 12 | 13 | -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/fonts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "u8g2.h" 4 | 5 | #define MAX_FONT_NUM 1127 6 | 7 | void setFont(u8g2_t *u8g2, uint16_t font_num = -1) 8 | { 9 | switch(font_num) 10 | { 11 | case 0:u8g2_SetFont(u8g2, u8g2_font_siji_t_6x10); break; 12 | case 1:u8g2_SetFont(u8g2, u8g2_font_u8glib_4_tf); break; 13 | case 2:u8g2_SetFont(u8g2, u8g2_font_u8glib_4_tr); break; 14 | case 3:u8g2_SetFont(u8g2, u8g2_font_u8glib_4_hf); break; 15 | case 4:u8g2_SetFont(u8g2, u8g2_font_u8glib_4_hr); break; 16 | case 5:u8g2_SetFont(u8g2, u8g2_font_m2icon_5_tf); break; 17 | case 6:u8g2_SetFont(u8g2, u8g2_font_m2icon_7_tf); break; 18 | case 7:u8g2_SetFont(u8g2, u8g2_font_m2icon_9_tf); break; 19 | case 8:u8g2_SetFont(u8g2, u8g2_font_freedoomr10_tu); break; 20 | case 9:u8g2_SetFont(u8g2, u8g2_font_freedoomr10_mu); break; 21 | case 10:u8g2_SetFont(u8g2, u8g2_font_freedoomr25_tn); break; 22 | case 11:u8g2_SetFont(u8g2, u8g2_font_freedoomr25_mn); break; 23 | case 12:u8g2_SetFont(u8g2, u8g2_font_amstrad_cpc_extended_8f); break; 24 | case 13:u8g2_SetFont(u8g2, u8g2_font_amstrad_cpc_extended_8r); break; 25 | case 14:u8g2_SetFont(u8g2, u8g2_font_amstrad_cpc_extended_8n); break; 26 | case 15:u8g2_SetFont(u8g2, u8g2_font_amstrad_cpc_extended_8u); break; 27 | case 16:u8g2_SetFont(u8g2, u8g2_font_cursor_tf); break; 28 | case 17:u8g2_SetFont(u8g2, u8g2_font_cursor_tr); break; 29 | case 18:u8g2_SetFont(u8g2, u8g2_font_micro_tr); break; 30 | case 19:u8g2_SetFont(u8g2, u8g2_font_micro_tn); break; 31 | case 20:u8g2_SetFont(u8g2, u8g2_font_micro_mr); break; 32 | case 21:u8g2_SetFont(u8g2, u8g2_font_micro_mn); break; 33 | case 22:u8g2_SetFont(u8g2, u8g2_font_4x6_tf); break; 34 | case 23:u8g2_SetFont(u8g2, u8g2_font_4x6_tr); break; 35 | case 24:u8g2_SetFont(u8g2, u8g2_font_4x6_tn); break; 36 | case 25:u8g2_SetFont(u8g2, u8g2_font_4x6_mf); break; 37 | case 26:u8g2_SetFont(u8g2, u8g2_font_4x6_mr); break; 38 | case 27:u8g2_SetFont(u8g2, u8g2_font_4x6_mn); break; 39 | case 28:u8g2_SetFont(u8g2, u8g2_font_4x6_t_cyrillic); break; 40 | case 29:u8g2_SetFont(u8g2, u8g2_font_5x7_tf); break; 41 | case 30:u8g2_SetFont(u8g2, u8g2_font_5x7_tr); break; 42 | case 31:u8g2_SetFont(u8g2, u8g2_font_5x7_tn); break; 43 | case 32:u8g2_SetFont(u8g2, u8g2_font_5x7_mf); break; 44 | case 33:u8g2_SetFont(u8g2, u8g2_font_5x7_mr); break; 45 | case 34:u8g2_SetFont(u8g2, u8g2_font_5x7_mn); break; 46 | case 35:u8g2_SetFont(u8g2, u8g2_font_5x7_t_cyrillic); break; 47 | case 36:u8g2_SetFont(u8g2, u8g2_font_5x8_tf); break; 48 | case 37:u8g2_SetFont(u8g2, u8g2_font_5x8_tr); break; 49 | case 38:u8g2_SetFont(u8g2, u8g2_font_5x8_tn); break; 50 | case 39:u8g2_SetFont(u8g2, u8g2_font_5x8_mf); break; 51 | case 40:u8g2_SetFont(u8g2, u8g2_font_5x8_mr); break; 52 | case 41:u8g2_SetFont(u8g2, u8g2_font_5x8_mn); break; 53 | case 42:u8g2_SetFont(u8g2, u8g2_font_5x8_t_cyrillic); break; 54 | case 43:u8g2_SetFont(u8g2, u8g2_font_6x10_tf); break; 55 | case 44:u8g2_SetFont(u8g2, u8g2_font_6x10_tr); break; 56 | case 45:u8g2_SetFont(u8g2, u8g2_font_6x10_tn); break; 57 | case 46:u8g2_SetFont(u8g2, u8g2_font_6x10_mf); break; 58 | case 47:u8g2_SetFont(u8g2, u8g2_font_6x10_mr); break; 59 | case 48:u8g2_SetFont(u8g2, u8g2_font_6x10_mn); break; 60 | case 49:u8g2_SetFont(u8g2, u8g2_font_6x12_tf); break; 61 | case 50:u8g2_SetFont(u8g2, u8g2_font_6x12_tr); break; 62 | case 51:u8g2_SetFont(u8g2, u8g2_font_6x12_tn); break; 63 | case 52:u8g2_SetFont(u8g2, u8g2_font_6x12_te); break; 64 | case 53:u8g2_SetFont(u8g2, u8g2_font_6x12_mf); break; 65 | case 54:u8g2_SetFont(u8g2, u8g2_font_6x12_mr); break; 66 | case 55:u8g2_SetFont(u8g2, u8g2_font_6x12_mn); break; 67 | case 56:u8g2_SetFont(u8g2, u8g2_font_6x12_me); break; 68 | case 57:u8g2_SetFont(u8g2, u8g2_font_6x12_t_symbols); break; 69 | case 58:u8g2_SetFont(u8g2, u8g2_font_6x12_m_symbols); break; 70 | case 59:u8g2_SetFont(u8g2, u8g2_font_6x13_tf); break; 71 | case 60:u8g2_SetFont(u8g2, u8g2_font_6x13_tr); break; 72 | case 61:u8g2_SetFont(u8g2, u8g2_font_6x13_tn); break; 73 | case 62:u8g2_SetFont(u8g2, u8g2_font_6x13_te); break; 74 | case 63:u8g2_SetFont(u8g2, u8g2_font_6x13_mf); break; 75 | case 64:u8g2_SetFont(u8g2, u8g2_font_6x13_mr); break; 76 | case 65:u8g2_SetFont(u8g2, u8g2_font_6x13_mn); break; 77 | case 66:u8g2_SetFont(u8g2, u8g2_font_6x13_me); break; 78 | case 67:u8g2_SetFont(u8g2, u8g2_font_6x13_t_hebrew); break; 79 | case 68:u8g2_SetFont(u8g2, u8g2_font_6x13_t_cyrillic); break; 80 | case 69:u8g2_SetFont(u8g2, u8g2_font_6x13B_tf); break; 81 | case 70:u8g2_SetFont(u8g2, u8g2_font_6x13B_tr); break; 82 | case 71:u8g2_SetFont(u8g2, u8g2_font_6x13B_tn); break; 83 | case 72:u8g2_SetFont(u8g2, u8g2_font_6x13B_mf); break; 84 | case 73:u8g2_SetFont(u8g2, u8g2_font_6x13B_mr); break; 85 | case 74:u8g2_SetFont(u8g2, u8g2_font_6x13B_mn); break; 86 | case 75:u8g2_SetFont(u8g2, u8g2_font_6x13B_t_hebrew); break; 87 | case 76:u8g2_SetFont(u8g2, u8g2_font_6x13B_t_cyrillic); break; 88 | case 77:u8g2_SetFont(u8g2, u8g2_font_6x13O_tf); break; 89 | case 78:u8g2_SetFont(u8g2, u8g2_font_6x13O_tr); break; 90 | case 79:u8g2_SetFont(u8g2, u8g2_font_6x13O_tn); break; 91 | case 80:u8g2_SetFont(u8g2, u8g2_font_6x13O_mf); break; 92 | case 81:u8g2_SetFont(u8g2, u8g2_font_6x13O_mr); break; 93 | case 82:u8g2_SetFont(u8g2, u8g2_font_6x13O_mn); break; 94 | case 83:u8g2_SetFont(u8g2, u8g2_font_7x13_tf); break; 95 | case 84:u8g2_SetFont(u8g2, u8g2_font_7x13_tr); break; 96 | case 85:u8g2_SetFont(u8g2, u8g2_font_7x13_tn); break; 97 | case 86:u8g2_SetFont(u8g2, u8g2_font_7x13_te); break; 98 | case 87:u8g2_SetFont(u8g2, u8g2_font_7x13_mf); break; 99 | case 88:u8g2_SetFont(u8g2, u8g2_font_7x13_mr); break; 100 | case 89:u8g2_SetFont(u8g2, u8g2_font_7x13_mn); break; 101 | case 90:u8g2_SetFont(u8g2, u8g2_font_7x13_me); break; 102 | case 91:u8g2_SetFont(u8g2, u8g2_font_7x13_t_symbols); break; 103 | case 92:u8g2_SetFont(u8g2, u8g2_font_7x13_m_symbols); break; 104 | case 93:u8g2_SetFont(u8g2, u8g2_font_7x13_t_cyrillic); break; 105 | case 94:u8g2_SetFont(u8g2, u8g2_font_7x13B_tf); break; 106 | case 95:u8g2_SetFont(u8g2, u8g2_font_7x13B_tr); break; 107 | case 96:u8g2_SetFont(u8g2, u8g2_font_7x13B_tn); break; 108 | case 97:u8g2_SetFont(u8g2, u8g2_font_7x13B_mf); break; 109 | case 98:u8g2_SetFont(u8g2, u8g2_font_7x13B_mr); break; 110 | case 99:u8g2_SetFont(u8g2, u8g2_font_7x13B_mn); break; 111 | case 100:u8g2_SetFont(u8g2, u8g2_font_7x13O_tf); break; 112 | case 101:u8g2_SetFont(u8g2, u8g2_font_7x13O_tr); break; 113 | case 102:u8g2_SetFont(u8g2, u8g2_font_7x13O_tn); break; 114 | case 103:u8g2_SetFont(u8g2, u8g2_font_7x13O_mf); break; 115 | case 104:u8g2_SetFont(u8g2, u8g2_font_7x13O_mr); break; 116 | case 105:u8g2_SetFont(u8g2, u8g2_font_7x13O_mn); break; 117 | case 106:u8g2_SetFont(u8g2, u8g2_font_7x14_tf); break; 118 | case 107:u8g2_SetFont(u8g2, u8g2_font_7x14_tr); break; 119 | case 108:u8g2_SetFont(u8g2, u8g2_font_7x14_tn); break; 120 | case 109:u8g2_SetFont(u8g2, u8g2_font_7x14_mf); break; 121 | case 110:u8g2_SetFont(u8g2, u8g2_font_7x14_mr); break; 122 | case 111:u8g2_SetFont(u8g2, u8g2_font_7x14_mn); break; 123 | case 112:u8g2_SetFont(u8g2, u8g2_font_7x14B_tf); break; 124 | case 113:u8g2_SetFont(u8g2, u8g2_font_7x14B_tr); break; 125 | case 114:u8g2_SetFont(u8g2, u8g2_font_7x14B_tn); break; 126 | case 115:u8g2_SetFont(u8g2, u8g2_font_7x14B_mf); break; 127 | case 116:u8g2_SetFont(u8g2, u8g2_font_7x14B_mr); break; 128 | case 117:u8g2_SetFont(u8g2, u8g2_font_7x14B_mn); break; 129 | case 118:u8g2_SetFont(u8g2, u8g2_font_8x13_tf); break; 130 | case 119:u8g2_SetFont(u8g2, u8g2_font_8x13_tr); break; 131 | case 120:u8g2_SetFont(u8g2, u8g2_font_8x13_tn); break; 132 | case 121:u8g2_SetFont(u8g2, u8g2_font_8x13_te); break; 133 | case 122:u8g2_SetFont(u8g2, u8g2_font_8x13_mf); break; 134 | case 123:u8g2_SetFont(u8g2, u8g2_font_8x13_mr); break; 135 | case 124:u8g2_SetFont(u8g2, u8g2_font_8x13_mn); break; 136 | case 125:u8g2_SetFont(u8g2, u8g2_font_8x13_me); break; 137 | case 126:u8g2_SetFont(u8g2, u8g2_font_8x13_t_symbols); break; 138 | case 127:u8g2_SetFont(u8g2, u8g2_font_8x13_m_symbols); break; 139 | case 128:u8g2_SetFont(u8g2, u8g2_font_8x13_t_cyrillic); break; 140 | case 129:u8g2_SetFont(u8g2, u8g2_font_8x13B_tf); break; 141 | case 130:u8g2_SetFont(u8g2, u8g2_font_8x13B_tr); break; 142 | case 131:u8g2_SetFont(u8g2, u8g2_font_8x13B_tn); break; 143 | case 132:u8g2_SetFont(u8g2, u8g2_font_8x13B_mf); break; 144 | case 133:u8g2_SetFont(u8g2, u8g2_font_8x13B_mr); break; 145 | case 134:u8g2_SetFont(u8g2, u8g2_font_8x13B_mn); break; 146 | case 135:u8g2_SetFont(u8g2, u8g2_font_8x13O_tf); break; 147 | case 136:u8g2_SetFont(u8g2, u8g2_font_8x13O_tr); break; 148 | case 137:u8g2_SetFont(u8g2, u8g2_font_8x13O_tn); break; 149 | case 138:u8g2_SetFont(u8g2, u8g2_font_8x13O_mf); break; 150 | case 139:u8g2_SetFont(u8g2, u8g2_font_8x13O_mr); break; 151 | case 140:u8g2_SetFont(u8g2, u8g2_font_8x13O_mn); break; 152 | case 141:u8g2_SetFont(u8g2, u8g2_font_9x15_tf); break; 153 | case 142:u8g2_SetFont(u8g2, u8g2_font_9x15_tr); break; 154 | case 143:u8g2_SetFont(u8g2, u8g2_font_9x15_tn); break; 155 | case 144:u8g2_SetFont(u8g2, u8g2_font_9x15_te); break; 156 | case 145:u8g2_SetFont(u8g2, u8g2_font_9x15_mf); break; 157 | case 146:u8g2_SetFont(u8g2, u8g2_font_9x15_mr); break; 158 | case 147:u8g2_SetFont(u8g2, u8g2_font_9x15_mn); break; 159 | case 148:u8g2_SetFont(u8g2, u8g2_font_9x15_me); break; 160 | case 149:u8g2_SetFont(u8g2, u8g2_font_9x15_t_symbols); break; 161 | case 150:u8g2_SetFont(u8g2, u8g2_font_9x15_m_symbols); break; 162 | case 151:u8g2_SetFont(u8g2, u8g2_font_9x15_t_cyrillic); break; 163 | case 152:u8g2_SetFont(u8g2, u8g2_font_9x15B_tf); break; 164 | case 153:u8g2_SetFont(u8g2, u8g2_font_9x15B_tr); break; 165 | case 154:u8g2_SetFont(u8g2, u8g2_font_9x15B_tn); break; 166 | case 155:u8g2_SetFont(u8g2, u8g2_font_9x15B_mf); break; 167 | case 156:u8g2_SetFont(u8g2, u8g2_font_9x15B_mr); break; 168 | case 157:u8g2_SetFont(u8g2, u8g2_font_9x15B_mn); break; 169 | case 158:u8g2_SetFont(u8g2, u8g2_font_9x18_tf); break; 170 | case 159:u8g2_SetFont(u8g2, u8g2_font_9x18_tr); break; 171 | case 160:u8g2_SetFont(u8g2, u8g2_font_9x18_tn); break; 172 | case 161:u8g2_SetFont(u8g2, u8g2_font_9x18_mf); break; 173 | case 162:u8g2_SetFont(u8g2, u8g2_font_9x18_mr); break; 174 | case 163:u8g2_SetFont(u8g2, u8g2_font_9x18_mn); break; 175 | case 164:u8g2_SetFont(u8g2, u8g2_font_9x18B_tf); break; 176 | case 165:u8g2_SetFont(u8g2, u8g2_font_9x18B_tr); break; 177 | case 166:u8g2_SetFont(u8g2, u8g2_font_9x18B_tn); break; 178 | case 167:u8g2_SetFont(u8g2, u8g2_font_9x18B_mf); break; 179 | case 168:u8g2_SetFont(u8g2, u8g2_font_9x18B_mr); break; 180 | case 169:u8g2_SetFont(u8g2, u8g2_font_9x18B_mn); break; 181 | case 170:u8g2_SetFont(u8g2, u8g2_font_10x20_tf); break; 182 | case 171:u8g2_SetFont(u8g2, u8g2_font_10x20_tr); break; 183 | case 172:u8g2_SetFont(u8g2, u8g2_font_10x20_tn); break; 184 | case 173:u8g2_SetFont(u8g2, u8g2_font_10x20_te); break; 185 | case 174:u8g2_SetFont(u8g2, u8g2_font_10x20_mf); break; 186 | case 175:u8g2_SetFont(u8g2, u8g2_font_10x20_mr); break; 187 | case 176:u8g2_SetFont(u8g2, u8g2_font_10x20_mn); break; 188 | case 177:u8g2_SetFont(u8g2, u8g2_font_10x20_me); break; 189 | case 178:u8g2_SetFont(u8g2, u8g2_font_10x20_t_greek); break; 190 | case 179:u8g2_SetFont(u8g2, u8g2_font_10x20_t_cyrillic); break; 191 | case 180:u8g2_SetFont(u8g2, u8g2_font_10x20_t_arabic); break; 192 | case 181:u8g2_SetFont(u8g2, u8g2_font_siji_t_6x10); break; 193 | case 182:u8g2_SetFont(u8g2, u8g2_font_siji_t); break; 194 | case 183:u8g2_SetFont(u8g2, u8g2_font_t0_11_tf); break; 195 | case 184:u8g2_SetFont(u8g2, u8g2_font_t0_11_tr); break; 196 | case 185:u8g2_SetFont(u8g2, u8g2_font_t0_11_tn); break; 197 | case 186:u8g2_SetFont(u8g2, u8g2_font_t0_11_te); break; 198 | case 187:u8g2_SetFont(u8g2, u8g2_font_t0_11_mf); break; 199 | case 188:u8g2_SetFont(u8g2, u8g2_font_t0_11_mr); break; 200 | case 189:u8g2_SetFont(u8g2, u8g2_font_t0_11_mn); break; 201 | case 190:u8g2_SetFont(u8g2, u8g2_font_t0_11_me); break; 202 | case 191:u8g2_SetFont(u8g2, u8g2_font_t0_11_t_all); break; 203 | case 192:u8g2_SetFont(u8g2, u8g2_font_t0_11b_tf); break; 204 | case 193:u8g2_SetFont(u8g2, u8g2_font_t0_11b_tr); break; 205 | case 194:u8g2_SetFont(u8g2, u8g2_font_t0_11b_tn); break; 206 | case 195:u8g2_SetFont(u8g2, u8g2_font_t0_11b_te); break; 207 | case 196:u8g2_SetFont(u8g2, u8g2_font_t0_11b_mf); break; 208 | case 197:u8g2_SetFont(u8g2, u8g2_font_t0_11b_mr); break; 209 | case 198:u8g2_SetFont(u8g2, u8g2_font_t0_11b_mn); break; 210 | case 199:u8g2_SetFont(u8g2, u8g2_font_t0_11b_me); break; 211 | case 200:u8g2_SetFont(u8g2, u8g2_font_t0_12_tf); break; 212 | case 201:u8g2_SetFont(u8g2, u8g2_font_t0_12_tr); break; 213 | case 202:u8g2_SetFont(u8g2, u8g2_font_t0_12_tn); break; 214 | case 203:u8g2_SetFont(u8g2, u8g2_font_t0_12_te); break; 215 | case 204:u8g2_SetFont(u8g2, u8g2_font_t0_12_mf); break; 216 | case 205:u8g2_SetFont(u8g2, u8g2_font_t0_12_mr); break; 217 | case 206:u8g2_SetFont(u8g2, u8g2_font_t0_12_mn); break; 218 | case 207:u8g2_SetFont(u8g2, u8g2_font_t0_12_me); break; 219 | case 208:u8g2_SetFont(u8g2, u8g2_font_t0_12b_tf); break; 220 | case 209:u8g2_SetFont(u8g2, u8g2_font_t0_12b_tr); break; 221 | case 210:u8g2_SetFont(u8g2, u8g2_font_t0_12b_tn); break; 222 | case 211:u8g2_SetFont(u8g2, u8g2_font_t0_12b_te); break; 223 | case 212:u8g2_SetFont(u8g2, u8g2_font_t0_12b_mf); break; 224 | case 213:u8g2_SetFont(u8g2, u8g2_font_t0_12b_mr); break; 225 | case 214:u8g2_SetFont(u8g2, u8g2_font_t0_12b_mn); break; 226 | case 215:u8g2_SetFont(u8g2, u8g2_font_t0_12b_me); break; 227 | case 216:u8g2_SetFont(u8g2, u8g2_font_t0_13_tf); break; 228 | case 217:u8g2_SetFont(u8g2, u8g2_font_t0_13_tr); break; 229 | case 218:u8g2_SetFont(u8g2, u8g2_font_t0_13_tn); break; 230 | case 219:u8g2_SetFont(u8g2, u8g2_font_t0_13_te); break; 231 | case 220:u8g2_SetFont(u8g2, u8g2_font_t0_13_mf); break; 232 | case 221:u8g2_SetFont(u8g2, u8g2_font_t0_13_mr); break; 233 | case 222:u8g2_SetFont(u8g2, u8g2_font_t0_13_mn); break; 234 | case 223:u8g2_SetFont(u8g2, u8g2_font_t0_13_me); break; 235 | case 224:u8g2_SetFont(u8g2, u8g2_font_t0_13b_tf); break; 236 | case 225:u8g2_SetFont(u8g2, u8g2_font_t0_13b_tr); break; 237 | case 226:u8g2_SetFont(u8g2, u8g2_font_t0_13b_tn); break; 238 | case 227:u8g2_SetFont(u8g2, u8g2_font_t0_13b_te); break; 239 | case 228:u8g2_SetFont(u8g2, u8g2_font_t0_13b_mf); break; 240 | case 229:u8g2_SetFont(u8g2, u8g2_font_t0_13b_mr); break; 241 | case 230:u8g2_SetFont(u8g2, u8g2_font_t0_13b_mn); break; 242 | case 231:u8g2_SetFont(u8g2, u8g2_font_t0_13b_me); break; 243 | case 232:u8g2_SetFont(u8g2, u8g2_font_t0_14_tf); break; 244 | case 233:u8g2_SetFont(u8g2, u8g2_font_t0_14_tr); break; 245 | case 234:u8g2_SetFont(u8g2, u8g2_font_t0_14_tn); break; 246 | case 235:u8g2_SetFont(u8g2, u8g2_font_t0_14_te); break; 247 | case 236:u8g2_SetFont(u8g2, u8g2_font_t0_14_mf); break; 248 | case 237:u8g2_SetFont(u8g2, u8g2_font_t0_14_mr); break; 249 | case 238:u8g2_SetFont(u8g2, u8g2_font_t0_14_mn); break; 250 | case 239:u8g2_SetFont(u8g2, u8g2_font_t0_14_me); break; 251 | case 240:u8g2_SetFont(u8g2, u8g2_font_t0_14b_tf); break; 252 | case 241:u8g2_SetFont(u8g2, u8g2_font_t0_14b_tr); break; 253 | case 242:u8g2_SetFont(u8g2, u8g2_font_t0_14b_tn); break; 254 | case 243:u8g2_SetFont(u8g2, u8g2_font_t0_14b_te); break; 255 | case 244:u8g2_SetFont(u8g2, u8g2_font_t0_14b_mf); break; 256 | case 245:u8g2_SetFont(u8g2, u8g2_font_t0_14b_mr); break; 257 | case 246:u8g2_SetFont(u8g2, u8g2_font_t0_14b_mn); break; 258 | case 247:u8g2_SetFont(u8g2, u8g2_font_t0_14b_me); break; 259 | case 248:u8g2_SetFont(u8g2, u8g2_font_t0_15_tf); break; 260 | case 249:u8g2_SetFont(u8g2, u8g2_font_t0_15_tr); break; 261 | case 250:u8g2_SetFont(u8g2, u8g2_font_t0_15_tn); break; 262 | case 251:u8g2_SetFont(u8g2, u8g2_font_t0_15_te); break; 263 | case 252:u8g2_SetFont(u8g2, u8g2_font_t0_15_mf); break; 264 | case 253:u8g2_SetFont(u8g2, u8g2_font_t0_15_mr); break; 265 | case 254:u8g2_SetFont(u8g2, u8g2_font_t0_15_mn); break; 266 | case 255:u8g2_SetFont(u8g2, u8g2_font_t0_15_me); break; 267 | case 256:u8g2_SetFont(u8g2, u8g2_font_t0_15b_tf); break; 268 | case 257:u8g2_SetFont(u8g2, u8g2_font_t0_15b_tr); break; 269 | case 258:u8g2_SetFont(u8g2, u8g2_font_t0_15b_tn); break; 270 | case 259:u8g2_SetFont(u8g2, u8g2_font_t0_15b_te); break; 271 | case 260:u8g2_SetFont(u8g2, u8g2_font_t0_15b_mf); break; 272 | case 261:u8g2_SetFont(u8g2, u8g2_font_t0_15b_mr); break; 273 | case 262:u8g2_SetFont(u8g2, u8g2_font_t0_15b_mn); break; 274 | case 263:u8g2_SetFont(u8g2, u8g2_font_t0_15b_me); break; 275 | case 264:u8g2_SetFont(u8g2, u8g2_font_t0_16_tf); break; 276 | case 265:u8g2_SetFont(u8g2, u8g2_font_t0_16_tr); break; 277 | case 266:u8g2_SetFont(u8g2, u8g2_font_t0_16_tn); break; 278 | case 267:u8g2_SetFont(u8g2, u8g2_font_t0_16_te); break; 279 | case 268:u8g2_SetFont(u8g2, u8g2_font_t0_16_mf); break; 280 | case 269:u8g2_SetFont(u8g2, u8g2_font_t0_16_mr); break; 281 | case 270:u8g2_SetFont(u8g2, u8g2_font_t0_16_mn); break; 282 | case 271:u8g2_SetFont(u8g2, u8g2_font_t0_16_me); break; 283 | case 272:u8g2_SetFont(u8g2, u8g2_font_t0_16b_tf); break; 284 | case 273:u8g2_SetFont(u8g2, u8g2_font_t0_16b_tr); break; 285 | case 274:u8g2_SetFont(u8g2, u8g2_font_t0_16b_tn); break; 286 | case 275:u8g2_SetFont(u8g2, u8g2_font_t0_16b_te); break; 287 | case 276:u8g2_SetFont(u8g2, u8g2_font_t0_16b_mf); break; 288 | case 277:u8g2_SetFont(u8g2, u8g2_font_t0_16b_mr); break; 289 | case 278:u8g2_SetFont(u8g2, u8g2_font_t0_16b_mn); break; 290 | case 279:u8g2_SetFont(u8g2, u8g2_font_t0_16b_me); break; 291 | case 280:u8g2_SetFont(u8g2, u8g2_font_t0_17_tf); break; 292 | case 281:u8g2_SetFont(u8g2, u8g2_font_t0_17_tr); break; 293 | case 282:u8g2_SetFont(u8g2, u8g2_font_t0_17_tn); break; 294 | case 283:u8g2_SetFont(u8g2, u8g2_font_t0_17_te); break; 295 | case 284:u8g2_SetFont(u8g2, u8g2_font_t0_17_mf); break; 296 | case 285:u8g2_SetFont(u8g2, u8g2_font_t0_17_mr); break; 297 | case 286:u8g2_SetFont(u8g2, u8g2_font_t0_17_mn); break; 298 | case 287:u8g2_SetFont(u8g2, u8g2_font_t0_17_me); break; 299 | case 288:u8g2_SetFont(u8g2, u8g2_font_t0_17b_tf); break; 300 | case 289:u8g2_SetFont(u8g2, u8g2_font_t0_17b_tr); break; 301 | case 290:u8g2_SetFont(u8g2, u8g2_font_t0_17b_tn); break; 302 | case 291:u8g2_SetFont(u8g2, u8g2_font_t0_17b_te); break; 303 | case 292:u8g2_SetFont(u8g2, u8g2_font_t0_17b_mf); break; 304 | case 293:u8g2_SetFont(u8g2, u8g2_font_t0_17b_mr); break; 305 | case 294:u8g2_SetFont(u8g2, u8g2_font_t0_17b_mn); break; 306 | case 295:u8g2_SetFont(u8g2, u8g2_font_t0_17b_me); break; 307 | case 296:u8g2_SetFont(u8g2, u8g2_font_t0_18_tf); break; 308 | case 297:u8g2_SetFont(u8g2, u8g2_font_t0_18_tr); break; 309 | case 298:u8g2_SetFont(u8g2, u8g2_font_t0_18_tn); break; 310 | case 299:u8g2_SetFont(u8g2, u8g2_font_t0_18_te); break; 311 | case 300:u8g2_SetFont(u8g2, u8g2_font_t0_18_mf); break; 312 | case 301:u8g2_SetFont(u8g2, u8g2_font_t0_18_mr); break; 313 | case 302:u8g2_SetFont(u8g2, u8g2_font_t0_18_mn); break; 314 | case 303:u8g2_SetFont(u8g2, u8g2_font_t0_18_me); break; 315 | case 304:u8g2_SetFont(u8g2, u8g2_font_t0_18b_tf); break; 316 | case 305:u8g2_SetFont(u8g2, u8g2_font_t0_18b_tr); break; 317 | case 306:u8g2_SetFont(u8g2, u8g2_font_t0_18b_tn); break; 318 | case 307:u8g2_SetFont(u8g2, u8g2_font_t0_18b_te); break; 319 | case 308:u8g2_SetFont(u8g2, u8g2_font_t0_18b_mf); break; 320 | case 309:u8g2_SetFont(u8g2, u8g2_font_t0_18b_mr); break; 321 | case 310:u8g2_SetFont(u8g2, u8g2_font_t0_18b_mn); break; 322 | case 311:u8g2_SetFont(u8g2, u8g2_font_t0_18b_me); break; 323 | case 312:u8g2_SetFont(u8g2, u8g2_font_t0_22_tf); break; 324 | case 313:u8g2_SetFont(u8g2, u8g2_font_t0_22_tr); break; 325 | case 314:u8g2_SetFont(u8g2, u8g2_font_t0_22_tn); break; 326 | case 315:u8g2_SetFont(u8g2, u8g2_font_t0_22_te); break; 327 | case 316:u8g2_SetFont(u8g2, u8g2_font_t0_22_mf); break; 328 | case 317:u8g2_SetFont(u8g2, u8g2_font_t0_22_mr); break; 329 | case 318:u8g2_SetFont(u8g2, u8g2_font_t0_22_mn); break; 330 | case 319:u8g2_SetFont(u8g2, u8g2_font_t0_22_me); break; 331 | case 320:u8g2_SetFont(u8g2, u8g2_font_t0_22b_tf); break; 332 | case 321:u8g2_SetFont(u8g2, u8g2_font_t0_22b_tr); break; 333 | case 322:u8g2_SetFont(u8g2, u8g2_font_t0_22b_tn); break; 334 | case 323:u8g2_SetFont(u8g2, u8g2_font_t0_22b_te); break; 335 | case 324:u8g2_SetFont(u8g2, u8g2_font_t0_22b_mf); break; 336 | case 325:u8g2_SetFont(u8g2, u8g2_font_t0_22b_mr); break; 337 | case 326:u8g2_SetFont(u8g2, u8g2_font_t0_22b_mn); break; 338 | case 327:u8g2_SetFont(u8g2, u8g2_font_t0_22b_me); break; 339 | case 328:u8g2_SetFont(u8g2, u8g2_font_profont10_tf); break; 340 | case 329:u8g2_SetFont(u8g2, u8g2_font_profont10_tr); break; 341 | case 330:u8g2_SetFont(u8g2, u8g2_font_profont10_tn); break; 342 | case 331:u8g2_SetFont(u8g2, u8g2_font_profont10_mf); break; 343 | case 332:u8g2_SetFont(u8g2, u8g2_font_profont10_mr); break; 344 | case 333:u8g2_SetFont(u8g2, u8g2_font_profont10_mn); break; 345 | case 334:u8g2_SetFont(u8g2, u8g2_font_profont11_tf); break; 346 | case 335:u8g2_SetFont(u8g2, u8g2_font_profont11_tr); break; 347 | case 336:u8g2_SetFont(u8g2, u8g2_font_profont11_tn); break; 348 | case 337:u8g2_SetFont(u8g2, u8g2_font_profont11_mf); break; 349 | case 338:u8g2_SetFont(u8g2, u8g2_font_profont11_mr); break; 350 | case 339:u8g2_SetFont(u8g2, u8g2_font_profont11_mn); break; 351 | case 340:u8g2_SetFont(u8g2, u8g2_font_profont12_tf); break; 352 | case 341:u8g2_SetFont(u8g2, u8g2_font_profont12_tr); break; 353 | case 342:u8g2_SetFont(u8g2, u8g2_font_profont12_tn); break; 354 | case 343:u8g2_SetFont(u8g2, u8g2_font_profont12_mf); break; 355 | case 344:u8g2_SetFont(u8g2, u8g2_font_profont12_mr); break; 356 | case 345:u8g2_SetFont(u8g2, u8g2_font_profont12_mn); break; 357 | case 346:u8g2_SetFont(u8g2, u8g2_font_profont15_tf); break; 358 | case 347:u8g2_SetFont(u8g2, u8g2_font_profont15_tr); break; 359 | case 348:u8g2_SetFont(u8g2, u8g2_font_profont15_tn); break; 360 | case 349:u8g2_SetFont(u8g2, u8g2_font_profont15_mf); break; 361 | case 350:u8g2_SetFont(u8g2, u8g2_font_profont15_mr); break; 362 | case 351:u8g2_SetFont(u8g2, u8g2_font_profont15_mn); break; 363 | case 352:u8g2_SetFont(u8g2, u8g2_font_profont17_tf); break; 364 | case 353:u8g2_SetFont(u8g2, u8g2_font_profont17_tr); break; 365 | case 354:u8g2_SetFont(u8g2, u8g2_font_profont17_tn); break; 366 | case 355:u8g2_SetFont(u8g2, u8g2_font_profont17_mf); break; 367 | case 356:u8g2_SetFont(u8g2, u8g2_font_profont17_mr); break; 368 | case 357:u8g2_SetFont(u8g2, u8g2_font_profont17_mn); break; 369 | case 358:u8g2_SetFont(u8g2, u8g2_font_profont22_tf); break; 370 | case 359:u8g2_SetFont(u8g2, u8g2_font_profont22_tr); break; 371 | case 360:u8g2_SetFont(u8g2, u8g2_font_profont22_tn); break; 372 | case 361:u8g2_SetFont(u8g2, u8g2_font_profont22_mf); break; 373 | case 362:u8g2_SetFont(u8g2, u8g2_font_profont22_mr); break; 374 | case 363:u8g2_SetFont(u8g2, u8g2_font_profont22_mn); break; 375 | case 364:u8g2_SetFont(u8g2, u8g2_font_profont29_tf); break; 376 | case 365:u8g2_SetFont(u8g2, u8g2_font_profont29_tr); break; 377 | case 366:u8g2_SetFont(u8g2, u8g2_font_profont29_tn); break; 378 | case 367:u8g2_SetFont(u8g2, u8g2_font_profont29_mf); break; 379 | case 368:u8g2_SetFont(u8g2, u8g2_font_profont29_mr); break; 380 | case 369:u8g2_SetFont(u8g2, u8g2_font_profont29_mn); break; 381 | case 370:u8g2_SetFont(u8g2, u8g2_font_mozart_nbp_tf); break; 382 | case 371:u8g2_SetFont(u8g2, u8g2_font_mozart_nbp_tr); break; 383 | case 372:u8g2_SetFont(u8g2, u8g2_font_mozart_nbp_tn); break; 384 | case 373:u8g2_SetFont(u8g2, u8g2_font_mozart_nbp_t_all); break; 385 | case 374:u8g2_SetFont(u8g2, u8g2_font_mozart_nbp_h_all); break; 386 | case 375:u8g2_SetFont(u8g2, u8g2_font_glasstown_nbp_tf); break; 387 | case 376:u8g2_SetFont(u8g2, u8g2_font_glasstown_nbp_tr); break; 388 | case 377:u8g2_SetFont(u8g2, u8g2_font_glasstown_nbp_tn); break; 389 | case 378:u8g2_SetFont(u8g2, u8g2_font_glasstown_nbp_t_all); break; 390 | case 379:u8g2_SetFont(u8g2, u8g2_font_shylock_nbp_tf); break; 391 | case 380:u8g2_SetFont(u8g2, u8g2_font_shylock_nbp_tr); break; 392 | case 381:u8g2_SetFont(u8g2, u8g2_font_shylock_nbp_tn); break; 393 | case 382:u8g2_SetFont(u8g2, u8g2_font_shylock_nbp_t_all); break; 394 | case 383:u8g2_SetFont(u8g2, u8g2_font_roentgen_nbp_tf); break; 395 | case 384:u8g2_SetFont(u8g2, u8g2_font_roentgen_nbp_tr); break; 396 | case 385:u8g2_SetFont(u8g2, u8g2_font_roentgen_nbp_tn); break; 397 | case 386:u8g2_SetFont(u8g2, u8g2_font_roentgen_nbp_t_all); break; 398 | case 387:u8g2_SetFont(u8g2, u8g2_font_roentgen_nbp_h_all); break; 399 | case 388:u8g2_SetFont(u8g2, u8g2_font_calibration_gothic_nbp_tf); break; 400 | case 389:u8g2_SetFont(u8g2, u8g2_font_calibration_gothic_nbp_tr); break; 401 | case 390:u8g2_SetFont(u8g2, u8g2_font_calibration_gothic_nbp_tn); break; 402 | case 391:u8g2_SetFont(u8g2, u8g2_font_calibration_gothic_nbp_t_all); break; 403 | case 392:u8g2_SetFont(u8g2, u8g2_font_smart_patrol_nbp_tf); break; 404 | case 393:u8g2_SetFont(u8g2, u8g2_font_smart_patrol_nbp_tr); break; 405 | case 394:u8g2_SetFont(u8g2, u8g2_font_smart_patrol_nbp_tn); break; 406 | case 395:u8g2_SetFont(u8g2, u8g2_font_prospero_bold_nbp_tf); break; 407 | case 396:u8g2_SetFont(u8g2, u8g2_font_prospero_bold_nbp_tr); break; 408 | case 397:u8g2_SetFont(u8g2, u8g2_font_prospero_bold_nbp_tn); break; 409 | case 398:u8g2_SetFont(u8g2, u8g2_font_prospero_nbp_tf); break; 410 | case 399:u8g2_SetFont(u8g2, u8g2_font_prospero_nbp_tr); break; 411 | case 400:u8g2_SetFont(u8g2, u8g2_font_prospero_nbp_tn); break; 412 | case 401:u8g2_SetFont(u8g2, u8g2_font_balthasar_regular_nbp_tf); break; 413 | case 402:u8g2_SetFont(u8g2, u8g2_font_balthasar_regular_nbp_tr); break; 414 | case 403:u8g2_SetFont(u8g2, u8g2_font_balthasar_regular_nbp_tn); break; 415 | case 404:u8g2_SetFont(u8g2, u8g2_font_balthasar_titling_nbp_tf); break; 416 | case 405:u8g2_SetFont(u8g2, u8g2_font_balthasar_titling_nbp_tr); break; 417 | case 406:u8g2_SetFont(u8g2, u8g2_font_balthasar_titling_nbp_tn); break; 418 | case 407:u8g2_SetFont(u8g2, u8g2_font_synchronizer_nbp_tf); break; 419 | case 408:u8g2_SetFont(u8g2, u8g2_font_synchronizer_nbp_tr); break; 420 | case 409:u8g2_SetFont(u8g2, u8g2_font_synchronizer_nbp_tn); break; 421 | case 410:u8g2_SetFont(u8g2, u8g2_font_mercutio_basic_nbp_tf); break; 422 | case 411:u8g2_SetFont(u8g2, u8g2_font_mercutio_basic_nbp_tr); break; 423 | case 412:u8g2_SetFont(u8g2, u8g2_font_mercutio_basic_nbp_tn); break; 424 | case 413:u8g2_SetFont(u8g2, u8g2_font_mercutio_basic_nbp_t_all); break; 425 | case 414:u8g2_SetFont(u8g2, u8g2_font_mercutio_sc_nbp_tf); break; 426 | case 415:u8g2_SetFont(u8g2, u8g2_font_mercutio_sc_nbp_tr); break; 427 | case 416:u8g2_SetFont(u8g2, u8g2_font_mercutio_sc_nbp_tn); break; 428 | case 417:u8g2_SetFont(u8g2, u8g2_font_mercutio_sc_nbp_t_all); break; 429 | case 418:u8g2_SetFont(u8g2, u8g2_font_miranda_nbp_tf); break; 430 | case 419:u8g2_SetFont(u8g2, u8g2_font_miranda_nbp_tr); break; 431 | case 420:u8g2_SetFont(u8g2, u8g2_font_miranda_nbp_tn); break; 432 | case 421:u8g2_SetFont(u8g2, u8g2_font_nine_by_five_nbp_tf); break; 433 | case 422:u8g2_SetFont(u8g2, u8g2_font_nine_by_five_nbp_tr); break; 434 | case 423:u8g2_SetFont(u8g2, u8g2_font_nine_by_five_nbp_tn); break; 435 | case 424:u8g2_SetFont(u8g2, u8g2_font_nine_by_five_nbp_t_all); break; 436 | case 425:u8g2_SetFont(u8g2, u8g2_font_rosencrantz_nbp_tf); break; 437 | case 426:u8g2_SetFont(u8g2, u8g2_font_rosencrantz_nbp_tr); break; 438 | case 427:u8g2_SetFont(u8g2, u8g2_font_rosencrantz_nbp_tn); break; 439 | case 428:u8g2_SetFont(u8g2, u8g2_font_rosencrantz_nbp_t_all); break; 440 | case 429:u8g2_SetFont(u8g2, u8g2_font_guildenstern_nbp_tf); break; 441 | case 430:u8g2_SetFont(u8g2, u8g2_font_guildenstern_nbp_tr); break; 442 | case 431:u8g2_SetFont(u8g2, u8g2_font_guildenstern_nbp_tn); break; 443 | case 432:u8g2_SetFont(u8g2, u8g2_font_guildenstern_nbp_t_all); break; 444 | case 433:u8g2_SetFont(u8g2, u8g2_font_astragal_nbp_tf); break; 445 | case 434:u8g2_SetFont(u8g2, u8g2_font_astragal_nbp_tr); break; 446 | case 435:u8g2_SetFont(u8g2, u8g2_font_astragal_nbp_tn); break; 447 | case 436:u8g2_SetFont(u8g2, u8g2_font_etl14thai_t); break; 448 | case 437:u8g2_SetFont(u8g2, u8g2_font_etl16thai_t); break; 449 | case 438:u8g2_SetFont(u8g2, u8g2_font_etl24thai_t); break; 450 | case 439:u8g2_SetFont(u8g2, u8g2_font_crox1cb_tf); break; 451 | case 440:u8g2_SetFont(u8g2, u8g2_font_crox1cb_tr); break; 452 | case 441:u8g2_SetFont(u8g2, u8g2_font_crox1cb_tn); break; 453 | case 442:u8g2_SetFont(u8g2, u8g2_font_crox1cb_mf); break; 454 | case 443:u8g2_SetFont(u8g2, u8g2_font_crox1cb_mr); break; 455 | case 444:u8g2_SetFont(u8g2, u8g2_font_crox1cb_mn); break; 456 | case 445:u8g2_SetFont(u8g2, u8g2_font_crox1c_tf); break; 457 | case 446:u8g2_SetFont(u8g2, u8g2_font_crox1c_tr); break; 458 | case 447:u8g2_SetFont(u8g2, u8g2_font_crox1c_tn); break; 459 | case 448:u8g2_SetFont(u8g2, u8g2_font_crox1c_mf); break; 460 | case 449:u8g2_SetFont(u8g2, u8g2_font_crox1c_mr); break; 461 | case 450:u8g2_SetFont(u8g2, u8g2_font_crox1c_mn); break; 462 | case 451:u8g2_SetFont(u8g2, u8g2_font_crox1hb_tf); break; 463 | case 452:u8g2_SetFont(u8g2, u8g2_font_crox1hb_tr); break; 464 | case 453:u8g2_SetFont(u8g2, u8g2_font_crox1hb_tn); break; 465 | case 454:u8g2_SetFont(u8g2, u8g2_font_crox1h_tf); break; 466 | case 455:u8g2_SetFont(u8g2, u8g2_font_crox1h_tr); break; 467 | case 456:u8g2_SetFont(u8g2, u8g2_font_crox1h_tn); break; 468 | case 457:u8g2_SetFont(u8g2, u8g2_font_crox1tb_tf); break; 469 | case 458:u8g2_SetFont(u8g2, u8g2_font_crox1tb_tr); break; 470 | case 459:u8g2_SetFont(u8g2, u8g2_font_crox1tb_tn); break; 471 | case 460:u8g2_SetFont(u8g2, u8g2_font_crox1t_tf); break; 472 | case 461:u8g2_SetFont(u8g2, u8g2_font_crox1t_tr); break; 473 | case 462:u8g2_SetFont(u8g2, u8g2_font_crox1t_tn); break; 474 | case 463:u8g2_SetFont(u8g2, u8g2_font_crox2cb_tf); break; 475 | case 464:u8g2_SetFont(u8g2, u8g2_font_crox2cb_tr); break; 476 | case 465:u8g2_SetFont(u8g2, u8g2_font_crox2cb_tn); break; 477 | case 466:u8g2_SetFont(u8g2, u8g2_font_crox2cb_mf); break; 478 | case 467:u8g2_SetFont(u8g2, u8g2_font_crox2cb_mr); break; 479 | case 468:u8g2_SetFont(u8g2, u8g2_font_crox2cb_mn); break; 480 | case 469:u8g2_SetFont(u8g2, u8g2_font_crox2c_tf); break; 481 | case 470:u8g2_SetFont(u8g2, u8g2_font_crox2c_tr); break; 482 | case 471:u8g2_SetFont(u8g2, u8g2_font_crox2c_tn); break; 483 | case 472:u8g2_SetFont(u8g2, u8g2_font_crox2c_mf); break; 484 | case 473:u8g2_SetFont(u8g2, u8g2_font_crox2c_mr); break; 485 | case 474:u8g2_SetFont(u8g2, u8g2_font_crox2c_mn); break; 486 | case 475:u8g2_SetFont(u8g2, u8g2_font_crox2hb_tf); break; 487 | case 476:u8g2_SetFont(u8g2, u8g2_font_crox2hb_tr); break; 488 | case 477:u8g2_SetFont(u8g2, u8g2_font_crox2hb_tn); break; 489 | case 478:u8g2_SetFont(u8g2, u8g2_font_crox2h_tf); break; 490 | case 479:u8g2_SetFont(u8g2, u8g2_font_crox2h_tr); break; 491 | case 480:u8g2_SetFont(u8g2, u8g2_font_crox2h_tn); break; 492 | case 481:u8g2_SetFont(u8g2, u8g2_font_crox2tb_tf); break; 493 | case 482:u8g2_SetFont(u8g2, u8g2_font_crox2tb_tr); break; 494 | case 483:u8g2_SetFont(u8g2, u8g2_font_crox2tb_tn); break; 495 | case 484:u8g2_SetFont(u8g2, u8g2_font_crox2t_tf); break; 496 | case 485:u8g2_SetFont(u8g2, u8g2_font_crox2t_tr); break; 497 | case 486:u8g2_SetFont(u8g2, u8g2_font_crox2t_tn); break; 498 | case 487:u8g2_SetFont(u8g2, u8g2_font_crox3cb_tf); break; 499 | case 488:u8g2_SetFont(u8g2, u8g2_font_crox3cb_tr); break; 500 | case 489:u8g2_SetFont(u8g2, u8g2_font_crox3cb_tn); break; 501 | case 490:u8g2_SetFont(u8g2, u8g2_font_crox3cb_mf); break; 502 | case 491:u8g2_SetFont(u8g2, u8g2_font_crox3cb_mr); break; 503 | case 492:u8g2_SetFont(u8g2, u8g2_font_crox3cb_mn); break; 504 | case 493:u8g2_SetFont(u8g2, u8g2_font_crox3c_tf); break; 505 | case 494:u8g2_SetFont(u8g2, u8g2_font_crox3c_tr); break; 506 | case 495:u8g2_SetFont(u8g2, u8g2_font_crox3c_tn); break; 507 | case 496:u8g2_SetFont(u8g2, u8g2_font_crox3c_mf); break; 508 | case 497:u8g2_SetFont(u8g2, u8g2_font_crox3c_mr); break; 509 | case 498:u8g2_SetFont(u8g2, u8g2_font_crox3c_mn); break; 510 | case 499:u8g2_SetFont(u8g2, u8g2_font_crox3hb_tf); break; 511 | case 500:u8g2_SetFont(u8g2, u8g2_font_crox3hb_tr); break; 512 | case 501:u8g2_SetFont(u8g2, u8g2_font_crox3hb_tn); break; 513 | case 502:u8g2_SetFont(u8g2, u8g2_font_crox3h_tf); break; 514 | case 503:u8g2_SetFont(u8g2, u8g2_font_crox3h_tr); break; 515 | case 504:u8g2_SetFont(u8g2, u8g2_font_crox3h_tn); break; 516 | case 505:u8g2_SetFont(u8g2, u8g2_font_crox3tb_tf); break; 517 | case 506:u8g2_SetFont(u8g2, u8g2_font_crox3tb_tr); break; 518 | case 507:u8g2_SetFont(u8g2, u8g2_font_crox3tb_tn); break; 519 | case 508:u8g2_SetFont(u8g2, u8g2_font_crox3t_tf); break; 520 | case 509:u8g2_SetFont(u8g2, u8g2_font_crox3t_tr); break; 521 | case 510:u8g2_SetFont(u8g2, u8g2_font_crox3t_tn); break; 522 | case 511:u8g2_SetFont(u8g2, u8g2_font_crox4hb_tf); break; 523 | case 512:u8g2_SetFont(u8g2, u8g2_font_crox4hb_tr); break; 524 | case 513:u8g2_SetFont(u8g2, u8g2_font_crox4hb_tn); break; 525 | case 514:u8g2_SetFont(u8g2, u8g2_font_crox4h_tf); break; 526 | case 515:u8g2_SetFont(u8g2, u8g2_font_crox4h_tr); break; 527 | case 516:u8g2_SetFont(u8g2, u8g2_font_crox4h_tn); break; 528 | case 517:u8g2_SetFont(u8g2, u8g2_font_crox4tb_tf); break; 529 | case 518:u8g2_SetFont(u8g2, u8g2_font_crox4tb_tr); break; 530 | case 519:u8g2_SetFont(u8g2, u8g2_font_crox4tb_tn); break; 531 | case 520:u8g2_SetFont(u8g2, u8g2_font_crox4t_tf); break; 532 | case 521:u8g2_SetFont(u8g2, u8g2_font_crox4t_tr); break; 533 | case 522:u8g2_SetFont(u8g2, u8g2_font_crox4t_tn); break; 534 | case 523:u8g2_SetFont(u8g2, u8g2_font_crox5hb_tf); break; 535 | case 524:u8g2_SetFont(u8g2, u8g2_font_crox5hb_tr); break; 536 | case 525:u8g2_SetFont(u8g2, u8g2_font_crox5hb_tn); break; 537 | case 526:u8g2_SetFont(u8g2, u8g2_font_crox5h_tf); break; 538 | case 527:u8g2_SetFont(u8g2, u8g2_font_crox5h_tr); break; 539 | case 528:u8g2_SetFont(u8g2, u8g2_font_crox5h_tn); break; 540 | case 529:u8g2_SetFont(u8g2, u8g2_font_crox5tb_tf); break; 541 | case 530:u8g2_SetFont(u8g2, u8g2_font_crox5tb_tr); break; 542 | case 531:u8g2_SetFont(u8g2, u8g2_font_crox5tb_tn); break; 543 | case 532:u8g2_SetFont(u8g2, u8g2_font_crox5t_tf); break; 544 | case 533:u8g2_SetFont(u8g2, u8g2_font_crox5t_tr); break; 545 | case 534:u8g2_SetFont(u8g2, u8g2_font_crox5t_tn); break; 546 | case 535:u8g2_SetFont(u8g2, u8g2_font_cu12_tf); break; 547 | case 536:u8g2_SetFont(u8g2, u8g2_font_cu12_tr); break; 548 | case 537:u8g2_SetFont(u8g2, u8g2_font_cu12_tn); break; 549 | case 538:u8g2_SetFont(u8g2, u8g2_font_cu12_te); break; 550 | case 539:u8g2_SetFont(u8g2, u8g2_font_cu12_hf); break; 551 | case 540:u8g2_SetFont(u8g2, u8g2_font_cu12_hr); break; 552 | case 541:u8g2_SetFont(u8g2, u8g2_font_cu12_hn); break; 553 | case 542:u8g2_SetFont(u8g2, u8g2_font_cu12_he); break; 554 | case 543:u8g2_SetFont(u8g2, u8g2_font_cu12_mf); break; 555 | case 544:u8g2_SetFont(u8g2, u8g2_font_cu12_mr); break; 556 | case 545:u8g2_SetFont(u8g2, u8g2_font_cu12_mn); break; 557 | case 546:u8g2_SetFont(u8g2, u8g2_font_cu12_me); break; 558 | case 547:u8g2_SetFont(u8g2, u8g2_font_cu12_t_symbols); break; 559 | case 548:u8g2_SetFont(u8g2, u8g2_font_cu12_h_symbols); break; 560 | case 549:u8g2_SetFont(u8g2, u8g2_font_cu12_t_greek); break; 561 | case 550:u8g2_SetFont(u8g2, u8g2_font_cu12_t_cyrillic); break; 562 | case 551:u8g2_SetFont(u8g2, u8g2_font_cu12_t_tibetan); break; 563 | case 552:u8g2_SetFont(u8g2, u8g2_font_cu12_t_hebrew); break; 564 | case 553:u8g2_SetFont(u8g2, u8g2_font_cu12_t_arabic); break; 565 | case 554:u8g2_SetFont(u8g2, u8g2_font_unifont_t_latin); break; 566 | case 555:u8g2_SetFont(u8g2, u8g2_font_unifont_t_extended); break; 567 | case 556:u8g2_SetFont(u8g2, u8g2_font_unifont_t_greek); break; 568 | case 557:u8g2_SetFont(u8g2, u8g2_font_unifont_t_cyrillic); break; 569 | case 558:u8g2_SetFont(u8g2, u8g2_font_unifont_t_hebrew); break; 570 | case 559:u8g2_SetFont(u8g2, u8g2_font_unifont_t_bengali); break; 571 | case 560:u8g2_SetFont(u8g2, u8g2_font_unifont_t_tibetan); break; 572 | case 561:u8g2_SetFont(u8g2, u8g2_font_unifont_t_urdu); break; 573 | case 562:u8g2_SetFont(u8g2, u8g2_font_unifont_t_polish); break; 574 | case 563:u8g2_SetFont(u8g2, u8g2_font_unifont_t_arabic); break; 575 | case 564:u8g2_SetFont(u8g2, u8g2_font_unifont_t_chinese1); break; 576 | case 565:u8g2_SetFont(u8g2, u8g2_font_unifont_t_chinese2); break; 577 | case 566:u8g2_SetFont(u8g2, u8g2_font_unifont_t_chinese3); break; 578 | case 567:u8g2_SetFont(u8g2, u8g2_font_unifont_t_japanese1); break; 579 | case 568:u8g2_SetFont(u8g2, u8g2_font_unifont_t_japanese2); break; 580 | case 569:u8g2_SetFont(u8g2, u8g2_font_unifont_t_korean1); break; 581 | case 570:u8g2_SetFont(u8g2, u8g2_font_unifont_t_korean2); break; 582 | case 571:u8g2_SetFont(u8g2, u8g2_font_gb16st_t_1); break; 583 | case 572:u8g2_SetFont(u8g2, u8g2_font_gb16st_t_2); break; 584 | case 573:u8g2_SetFont(u8g2, u8g2_font_gb16st_t_3); break; 585 | case 574:u8g2_SetFont(u8g2, u8g2_font_gb24st_t_1); break; 586 | case 575:u8g2_SetFont(u8g2, u8g2_font_gb24st_t_2); break; 587 | case 576:u8g2_SetFont(u8g2, u8g2_font_gb24st_t_3); break; 588 | case 577:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_chinese1); break; 589 | case 578:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_chinese2); break; 590 | case 579:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_chinese3); break; 591 | case 580:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_gb2312); break; 592 | case 581:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_gb2312a); break; 593 | case 582:u8g2_SetFont(u8g2, u8g2_font_wqy12_t_gb2312b); break; 594 | case 583:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_chinese1); break; 595 | case 584:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_chinese2); break; 596 | case 585:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_chinese3); break; 597 | case 586:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_gb2312); break; 598 | case 587:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_gb2312a); break; 599 | case 588:u8g2_SetFont(u8g2, u8g2_font_wqy13_t_gb2312b); break; 600 | case 589:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_chinese1); break; 601 | case 590:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_chinese2); break; 602 | case 591:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_chinese3); break; 603 | case 592:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_gb2312); break; 604 | case 593:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_gb2312a); break; 605 | case 594:u8g2_SetFont(u8g2, u8g2_font_wqy14_t_gb2312b); break; 606 | case 595:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_chinese1); break; 607 | case 596:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_chinese2); break; 608 | case 597:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_chinese3); break; 609 | case 598:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_gb2312); break; 610 | case 599:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_gb2312a); break; 611 | case 600:u8g2_SetFont(u8g2, u8g2_font_wqy15_t_gb2312b); break; 612 | case 601:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_chinese1); break; 613 | case 602:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_chinese2); break; 614 | case 603:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_chinese3); break; 615 | case 604:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_gb2312); break; 616 | case 605:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_gb2312a); break; 617 | case 606:u8g2_SetFont(u8g2, u8g2_font_wqy16_t_gb2312b); break; 618 | case 607:u8g2_SetFont(u8g2, u8g2_font_b10_t_japanese1); break; 619 | case 608:u8g2_SetFont(u8g2, u8g2_font_b10_t_japanese2); break; 620 | case 609:u8g2_SetFont(u8g2, u8g2_font_b10_b_t_japanese1); break; 621 | case 610:u8g2_SetFont(u8g2, u8g2_font_b10_b_t_japanese2); break; 622 | case 611:u8g2_SetFont(u8g2, u8g2_font_f10_t_japanese1); break; 623 | case 612:u8g2_SetFont(u8g2, u8g2_font_f10_t_japanese2); break; 624 | case 613:u8g2_SetFont(u8g2, u8g2_font_f10_b_t_japanese1); break; 625 | case 614:u8g2_SetFont(u8g2, u8g2_font_f10_b_t_japanese2); break; 626 | case 615:u8g2_SetFont(u8g2, u8g2_font_b12_t_japanese1); break; 627 | case 616:u8g2_SetFont(u8g2, u8g2_font_b12_t_japanese2); break; 628 | case 617:u8g2_SetFont(u8g2, u8g2_font_b12_b_t_japanese1); break; 629 | case 618:u8g2_SetFont(u8g2, u8g2_font_b12_b_t_japanese2); break; 630 | case 619:u8g2_SetFont(u8g2, u8g2_font_f12_t_japanese1); break; 631 | case 620:u8g2_SetFont(u8g2, u8g2_font_f12_t_japanese2); break; 632 | case 621:u8g2_SetFont(u8g2, u8g2_font_f12_b_t_japanese1); break; 633 | case 622:u8g2_SetFont(u8g2, u8g2_font_f12_b_t_japanese2); break; 634 | case 623:u8g2_SetFont(u8g2, u8g2_font_b16_t_japanese1); break; 635 | case 624:u8g2_SetFont(u8g2, u8g2_font_b16_t_japanese2); break; 636 | case 625:u8g2_SetFont(u8g2, u8g2_font_b16_b_t_japanese1); break; 637 | case 626:u8g2_SetFont(u8g2, u8g2_font_b16_b_t_japanese2); break; 638 | case 627:u8g2_SetFont(u8g2, u8g2_font_f16_t_japanese1); break; 639 | case 628:u8g2_SetFont(u8g2, u8g2_font_f16_t_japanese2); break; 640 | case 629:u8g2_SetFont(u8g2, u8g2_font_f16_b_t_japanese1); break; 641 | case 630:u8g2_SetFont(u8g2, u8g2_font_f16_b_t_japanese2); break; 642 | case 631:u8g2_SetFont(u8g2, u8g2_font_unifont_t_symbols); break; 643 | case 632:u8g2_SetFont(u8g2, u8g2_font_unifont_h_symbols); break; 644 | case 633:u8g2_SetFont(u8g2, u8g2_font_artossans8_8r); break; 645 | case 634:u8g2_SetFont(u8g2, u8g2_font_artossans8_8n); break; 646 | case 635:u8g2_SetFont(u8g2, u8g2_font_artossans8_8u); break; 647 | case 636:u8g2_SetFont(u8g2, u8g2_font_artosserif8_8r); break; 648 | case 637:u8g2_SetFont(u8g2, u8g2_font_artosserif8_8n); break; 649 | case 638:u8g2_SetFont(u8g2, u8g2_font_artosserif8_8u); break; 650 | case 639:u8g2_SetFont(u8g2, u8g2_font_chroma48medium8_8r); break; 651 | case 640:u8g2_SetFont(u8g2, u8g2_font_chroma48medium8_8n); break; 652 | case 641:u8g2_SetFont(u8g2, u8g2_font_chroma48medium8_8u); break; 653 | case 642:u8g2_SetFont(u8g2, u8g2_font_saikyosansbold8_8n); break; 654 | case 643:u8g2_SetFont(u8g2, u8g2_font_saikyosansbold8_8u); break; 655 | case 644:u8g2_SetFont(u8g2, u8g2_font_torussansbold8_8r); break; 656 | case 645:u8g2_SetFont(u8g2, u8g2_font_torussansbold8_8n); break; 657 | case 646:u8g2_SetFont(u8g2, u8g2_font_torussansbold8_8u); break; 658 | case 647:u8g2_SetFont(u8g2, u8g2_font_victoriabold8_8r); break; 659 | case 648:u8g2_SetFont(u8g2, u8g2_font_victoriabold8_8n); break; 660 | case 649:u8g2_SetFont(u8g2, u8g2_font_victoriabold8_8u); break; 661 | case 650:u8g2_SetFont(u8g2, u8g2_font_victoriamedium8_8r); break; 662 | case 651:u8g2_SetFont(u8g2, u8g2_font_victoriamedium8_8n); break; 663 | case 652:u8g2_SetFont(u8g2, u8g2_font_victoriamedium8_8u); break; 664 | case 653:u8g2_SetFont(u8g2, u8g2_font_courB08_tf); break; 665 | case 654:u8g2_SetFont(u8g2, u8g2_font_courB08_tr); break; 666 | case 655:u8g2_SetFont(u8g2, u8g2_font_courB08_tn); break; 667 | case 656:u8g2_SetFont(u8g2, u8g2_font_courB10_tf); break; 668 | case 657:u8g2_SetFont(u8g2, u8g2_font_courB10_tr); break; 669 | case 658:u8g2_SetFont(u8g2, u8g2_font_courB10_tn); break; 670 | case 659:u8g2_SetFont(u8g2, u8g2_font_courB12_tf); break; 671 | case 660:u8g2_SetFont(u8g2, u8g2_font_courB12_tr); break; 672 | case 661:u8g2_SetFont(u8g2, u8g2_font_courB12_tn); break; 673 | case 662:u8g2_SetFont(u8g2, u8g2_font_courB14_tf); break; 674 | case 663:u8g2_SetFont(u8g2, u8g2_font_courB14_tr); break; 675 | case 664:u8g2_SetFont(u8g2, u8g2_font_courB14_tn); break; 676 | case 665:u8g2_SetFont(u8g2, u8g2_font_courB18_tf); break; 677 | case 666:u8g2_SetFont(u8g2, u8g2_font_courB18_tr); break; 678 | case 667:u8g2_SetFont(u8g2, u8g2_font_courB18_tn); break; 679 | case 668:u8g2_SetFont(u8g2, u8g2_font_courB24_tf); break; 680 | case 669:u8g2_SetFont(u8g2, u8g2_font_courB24_tr); break; 681 | case 670:u8g2_SetFont(u8g2, u8g2_font_courB24_tn); break; 682 | case 671:u8g2_SetFont(u8g2, u8g2_font_courR08_tf); break; 683 | case 672:u8g2_SetFont(u8g2, u8g2_font_courR08_tr); break; 684 | case 673:u8g2_SetFont(u8g2, u8g2_font_courR08_tn); break; 685 | case 674:u8g2_SetFont(u8g2, u8g2_font_courR10_tf); break; 686 | case 675:u8g2_SetFont(u8g2, u8g2_font_courR10_tr); break; 687 | case 676:u8g2_SetFont(u8g2, u8g2_font_courR10_tn); break; 688 | case 677:u8g2_SetFont(u8g2, u8g2_font_courR12_tf); break; 689 | case 678:u8g2_SetFont(u8g2, u8g2_font_courR12_tr); break; 690 | case 679:u8g2_SetFont(u8g2, u8g2_font_courR12_tn); break; 691 | case 680:u8g2_SetFont(u8g2, u8g2_font_courR14_tf); break; 692 | case 681:u8g2_SetFont(u8g2, u8g2_font_courR14_tr); break; 693 | case 682:u8g2_SetFont(u8g2, u8g2_font_courR14_tn); break; 694 | case 683:u8g2_SetFont(u8g2, u8g2_font_courR18_tf); break; 695 | case 684:u8g2_SetFont(u8g2, u8g2_font_courR18_tr); break; 696 | case 685:u8g2_SetFont(u8g2, u8g2_font_courR18_tn); break; 697 | case 686:u8g2_SetFont(u8g2, u8g2_font_courR24_tf); break; 698 | case 687:u8g2_SetFont(u8g2, u8g2_font_courR24_tr); break; 699 | case 688:u8g2_SetFont(u8g2, u8g2_font_courR24_tn); break; 700 | case 689:u8g2_SetFont(u8g2, u8g2_font_helvB08_tf); break; 701 | case 690:u8g2_SetFont(u8g2, u8g2_font_helvB08_tr); break; 702 | case 691:u8g2_SetFont(u8g2, u8g2_font_helvB08_tn); break; 703 | case 692:u8g2_SetFont(u8g2, u8g2_font_helvB08_te); break; 704 | case 693:u8g2_SetFont(u8g2, u8g2_font_helvB10_tf); break; 705 | case 694:u8g2_SetFont(u8g2, u8g2_font_helvB10_tr); break; 706 | case 695:u8g2_SetFont(u8g2, u8g2_font_helvB10_tn); break; 707 | case 696:u8g2_SetFont(u8g2, u8g2_font_helvB10_te); break; 708 | case 697:u8g2_SetFont(u8g2, u8g2_font_helvB12_tf); break; 709 | case 698:u8g2_SetFont(u8g2, u8g2_font_helvB12_tr); break; 710 | case 699:u8g2_SetFont(u8g2, u8g2_font_helvB12_tn); break; 711 | case 700:u8g2_SetFont(u8g2, u8g2_font_helvB12_te); break; 712 | case 701:u8g2_SetFont(u8g2, u8g2_font_helvB14_tf); break; 713 | case 702:u8g2_SetFont(u8g2, u8g2_font_helvB14_tr); break; 714 | case 703:u8g2_SetFont(u8g2, u8g2_font_helvB14_tn); break; 715 | case 704:u8g2_SetFont(u8g2, u8g2_font_helvB14_te); break; 716 | case 705:u8g2_SetFont(u8g2, u8g2_font_helvB18_tf); break; 717 | case 706:u8g2_SetFont(u8g2, u8g2_font_helvB18_tr); break; 718 | case 707:u8g2_SetFont(u8g2, u8g2_font_helvB18_tn); break; 719 | case 708:u8g2_SetFont(u8g2, u8g2_font_helvB18_te); break; 720 | case 709:u8g2_SetFont(u8g2, u8g2_font_helvB24_tf); break; 721 | case 710:u8g2_SetFont(u8g2, u8g2_font_helvB24_tr); break; 722 | case 711:u8g2_SetFont(u8g2, u8g2_font_helvB24_tn); break; 723 | case 712:u8g2_SetFont(u8g2, u8g2_font_helvB24_te); break; 724 | case 713:u8g2_SetFont(u8g2, u8g2_font_helvR08_tf); break; 725 | case 714:u8g2_SetFont(u8g2, u8g2_font_helvR08_tr); break; 726 | case 715:u8g2_SetFont(u8g2, u8g2_font_helvR08_tn); break; 727 | case 716:u8g2_SetFont(u8g2, u8g2_font_helvR08_te); break; 728 | case 717:u8g2_SetFont(u8g2, u8g2_font_helvR10_tf); break; 729 | case 718:u8g2_SetFont(u8g2, u8g2_font_helvR10_tr); break; 730 | case 719:u8g2_SetFont(u8g2, u8g2_font_helvR10_tn); break; 731 | case 720:u8g2_SetFont(u8g2, u8g2_font_helvR10_te); break; 732 | case 721:u8g2_SetFont(u8g2, u8g2_font_helvR12_tf); break; 733 | case 722:u8g2_SetFont(u8g2, u8g2_font_helvR12_tr); break; 734 | case 723:u8g2_SetFont(u8g2, u8g2_font_helvR12_tn); break; 735 | case 724:u8g2_SetFont(u8g2, u8g2_font_helvR12_te); break; 736 | case 725:u8g2_SetFont(u8g2, u8g2_font_helvR14_tf); break; 737 | case 726:u8g2_SetFont(u8g2, u8g2_font_helvR14_tr); break; 738 | case 727:u8g2_SetFont(u8g2, u8g2_font_helvR14_tn); break; 739 | case 728:u8g2_SetFont(u8g2, u8g2_font_helvR14_te); break; 740 | case 729:u8g2_SetFont(u8g2, u8g2_font_helvR18_tf); break; 741 | case 730:u8g2_SetFont(u8g2, u8g2_font_helvR18_tr); break; 742 | case 731:u8g2_SetFont(u8g2, u8g2_font_helvR18_tn); break; 743 | case 732:u8g2_SetFont(u8g2, u8g2_font_helvR18_te); break; 744 | case 733:u8g2_SetFont(u8g2, u8g2_font_helvR24_tf); break; 745 | case 734:u8g2_SetFont(u8g2, u8g2_font_helvR24_tr); break; 746 | case 735:u8g2_SetFont(u8g2, u8g2_font_helvR24_tn); break; 747 | case 736:u8g2_SetFont(u8g2, u8g2_font_helvR24_te); break; 748 | case 737:u8g2_SetFont(u8g2, u8g2_font_ncenB08_tf); break; 749 | case 738:u8g2_SetFont(u8g2, u8g2_font_ncenB08_tr); break; 750 | case 739:u8g2_SetFont(u8g2, u8g2_font_ncenB08_tn); break; 751 | case 740:u8g2_SetFont(u8g2, u8g2_font_ncenB08_te); break; 752 | case 741:u8g2_SetFont(u8g2, u8g2_font_ncenB10_tf); break; 753 | case 742:u8g2_SetFont(u8g2, u8g2_font_ncenB10_tr); break; 754 | case 743:u8g2_SetFont(u8g2, u8g2_font_ncenB10_tn); break; 755 | case 744:u8g2_SetFont(u8g2, u8g2_font_ncenB10_te); break; 756 | case 745:u8g2_SetFont(u8g2, u8g2_font_ncenB12_tf); break; 757 | case 746:u8g2_SetFont(u8g2, u8g2_font_ncenB12_tr); break; 758 | case 747:u8g2_SetFont(u8g2, u8g2_font_ncenB12_tn); break; 759 | case 748:u8g2_SetFont(u8g2, u8g2_font_ncenB12_te); break; 760 | case 749:u8g2_SetFont(u8g2, u8g2_font_ncenB14_tf); break; 761 | case 750:u8g2_SetFont(u8g2, u8g2_font_ncenB14_tr); break; 762 | case 751:u8g2_SetFont(u8g2, u8g2_font_ncenB14_tn); break; 763 | case 752:u8g2_SetFont(u8g2, u8g2_font_ncenB14_te); break; 764 | case 753:u8g2_SetFont(u8g2, u8g2_font_ncenB18_tf); break; 765 | case 754:u8g2_SetFont(u8g2, u8g2_font_ncenB18_tr); break; 766 | case 755:u8g2_SetFont(u8g2, u8g2_font_ncenB18_tn); break; 767 | case 756:u8g2_SetFont(u8g2, u8g2_font_ncenB18_te); break; 768 | case 757:u8g2_SetFont(u8g2, u8g2_font_ncenB24_tf); break; 769 | case 758:u8g2_SetFont(u8g2, u8g2_font_ncenB24_tr); break; 770 | case 759:u8g2_SetFont(u8g2, u8g2_font_ncenB24_tn); break; 771 | case 760:u8g2_SetFont(u8g2, u8g2_font_ncenB24_te); break; 772 | case 761:u8g2_SetFont(u8g2, u8g2_font_ncenR08_tf); break; 773 | case 762:u8g2_SetFont(u8g2, u8g2_font_ncenR08_tr); break; 774 | case 763:u8g2_SetFont(u8g2, u8g2_font_ncenR08_tn); break; 775 | case 764:u8g2_SetFont(u8g2, u8g2_font_ncenR08_te); break; 776 | case 765:u8g2_SetFont(u8g2, u8g2_font_ncenR10_tf); break; 777 | case 766:u8g2_SetFont(u8g2, u8g2_font_ncenR10_tr); break; 778 | case 767:u8g2_SetFont(u8g2, u8g2_font_ncenR10_tn); break; 779 | case 768:u8g2_SetFont(u8g2, u8g2_font_ncenR10_te); break; 780 | case 769:u8g2_SetFont(u8g2, u8g2_font_ncenR12_tf); break; 781 | case 770:u8g2_SetFont(u8g2, u8g2_font_ncenR12_tr); break; 782 | case 771:u8g2_SetFont(u8g2, u8g2_font_ncenR12_tn); break; 783 | case 772:u8g2_SetFont(u8g2, u8g2_font_ncenR12_te); break; 784 | case 773:u8g2_SetFont(u8g2, u8g2_font_ncenR14_tf); break; 785 | case 774:u8g2_SetFont(u8g2, u8g2_font_ncenR14_tr); break; 786 | case 775:u8g2_SetFont(u8g2, u8g2_font_ncenR14_tn); break; 787 | case 776:u8g2_SetFont(u8g2, u8g2_font_ncenR14_te); break; 788 | case 777:u8g2_SetFont(u8g2, u8g2_font_ncenR18_tf); break; 789 | case 778:u8g2_SetFont(u8g2, u8g2_font_ncenR18_tr); break; 790 | case 779:u8g2_SetFont(u8g2, u8g2_font_ncenR18_tn); break; 791 | case 780:u8g2_SetFont(u8g2, u8g2_font_ncenR18_te); break; 792 | case 781:u8g2_SetFont(u8g2, u8g2_font_ncenR24_tf); break; 793 | case 782:u8g2_SetFont(u8g2, u8g2_font_ncenR24_tr); break; 794 | case 783:u8g2_SetFont(u8g2, u8g2_font_ncenR24_tn); break; 795 | case 784:u8g2_SetFont(u8g2, u8g2_font_ncenR24_te); break; 796 | case 785:u8g2_SetFont(u8g2, u8g2_font_timB08_tf); break; 797 | case 786:u8g2_SetFont(u8g2, u8g2_font_timB08_tr); break; 798 | case 787:u8g2_SetFont(u8g2, u8g2_font_timB08_tn); break; 799 | case 788:u8g2_SetFont(u8g2, u8g2_font_timB10_tf); break; 800 | case 789:u8g2_SetFont(u8g2, u8g2_font_timB10_tr); break; 801 | case 790:u8g2_SetFont(u8g2, u8g2_font_timB10_tn); break; 802 | case 791:u8g2_SetFont(u8g2, u8g2_font_timB12_tf); break; 803 | case 792:u8g2_SetFont(u8g2, u8g2_font_timB12_tr); break; 804 | case 793:u8g2_SetFont(u8g2, u8g2_font_timB12_tn); break; 805 | case 794:u8g2_SetFont(u8g2, u8g2_font_timB14_tf); break; 806 | case 795:u8g2_SetFont(u8g2, u8g2_font_timB14_tr); break; 807 | case 796:u8g2_SetFont(u8g2, u8g2_font_timB14_tn); break; 808 | case 797:u8g2_SetFont(u8g2, u8g2_font_timB18_tf); break; 809 | case 798:u8g2_SetFont(u8g2, u8g2_font_timB18_tr); break; 810 | case 799:u8g2_SetFont(u8g2, u8g2_font_timB18_tn); break; 811 | case 800:u8g2_SetFont(u8g2, u8g2_font_timB24_tf); break; 812 | case 801:u8g2_SetFont(u8g2, u8g2_font_timB24_tr); break; 813 | case 802:u8g2_SetFont(u8g2, u8g2_font_timB24_tn); break; 814 | case 803:u8g2_SetFont(u8g2, u8g2_font_timR08_tf); break; 815 | case 804:u8g2_SetFont(u8g2, u8g2_font_timR08_tr); break; 816 | case 805:u8g2_SetFont(u8g2, u8g2_font_timR08_tn); break; 817 | case 806:u8g2_SetFont(u8g2, u8g2_font_timR10_tf); break; 818 | case 807:u8g2_SetFont(u8g2, u8g2_font_timR10_tr); break; 819 | case 808:u8g2_SetFont(u8g2, u8g2_font_timR10_tn); break; 820 | case 809:u8g2_SetFont(u8g2, u8g2_font_timR12_tf); break; 821 | case 810:u8g2_SetFont(u8g2, u8g2_font_timR12_tr); break; 822 | case 811:u8g2_SetFont(u8g2, u8g2_font_timR12_tn); break; 823 | case 812:u8g2_SetFont(u8g2, u8g2_font_timR14_tf); break; 824 | case 813:u8g2_SetFont(u8g2, u8g2_font_timR14_tr); break; 825 | case 814:u8g2_SetFont(u8g2, u8g2_font_timR14_tn); break; 826 | case 815:u8g2_SetFont(u8g2, u8g2_font_timR18_tf); break; 827 | case 816:u8g2_SetFont(u8g2, u8g2_font_timR18_tr); break; 828 | case 817:u8g2_SetFont(u8g2, u8g2_font_timR18_tn); break; 829 | case 818:u8g2_SetFont(u8g2, u8g2_font_timR24_tf); break; 830 | case 819:u8g2_SetFont(u8g2, u8g2_font_timR24_tr); break; 831 | case 820:u8g2_SetFont(u8g2, u8g2_font_timR24_tn); break; 832 | case 821:u8g2_SetFont(u8g2, u8g2_font_baby_tf); break; 833 | case 822:u8g2_SetFont(u8g2, u8g2_font_baby_tr); break; 834 | case 823:u8g2_SetFont(u8g2, u8g2_font_baby_tn); break; 835 | case 824:u8g2_SetFont(u8g2, u8g2_font_blipfest_07_tr); break; 836 | case 825:u8g2_SetFont(u8g2, u8g2_font_blipfest_07_tn); break; 837 | case 826:u8g2_SetFont(u8g2, u8g2_font_chikita_tf); break; 838 | case 827:u8g2_SetFont(u8g2, u8g2_font_chikita_tr); break; 839 | case 828:u8g2_SetFont(u8g2, u8g2_font_chikita_tn); break; 840 | case 829:u8g2_SetFont(u8g2, u8g2_font_lucasfont_alternate_tf); break; 841 | case 830:u8g2_SetFont(u8g2, u8g2_font_lucasfont_alternate_tr); break; 842 | case 831:u8g2_SetFont(u8g2, u8g2_font_lucasfont_alternate_tn); break; 843 | case 832:u8g2_SetFont(u8g2, u8g2_font_p01type_tf); break; 844 | case 833:u8g2_SetFont(u8g2, u8g2_font_p01type_tr); break; 845 | case 834:u8g2_SetFont(u8g2, u8g2_font_p01type_tn); break; 846 | case 835:u8g2_SetFont(u8g2, u8g2_font_pixelle_micro_tr); break; 847 | case 836:u8g2_SetFont(u8g2, u8g2_font_pixelle_micro_tn); break; 848 | case 837:u8g2_SetFont(u8g2, u8g2_font_robot_de_niro_tf); break; 849 | case 838:u8g2_SetFont(u8g2, u8g2_font_robot_de_niro_tr); break; 850 | case 839:u8g2_SetFont(u8g2, u8g2_font_robot_de_niro_tn); break; 851 | case 840:u8g2_SetFont(u8g2, u8g2_font_trixel_square_tf); break; 852 | case 841:u8g2_SetFont(u8g2, u8g2_font_trixel_square_tr); break; 853 | case 842:u8g2_SetFont(u8g2, u8g2_font_trixel_square_tn); break; 854 | case 843:u8g2_SetFont(u8g2, u8g2_font_haxrcorp4089_tr); break; 855 | case 844:u8g2_SetFont(u8g2, u8g2_font_haxrcorp4089_tn); break; 856 | case 845:u8g2_SetFont(u8g2, u8g2_font_haxrcorp4089_t_cyrillic); break; 857 | case 846:u8g2_SetFont(u8g2, u8g2_font_fub11_tf); break; 858 | case 847:u8g2_SetFont(u8g2, u8g2_font_fub11_tr); break; 859 | case 848:u8g2_SetFont(u8g2, u8g2_font_fub11_tn); break; 860 | case 849:u8g2_SetFont(u8g2, u8g2_font_fub14_tf); break; 861 | case 850:u8g2_SetFont(u8g2, u8g2_font_fub14_tr); break; 862 | case 851:u8g2_SetFont(u8g2, u8g2_font_fub14_tn); break; 863 | case 852:u8g2_SetFont(u8g2, u8g2_font_fub17_tf); break; 864 | case 853:u8g2_SetFont(u8g2, u8g2_font_fub17_tr); break; 865 | case 854:u8g2_SetFont(u8g2, u8g2_font_fub17_tn); break; 866 | case 855:u8g2_SetFont(u8g2, u8g2_font_fub20_tf); break; 867 | case 856:u8g2_SetFont(u8g2, u8g2_font_fub20_tr); break; 868 | case 857:u8g2_SetFont(u8g2, u8g2_font_fub20_tn); break; 869 | case 858:u8g2_SetFont(u8g2, u8g2_font_fub25_tf); break; 870 | case 859:u8g2_SetFont(u8g2, u8g2_font_fub25_tr); break; 871 | case 860:u8g2_SetFont(u8g2, u8g2_font_fub25_tn); break; 872 | case 861:u8g2_SetFont(u8g2, u8g2_font_fub30_tf); break; 873 | case 862:u8g2_SetFont(u8g2, u8g2_font_fub30_tr); break; 874 | case 863:u8g2_SetFont(u8g2, u8g2_font_fub30_tn); break; 875 | case 864:u8g2_SetFont(u8g2, u8g2_font_fub35_tf); break; 876 | case 865:u8g2_SetFont(u8g2, u8g2_font_fub35_tr); break; 877 | case 866:u8g2_SetFont(u8g2, u8g2_font_fub35_tn); break; 878 | case 867:u8g2_SetFont(u8g2, u8g2_font_fub42_tf); break; 879 | case 868:u8g2_SetFont(u8g2, u8g2_font_fub42_tr); break; 880 | case 869:u8g2_SetFont(u8g2, u8g2_font_fub42_tn); break; 881 | case 870:u8g2_SetFont(u8g2, u8g2_font_fub49_tn); break; 882 | case 871:u8g2_SetFont(u8g2, u8g2_font_fub11_t_symbol); break; 883 | case 872:u8g2_SetFont(u8g2, u8g2_font_fub14_t_symbol); break; 884 | case 873:u8g2_SetFont(u8g2, u8g2_font_fub17_t_symbol); break; 885 | case 874:u8g2_SetFont(u8g2, u8g2_font_fub20_t_symbol); break; 886 | case 875:u8g2_SetFont(u8g2, u8g2_font_fub25_t_symbol); break; 887 | case 876:u8g2_SetFont(u8g2, u8g2_font_fub30_t_symbol); break; 888 | case 877:u8g2_SetFont(u8g2, u8g2_font_fub35_t_symbol); break; 889 | case 878:u8g2_SetFont(u8g2, u8g2_font_fub42_t_symbol); break; 890 | case 879:u8g2_SetFont(u8g2, u8g2_font_fub49_t_symbol); break; 891 | case 880:u8g2_SetFont(u8g2, u8g2_font_fur11_tf); break; 892 | case 881:u8g2_SetFont(u8g2, u8g2_font_fur11_tr); break; 893 | case 882:u8g2_SetFont(u8g2, u8g2_font_fur11_tn); break; 894 | case 883:u8g2_SetFont(u8g2, u8g2_font_fur14_tf); break; 895 | case 884:u8g2_SetFont(u8g2, u8g2_font_fur14_tr); break; 896 | case 885:u8g2_SetFont(u8g2, u8g2_font_fur14_tn); break; 897 | case 886:u8g2_SetFont(u8g2, u8g2_font_fur17_tf); break; 898 | case 887:u8g2_SetFont(u8g2, u8g2_font_fur17_tr); break; 899 | case 888:u8g2_SetFont(u8g2, u8g2_font_fur17_tn); break; 900 | case 889:u8g2_SetFont(u8g2, u8g2_font_fur20_tf); break; 901 | case 890:u8g2_SetFont(u8g2, u8g2_font_fur20_tr); break; 902 | case 891:u8g2_SetFont(u8g2, u8g2_font_fur20_tn); break; 903 | case 892:u8g2_SetFont(u8g2, u8g2_font_fur25_tf); break; 904 | case 893:u8g2_SetFont(u8g2, u8g2_font_fur25_tr); break; 905 | case 894:u8g2_SetFont(u8g2, u8g2_font_fur25_tn); break; 906 | case 895:u8g2_SetFont(u8g2, u8g2_font_fur30_tf); break; 907 | case 896:u8g2_SetFont(u8g2, u8g2_font_fur30_tr); break; 908 | case 897:u8g2_SetFont(u8g2, u8g2_font_fur30_tn); break; 909 | case 898:u8g2_SetFont(u8g2, u8g2_font_fur35_tf); break; 910 | case 899:u8g2_SetFont(u8g2, u8g2_font_fur35_tr); break; 911 | case 900:u8g2_SetFont(u8g2, u8g2_font_fur35_tn); break; 912 | case 901:u8g2_SetFont(u8g2, u8g2_font_fur42_tf); break; 913 | case 902:u8g2_SetFont(u8g2, u8g2_font_fur42_tr); break; 914 | case 903:u8g2_SetFont(u8g2, u8g2_font_fur42_tn); break; 915 | case 904:u8g2_SetFont(u8g2, u8g2_font_fur49_tn); break; 916 | case 905:u8g2_SetFont(u8g2, u8g2_font_fur11_t_symbol); break; 917 | case 906:u8g2_SetFont(u8g2, u8g2_font_fur14_t_symbol); break; 918 | case 907:u8g2_SetFont(u8g2, u8g2_font_fur17_t_symbol); break; 919 | case 908:u8g2_SetFont(u8g2, u8g2_font_fur20_t_symbol); break; 920 | case 909:u8g2_SetFont(u8g2, u8g2_font_fur25_t_symbol); break; 921 | case 910:u8g2_SetFont(u8g2, u8g2_font_fur30_t_symbol); break; 922 | case 911:u8g2_SetFont(u8g2, u8g2_font_fur35_t_symbol); break; 923 | case 912:u8g2_SetFont(u8g2, u8g2_font_fur42_t_symbol); break; 924 | case 913:u8g2_SetFont(u8g2, u8g2_font_fur49_t_symbol); break; 925 | case 914:u8g2_SetFont(u8g2, u8g2_font_osb18_tf); break; 926 | case 915:u8g2_SetFont(u8g2, u8g2_font_osb18_tr); break; 927 | case 916:u8g2_SetFont(u8g2, u8g2_font_osb18_tn); break; 928 | case 917:u8g2_SetFont(u8g2, u8g2_font_osb21_tf); break; 929 | case 918:u8g2_SetFont(u8g2, u8g2_font_osb21_tr); break; 930 | case 919:u8g2_SetFont(u8g2, u8g2_font_osb21_tn); break; 931 | case 920:u8g2_SetFont(u8g2, u8g2_font_osb26_tf); break; 932 | case 921:u8g2_SetFont(u8g2, u8g2_font_osb26_tr); break; 933 | case 922:u8g2_SetFont(u8g2, u8g2_font_osb26_tn); break; 934 | case 923:u8g2_SetFont(u8g2, u8g2_font_osb29_tf); break; 935 | case 924:u8g2_SetFont(u8g2, u8g2_font_osb29_tr); break; 936 | case 925:u8g2_SetFont(u8g2, u8g2_font_osb29_tn); break; 937 | case 926:u8g2_SetFont(u8g2, u8g2_font_osb35_tf); break; 938 | case 927:u8g2_SetFont(u8g2, u8g2_font_osb35_tr); break; 939 | case 928:u8g2_SetFont(u8g2, u8g2_font_osb35_tn); break; 940 | case 929:u8g2_SetFont(u8g2, u8g2_font_osb41_tf); break; 941 | case 930:u8g2_SetFont(u8g2, u8g2_font_osb41_tr); break; 942 | case 931:u8g2_SetFont(u8g2, u8g2_font_osb41_tn); break; 943 | case 932:u8g2_SetFont(u8g2, u8g2_font_osr18_tf); break; 944 | case 933:u8g2_SetFont(u8g2, u8g2_font_osr18_tr); break; 945 | case 934:u8g2_SetFont(u8g2, u8g2_font_osr18_tn); break; 946 | case 935:u8g2_SetFont(u8g2, u8g2_font_osr21_tf); break; 947 | case 936:u8g2_SetFont(u8g2, u8g2_font_osr21_tr); break; 948 | case 937:u8g2_SetFont(u8g2, u8g2_font_osr21_tn); break; 949 | case 938:u8g2_SetFont(u8g2, u8g2_font_osr26_tf); break; 950 | case 939:u8g2_SetFont(u8g2, u8g2_font_osr26_tr); break; 951 | case 940:u8g2_SetFont(u8g2, u8g2_font_osr26_tn); break; 952 | case 941:u8g2_SetFont(u8g2, u8g2_font_osr29_tf); break; 953 | case 942:u8g2_SetFont(u8g2, u8g2_font_osr29_tr); break; 954 | case 943:u8g2_SetFont(u8g2, u8g2_font_osr29_tn); break; 955 | case 944:u8g2_SetFont(u8g2, u8g2_font_osr35_tf); break; 956 | case 945:u8g2_SetFont(u8g2, u8g2_font_osr35_tr); break; 957 | case 946:u8g2_SetFont(u8g2, u8g2_font_osr35_tn); break; 958 | case 947:u8g2_SetFont(u8g2, u8g2_font_osr41_tf); break; 959 | case 948:u8g2_SetFont(u8g2, u8g2_font_osr41_tr); break; 960 | case 949:u8g2_SetFont(u8g2, u8g2_font_osr41_tn); break; 961 | case 950:u8g2_SetFont(u8g2, u8g2_font_inr16_mf); break; 962 | case 951:u8g2_SetFont(u8g2, u8g2_font_inr16_mr); break; 963 | case 952:u8g2_SetFont(u8g2, u8g2_font_inr16_mn); break; 964 | case 953:u8g2_SetFont(u8g2, u8g2_font_inr19_mf); break; 965 | case 954:u8g2_SetFont(u8g2, u8g2_font_inr19_mr); break; 966 | case 955:u8g2_SetFont(u8g2, u8g2_font_inr19_mn); break; 967 | case 956:u8g2_SetFont(u8g2, u8g2_font_inr21_mf); break; 968 | case 957:u8g2_SetFont(u8g2, u8g2_font_inr21_mr); break; 969 | case 958:u8g2_SetFont(u8g2, u8g2_font_inr21_mn); break; 970 | case 959:u8g2_SetFont(u8g2, u8g2_font_inr24_mf); break; 971 | case 960:u8g2_SetFont(u8g2, u8g2_font_inr24_mr); break; 972 | case 961:u8g2_SetFont(u8g2, u8g2_font_inr24_mn); break; 973 | case 962:u8g2_SetFont(u8g2, u8g2_font_inr27_mf); break; 974 | case 963:u8g2_SetFont(u8g2, u8g2_font_inr27_mr); break; 975 | case 964:u8g2_SetFont(u8g2, u8g2_font_inr27_mn); break; 976 | case 965:u8g2_SetFont(u8g2, u8g2_font_inr30_mf); break; 977 | case 966:u8g2_SetFont(u8g2, u8g2_font_inr30_mr); break; 978 | case 967:u8g2_SetFont(u8g2, u8g2_font_inr30_mn); break; 979 | case 968:u8g2_SetFont(u8g2, u8g2_font_inr33_mf); break; 980 | case 969:u8g2_SetFont(u8g2, u8g2_font_inr33_mr); break; 981 | case 970:u8g2_SetFont(u8g2, u8g2_font_inr33_mn); break; 982 | case 971:u8g2_SetFont(u8g2, u8g2_font_inr38_mf); break; 983 | case 972:u8g2_SetFont(u8g2, u8g2_font_inr38_mr); break; 984 | case 973:u8g2_SetFont(u8g2, u8g2_font_inr38_mn); break; 985 | case 974:u8g2_SetFont(u8g2, u8g2_font_inr42_mf); break; 986 | case 975:u8g2_SetFont(u8g2, u8g2_font_inr42_mr); break; 987 | case 976:u8g2_SetFont(u8g2, u8g2_font_inr42_mn); break; 988 | case 977:u8g2_SetFont(u8g2, u8g2_font_inr46_mf); break; 989 | case 978:u8g2_SetFont(u8g2, u8g2_font_inr46_mr); break; 990 | case 979:u8g2_SetFont(u8g2, u8g2_font_inr46_mn); break; 991 | case 980:u8g2_SetFont(u8g2, u8g2_font_inr49_mf); break; 992 | case 981:u8g2_SetFont(u8g2, u8g2_font_inr49_mr); break; 993 | case 982:u8g2_SetFont(u8g2, u8g2_font_inr49_mn); break; 994 | case 983:u8g2_SetFont(u8g2, u8g2_font_inr53_mf); break; 995 | case 984:u8g2_SetFont(u8g2, u8g2_font_inr53_mr); break; 996 | case 985:u8g2_SetFont(u8g2, u8g2_font_inr53_mn); break; 997 | case 986:u8g2_SetFont(u8g2, u8g2_font_inr57_mn); break; 998 | case 987:u8g2_SetFont(u8g2, u8g2_font_inr62_mn); break; 999 | case 988:u8g2_SetFont(u8g2, u8g2_font_inb16_mf); break; 1000 | case 989:u8g2_SetFont(u8g2, u8g2_font_inb16_mr); break; 1001 | case 990:u8g2_SetFont(u8g2, u8g2_font_inb16_mn); break; 1002 | case 991:u8g2_SetFont(u8g2, u8g2_font_inb19_mf); break; 1003 | case 992:u8g2_SetFont(u8g2, u8g2_font_inb19_mr); break; 1004 | case 993:u8g2_SetFont(u8g2, u8g2_font_inb19_mn); break; 1005 | case 994:u8g2_SetFont(u8g2, u8g2_font_inb21_mf); break; 1006 | case 995:u8g2_SetFont(u8g2, u8g2_font_inb21_mr); break; 1007 | case 996:u8g2_SetFont(u8g2, u8g2_font_inb21_mn); break; 1008 | case 997:u8g2_SetFont(u8g2, u8g2_font_inb24_mf); break; 1009 | case 998:u8g2_SetFont(u8g2, u8g2_font_inb24_mr); break; 1010 | case 999:u8g2_SetFont(u8g2, u8g2_font_inb24_mn); break; 1011 | case 1000:u8g2_SetFont(u8g2, u8g2_font_inb27_mf); break; 1012 | case 1001:u8g2_SetFont(u8g2, u8g2_font_inb27_mr); break; 1013 | case 1002:u8g2_SetFont(u8g2, u8g2_font_inb27_mn); break; 1014 | case 1003:u8g2_SetFont(u8g2, u8g2_font_inb30_mf); break; 1015 | case 1004:u8g2_SetFont(u8g2, u8g2_font_inb30_mr); break; 1016 | case 1005:u8g2_SetFont(u8g2, u8g2_font_inb30_mn); break; 1017 | case 1006:u8g2_SetFont(u8g2, u8g2_font_inb33_mf); break; 1018 | case 1007:u8g2_SetFont(u8g2, u8g2_font_inb33_mr); break; 1019 | case 1008:u8g2_SetFont(u8g2, u8g2_font_inb33_mn); break; 1020 | case 1009:u8g2_SetFont(u8g2, u8g2_font_inb38_mf); break; 1021 | case 1010:u8g2_SetFont(u8g2, u8g2_font_inb38_mr); break; 1022 | case 1011:u8g2_SetFont(u8g2, u8g2_font_inb38_mn); break; 1023 | case 1012:u8g2_SetFont(u8g2, u8g2_font_inb42_mf); break; 1024 | case 1013:u8g2_SetFont(u8g2, u8g2_font_inb42_mr); break; 1025 | case 1014:u8g2_SetFont(u8g2, u8g2_font_inb42_mn); break; 1026 | case 1015:u8g2_SetFont(u8g2, u8g2_font_inb46_mf); break; 1027 | case 1016:u8g2_SetFont(u8g2, u8g2_font_inb46_mr); break; 1028 | case 1017:u8g2_SetFont(u8g2, u8g2_font_inb46_mn); break; 1029 | case 1018:u8g2_SetFont(u8g2, u8g2_font_inb49_mf); break; 1030 | case 1019:u8g2_SetFont(u8g2, u8g2_font_inb49_mr); break; 1031 | case 1020:u8g2_SetFont(u8g2, u8g2_font_inb49_mn); break; 1032 | case 1021:u8g2_SetFont(u8g2, u8g2_font_inb53_mf); break; 1033 | case 1022:u8g2_SetFont(u8g2, u8g2_font_inb53_mr); break; 1034 | case 1023:u8g2_SetFont(u8g2, u8g2_font_inb53_mn); break; 1035 | case 1024:u8g2_SetFont(u8g2, u8g2_font_inb57_mn); break; 1036 | case 1025:u8g2_SetFont(u8g2, u8g2_font_inb63_mn); break; 1037 | case 1026:u8g2_SetFont(u8g2, u8g2_font_logisoso16_tf); break; 1038 | case 1027:u8g2_SetFont(u8g2, u8g2_font_logisoso16_tr); break; 1039 | case 1028:u8g2_SetFont(u8g2, u8g2_font_logisoso16_tn); break; 1040 | case 1029:u8g2_SetFont(u8g2, u8g2_font_logisoso18_tf); break; 1041 | case 1030:u8g2_SetFont(u8g2, u8g2_font_logisoso18_tr); break; 1042 | case 1031:u8g2_SetFont(u8g2, u8g2_font_logisoso18_tn); break; 1043 | case 1032:u8g2_SetFont(u8g2, u8g2_font_logisoso20_tf); break; 1044 | case 1033:u8g2_SetFont(u8g2, u8g2_font_logisoso20_tr); break; 1045 | case 1034:u8g2_SetFont(u8g2, u8g2_font_logisoso20_tn); break; 1046 | case 1035:u8g2_SetFont(u8g2, u8g2_font_logisoso22_tf); break; 1047 | case 1036:u8g2_SetFont(u8g2, u8g2_font_logisoso22_tr); break; 1048 | case 1037:u8g2_SetFont(u8g2, u8g2_font_logisoso22_tn); break; 1049 | case 1038:u8g2_SetFont(u8g2, u8g2_font_logisoso24_tf); break; 1050 | case 1039:u8g2_SetFont(u8g2, u8g2_font_logisoso24_tr); break; 1051 | case 1040:u8g2_SetFont(u8g2, u8g2_font_logisoso24_tn); break; 1052 | case 1041:u8g2_SetFont(u8g2, u8g2_font_logisoso26_tf); break; 1053 | case 1042:u8g2_SetFont(u8g2, u8g2_font_logisoso26_tr); break; 1054 | case 1043:u8g2_SetFont(u8g2, u8g2_font_logisoso26_tn); break; 1055 | case 1044:u8g2_SetFont(u8g2, u8g2_font_logisoso28_tf); break; 1056 | case 1045:u8g2_SetFont(u8g2, u8g2_font_logisoso28_tr); break; 1057 | case 1046:u8g2_SetFont(u8g2, u8g2_font_logisoso28_tn); break; 1058 | case 1047:u8g2_SetFont(u8g2, u8g2_font_logisoso30_tf); break; 1059 | case 1048:u8g2_SetFont(u8g2, u8g2_font_logisoso30_tr); break; 1060 | case 1049:u8g2_SetFont(u8g2, u8g2_font_logisoso30_tn); break; 1061 | case 1050:u8g2_SetFont(u8g2, u8g2_font_logisoso32_tf); break; 1062 | case 1051:u8g2_SetFont(u8g2, u8g2_font_logisoso32_tr); break; 1063 | case 1052:u8g2_SetFont(u8g2, u8g2_font_logisoso32_tn); break; 1064 | case 1053:u8g2_SetFont(u8g2, u8g2_font_logisoso34_tf); break; 1065 | case 1054:u8g2_SetFont(u8g2, u8g2_font_logisoso34_tr); break; 1066 | case 1055:u8g2_SetFont(u8g2, u8g2_font_logisoso34_tn); break; 1067 | case 1056:u8g2_SetFont(u8g2, u8g2_font_logisoso38_tf); break; 1068 | case 1057:u8g2_SetFont(u8g2, u8g2_font_logisoso38_tr); break; 1069 | case 1058:u8g2_SetFont(u8g2, u8g2_font_logisoso38_tn); break; 1070 | case 1059:u8g2_SetFont(u8g2, u8g2_font_logisoso42_tf); break; 1071 | case 1060:u8g2_SetFont(u8g2, u8g2_font_logisoso42_tr); break; 1072 | case 1061:u8g2_SetFont(u8g2, u8g2_font_logisoso42_tn); break; 1073 | case 1062:u8g2_SetFont(u8g2, u8g2_font_logisoso46_tf); break; 1074 | case 1063:u8g2_SetFont(u8g2, u8g2_font_logisoso46_tr); break; 1075 | case 1064:u8g2_SetFont(u8g2, u8g2_font_logisoso46_tn); break; 1076 | case 1065:u8g2_SetFont(u8g2, u8g2_font_logisoso50_tf); break; 1077 | case 1066:u8g2_SetFont(u8g2, u8g2_font_logisoso50_tr); break; 1078 | case 1067:u8g2_SetFont(u8g2, u8g2_font_logisoso50_tn); break; 1079 | case 1068:u8g2_SetFont(u8g2, u8g2_font_logisoso54_tf); break; 1080 | case 1069:u8g2_SetFont(u8g2, u8g2_font_logisoso54_tr); break; 1081 | case 1070:u8g2_SetFont(u8g2, u8g2_font_logisoso54_tn); break; 1082 | case 1071:u8g2_SetFont(u8g2, u8g2_font_logisoso58_tf); break; 1083 | case 1072:u8g2_SetFont(u8g2, u8g2_font_logisoso58_tr); break; 1084 | case 1073:u8g2_SetFont(u8g2, u8g2_font_logisoso58_tn); break; 1085 | case 1074:u8g2_SetFont(u8g2, u8g2_font_logisoso62_tn); break; 1086 | case 1075:u8g2_SetFont(u8g2, u8g2_font_logisoso78_tn); break; 1087 | case 1076:u8g2_SetFont(u8g2, u8g2_font_logisoso92_tn); break; 1088 | case 1077:u8g2_SetFont(u8g2, u8g2_font_pressstart2p_8f); break; 1089 | case 1078:u8g2_SetFont(u8g2, u8g2_font_pressstart2p_8r); break; 1090 | case 1079:u8g2_SetFont(u8g2, u8g2_font_pressstart2p_8n); break; 1091 | case 1080:u8g2_SetFont(u8g2, u8g2_font_pressstart2p_8u); break; 1092 | case 1081:u8g2_SetFont(u8g2, u8g2_font_pcsenior_8f); break; 1093 | case 1082:u8g2_SetFont(u8g2, u8g2_font_pcsenior_8r); break; 1094 | case 1083:u8g2_SetFont(u8g2, u8g2_font_pcsenior_8n); break; 1095 | case 1084:u8g2_SetFont(u8g2, u8g2_font_pcsenior_8u); break; 1096 | case 1085:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcgathin_8f); break; 1097 | case 1086:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcgathin_8r); break; 1098 | case 1087:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcgathin_8n); break; 1099 | case 1088:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcgathin_8u); break; 1100 | case 1089:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcga_8f); break; 1101 | case 1090:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcga_8r); break; 1102 | case 1091:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcga_8n); break; 1103 | case 1092:u8g2_SetFont(u8g2, u8g2_font_pxplusibmcga_8u); break; 1104 | case 1093:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_8f); break; 1105 | case 1094:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_8r); break; 1106 | case 1095:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_8n); break; 1107 | case 1096:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_8u); break; 1108 | case 1097:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_t_all); break; 1109 | case 1098:u8g2_SetFont(u8g2, u8g2_font_pxplustandynewtv_8_all); break; 1110 | case 1099:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_tf); break; 1111 | case 1100:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_tr); break; 1112 | case 1101:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_tn); break; 1113 | case 1102:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_mf); break; 1114 | case 1103:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_mr); break; 1115 | case 1104:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_mn); break; 1116 | case 1105:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_t_all); break; 1117 | case 1106:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga9_m_all); break; 1118 | case 1107:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_tf); break; 1119 | case 1108:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_tr); break; 1120 | case 1109:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_tn); break; 1121 | case 1110:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_mf); break; 1122 | case 1111:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_mr); break; 1123 | case 1112:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_mn); break; 1124 | case 1113:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_t_all); break; 1125 | case 1114:u8g2_SetFont(u8g2, u8g2_font_pxplusibmvga8_m_all); break; 1126 | case 1115:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_tf); break; 1127 | case 1116:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_tr); break; 1128 | case 1117:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_tn); break; 1129 | case 1118:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_mf); break; 1130 | case 1119:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_mr); break; 1131 | case 1120:u8g2_SetFont(u8g2, u8g2_font_px437wyse700a_mn); break; 1132 | case 1121:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_tf); break; 1133 | case 1122:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_tr); break; 1134 | case 1123:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_tn); break; 1135 | case 1124:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_mf); break; 1136 | case 1125:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_mr); break; 1137 | case 1126:u8g2_SetFont(u8g2, u8g2_font_px437wyse700b_mn); break; 1138 | default:u8g2_SetFont(u8g2, u8g2_font_helvB08_tr); 1139 | } 1140 | } 1141 | -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "u8g2.h" 6 | #include "fonts.h" 7 | #include "screens.h" 8 | 9 | u8g2_t u8g2; 10 | 11 | /* 12 | objects: 13 | 0 - temp 14 | 1 - time 15 | 2 - heart rate 16 | 3 - bluetooth 17 | 4 - battery 18 | */ 19 | 20 | /* 21 | Default layout 22 | [] : icon, # : index 23 | +----------------+ 24 | |[#3] [#2] [#4]| 25 | | +---- #1 ----+ | 26 | | | HH:MM | | 27 | | +------------+ | 28 | +----------------+ 29 | 30 | +----------------+ 31 | |[#3] [#0] [#4]| 32 | | +- #1-++-#2--+ | 33 | | |HH:MM|| BPM | | 34 | | +-----++-----+ | 35 | +----------------+ 36 | 37 | +----------------+ 38 | |[#3] [#1] [#4]| 39 | | +---- #2 ----+ | 40 | | | BPM | | 41 | | +------------+ | 42 | +----------------+ 43 | */ 44 | 45 | /* 46 | int8_t x[5] = {65,-5,16,0,54}; 47 | int8_t y[5] = {8,33,8,8,7}; 48 | uint16_t font[5] = {0,1040,0,0,0}; 49 | uint8_t width[5] = {12,12,12,12,12}; 50 | */ 51 | uint8_t screen_index = 0; 52 | std::string object_name[] = {"temp", "time", "heart rate", "bluetooth", "battery", "date"}; 53 | 54 | int main(void) 55 | { 56 | uint8_t object = 0; 57 | char k = ' '; 58 | 59 | u8g2_SetupBuffer_SDL_128x64(&u8g2, &u8g2_cb_r0); 60 | u8g2_InitDisplay(&u8g2); 61 | u8g2_SetPowerSave(&u8g2, 0); 62 | 63 | setFont(&u8g2, -1); 64 | u8g2_SetFontDirection(&u8g2, 0); 65 | u8g2_SetFontRefHeightAll(&u8g2); 66 | 67 | 68 | while (true) 69 | { 70 | //u8g2_InitDisplay(&u8g2); 71 | //u8g2_ClearDisplay(&u8g2); 72 | //u8g2_ClearBuffer(&u8g2); 73 | u8g2_FirstPage(&u8g2); 74 | do { 75 | screen(&u8g2, screen_index); 76 | u8g2_DrawHLine(&u8g2,0,33,66); 77 | u8g2_DrawVLine(&u8g2,65,0,34); 78 | } while( u8g2_NextPage(&u8g2) ); 79 | 80 | do 81 | { 82 | k = u8g_sdl_get_key(); 83 | } while( k < 0 ); 84 | 85 | printf("k = %d(%c)\n", k, k); 86 | 87 | if ( k == 'q' ) 88 | { 89 | break; 90 | } 91 | else if (k == ' ') 92 | { 93 | screen_index = (screen_index == 2)?0:screen_index+1; 94 | } 95 | else if (k == 's') 96 | { 97 | object = (object == 5)?0:object+1; 98 | } 99 | else if ( k == 'h') 100 | { 101 | for (uint8_t i = 0; i < 6; ++i) 102 | { 103 | printf("%s: x,y,font = %d,%d,%d\n",(object_name[i]).c_str(),x[i],y[i],font[i]); 104 | } 105 | } 106 | else 107 | { 108 | if ( k == 17 ) y[object] -= 5; // up arrow 109 | if ( k == 18 ) y[object] += 5; // down arrow 110 | if ( k == 20 ) x[object] -= 5; // left arrow 111 | if ( k == 19 ) x[object] += 5; // right arrow 112 | if ( k == 'w' ) y[object] -= 1; // up arrow 113 | if ( k == 'x' ) y[object] += 1; // down arrow 114 | if ( k == 'a' ) x[object] -= 1; // left arrow 115 | if ( k == 'd' ) x[object] += 1; // right arrow 116 | if ( k == 'o' ) font[object] = (font[object] == 0)?MAX_FONT_NUM-1:font[object]-1; // minus 117 | if ( k == 'p' ) font[object] = (font[object] == MAX_FONT_NUM-1)?0:font[object]+1; // plus 118 | } 119 | 120 | 121 | printf("%s: x,y,font = %d,%d,%d\n",object_name[object].c_str(),x[object],y[object],font[object]); 122 | } 123 | 124 | return 0; 125 | } 126 | // user menu example 127 | //u8g2_UserInterfaceSelectionList(&u8g2, "Title", 0, "abc\ndef\nghi\njkl\n12345\n67890\nabcdefg\nxyz\n111\n222\n333\n444"); 128 | 129 | -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micooke/arduino-nRF5-smartwatches/defb6758ab3467e0512b48fc099fe35d757f9886/libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/main.o -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2/sys/sdl/watch_64x32/screens.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "u8g2.h" 4 | #include 5 | /* 6 | objects: 7 | 0 - temp 8 | 1 - time 9 | 2 - heart rate 10 | 3 - bluetooth 11 | 4 - battery 12 | 5 - date 13 | */ 14 | 15 | int8_t x[] = {65,-5,65,0,53,14}; 16 | int8_t y[] = {8,33,17,8,7,8}; 17 | uint16_t font[] = {0,1040,0,0,0,692}; 18 | uint8_t width[] = {12,12,8,12,12,8}; 19 | 20 | const uint16_t _temperature = 0xe010+12; // thermometer 21 | const uint16_t _heartrate[2] = {0xe100+6,0xe100+7}; // big heart, small heart 22 | const uint16_t _bluetooth[2] = {0xe000+11,0xe1b0+5}; // big BT, medium BT 23 | const uint16_t _battery = 0xe230+10; // battery charging 24 | 25 | // sijiNumerals(u8g2_t *u8g2, std::string &s, uint8_t x, uint8_t y, uint8_t font_size = 2) 26 | // writes the string at position x,y using siji numbers instead of the standard number set 27 | // font_size = {0,1,2,3} = {small rounded, large rounded, small squared, large squared} 28 | // 29 | void sijiNumerals(u8g2_t *u8g2, uint8_t x, uint8_t y, std::string s, uint8_t font_size = 1) 30 | { 31 | const uint16_t c_offset = (font_size < 4)?(0xE15F + font_size*10):0xE17D; 32 | const uint8_t font_width = 7; 33 | 34 | uint8_t c_index = 0; 35 | u8g2_SetFont(u8g2, u8g2_font_siji_t_6x10); 36 | for (uint8_t c = 0; c < s.length(); c++) 37 | { 38 | c_index = s[c] - '0'; 39 | if (c_index < 10) 40 | { 41 | u8g2_DrawGlyph(u8g2, x + c*font_width, y, c_offset + c_index); 42 | } 43 | else 44 | { 45 | // font_size determines the colon used 46 | // 0,2 - small fonts use 0xE192 47 | // 1,3 - large fonts use 0xE193 48 | u8g2_DrawGlyph(u8g2, x + c*font_width, y, 0xE192 + (font_size % 2)); 49 | } 50 | } 51 | } 52 | 53 | void printObject(u8g2_t *u8g2, uint8_t object_index = 0) 54 | { 55 | // set the correct font 56 | switch(object_index) 57 | { 58 | case 0: // temp 59 | setFont(u8g2, 0); 60 | u8g2_DrawGlyph(u8g2, x[object_index], y[object_index], _temperature); // thermometer 61 | setFont(u8g2, font[object_index]); 62 | u8g2_DrawStr(u8g2, x[object_index]+ width[object_index], y[object_index], "30"); 63 | break; // 12 x 12 64 | case 1: // time 65 | setFont(u8g2, font[object_index]); 66 | u8g2_DrawStr(u8g2, x[object_index], y[object_index], "12:34"); 67 | break; 68 | case 2: // heart rate 69 | setFont(u8g2, 0); 70 | u8g2_DrawGlyph(u8g2, x[object_index], y[object_index], _heartrate[0]); // big heart 71 | setFont(u8g2, font[object_index]); 72 | //u8g2_DrawStr(u8g2, x[object_index]+ width[object_index], y[object_index], "189"); 73 | sijiNumerals(u8g2, x[object_index]+ width[object_index], y[object_index], std::string("189")); 74 | break; 75 | case 3: // bluetooth 76 | setFont(u8g2, 0); 77 | u8g2_DrawGlyph(u8g2, x[object_index], y[object_index], _bluetooth[1]); // bluetooth 78 | break; 79 | case 4: // battery 80 | setFont(u8g2, 0); 81 | u8g2_DrawGlyph(u8g2, x[object_index], y[object_index], _battery); // battery 82 | break; 83 | case 5: // date 84 | setFont(u8g2, font[object_index]); 85 | u8g2_DrawStr(u8g2, x[object_index], y[object_index], "12 JAN"); 86 | break; 87 | default: 88 | printObject(u8g2, 0); 89 | printObject(u8g2, 1); 90 | printObject(u8g2, 2); 91 | printObject(u8g2, 3); 92 | printObject(u8g2, 4); 93 | printObject(u8g2, 5); 94 | } 95 | } 96 | 97 | void screen(u8g2_t *u8g2, uint8_t s = 0) 98 | { 99 | /* 100 | objects: 101 | 0 - temp 102 | 1 - time 103 | 2 - heart rate 104 | 3 - bluetooth 105 | 4 - battery 106 | 5 - date 107 | 108 | Default layout 109 | [] : icon, # : index 110 | +----------------+ 111 | |[#3] [#5] [#4]| 112 | | +---- #1 ----+ | 113 | | | HH:MM | | 114 | | +------------+ | 115 | +----------------+ 116 | 117 | +----------------+ 118 | |[#3] [#2] [#4]| 119 | | +---- #1 ----+ | 120 | | | HH:MM | | 121 | | +------------+ | 122 | +----------------+ 123 | 124 | +----------------+ 125 | |[#3] [#1] [#4]| 126 | | +---- #2 ----+ | 127 | | | BPM | | 128 | | +------------+ | 129 | +----------------+ 130 | 131 | 132 | 133 | */ 134 | 135 | switch(s) 136 | { 137 | case 0: 138 | printObject(u8g2, -1); // print all 139 | break; 140 | case 1: // BIG TIME 141 | setFont(u8g2, 0); 142 | u8g2_DrawGlyph(u8g2, 16, 8, _heartrate[0]); // big heart 143 | //u8g2_DrawStr(u8g2, 16 + 12, 8, "189"); 144 | sijiNumerals(u8g2, 16+8, 8, std::string("189")); 145 | u8g2_DrawGlyph(u8g2, 0, 8, _bluetooth[1]); // bluetooth 146 | u8g2_DrawGlyph(u8g2, 53, 7, _battery); // battery 147 | 148 | // time 149 | setFont(u8g2, 1040); 150 | u8g2_DrawStr(u8g2, -5, 33, "12:34"); 151 | break; 152 | case 2: // BIG HEART RATE 153 | setFont(u8g2, 0); 154 | u8g2_DrawGlyph(u8g2, 0, 8, _bluetooth[1]); // bluetooth 155 | u8g2_DrawGlyph(u8g2, 53, 7, _battery); // battery 156 | 157 | // time 158 | //u8g2_DrawStr(u8g2, 16, 8, "12:34"); 159 | sijiNumerals(u8g2, 12, 8, std::string("12:04")); 160 | 161 | // heartrate 162 | u8g2_DrawGlyph(u8g2, 4, 25, _heartrate[0]); // big heart 163 | setFont(u8g2, 1040); 164 | u8g2_DrawStr(u8g2, 11, 33, "189"); 165 | break; 166 | } 167 | } -------------------------------------------------------------------------------- /libraries/examples/Examples/u8g2_ScreenTest/u8g2_ScreenTest.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ScreenTest.ino using: 3 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #ifdef U8X8_HAVE_HW_SPI 10 | #include 11 | #endif 12 | #ifdef U8X8_HAVE_HW_I2C 13 | #include 14 | #endif 15 | 16 | /* 17 | U8glib Example Overview: 18 | Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption 19 | Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards. 20 | U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only. 21 | 22 | This is a page buffer example. 23 | */ 24 | 25 | #if defined(_VARIANT_T28_) 26 | U8G2_SH1107_64X128_1_4W_HW_SPI u8g2(U8G2_R0, OLED_CS, OLED_DC, OLED_RST); 27 | #elif defined (_VARIANT_IDO003_) | defined (_VARIANT_ID100HR_) | defined(_VARIANT_ID107HR_) 28 | U8G2_SH1106_64X32_1_4W_HW_SPI u8g2(U8G2_R0, OLED_CS, OLED_DC, OLED_RST); 29 | #else 30 | // generic example for the common 128x64 SSD1306 OLED 31 | #define OLED_CS 10 32 | #define OLED_DC 9 33 | #define OLED_RST 8 34 | U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, OLED_CS, OLED_DC, OLED_RST); 35 | #endif 36 | 37 | void u8g2_prepare(void) { 38 | u8g2.setFont(u8g2_font_6x10_tf); 39 | u8g2.setFontRefHeightExtendedText(); 40 | u8g2.setDrawColor(1); 41 | u8g2.setFontPosTop(); 42 | u8g2.setFontDirection(0); 43 | } 44 | 45 | void u8g2_box_title() { 46 | u8g2.drawStr( 5, 5, "U8g2"); 47 | u8g2.drawStr( 5, 20, "ScreenTest"); 48 | 49 | u8g2.drawFrame(0, 0, u8g2.getDisplayWidth(), u8g2.getDisplayHeight()); 50 | } 51 | 52 | void displayPage() 53 | { 54 | u8g2.firstPage(); 55 | do { 56 | u8g2_box_title(); 57 | } while( u8g2.nextPage() ); 58 | } 59 | 60 | void setup(void) 61 | { 62 | #if defined (_VARIANT_T28_) 63 | // Turn off the vibration motor and hr sensor (both are driven by P-mosfets, so drive HIGH to turn off) 64 | pinMode(PIN_VIBRATE, OUTPUT); 65 | pinMode(PIN_HR_ON, OUTPUT); 66 | digitalWrite(PIN_VIBRATE, HIGH); 67 | digitalWrite(PIN_HR_ON, HIGH); 68 | #endif 69 | 70 | Serial.begin(9600); 71 | Serial.println(__FILE__); 72 | Serial.print(__DATE__); Serial.print(F(" @ ")); Serial.println(__TIME__); 73 | 74 | u8g2.begin(); 75 | u8g2_prepare(); 76 | displayPage(); 77 | Serial.println("end setup"); 78 | } 79 | 80 | void loop(void) 81 | { 82 | delay(5000); 83 | u8g2.setFlipMode(true); 84 | displayPage(); 85 | delay(5000); 86 | u8g2.setFlipMode(false); 87 | displayPage(); 88 | } -------------------------------------------------------------------------------- /libraries/examples/README.md: -------------------------------------------------------------------------------- 1 | ### u8g2_ScreenTest 2 | This is a page buffer example that draws a border around the whole screen, and prints "U8g2" and "ScreenTest" on line 1 and line 2 respectively. 3 | -------------------------------------------------------------------------------- /libraries/examples/examples.h: -------------------------------------------------------------------------------- 1 | /* examples.h */ -------------------------------------------------------------------------------- /libraries/examples/library.properties: -------------------------------------------------------------------------------- 1 | name=examples 2 | version=0.0 3 | author=Mark Cooke (https://github/micooke) 4 | maintainer=Mark Cooke (https://github/micooke) 5 | sentence=various nRF5 smartwatch examples 6 | paragraph= 7 | category=Uncategorized 8 | url=https://github.com/micooke/arduino-nRF5-smartwatches 9 | architectures=* 10 | -------------------------------------------------------------------------------- /nrf52_disable_read_protection.txt: -------------------------------------------------------------------------------- 1 | To share my experience with the nRF52832. 2 | I was unable to disable the read protection / flash lock with a BMP or ST-Link V2, but i was successful with a J-Link. 3 | 4 | When nRF52832 chip is read protected / locked, the first step is to try: 5 | nrfjprog –recover -f nrf52 6 | 7 | This performs the same task as: 8 | >Jlink -if swd -device nrf52 9 | J-Link>SWDSelect 10 | J-Link>SWDWriteDP 1, 0x50000000 11 | J-Link>SWDWriteDP 2, 0x01000000 12 | J-Link>SWDWriteAP 1, 0x00000001 13 | 14 | Wait until AP 2 is 0, and the operation is complete 15 | J-Link>SWDReadAP 2 16 | 17 | If two successive reads from AP 3 produce 0, then 1 then protection is disabled 18 | J-Link>SWDReadAP 3 19 | J-Link>SWDReadAP 3 20 | 21 | Tested with JLink v6.20b -------------------------------------------------------------------------------- /platform.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 2 | # Copyright (c) 2016 Mark Cooke All right reserved. 3 | # 4 | # This library is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU Lesser General Public 6 | # License as published by the Free Software Foundation; either 7 | # version 2.1 of the License, or (at your option) any later version. 8 | # 9 | # This library is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | # See the GNU Lesser General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public 15 | # License along with this library; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | 18 | name=nRF5 smartwatches 19 | version=0.2.1 20 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # get the latest and greatest 4 | echo updating the local repository 5 | git clone https://github.com/micooke/arduino-nRF5-smartwatches.git 6 | cd arduino-nRF5-smartwatches 7 | 8 | # save the path 9 | fullpath=$(pwd) 10 | path=${PWD##*/} 11 | 12 | # update submodules 13 | git submodule update --init --recursive 14 | cd libraries/Kx022-1020 && git pull origin master && cd $fullpath 15 | cd libraries/SoftwareI2C && git pull origin master && cd $fullpath 16 | cd libraries/sparkfun_OLED && git pull origin master && cd $fullpath 17 | cd libraries/HP203B && git pull origin master && cd $fullpath 18 | cd libraries/Si1143 && git pull origin master && cd $fullpath 19 | cd libraries/SoftwareSerial && git pull origin master && cd $fullpath 20 | 21 | read -p "Release number (e.g. 0.2.1):" version 22 | 23 | # copy the folder 24 | cd .. 25 | mv $path $path-$version 26 | cd $path-$version 27 | 28 | # remove all .git folders 29 | rm -Rf .git 30 | rm -Rf libraries/Kx022-1020/.git 31 | rm -Rf libraries/SoftwareI2C/.git 32 | rm -Rf libraries/sparkfun_OLED/.git 33 | rm -Rf libraries/HP203B/.git 34 | rm -Rf libraries/Si1143/.git 35 | rm -Rf libraries/SoftwareSerial/.git 36 | 37 | # gzip it up 38 | cd .. 39 | tar -czvf $version.tar.gz $path-$version 40 | 41 | # clean up 42 | rm -Rf $path-$version 43 | 44 | # output size and md5 45 | md5_=$(md5sum $version.tar.gz) 46 | size_=$(wc -c $version.tar.gz) 47 | echo md5 : $md5_ 48 | echo size : $size_ 49 | -------------------------------------------------------------------------------- /softdevices.txt: -------------------------------------------------------------------------------- 1 | names=s110,s130,s132 2 | 3 | s110.url=http://www.nordicsemi.com/eng/content/download/80234/1351257/file/s110_nrf51_8.0.0.zip 4 | s110.filename=s110_nrf51_8.0.0_softdevice.hex 5 | 6 | s130.url=http://www.nordicsemi.com/eng/content/download/95150/1606929/file/s130_nrf51_2.0.0.zip 7 | s130.filename=s130_nrf51_2.0.1_softdevice.hex 8 | 9 | s132.url=http://www.nordicsemi.com/eng/content/download/95151/1606944/file/s132_nrf52_2.0.0.zip 10 | s132.filename=s132_nrf52_2.0.1_softdevice.hex 11 | -------------------------------------------------------------------------------- /variants/DS_D6/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/DS_D6/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2019 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | // https://github.com/fanoush/ds-d6/wiki/Hardware 23 | const uint32_t g_ADigitalPinMap[] = { 24 | 0, 25 | 1, 26 | 2, // charge detect: vmul-5/analogRead(D2) 27 | 3, // battery voltage: vmul*analogRead(D3) 28 | 4, // OLED RST - 128x32 SSD1306 29 | 5, // OLED MOSI - 128x32 SSD1306 30 | 6, // OLED SCK - 128x32 SSD1306 31 | 7, // HR sensor SCL - PAH8001 32 | 8, // HR sensor SDA - PAH8001 33 | 9, 34 | 10, 35 | 11, 36 | 12, 37 | 13, // Accel SCL - Kx023 38 | 14, // Accel SDA - Kx023 39 | 15, // Accel INT1 - Kx023 40 | 16, 41 | 17, 42 | 18, 43 | 19, 44 | 20, 45 | 21, 46 | 22, // UART RX 47 | 23, // UART TX 48 | 24, 49 | 25, // Vibration Motor 50 | 26, // HR sensor ENABLE - PAH8001 51 | 27, 52 | 28, // OLED DC - 128x32 SSD1306 53 | 29, // OLED CS - 128x32 SSD1306 54 | 30, // Button1 / Touch Button (Pull Up) 55 | 31 56 | }; 57 | -------------------------------------------------------------------------------- /variants/DS_D6/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2019 Mark Cooke All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_DS_D6_ 18 | #define _VARIANT_DS_D6_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT 32u 40 | #define NUM_DIGITAL_PINS 20u 41 | #define NUM_ANALOG_INPUTS 8u 42 | #define NUM_ANALOG_OUTPUTS 0u 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 30u 46 | #define PIN_TOUCH PIN_BUTTON1 47 | 48 | #define PIN_VIBRATE 25u 49 | #define PIN_HR_ON 26u 50 | 51 | #define LED_BUILTIN PIN_VIBRATE 52 | 53 | /* 54 | * Analog pins 55 | */ 56 | #define PIN_A0 2u 57 | #define PIN_A1 3u 58 | #define PIN_A2 4u 59 | #define PIN_A3 5u 60 | #define PIN_A4 28u 61 | #define PIN_A5 29u 62 | #define PIN_A6 30u 63 | #define PIN_A7 31u 64 | 65 | static const uint8_t A0 = PIN_A0; 66 | static const uint8_t A1 = PIN_A1; 67 | static const uint8_t A2 = PIN_A2; 68 | static const uint8_t A3 = PIN_A3; 69 | static const uint8_t A4 = PIN_A4; 70 | static const uint8_t A5 = PIN_A5; 71 | #ifdef NRF52 72 | #define ADC_RESOLUTION 14 73 | #else 74 | #define ADC_RESOLUTION 10 75 | #endif 76 | 77 | /* 78 | * Serial interfaces 79 | */ 80 | // Serial 81 | 82 | #define PIN_SERIAL_RX 22u 83 | #define PIN_SERIAL_TX 23u 84 | 85 | /* 86 | * SPI Interfaces 87 | */ 88 | 89 | #define SPI_INTERFACES_COUNT 1 90 | 91 | #define PIN_SPI_MISO 31u // pin 31 unallocated 92 | #define PIN_SPI_MOSI 5u // 128x32 SSD1306 OLED 93 | #define PIN_SPI_SCK 6u 94 | #define PIN_SPI_RST 4u 95 | #define PIN_SPI_DC 28u 96 | #define PIN_SPI_CS 29u 97 | 98 | static const uint8_t SS = PIN_SPI_CS; 99 | static const uint8_t MOSI = PIN_SPI_MOSI; 100 | static const uint8_t MISO = PIN_SPI_MISO; 101 | static const uint8_t SCK = PIN_SPI_SCK; 102 | 103 | #define OLED_RST PIN_SPI_RST 104 | #define OLED_CS PIN_SPI_CS 105 | #define OLED_DC PIN_SPI_DC 106 | 107 | /* 108 | * Wire Interfaces 109 | */ 110 | #define WIRE_INTERFACES_COUNT 1 111 | 112 | #ifdef ACCEL_HWI2C 113 | #define PIN_WIRE_SDA 13u // Kx023 (Address 0x1f)- Accelerometer Sensor 114 | #define PIN_WIRE_SCL 14u 115 | #define PIN_WIRE_INT1 15u 116 | #define PIN_WIRE1_SDA 7u // PAH8001 (Address 0x6b) - HeartRate Sensor 117 | #define PIN_WIRE1_SCL 8u 118 | #else 119 | #define PIN_WIRE_SDA 7u // PAH8001 (Address 0x6b) - HeartRate Sensor 120 | #define PIN_WIRE_SCL 8u 121 | #define PIN_WIRE1_SDA 13u // Kx023 (Address 0x1f) - Accelerometer Sensor 122 | #define PIN_WIRE1_SCL 14u 123 | #define PIN_WIRE1_INT1 15u 124 | #endif 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /variants/ID100HR/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/ID100HR/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, 33 | 10, 34 | 11, 35 | 12, 36 | 13, 37 | 14, 38 | 15, 39 | 16, 40 | 17, 41 | 18, 42 | 19, 43 | 20, 44 | 21, 45 | 22, 46 | 23, 47 | 24, 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/ID100HR/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_ID100HR_ 18 | #define _VARIANT_ID100HR_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT (31u) 40 | #define NUM_DIGITAL_PINS (31u) 41 | #define NUM_ANALOG_INPUTS (6u) 42 | #define NUM_ANALOG_OUTPUTS (0u) 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 (4) 46 | #define PIN_BUTTON2 (7) 47 | 48 | #define PIN_VIBRATE (8) 49 | #define LED_BUILTIN PIN_VIBRATE 50 | 51 | /* 52 | * Analog pins 53 | */ 54 | #define PIN_A0 (2) 55 | #define PIN_A1 (3) 56 | #define PIN_A2 (4) 57 | #define PIN_A3 (5) 58 | #define PIN_A4 (6) 59 | #define PIN_A5 (7) 60 | 61 | static const uint8_t A0 = PIN_A0; 62 | static const uint8_t A1 = PIN_A1; 63 | static const uint8_t A2 = PIN_A2; 64 | static const uint8_t A3 = PIN_A3; 65 | static const uint8_t A4 = PIN_A4; 66 | static const uint8_t A5 = PIN_A5; 67 | #ifdef NRF52 68 | #define ADC_RESOLUTION 14 69 | #else 70 | #define ADC_RESOLUTION 10 71 | #endif 72 | 73 | /* 74 | * Serial interfaces 75 | */ 76 | // Serial 77 | #define PIN_SERIAL_RX (17) 78 | #define PIN_SERIAL_TX (18) 79 | 80 | /* 81 | * SPI Interfaces 82 | */ 83 | #define SPI_INTERFACES_COUNT 1 84 | 85 | #define PIN_SPI_MISO (3) 86 | #define PIN_SPI_MOSI (2) 87 | #define PIN_SPI_SCK (1) 88 | 89 | static const uint8_t SS = 29; 90 | static const uint8_t MOSI = PIN_SPI_MOSI; 91 | static const uint8_t MISO = PIN_SPI_MISO; 92 | static const uint8_t SCK = PIN_SPI_SCK; 93 | 94 | #define OLED_RST (30) 95 | #define OLED_CS (29) 96 | #define OLED_DC (0) 97 | 98 | /* 99 | * Wire Interfaces 100 | */ 101 | #define WIRE_INTERFACES_COUNT 2 102 | 103 | #define PIN_WIRE_SDA (14) 104 | #define PIN_WIRE_SCL (16) 105 | 106 | #define PIN_WIRE1_SDA 26u 107 | #define PIN_WIRE1_SCL 28u 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /variants/ID107HR/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/ID107HR/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, 33 | 10, 34 | 11, 35 | 12, 36 | 13, 37 | 14, 38 | 15, 39 | 16, 40 | 17, 41 | 18, 42 | 19, 43 | 20, 44 | 21, 45 | 22, 46 | 23, 47 | 24, 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/ID107HR/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_ID107HR_ 18 | #define _VARIANT_ID107HR_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT (31u) 40 | #define NUM_DIGITAL_PINS (31u) 41 | #define NUM_ANALOG_INPUTS (6u) 42 | #define NUM_ANALOG_OUTPUTS (0u) 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 (4) 46 | #define PIN_BUTTON2 (7) 47 | 48 | #define PIN_VIBRATE (6) 49 | #define LED_BUILTIN PIN_VIBRATE 50 | 51 | /* 52 | * Analog pins 53 | */ 54 | #define PIN_A0 (2) 55 | #define PIN_A1 (3) 56 | #define PIN_A2 (4) 57 | #define PIN_A3 (5) 58 | #define PIN_A4 (6) 59 | #define PIN_A5 (7) 60 | 61 | static const uint8_t A0 = PIN_A0; 62 | static const uint8_t A1 = PIN_A1; 63 | static const uint8_t A2 = PIN_A2; 64 | static const uint8_t A3 = PIN_A3; 65 | static const uint8_t A4 = PIN_A4; 66 | static const uint8_t A5 = PIN_A5; 67 | #ifdef NRF52 68 | #define ADC_RESOLUTION 14 69 | #else 70 | #define ADC_RESOLUTION 10 71 | #endif 72 | 73 | /* 74 | * Serial interfaces 75 | */ 76 | // Serial 77 | #define PIN_SERIAL_RX (17) 78 | #define PIN_SERIAL_TX (18) 79 | 80 | /* 81 | * SPI Interfaces 82 | */ 83 | #define SPI_INTERFACES_COUNT 1 84 | 85 | #define PIN_SPI_MISO (3) 86 | #define PIN_SPI_MOSI (2) 87 | #define PIN_SPI_SCK (1) 88 | 89 | static const uint8_t SS = 29; 90 | static const uint8_t MOSI = PIN_SPI_MOSI; 91 | static const uint8_t MISO = PIN_SPI_MISO; 92 | static const uint8_t SCK = PIN_SPI_SCK; 93 | 94 | #define OLED_RST (30) 95 | #define OLED_CS (29) 96 | #define OLED_DC (0) 97 | 98 | /* 99 | * Wire Interfaces 100 | */ 101 | #define WIRE_INTERFACES_COUNT 1 102 | 103 | #ifdef ACCEL_HWI2C 104 | #define PIN_WIRE_SDA 14 // Kx022 - Accelerometer Sensor 105 | #define PIN_WIRE_SCL 16 106 | #define PIN_WIRE1_SDA 22u // Si1143 - HeartRate Sensor 107 | #define PIN_WIRE1_SCL 23u 108 | #else 109 | #define PIN_WIRE_SDA 22u // Si1143 - HeartRate Sensor 110 | #define PIN_WIRE_SCL 23u 111 | #define PIN_WIRE1_SDA 14 // Kx022 - Accelerometer Sensor 112 | #define PIN_WIRE1_SCL 16 113 | #endif 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /variants/ID107HRPlus/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/ID107HRPlus/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, 33 | 10, 34 | 11, 35 | 12, 36 | 13, 37 | 14, 38 | 15, 39 | 16, 40 | 17, 41 | 18, 42 | 19, 43 | 20, 44 | 21, 45 | 22, 46 | 23, 47 | 24, 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/ID107HRPlus/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_ID017HR_PLUS_ 18 | #define _VARIANT_ID017HR_PLUS_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT 32u 40 | #define NUM_DIGITAL_PINS 20u 41 | #define NUM_ANALOG_INPUTS 6u 42 | #define NUM_ANALOG_OUTPUTS 0u 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 0u // UNKNOWN 46 | #define PIN_BUTTON2 0u // UNKNOWN 47 | 48 | #define PIN_VIBRATE 25u // UNKNOWN 49 | #define LED_BUILTIN PIN_VIBRATE 50 | 51 | /* 52 | * Analog pins 53 | */ 54 | #define PIN_A0 (2) 55 | #define PIN_A1 (3) // Kx022 SDA 56 | #define PIN_A2 (4) // Kx022 ADDR 57 | #define PIN_A3 (5) // Kx022 SCL 58 | #define PIN_A4 (6) // Kx022 INT 59 | #define PIN_A5 (7) // Kx022 NCS 60 | 61 | static const uint8_t A0 = PIN_A0; 62 | static const uint8_t A1 = PIN_A1; 63 | static const uint8_t A2 = PIN_A2; 64 | static const uint8_t A3 = PIN_A3; 65 | static const uint8_t A4 = PIN_A4; 66 | static const uint8_t A5 = PIN_A5; 67 | #ifdef NRF52 68 | #define ADC_RESOLUTION 14 69 | #else 70 | #define ADC_RESOLUTION 10 71 | #endif 72 | 73 | /* 74 | * Serial interfaces 75 | */ 76 | // Serial 77 | #define PIN_SERIAL_RX 23u 78 | #define PIN_SERIAL_TX 24u 79 | 80 | /* 81 | * SPI Interfaces 82 | */ 83 | #define SPI_INTERFACES_COUNT 1 84 | 85 | #define PIN_SPI_MISO 27u // MX25L MISO 86 | #define PIN_SPI_MOSI 31u // MX25L MOSI 87 | #define PIN_SPI_SCK 30u // MX25L MISO 88 | 89 | static const uint8_t SS = 28u; // MX25L CE 90 | static const uint8_t MOSI = PIN_SPI_MOSI; 91 | static const uint8_t MISO = PIN_SPI_MISO; 92 | static const uint8_t SCK = PIN_SPI_SCK; 93 | 94 | #define OLED_RST 0u // UNKNOWN 95 | #define OLED_CS 0u // UNKNOWN 96 | #define OLED_DC 0u // UNKNOWN 97 | 98 | /* 99 | * Wire Interfaces 100 | */ 101 | #define WIRE_INTERFACES_COUNT 2 102 | 103 | #define PIN_WIRE_SDA 3u 104 | #define PIN_WIRE_SCL 5u 105 | 106 | #define PIN_WIRE1_SDA 10u 107 | #define PIN_WIRE1_SCL 18u 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /variants/IDO003/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/IDO003/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, 33 | 10, 34 | 11, 35 | 12, 36 | 13, 37 | 14, 38 | 15, 39 | 16, 40 | 17, 41 | 18, 42 | 19, 43 | 20, 44 | 21, 45 | 22, 46 | 23, 47 | 24, 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/IDO003/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_IDO003_ 18 | #define _VARIANT_IDO003_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT (31u) 40 | #define NUM_DIGITAL_PINS (31u) 41 | #define NUM_ANALOG_INPUTS (6u) 42 | #define NUM_ANALOG_OUTPUTS (0u) 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 (4) // needs INPUT_PULLUP 46 | #define PIN_BUTTON2 PIN_BUTTON1 // For consistency with other smartwatches 47 | 48 | #define PIN_VIBRATE (7) 49 | #define LED_BUILTIN PIN_VIBRATE 50 | 51 | /* 52 | * Analog pins 53 | */ 54 | #define PIN_A0 (2) 55 | #define PIN_A1 (3) 56 | #define PIN_A2 (4) 57 | #define PIN_A3 (5) 58 | #define PIN_A4 (6) 59 | #define PIN_A5 (7) 60 | 61 | static const uint8_t A0 = PIN_A0; 62 | static const uint8_t A1 = PIN_A1; 63 | static const uint8_t A2 = PIN_A2; 64 | static const uint8_t A3 = PIN_A3; 65 | static const uint8_t A4 = PIN_A4; 66 | static const uint8_t A5 = PIN_A5; 67 | #ifdef NRF52 68 | #define ADC_RESOLUTION 14 69 | #else 70 | #define ADC_RESOLUTION 10 71 | #endif 72 | 73 | /* 74 | * Serial interfaces 75 | */ 76 | // Serial 77 | #define PIN_SERIAL_RX (17) 78 | #define PIN_SERIAL_TX (18) 79 | 80 | /* 81 | * SPI Interfaces 82 | */ 83 | #define SPI_INTERFACES_COUNT 1 84 | 85 | #define PIN_SPI_MISO (31) 86 | #define PIN_SPI_MOSI (29) 87 | #define PIN_SPI_SCK (30) 88 | 89 | static const uint8_t SS = 2; 90 | static const uint8_t MOSI = PIN_SPI_MOSI; 91 | static const uint8_t MISO = PIN_SPI_MISO; 92 | static const uint8_t SCK = PIN_SPI_SCK; 93 | 94 | #define OLED_RST (1) 95 | #define OLED_CS (2) 96 | #define OLED_DC (0) 97 | 98 | /* 99 | * Wire Interfaces 100 | */ 101 | #define WIRE_INTERFACES_COUNT 1 102 | 103 | #define PIN_WIRE_SDA (14) 104 | #define PIN_WIRE_SCL (16) 105 | 106 | #ifdef __cplusplus 107 | } 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /variants/T28/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/T28/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, // RH 6051C = OC (touch) 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, // Mosfet - drives Si1143 / HRM (PULL HIGH = OFF) 33 | 10, // Mosfet - drives vibrate motor (PULL HIGH = OFF) 34 | 11, // ublox G7020-KT RX 35 | 12, 36 | 13, // Kx023 - SDA 37 | 14, 38 | 15, 39 | 16, // Kx023 - SCL 40 | 17, 41 | 18, 42 | 19, // G24A24 / GT22L - MISO 43 | 20, // Button 1 44 | 21, // G24A24 / GT22L - CS 45 | 22, // G24A24 / GT22L - CLK 46 | 23, // G24A24 / GT22L - MOSI 47 | 24, // Button 2 ? 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/T28/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2018 Mark Cooke All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_T28_ 18 | #define _VARIANT_T28_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT 32u 40 | #define NUM_DIGITAL_PINS 20u 41 | #define NUM_ANALOG_INPUTS 8u 42 | #define NUM_ANALOG_OUTPUTS 0u 43 | 44 | // Buttons 45 | #define PIN_BUTTON1 20u // TOP 46 | #define PIN_BUTTON2 24u // BOTTOM 47 | #define PIN_TOUCH 2u // RH6015-C, input OC 48 | 49 | #define PIN_VIBRATE 10u 50 | #define PIN_HR_ON 9u 51 | 52 | #define PIN_OLED_VPP 1u 53 | #define PIN_OLED_SW 3u 54 | 55 | #define LED_BUILTIN PIN_VIBRATE 56 | 57 | /* 58 | * Analog pins 59 | */ 60 | #define PIN_A0 2u 61 | #define PIN_A1 3u 62 | #define PIN_A2 4u 63 | #define PIN_A3 5u 64 | #define PIN_A4 28u 65 | #define PIN_A5 29u 66 | #define PIN_A6 30u 67 | #define PIN_A7 31u 68 | 69 | static const uint8_t A0 = PIN_A0; 70 | static const uint8_t A1 = PIN_A1; 71 | static const uint8_t A2 = PIN_A2; 72 | static const uint8_t A3 = PIN_A3; 73 | static const uint8_t A4 = PIN_A4; 74 | static const uint8_t A5 = PIN_A5; 75 | #ifdef NRF52 76 | #define ADC_RESOLUTION 14 77 | #else 78 | #define ADC_RESOLUTION 10 79 | #endif 80 | 81 | /* 82 | * Serial interfaces 83 | */ 84 | // Serial 85 | 86 | #define PIN_SERIAL_RX 25u 87 | #define PIN_SERIAL_TX 26u 88 | 89 | // To vacant pads near HR ribbon 90 | // +------------------ribbon------------- 91 | // | [ Top ] - To K42 Mosfet P0.09 92 | // | [ ] - P0.04 93 | // | [ ] - VSS 94 | // +------------------------------------- 95 | // [ ] - P0.02 96 | // [ ] - P0.26 // debug Tx 97 | // [Bottom] - P0.25 // debug Rx 98 | // 99 | #define PIN_SERIAL1_RX 31u // UBLOX Tx (9600 BAUD) 100 | #define PIN_SERIAL1_TX 11u // UBLOX Rx 101 | 102 | /* 103 | * SPI Interfaces 104 | */ 105 | 106 | #define SPI_INTERFACES_COUNT 2 107 | 108 | #define PIN_SPI_MISO 5u // -1// OLED - 4 wire SPI 109 | #define PIN_SPI_MOSI 18u 110 | #define PIN_SPI_SCK 17u 111 | //#define PIN_SPI_CS 28u 112 | 113 | #define PIN_SPI1_MISO 19u // GT22 114 | #define PIN_SPI1_MOSI 23u 115 | #define PIN_SPI1_SCK 22u 116 | #define PIN_SPI1_CS 21u 117 | 118 | static const uint8_t SS = 28u; 119 | static const uint8_t MOSI = PIN_SPI_MOSI; 120 | static const uint8_t MISO = PIN_SPI_MISO; 121 | static const uint8_t SCK = PIN_SPI_SCK; 122 | 123 | #define OLED_RST 14u 124 | #define OLED_CS 28u 125 | #define OLED_DC 30u 126 | 127 | /* 128 | * Wire Interfaces 129 | */ 130 | #define WIRE_INTERFACES_COUNT 1 131 | 132 | #ifdef ACCEL_HWI2C 133 | #define PIN_WIRE_SDA 13u // Kx023 - Accelerometer Sensor 134 | #define PIN_WIRE_SCL 16u 135 | #define PIN_WIRE1_SDA 22u // Si1143 - HeartRate Sensor 136 | #define PIN_WIRE1_SCL 23u 137 | #else 138 | #define PIN_WIRE_SDA 22u // Si1143 - HeartRate Sensor 139 | #define PIN_WIRE_SCL 23u 140 | #define PIN_WIRE1_SDA 13u // Kx023 - Accelerometer Sensor 141 | #define PIN_WIRE1_SCL 16u 142 | #endif 143 | 144 | #ifdef __cplusplus 145 | } 146 | #endif 147 | 148 | #endif 149 | -------------------------------------------------------------------------------- /variants/Taida_Century_nRF52_minidev/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/Taida_Century_nRF52_minidev/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2016 Frank Holtz. All right reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | const uint32_t g_ADigitalPinMap[] = { 24 | // D0 - D7 25 | 25, // D0, near Radio! -> Low drive, low frequency I/O only. 26 | 26, // D1, near Radio! -> Low drive, low frequency I/O only. 27 | 27, // D2, near Radio! -> Low drive, low frequency I/O only. 28 | 28, // D3, near Radio! -> Low drive, low frequency I/O only. 29 | 29, // D4, NOT CONNECTED, near Radio! -> Low drive, low frequency I/O only. 30 | 30, // D5, LED1, near Radio! -> Low drive, low frequency I/O only. 31 | 31, // D6, LED2, near Radio! -> Low drive, low frequency I/O only. 32 | 2, // D7 33 | 34 | // D8 - D13 35 | 3, // D8 36 | 4, // D9, BUTTON1, NFC-Antenna 1 37 | 5, // D10 38 | 0, // D11, NOT CONNECTED 39 | 1, // D12, NOT CONNECTED 40 | 6, // D13 41 | 42 | // D14 - D30 43 | 7, // D14 44 | 8, // D15 45 | 9, // D16, NOT CONNECTED 46 | 10, // D17, NFC-Antenna 2, NOT CONNECTED 47 | 11, // D18 48 | 12, // D19 49 | 13, // D20, SS 50 | 14, // D21, MISO 51 | 15, // D22, MOSI 52 | 16, // D23, SCK 53 | 17, // D24, A0 54 | 18, // D25, A1 55 | 19, // D26, A2 56 | 20, // D27, A3 57 | 22, // D28, A4, near Radio! -> Low drive, low frequency I/O only. 58 | 23, // D29, A5, near Radio! -> Low drive, low frequency I/O only. 59 | 24, // D30, 60 | 61 | 21, // RESET 62 | }; 63 | -------------------------------------------------------------------------------- /variants/Taida_Century_nRF52_minidev/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2016 Frank Holtz. All right reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _VARIANT_STCT_NRF52_minidev_ 20 | #define _VARIANT_STCT_NRF52_minidev_ 21 | 22 | /** Master clock frequency */ 23 | #ifdef NRF52 24 | #define VARIANT_MCK (64000000ul) 25 | #else 26 | #define VARIANT_MCK (16000000ul) 27 | #endif 28 | 29 | /*---------------------------------------------------------------------------- 30 | * Headers 31 | *----------------------------------------------------------------------------*/ 32 | 33 | #include "WVariant.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" 37 | { 38 | #endif // __cplusplus 39 | 40 | // Number of pins defined in PinDescription array 41 | #define PINS_COUNT (32u) 42 | #define NUM_DIGITAL_PINS (20u) 43 | #define NUM_ANALOG_INPUTS (6u) 44 | #define NUM_ANALOG_OUTPUTS (0u) 45 | 46 | // LEDs 47 | #define PIN_LED1 (5u) 48 | #define PIN_LED2 (6u) 49 | #define LED_BUILTIN PIN_LED1 50 | 51 | // Buttons 52 | // KEY 53 | #define PIN_BUTTON1 (9u) 54 | // Reset -> read nordic documentation for disabling reset function 55 | #define PIN_BUTTON2 (31u) 56 | 57 | /* 58 | * Analog pins 59 | */ 60 | #define PIN_A0 (25u) 61 | #define PIN_A1 (26u) 62 | #define PIN_A2 (27u) 63 | #define PIN_A3 (28u) 64 | #define PIN_A4 (29u) 65 | #define PIN_A5 (30u) 66 | 67 | static const uint8_t A0 = PIN_A0; 68 | static const uint8_t A1 = PIN_A1; 69 | static const uint8_t A2 = PIN_A2; 70 | static const uint8_t A3 = PIN_A3; 71 | static const uint8_t A4 = PIN_A4; 72 | static const uint8_t A5 = PIN_A5; 73 | #ifdef NRF52 74 | #define ADC_RESOLUTION 14 75 | #else 76 | #define ADC_RESOLUTION 10 77 | #endif 78 | 79 | // Other pins 80 | #define PIN_AREF (24) 81 | static const uint8_t AREF = PIN_AREF; 82 | 83 | /* 84 | * SPI Interfaces 85 | */ 86 | #define SPI_INTERFACES_COUNT 1 87 | 88 | #define PIN_SPI_MISO (21u) 89 | #define PIN_SPI_MOSI (22u) 90 | #define PIN_SPI_SCK (23u) 91 | 92 | static const uint8_t SS = 20u; 93 | static const uint8_t MOSI = PIN_SPI_MOSI; 94 | static const uint8_t MISO = PIN_SPI_MISO; 95 | static const uint8_t SCK = PIN_SPI_SCK; 96 | 97 | /* 98 | * Serial interfaces 99 | */ 100 | // Serial 101 | #ifdef STCT_NRF52_minidev_RGZ // J11 - J12 soldered (RGZ) 102 | #define PIN_SERIAL_RX (2u) 103 | #define PIN_SERIAL_TX (3u) 104 | #elif defined (STCT_NRF52_minidev_RSM) // J15 - J16 soldered (RSM) 105 | #define PIN_SERIAL_RX (1u) 106 | #define PIN_SERIAL_TX (2u) 107 | #else // original configuration 108 | #define PIN_SERIAL_RX (18u) 109 | #define PIN_SERIAL_TX (19u) 110 | #endif 111 | 112 | /* 113 | * Wire Interfaces 114 | */ 115 | #define WIRE_INTERFACES_COUNT 1 116 | 117 | #ifdef STCT_NRF52_minidev_RGZ 118 | #define PIN_WIRE_SDA (7u) 119 | #define PIN_WIRE_SCL (8u) 120 | #elif defined (STCT_NRF52_minidev_RSM) 121 | #define PIN_WIRE_SDA (7u) 122 | #define PIN_WIRE_SCL (8u) 123 | #else // original configuration 124 | #define PIN_WIRE_SDA (2u) 125 | #define PIN_WIRE_SCL (3u) 126 | #endif 127 | 128 | //#define PIN_WIRE1_SDA (11u) 129 | //#define PIN_WIRE1_SCL (12u) 130 | 131 | static const uint8_t SDA = PIN_WIRE_SDA; 132 | static const uint8_t SCL = PIN_WIRE_SCL; 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | #endif 139 | -------------------------------------------------------------------------------- /variants/Waveshare_BLE400_HRM/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /variants/Waveshare_BLE400_HRM/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "variant.h" 21 | 22 | const uint32_t g_ADigitalPinMap[] = { 23 | 0, 24 | 1, 25 | 2, 26 | 3, 27 | 4, 28 | 5, 29 | 6, 30 | 7, 31 | 8, 32 | 9, 33 | 10, 34 | 11, 35 | 12, 36 | 13, 37 | 14, 38 | 15, 39 | 16, 40 | 17, 41 | 18, 42 | 19, 43 | 20, 44 | 21, 45 | 22, 46 | 23, 47 | 24, 48 | 25, 49 | 26, 50 | 27, 51 | 28, 52 | 29, 53 | 30, 54 | 31 55 | }; 56 | -------------------------------------------------------------------------------- /variants/Waveshare_BLE400_HRM/variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | See the GNU Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef _VARIANT_WAVESHARE_BLE400_ 18 | #define _VARIANT_WAVESHARE_BLE400_ 19 | 20 | /** Master clock frequency */ 21 | #ifdef NRF52 22 | #define VARIANT_MCK (64000000ul) 23 | #else 24 | #define VARIANT_MCK (16000000ul) 25 | #endif 26 | 27 | /*---------------------------------------------------------------------------- 28 | * Headers 29 | *----------------------------------------------------------------------------*/ 30 | 31 | #include "WVariant.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif // __cplusplus 37 | 38 | // Number of pins defined in PinDescription array 39 | #define PINS_COUNT (31u) 40 | #define NUM_DIGITAL_PINS (31u) 41 | #define NUM_ANALOG_INPUTS (6u) 42 | #define NUM_ANALOG_OUTPUTS (0u) 43 | 44 | // LEDs 45 | #define PIN_LED1 (18) 46 | #define PIN_LED2 (19) 47 | #define PIN_LED3 (20) 48 | #define PIN_LED4 (21) 49 | #define PIN_LED5 (22) 50 | #define LED_BUILTIN PIN_LED1 51 | 52 | // Buttons 53 | #define PIN_BUTTON1 (16) 54 | #define PIN_BUTTON2 (17) 55 | 56 | /* 57 | * Analog pins 58 | */ 59 | #define PIN_A0 (2) 60 | #define PIN_A1 (3) 61 | #define PIN_A2 (4) 62 | #define PIN_A3 (5) 63 | #define PIN_A4 (6) 64 | #define PIN_A5 (7) 65 | 66 | static const uint8_t A0 = PIN_A0 ; 67 | static const uint8_t A1 = PIN_A1 ; 68 | static const uint8_t A2 = PIN_A2 ; 69 | static const uint8_t A3 = PIN_A3 ; 70 | static const uint8_t A4 = PIN_A4 ; 71 | static const uint8_t A5 = PIN_A5 ; 72 | #ifdef NRF52 73 | #define ADC_RESOLUTION 14 74 | #else 75 | #define ADC_RESOLUTION 10 76 | #endif 77 | 78 | /* 79 | * Serial interfaces 80 | */ 81 | // Serial 82 | #define PIN_SERIAL_RX (11) 83 | #define PIN_SERIAL_TX (9) 84 | 85 | /* 86 | * SPI Interfaces 87 | */ 88 | #define SPI_INTERFACES_COUNT 1 89 | 90 | #define PIN_SPI_MISO (23) 91 | #define PIN_SPI_MOSI (24) 92 | #define PIN_SPI_SCK (25) 93 | 94 | static const uint8_t SS = 30 ; 95 | static const uint8_t MOSI = PIN_SPI_MOSI ; 96 | static const uint8_t MISO = PIN_SPI_MISO ; 97 | static const uint8_t SCK = PIN_SPI_SCK ; 98 | 99 | /* 100 | * Wire Interfaces 101 | */ 102 | #define WIRE_INTERFACES_COUNT 1 103 | 104 | #define PIN_WIRE_SDA (0u) 105 | #define PIN_WIRE_SCL (1u) 106 | 107 | static const uint8_t SDA = PIN_WIRE_SDA; 108 | static const uint8_t SCL = PIN_WIRE_SCL; 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif 115 | --------------------------------------------------------------------------------