25 Commits

Author SHA1 Message Date
Nic Limper
b0715fae97 cosmetic 2023-09-20 10:24:40 +02:00
Nic Limper
6e326009c3 finetuning C6 flashing, automatic retry on failing download 2023-09-20 10:15:55 +02:00
Jelmer
0a43c601fe M3 FW 0.1.6-beta3 2023-09-20 00:51:31 +02:00
Nic Limper
f92448992e remove debug info 2023-09-20 00:26:36 +02:00
Nic Limper
2d84583797 update button: download latest esp32-c6 firmware + flash from esp32-s3 2023-09-19 20:24:57 +02:00
atc1441
fac67eac7e Fixed Pull-up for C6 in YellowAP PCB for self flashing the C6 from ESP32-S3 2023-09-18 21:51:28 +02:00
Nic Limper
6cee005e92 esp32-c6 binaries for flashing by esp32-s3 2023-09-18 20:11:56 +02:00
Nic Limper
e68e549eaf bugfix, prevent duplicate dhcp hostnames 2023-09-15 09:50:56 +02:00
Jelmer
3eb4b94b06 Merge branch 'master' of https://github.com/jjwbruijn/OpenEPaperLink 2023-09-14 12:38:03 +02:00
Jelmer
9951dc5ce5 added and updated M3 jigs 2023-09-14 12:37:47 +02:00
Nic Limper
c53f33f8ec bugfix calculating expected next checkin 2023-09-11 20:40:05 +02:00
Nic Limper
abbc636948 custom partition table (with 3MB littlefs) for C6 2023-09-11 14:01:42 +02:00
Nic Limper
7e32a1a197 remove unused preview files from /current folder at startup 2023-09-11 13:50:37 +02:00
Nic Limper
95d0cf6804 esp-serial-flasher library (altered from the original) 2023-09-11 00:57:19 +02:00
Nic Limper
a92e0eb5e6 flashing ESP32-C6 from ESP32 via serial connection from webinterface
To flash the C6, place bootloader.bin, partition-table.bin and OpenEPaperLink_esp32_C6.bin in the file system root.
APconfig -> update -> advanced options -> update ESP32-C6
This should also work with a previous unconfigured C6.
Compatible with Yellow-AP.
2023-09-11 00:48:08 +02:00
Jelmer
c6c3c4f9f6 Update README.md 2023-09-10 22:45:48 +02:00
Nic Limper
2e64ed2f16 set dhcp hostname 2023-09-09 19:01:18 +02:00
Nic Limper
2780b7ce36 only send fast lut to capable tags 2023-09-08 23:58:52 +02:00
Nic Limper
9af2bd2a92 tagReturnData for C6 AP. It compiles, but other than that, untested 2023-09-08 20:27:18 +02:00
Nic Limper
92ff939adc bugfix gethwtype 2023-09-08 17:23:19 +02:00
Nic Limper
83ff8564a7 'flash led' command in context menu of webinterface 2023-09-08 17:07:48 +02:00
Jelmer
dc33ff5854 ESP32 return-data support 2023-09-08 11:19:33 +02:00
jjwbruijn
4176252b51 ZBS Tag Return-data support 2023-09-08 11:16:16 +02:00
Moritz Wirger
36c3c45510 Json url file template (#128)
json template url + file implementation. 
The file contains the json template, and can contain variables that will be extracted from the json in the url. The url is fetched at regular intervals.
2023-09-08 11:06:15 +02:00
jjwbruijn
abb9b195d3 updated oepl-wide definitions 2023-09-08 00:10:26 +02:00
169 changed files with 32256 additions and 10233 deletions

View File

@@ -0,0 +1,281 @@
TRACE +0.008 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00100040
TRACE +0.000 Write 14 bytes: c0000a04000000000000100040c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04006f80e02c00000000c0
TRACE +0.000 Received full packet: 010a04006f80e02c00000000
Detecting chip type...
TRACE +0.000 command op=0x14 data len=0 wait_response=1 timeout=3.000 data=
TRACE +0.000 Write 10 bytes: c00014000000000000c0
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 33 bytes:
011418006f80e02c 0000000000000000 | ....o..,........
0000000c0d000000 0000000000000000 | ................
c0 | .
TRACE +0.000 Received full packet:
011418006f80e02c 0000000000000000 | ....o..,........
0000000c0d000000 0000000000000000 | ................
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=80f58740
TRACE +0.000 Write 14 bytes: c0000a04000000000080f58740c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000050080b60c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000800000000c0
TRACE +0.000 Received full packet: 010a04000000000800000000
TRACE +0.008 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000050080b60c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000800000000c0
TRACE +0.000 Received full packet: 010a04000000000800000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000050080b60c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000800000000c0
TRACE +0.000 Received full packet: 010a04000000000800000000
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=44080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000044080b60c0
TRACE +0.010 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400e85342ca00000000c0
TRACE +0.000 Received full packet: 010a0400e85342ca00000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=48080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000048080b60c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04004c40feff00000000c0
TRACE +0.000 Received full packet: 010a04004c40feff00000000
MAC: 40:4c:ca:ff:fe:42:53:e8
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=44080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000044080b60c0
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400e85342ca00000000c0
TRACE +0.000 Received full packet: 010a0400e85342ca00000000
TRACE +0.002 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=48080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000048080b60c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04004c40feff00000000c0
TRACE +0.000 Received full packet: 010a04004c40feff00000000
BASE MAC: 40:4c:ca:42:53:e8
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=44080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000044080b60c0
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400e85342ca00000000c0
TRACE +0.000 Received full packet: 010a0400e85342ca00000000
!!! TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=48080b60
TRACE +0.000 Write 14 bytes: c0000a04000000000048080b60c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04004c40feff00000000c0
TRACE +0.000 Received full packet: 010a04004c40feff00000000
MAC_EXT: ff:fe
Enabling default SPI flash mode...
!!!! TRACE +0.000 command op=0x0d data len=8 wait_response=1 timeout=3.000 data=0000000000000000
TRACE +0.000 Write 18 bytes:
c0000d0800000000 0000000000000000 | ................
00c0 | ..
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010d04004c40feff00000000c0
TRACE +0.000 Received full packet: 010d04004c40feff00000000
v TRACE +0.008 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=18300060
TRACE +0.000 Write 14 bytes: c0000a04000000000018300060c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000008000000000c0
TRACE +0.000 Received full packet: 010a04000000008000000000
v TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=20300060
TRACE +0.000 Write 14 bytes: c0000a04000000000020300060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000007000000000c0
TRACE +0.000 Received full packet: 010a04000000007000000000
v TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2830006017000000ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0028300060170000 | .........(0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.010 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1830006000000090ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0018300060000000 | ..........0.`...
90ffffffff000000 00c0 | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.008 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=203000609f000070ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 00203000609f0000 | ......... 0.`...
70ffffffff000000 00c0 | p.........
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=5830006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0058300060000000 | .........X0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0030006000000400ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0000300060000004 | ..........0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00300060
TRACE +0.000 Write 14 bytes: c0000a04000000000000300060c0
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
!!! TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58300060
TRACE +0.000 Write 14 bytes: c0000a04000000000058300060c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c840170000000000c0
TRACE +0.000 Received full packet: 010a0400c840170000000000
!!! TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1830006000000080ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0018300060000000 | ..........0.`...
80ffffffff000000 00c0 | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.008 Read 13 bytes: 01090400c840170000000000c0
TRACE +0.000 Received full packet: 01090400c840170000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2030006000000070ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0020300060000000 | ......... 0.`...
70ffffffff000000 00c0 | p.........
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01090400c840170000000000c0
TRACE +0.000 Received full packet: 01090400c840170000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=18300060
TRACE +0.000 Write 14 bytes: c0000a04000000000018300060c0
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000008000000000c0
TRACE +0.000 Received full packet: 010a04000000008000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=20300060
TRACE +0.000 Write 14 bytes: c0000a04000000000020300060c0
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000007000000000c0
TRACE +0.000 Received full packet: 010a04000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2830006007000000ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0028300060070000 | .........(0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1c3000600700005cffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 001c300060070000 | ..........0.`...
5cffffffff000000 00c0 | \.........
TRACE +0.002 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=18300060000000f0ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0018300060000000 | ..........0.`...
f0ffffffff000000 00c0 | ..........
TRACE +0.008 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=203000605a000070ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 00203000605a0000 | ......... 0.`Z..
70ffffffff000000 00c0 | p.........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0430006010000000ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0004300060100000 | ..........0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.012 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=5830006000000000ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0058300060000000 | .........X0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=0030006000000400ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0000300060000004 | ..........0.`...
00ffffffff000000 00c0 | ..........
TRACE +0.010 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010904000000007000000000c0
TRACE +0.000 Received full packet: 010904000000007000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00300060
TRACE +0.000 Write 14 bytes: c0000a04000000000000300060c0
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58300060
TRACE +0.000 Write 14 bytes: c0000a04000000000058300060c0
TRACE +0.010 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c800000000000000c0
TRACE +0.000 Received full packet: 010a0400c800000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=1830006000000080ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0018300060000000 | ..........0.`...
80ffffffff000000 00c0 | ..........
TRACE +0.000 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01090400c800000000000000c0
TRACE +0.000 Received full packet: 01090400c800000000000000
TRACE +0.000 command op=0x09 data len=16 wait_response=1 timeout=3.000 data=2030006000000070ffffffff00000000
TRACE +0.000 Write 26 bytes:
c000091000000000 0020300060000000 | ......... 0.`...
70ffffffff000000 00c0 | p.........
TRACE +0.010 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01090400c800000000000000c0
TRACE +0.000 Received full packet: 01090400c800000000000000
Manufacturer: c8
Device: 4017
Detected flash size: 8MB

View File

@@ -0,0 +1,96 @@
C6 flash starting
Write 1 bytes: c000082400000000000707122055555555
55555555555555555555555555555555
555555555555555555555555c0
Read 1 bytes: 004553502d524f4d3a657370333263362d32303232303931390d0a4275696c643a53657020313920323032320d0a7273743a3078312028504f5745524f4e292c626f6f743a307836362028444f574e4c4f4144285553422f55415254302f5344494f5f5245495f46454f29290d0a77616974696e6720666f7220646f776e6c6f61640d0a
Write 1 bytes: c000082400000000000707122055555555
55555555555555555555555555555555
555555555555555555555555c0
Read 1 bytes: c0010804000707122000000000c0
Write 1 bytes: c0000a04000000000000100040c0
Read 1 bytes: c0010804000707122000000000c0
c0010804000707122000000000c0
c0010804000707122000000000c0
c0010804000707122000000000c0
c0010804000707122000000000c0
c0010804000707122000000000c0
c0010804000707122000000000c0
c0010a04006f80e02c00000000c0
Write 1 bytes: c0000a04000000000048080b60c0 600b0848!!! read 0x12
c0000a04000000000044080b60c0 600b0844 read 0x11
Read 1 bytes: c0010a04004c40feff00000000c0
c0010a0400e85342ca00000000c0
esptool: c0010a04004c40feff00000000c0
>>>>> Write 1 bytes: c0000a0400000000004c080b60c0 600b084C!!! read 0x13
esptool: c0000a04000000000048080b60c0 600b0848 read 0x12
Read 1 bytes: c0010a04000000000000000000c0
esptool: c0010a04004c40feff00000000c0
command op=0x0d data len=8
>>>>> Write 1 bytes: c0000d080000000000feff000000000000c0
esptool:c0000d0800000000000000000000000000c0
>>>>> Read 1 bytes: c0010d04000000000000000000c0
esptool: c0010d04004c40feff00000000c0
Connected to target
Connected to ESP32-C6
bootloader
size: 21248
Erasing flash (this may take a while)...
esp_loader_flash_start
block_size 1024
detect_flash_size
spi_flash_command 159 0 24
v Write 1 bytes: c0000a04000000000018300060c0
Read 1 bytes: c0010a04000000008000000000c0
v Write 1 bytes: c0000a04000000000020300060c0
Read 1 bytes: c0010a04000000007000000000c0
v Write 1 bytes: c000091000000000002830006017000000
ffffffff00000000c0
Read 1 bytes: c0010904000000007000000000c0
v Write 1 bytes: c000091000000000001830006000000090
ffffffff00000000c0
Read 1 bytes: c0010904000000007000000000c0
v Write 1 bytes: c00009100000000000203000609f000070
ffffffff00000000c0
Read 1 bytes: c0010904000000007000000000c0
v Write 1 bytes: c000091000000000005830006000000000
ffffffff00000000c0
Read 1 bytes: c0010904000000007000000000c0
v Write 1 bytes: c000091000000000000030006000000400
ffffffff00000000c0
Read 1 bytes: c0010904000000007000000000c0try 9
v Write 1 bytes: c0000a04000000000000300060c0
Read 1 bytes: c0010a04000000000000000000c0
Write 1 bytes: c0000a04000000000058300060c0
!!! Read 1 bytes: c0010a0400ffffff0000000000c0
Write 1 bytes: c000091000000000001830006000000080
ffffffff00000000c0
!!! Read 1 bytes: c001090400ffffff0000000000c0
Write 1 bytes: c000091000000000002030006000000070
ffffffff00000000c0
Read 1 bytes: c001090400ffffff0000000000c0
size_id 255
DEBUG: Flash size detection failed, falling back to default
Write 1 bytes: c000021400000000000053000015000000
000400000000000000000000c0
Read 0 bytes:
Erasing flash failed with error 2.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@
#ifndef Binary_h
#define Binary_h
#define B0 0
//#define B0 0
#define B00 0
#define B000 0
#define B0000 0
@@ -28,7 +28,7 @@
#define B000000 0
#define B0000000 0
#define B00000000 0
#define B1 1
//#define B1 1
#define B01 1
#define B001 1
#define B0001 1

View File

@@ -33,89 +33,89 @@ const SPISettings DEFAULT_SPI_SETTINGS = SPISettings();
SPIClass::SPIClass(NRF_SPI_Type *p_spi, uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI)
{
initialized = false;
assert(p_spi != NULL);
_p_spi = p_spi;
initialized = false;
assert(p_spi != NULL);
_p_spi = p_spi;
// pins
_uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
_uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
_uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
// pins
_uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
_uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
_uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
_dataMode = SPI_MODE0;
_bitOrder = SPI_CONFIG_ORDER_MsbFirst;
_dataMode = SPI_MODE0;
_bitOrder = SPI_CONFIG_ORDER_MsbFirst;
}
#ifdef ARDUINO_GENERIC
void SPIClass::setPins(uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI)
{
_uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
_uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
_uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
_uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
_uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
_uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
}
#endif // ARDUINO_GENERIC
void SPIClass::begin()
{
init();
init();
_p_spi->PSELSCK = _uc_pinSCK;
_p_spi->PSELMOSI = _uc_pinMosi;
_p_spi->PSELMISO = _uc_pinMiso;
_p_spi->PSELSCK = _uc_pinSCK;
_p_spi->PSELMOSI = _uc_pinMosi;
_p_spi->PSELMISO = _uc_pinMiso;
config(DEFAULT_SPI_SETTINGS);
config(DEFAULT_SPI_SETTINGS);
}
void SPIClass::init()
{
if (initialized)
return;
interruptMode = SPI_IMODE_NONE;
interruptSave = 0;
interruptMask = 0;
initialized = true;
if (initialized)
return;
interruptMode = SPI_IMODE_NONE;
interruptSave = 0;
interruptMask = 0;
initialized = true;
}
void SPIClass::config(SPISettings settings)
{
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
uint32_t config = settings.bitOrder;
uint32_t config = settings.bitOrder;
switch (settings.dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
switch (settings.dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
_p_spi->CONFIG = config;
_p_spi->FREQUENCY = settings.clockFreq;
_p_spi->CONFIG = config;
_p_spi->FREQUENCY = settings.clockFreq;
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
}
void SPIClass::end()
{
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
initialized = false;
initialized = false;
}
void SPIClass::usingInterrupt(int /*interruptNumber*/)
@@ -124,7 +124,7 @@ void SPIClass::usingInterrupt(int /*interruptNumber*/)
void SPIClass::beginTransaction(SPISettings settings)
{
config(settings);
config(settings);
}
void SPIClass::endTransaction(void)
@@ -133,133 +133,133 @@ void SPIClass::endTransaction(void)
void SPIClass::setBitOrder(BitOrder order)
{
this->_bitOrder = (order == MSBFIRST ? SPI_CONFIG_ORDER_MsbFirst : SPI_CONFIG_ORDER_LsbFirst);
this->_bitOrder = (order == MSBFIRST ? SPI_CONFIG_ORDER_MsbFirst : SPI_CONFIG_ORDER_LsbFirst);
uint32_t config = this->_bitOrder;
uint32_t config = this->_bitOrder;
switch (this->_dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
switch (this->_dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
_p_spi->CONFIG = config;
_p_spi->CONFIG = config;
}
void SPIClass::setDataMode(uint8_t mode)
{
this->_dataMode = mode;
this->_dataMode = mode;
uint32_t config = this->_bitOrder;
uint32_t config = this->_bitOrder;
switch (this->_dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
switch (this->_dataMode) {
default:
case SPI_MODE0:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE1:
config |= (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE2:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
break;
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
case SPI_MODE3:
config |= (SPI_CONFIG_CPOL_ActiveLow << SPI_CONFIG_CPOL_Pos);
config |= (SPI_CONFIG_CPHA_Trailing << SPI_CONFIG_CPHA_Pos);
break;
}
_p_spi->CONFIG = config;
_p_spi->CONFIG = config;
}
void SPIClass::setClockDivider(uint8_t div)
{
uint32_t clockFreq;
uint32_t clockFreq;
if (div >= SPI_CLOCK_DIV128) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K125;
} else if (div >= SPI_CLOCK_DIV64) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K250;
} else if (div >= SPI_CLOCK_DIV32) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K500;
} else if (div >= SPI_CLOCK_DIV16) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M1;
} else if (div >= SPI_CLOCK_DIV8) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M2;
} else if (div >= SPI_CLOCK_DIV4) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M4;
} else {
clockFreq = SPI_FREQUENCY_FREQUENCY_M8;
}
if (div >= SPI_CLOCK_DIV128) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K125;
} else if (div >= SPI_CLOCK_DIV64) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K250;
} else if (div >= SPI_CLOCK_DIV32) {
clockFreq = SPI_FREQUENCY_FREQUENCY_K500;
} else if (div >= SPI_CLOCK_DIV16) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M1;
} else if (div >= SPI_CLOCK_DIV8) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M2;
} else if (div >= SPI_CLOCK_DIV4) {
clockFreq = SPI_FREQUENCY_FREQUENCY_M4;
} else {
clockFreq = SPI_FREQUENCY_FREQUENCY_M8;
}
_p_spi->FREQUENCY = clockFreq;
_p_spi->FREQUENCY = clockFreq;
}
byte SPIClass::transfer(uint8_t data)
{
_p_spi->TXD = data;
_p_spi->TXD = data;
while(!_p_spi->EVENTS_READY);
while(!_p_spi->EVENTS_READY);
data = _p_spi->RXD;
data = _p_spi->RXD;
_p_spi->EVENTS_READY = 0x0UL;
_p_spi->EVENTS_READY = 0x0UL;
return data;
return data;
}
uint16_t SPIClass::transfer16(uint16_t data) {
union { uint16_t val; struct { uint8_t lsb; uint8_t msb; }; } t;
union { uint16_t val; struct { uint8_t lsb; uint8_t msb; }; } t;
t.val = data;
t.val = data;
if (_bitOrder == SPI_CONFIG_ORDER_LsbFirst) {
t.lsb = transfer(t.lsb);
t.msb = transfer(t.msb);
} else {
t.msb = transfer(t.msb);
t.lsb = transfer(t.lsb);
}
if (_bitOrder == SPI_CONFIG_ORDER_LsbFirst) {
t.lsb = transfer(t.lsb);
t.msb = transfer(t.msb);
} else {
t.msb = transfer(t.msb);
t.lsb = transfer(t.lsb);
}
return t.val;
return t.val;
}
void SPIClass::attachInterrupt() {
// Should be enableInterrupt()
// Should be enableInterrupt()
}
void SPIClass::detachInterrupt() {
// Should be disableInterrupt()
// Should be disableInterrupt()
}
#if SPI_INTERFACES_COUNT > 0
#if defined(NRF52_SERIES) && !defined(NRF52811_XXAA)
SPIClass SPI (NRF_SPI2, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
#else
SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
// SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
#endif
#endif

View File

@@ -3,6 +3,13 @@
#include "hal.h"
#include "wdt.h"
int8_t temperature = 0;
uint32_t batteryRaw = 0;
uint16_t batteryVoltage = 0;
bool lowBattery = false;
bool disablePinInterruptSleep = false;
int8_t startHFCLK(void) {
if (!isHFCLKstable()) {
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
@@ -29,6 +36,103 @@ uint8_t isHFCLKstable(void) {
}
}
void setupBatteryVoltage() {
NRF_SAADC->CH[0]
.CONFIG = (SAADC_CH_CONFIG_GAIN_Gain1_6 << SAADC_CH_CONFIG_GAIN_Pos) |
(SAADC_CH_CONFIG_MODE_SE << SAADC_CH_CONFIG_MODE_Pos) |
(SAADC_CH_CONFIG_REFSEL_Internal << SAADC_CH_CONFIG_REFSEL_Pos) |
(SAADC_CH_CONFIG_RESN_Bypass << SAADC_CH_CONFIG_RESN_Pos) |
(SAADC_CH_CONFIG_RESP_Bypass << SAADC_CH_CONFIG_RESP_Pos) |
(SAADC_CH_CONFIG_TACQ_3us << SAADC_CH_CONFIG_TACQ_Pos);
NRF_SAADC->CH[0].PSELP = SAADC_CH_PSELP_PSELP_VDD << SAADC_CH_PSELP_PSELP_Pos;
NRF_SAADC->CH[0].PSELN = SAADC_CH_PSELN_PSELN_NC << SAADC_CH_PSELN_PSELN_Pos;
NRF_SAADC->RESOLUTION = SAADC_RESOLUTION_VAL_14bit << SAADC_RESOLUTION_VAL_Pos;
NRF_SAADC->RESULT.MAXCNT = 1;
NRF_SAADC->RESULT.PTR = (uint32_t)&batteryRaw;
NRF_SAADC->SAMPLERATE = SAADC_SAMPLERATE_MODE_Task << SAADC_SAMPLERATE_MODE_Pos;
NRF_SAADC->ENABLE = SAADC_ENABLE_ENABLE_Enabled << SAADC_ENABLE_ENABLE_Pos;
NRF_SAADC->TASKS_CALIBRATEOFFSET = 1;
while (NRF_SAADC->EVENTS_CALIBRATEDONE == 0)
;
NRF_SAADC->EVENTS_CALIBRATEDONE = 0;
while (NRF_SAADC->STATUS == (SAADC_STATUS_STATUS_Busy << SAADC_STATUS_STATUS_Pos))
;
NRF_SAADC->ENABLE = SAADC_ENABLE_ENABLE_Disabled << SAADC_ENABLE_ENABLE_Pos;
}
void getVoltage() {
NRF_SAADC->ENABLE = SAADC_ENABLE_ENABLE_Enabled << SAADC_ENABLE_ENABLE_Pos;
NRF_SAADC->TASKS_START = 1;
while (NRF_SAADC->EVENTS_STARTED == 0)
;
NRF_SAADC->EVENTS_STARTED = 0;
NRF_SAADC->TASKS_SAMPLE = 1;
while (NRF_SAADC->EVENTS_END == 0)
;
NRF_SAADC->EVENTS_END = 0;
// Convert the result to voltage
// Result = [V(p) - V(n)] * GAIN/REFERENCE * 2^(RESOLUTION)
// Result = (VDD - 0) * ((1/6) / 0.6) * 2^14
// VDD = Result / 4551.1
batteryRaw *= 10000;
batteryRaw /= 45511;
batteryVoltage = (uint16_t)batteryRaw;
printf("voltage = %d\n", batteryVoltage);
// Stop the SAADC, since it's not used anymore.
NRF_SAADC->TASKS_STOP = 1;
while (NRF_SAADC->EVENTS_STOPPED == 0)
;
NRF_SAADC->EVENTS_STOPPED = 0;
NRF_SAADC->ENABLE = SAADC_ENABLE_ENABLE_Disabled << SAADC_ENABLE_ENABLE_Pos;
}
void setupTemperature() {
// Trigger temperature measurement
NRF_TEMP->A0 = NRF_FICR->TEMP.A0;
NRF_TEMP->A1 = NRF_FICR->TEMP.A1;
NRF_TEMP->A2 = NRF_FICR->TEMP.A2;
NRF_TEMP->A3 = NRF_FICR->TEMP.A3;
NRF_TEMP->A4 = NRF_FICR->TEMP.A4;
NRF_TEMP->A5 = NRF_FICR->TEMP.A5;
// top two 'B0' and 'B1' are also in binary.h by the Arduino framework...
NRF_TEMP->B0 = NRF_FICR->TEMP.B0;
NRF_TEMP->B1 = NRF_FICR->TEMP.B1;
NRF_TEMP->B2 = NRF_FICR->TEMP.B2;
NRF_TEMP->B3 = NRF_FICR->TEMP.B3;
NRF_TEMP->B4 = NRF_FICR->TEMP.B4;
NRF_TEMP->B5 = NRF_FICR->TEMP.B5;
NRF_TEMP->T0 = NRF_FICR->TEMP.T0;
NRF_TEMP->T1 = NRF_FICR->TEMP.T1;
NRF_TEMP->T2 = NRF_FICR->TEMP.T2;
NRF_TEMP->T3 = NRF_FICR->TEMP.T3;
NRF_TEMP->T4 = NRF_FICR->TEMP.T4;
}
void getTemperature() {
NRF_TEMP->TASKS_START = 1;
// Wait until measurement is finished
while (NRF_TEMP->EVENTS_DATARDY == 0)
;
NRF_TEMP->EVENTS_DATARDY = 0;
// Read temperature and convert to celcius (rounding down)
int32_t temp = (int32_t)NRF_TEMP->TEMP;
temp *= 25;
temperature = (uint8_t)(temp / 100);
printf("temp = %lu.%lu\n", temp / 100, temp % 100);
}
void boardGetOwnMac(uint8_t *mac) {
mac[0] = MAC_ID_1;
mac[1] = MAC_ID_0;
@@ -58,72 +162,83 @@ uint32_t sleepMsEntry = 0;
uint32_t loops = 0;
bool interruped = false;
//uint8_t ledcfg[12] = {0b00100010,0x78,0b00100100,5,0x03,0b01000011,1,0xC2,0b1100001,10,10,0};
//uint8_t ledcfg[12] = {0b00010010,0x7D,0,0,0x03,0xE8,0,0,0,0,0,0};
uint8_t ledcfg[12] = {255,0,0,0,0,0,0,0,0,0,0,0};
// uint8_t ledcfg[12] = {0b00100010,0x78,0b00100100,5,0x03,0b01000011,1,0xC2,0b1100001,10,10,0};
// uint8_t ledcfg[12] = {0b00010010,0x7D,0,0,0x03,0xE8,0,0,0,0,0,0};
uint8_t ledcfg[12] = {255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void setled(uint64_t parta,u_int32_t partb){
void setled(uint64_t parta, u_int32_t partb) {
ledcfg[0] = parta & 0xFF;
ledcfg[1] = (parta >> 8)& 0xFF;
ledcfg[2] = (parta >> 16)& 0xFF;
ledcfg[3] = (parta >> 24)& 0xFF;
ledcfg[4] = (parta >> 32)& 0xFF;
ledcfg[5] = (parta >> 40)& 0xFF;
ledcfg[6] = (parta >> 48)& 0xFF;
ledcfg[7] = (parta >> 56)& 0xFF;
ledcfg[1] = (parta >> 8) & 0xFF;
ledcfg[2] = (parta >> 16) & 0xFF;
ledcfg[3] = (parta >> 24) & 0xFF;
ledcfg[4] = (parta >> 32) & 0xFF;
ledcfg[5] = (parta >> 40) & 0xFF;
ledcfg[6] = (parta >> 48) & 0xFF;
ledcfg[7] = (parta >> 56) & 0xFF;
ledcfg[8] = partb & 0xFF;
ledcfg[9] = (partb >> 8)& 0xFF;
ledcfg[10] = (partb >> 16)& 0xFF;
ledcfg[11] = (partb >> 24)& 0xFF;
ledcfg[9] = (partb >> 8) & 0xFF;
ledcfg[10] = (partb >> 16) & 0xFF;
ledcfg[11] = (partb >> 24) & 0xFF;
}
void resettimer(){
//tell the sleep function to net sleep again
void resettimer() {
// tell the sleep function to net sleep again
sleepMsEntry = sleepMsEntry - 999999999;
loops = 0;
interruped = true;
}
void flashled(uint8_t color,uint8_t brightnes){
void flashled(uint8_t color, uint8_t brightnes) {
uint8_t colorred = (color >> 5) & 0b00000111;
uint8_t colorgreen = (color >> 2) & 0b00000111;
uint8_t colorblue = color & 0b00000011;
for(uint16_t i = 0;i < brightnes;i++){
digitalWrite(LED_RED, !(colorred >= 7));
digitalWrite(LED_GREEN, !(colorgreen >= 7));
digitalWrite(LED_BLUE, !(colorblue >= 3));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 1));
digitalWrite(LED_GREEN, !(colorgreen >= 1));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 6));
digitalWrite(LED_GREEN, !(colorgreen >= 6));
digitalWrite(LED_BLUE, !(colorblue >= 1));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 2));
digitalWrite(LED_GREEN, !(colorgreen >= 2));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 5));
digitalWrite(LED_GREEN, !(colorgreen >= 5));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 3));
digitalWrite(LED_GREEN, !(colorgreen >= 3));
digitalWrite(LED_BLUE, !(colorblue >= 2));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 4));
digitalWrite(LED_GREEN, !(colorgreen >= 4));
nrf_delay_us(100);
digitalWrite(LED_RED, HIGH);
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_BLUE, HIGH);
for (uint16_t i = 0; i < brightnes; i++) {
digitalWrite(LED_RED, !(colorred >= 7));
digitalWrite(LED_GREEN, !(colorgreen >= 7));
digitalWrite(LED_BLUE, !(colorblue >= 3));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 1));
digitalWrite(LED_GREEN, !(colorgreen >= 1));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 6));
digitalWrite(LED_GREEN, !(colorgreen >= 6));
digitalWrite(LED_BLUE, !(colorblue >= 1));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 2));
digitalWrite(LED_GREEN, !(colorgreen >= 2));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 5));
digitalWrite(LED_GREEN, !(colorgreen >= 5));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 3));
digitalWrite(LED_GREEN, !(colorgreen >= 3));
digitalWrite(LED_BLUE, !(colorblue >= 2));
nrf_delay_us(100);
digitalWrite(LED_RED, !(colorred >= 4));
digitalWrite(LED_GREEN, !(colorgreen >= 4));
nrf_delay_us(100);
digitalWrite(LED_RED, HIGH);
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_BLUE, HIGH);
}
}
void sleepwithinterrupts(uint32_t sleepinterval){
yield();
sleepMsEntry = millis();
//sometimes we wake up early
while (millis() - sleepMsEntry < sleepinterval){
void sleepwithinterrupts(uint32_t sleepinterval) {
yield();
sleepMsEntry = millis();
// disable GPIOTE
if (disablePinInterruptSleep) {
for (uint8_t c = 0; c < 8; c++) {
for (uint8_t d = 0; d < 32; d++) {
uint32_t e = ((uint32_t)d) << 8;
NRF_GPIOTE->CONFIG[c] = e;
}
}
}
// sometimes we wake up early
while (millis() - sleepMsEntry < sleepinterval) {
initRTC0(sleepinterval);
__WFE();
__SEV();
@@ -131,29 +246,28 @@ void sleepwithinterrupts(uint32_t sleepinterval){
}
}
void ledflashlogic(uint32_t ms){
void ledflashlogic(uint32_t ms) {
watchdog_enable(ms + 1000);
uint8_t brightnes = ledcfg[0] >> 4 & 0b00001111;
uint8_t mode = ledcfg[0] & 0b00001111;
//lets not blink for short delays
if(ms < 2000)mode = 15;
//if(mode == 0)sleepwithinterrupts(ms);
if(mode == 1){
uint8_t color = ledcfg[1];
uint32_t ledinerv = (ledcfg[2] << 24 )+ (ledcfg[3] << 16)+ (ledcfg[4] << 8)+ ledcfg[5];
uint32_t sleepinterval = ledinerv;
loops = ms / ledinerv;
if(loops == 0){
loops = 1;
sleepinterval = ms;
}
if(sleepinterval > ms)sleepinterval = ms;
for(uint32_t i = 0;i < loops;i++){
flashled(color,brightnes);
sleepwithinterrupts(sleepinterval);
}
}
else if(mode == 0){
// lets not blink for short delays
if (ms < 2000) mode = 15;
// if(mode == 0)sleepwithinterrupts(ms);
if (mode == 1) {
uint8_t color = ledcfg[1];
uint32_t ledinerv = (ledcfg[2] << 24) + (ledcfg[3] << 16) + (ledcfg[4] << 8) + ledcfg[5];
uint32_t sleepinterval = ledinerv;
loops = ms / ledinerv;
if (loops == 0) {
loops = 1;
sleepinterval = ms;
}
if (sleepinterval > ms) sleepinterval = ms;
for (uint32_t i = 0; i < loops; i++) {
flashled(color, brightnes);
sleepwithinterrupts(sleepinterval);
}
} else if (mode == 0) {
interruped = false;
uint8_t interloopdelayfactor = 100;
u_int8_t loopdelayfactor = 100;
@@ -170,60 +284,63 @@ void ledflashlogic(uint32_t ms){
uint8_t ildelay2 = 0;
uint8_t ildelay3 = 0;
uint8_t grouprepeats = ledcfg[7];
uint32_t fulllooptime1 = loopcnt1 * loop1delay * loopdelayfactor + ildelay1 * interloopdelayfactor;
uint32_t fulllooptime2 = loopcnt2 * loop2delay * loopdelayfactor + ildelay2 * interloopdelayfactor;
uint32_t fulllooptime3 = loopcnt3 * loop3delay * loopdelayfactor + ildelay3 * interloopdelayfactor;
uint32_t fulllooptime1 = loopcnt1 * loop1delay * loopdelayfactor + ildelay1 * interloopdelayfactor;
uint32_t fulllooptime2 = loopcnt2 * loop2delay * loopdelayfactor + ildelay2 * interloopdelayfactor;
uint32_t fulllooptime3 = loopcnt3 * loop3delay * loopdelayfactor + ildelay3 * interloopdelayfactor;
uint32_t looptimesum = fulllooptime1 + fulllooptime2 + fulllooptime3;
int fittingrepeats = (int) ms / looptimesum;
int fittingrepeats = (int)ms / looptimesum;
grouprepeats = fittingrepeats;
if(grouprepeats == 0)grouprepeats = 1;
if (grouprepeats == 0) grouprepeats = 1;
for(int j = 0;j < grouprepeats;j++){
for (int j = 0; j < grouprepeats; j++) {
if (!interruped) {
for (int i = 0; i < loopcnt1; i++) {
flashled(c1, brightnes);
sleepwithinterrupts(loop1delay * loopdelayfactor);
if (interruped) break;
}
sleepwithinterrupts(ildelay1 * interloopdelayfactor);
}
if (!interruped) {
for (int i = 0; i < loopcnt2; i++) {
flashled(c2, brightnes);
sleepwithinterrupts(loop2delay * loopdelayfactor);
if (interruped) break;
}
sleepwithinterrupts(ildelay2 * interloopdelayfactor);
}
if(!interruped){
for(int i = 0;i < loopcnt1;i++){
flashled(c1,brightnes);
sleepwithinterrupts(loop1delay * loopdelayfactor);
if(interruped)break;
if (!interruped) {
for (int i = 0; i < loopcnt3; i++) {
flashled(c3, brightnes);
sleepwithinterrupts(loop3delay * loopdelayfactor);
if (interruped) break;
}
sleepwithinterrupts(ildelay3 * interloopdelayfactor);
}
if (interruped) break;
}
sleepwithinterrupts(ildelay1 * interloopdelayfactor);
}
if(!interruped){
for(int i = 0;i < loopcnt2;i++){
flashled(c2,brightnes);
sleepwithinterrupts(loop2delay * loopdelayfactor);
if(interruped)break;
}
sleepwithinterrupts(ildelay2 * interloopdelayfactor);
}
if(!interruped){
for(int i = 0;i < loopcnt3;i++){
flashled(c3,brightnes);
sleepwithinterrupts(loop3delay * loopdelayfactor);
if(interruped)break;
}
sleepwithinterrupts(ildelay3 * interloopdelayfactor);
}
if(interruped)break;
}
}
else sleepwithinterrupts(ms);
} else
sleepwithinterrupts(ms);
}
void sleepForMs(uint32_t ms) {
// Turn everything off for minimal deep sleep current
radioRxEnable(0);
// disable brownout
NRF_POWER->POFCON &= ~((uint32_t)1);
NRF_CLOCK->TASKS_HFCLKSTOP = 1U;
while ((NRF_CLOCK->HFCLKSTAT & 0x10001) == 0x10001);
while ((NRF_CLOCK->HFCLKSTAT & 0x10001) == 0x10001)
;
Serial.end();
yield();
//led and sleep stuff
// led and sleep stuff
ledflashlogic(ms);
//we have to restart the serial
// we have to restart the serial
Serial.begin(115200);
Serial.println("wu");
}
#define LF_FREQUENCY 32768UL

View File

@@ -1,9 +1,10 @@
#include "zigbee.h"
#include "epd_spi.h"
#include "eeprom_spi.h"
#define RADIO_FIRST_CHANNEL (11) //2.4-GHz channels start at 11
#define RADIO_FIRST_CHANNEL (11) // 2.4-GHz channels start at 11
#define eepromByte spiByte
// #define eepromByte spiByte ??
#define eepromPrvSelect() \
do { \
digitalWrite(FLASH_CS, LOW); \
@@ -28,6 +29,12 @@
#define EPD_CLK 19
#define EPD_MOSI 20
// these are used by the UC8159 controller.
// EPD_HLT is External (EPD)EEPROM _CS
#define EPD_HLT 23
// This is the EEPROM MISO pin (from SPI EEPROM to nRF)
#define EPD_VPP 24
#define NFC_I2C_SDA 8
#define NFC_I2C_SCL 9
#define NFC_POWER 10
@@ -47,10 +54,22 @@
#define DBG_RXD 26
#define DBG_TEST 27
#define BATTERY_VOLTAGE_MINIMUM 2450 // 2600 or below is the best we can do on the EPD
void initRTC0(uint32_t ms);
int8_t startHFCLK(void);
uint8_t isHFCLKstable(void);
void boardGetOwnMac(uint8_t *mac);
void sleepForMs(uint32_t ms);
void setled(uint64_t parta,u_int32_t partb);
void resettimer();
void setled(uint64_t parta, u_int32_t partb);
void resettimer();
extern uint16_t batteryVoltage;
extern bool lowBattery;
extern int8_t temperature;
extern bool disablePinInterruptSleep;
void setupBatteryVoltage();
void getVoltage();
void setupTemperature();
void getTemperature();

View File

@@ -4,24 +4,11 @@
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
// eeprom map
#define EEPROM_SETTINGS_AREA_START (0x01000UL)
#define EEPROM_SETTINGS_AREA_LEN (0x03000UL)
#define EEPROM_UPDATE_AREA_START (0x04000UL)
#define EEPROM_UPDATE_AREA_LEN (0x10000UL)
#define EEPROM_IMG_START (0x14000UL)
#define EEPROM_IMG_EACH (0x04000UL) // 160*296 / 8 * 2 = 0x2E40
// Mac fixed part
// 7E22CC67B298 (B29)
// 7E77B949B19A (B19)
#define MAC_ID_0 0xB1
#define MAC_ID_1 0x90
// AP mode definitions
#define HAS_EEPROM 1
#define HAS_SCREEN 1
#define AP_EMULATE_TAG 1
// hw types
#define HW_TYPE SOLUM_M3_BWR_22
@@ -32,4 +19,9 @@
#define SCREEN_XOFFSET 8
#define SCREEN_YOFFSET 0
#define EEPROM_IMG_EACH 0x3000UL // ((SCREEN_WIDTH*SCREEN_HEIGHT/8*2)+sizeof(struct eepromImageHeader)) rounded up to the nearest sector size (4096)
#define EPD_MIRROR_H
#define EPD_DRAW_DIRECTION_RIGHT
//#define CUSTOM_LUT_SUPPORT
#endif

View File

@@ -4,13 +4,6 @@
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
// eeprom map
#define EEPROM_SETTINGS_AREA_START (0x01000UL)
#define EEPROM_SETTINGS_AREA_LEN (0x03000UL)
#define EEPROM_UPDATE_AREA_START (0x04000UL)
#define EEPROM_UPDATE_AREA_LEN (0x10000UL)
#define EEPROM_IMG_START (0x14000UL)
#define EEPROM_IMG_EACH (0x04000UL) // 168*384 / 8 * 2 = 0x3F00
// Mac fixed part
// 7E22CC67B298 (B29)
@@ -29,7 +22,13 @@
#define SCREEN_WIDTH 168
#define SCREEN_HEIGHT 384
#define SCREEN_XOFFSET 0
#define SCREEN_XOFFSET 8
#define SCREEN_YOFFSET 0
#define EEPROM_IMG_EACH 0x4000UL // ((SCREEN_WIDTH*SCREEN_HEIGHT/8*2)+sizeof(struct eepromImageHeader)) rounded up to the nearest sector size (4096)
#define EPD_MIRROR_H
#define EPD_DRAW_DIRECTION_RIGHT
//#define CUSTOM_LUT_SUPPORT
#endif

View File

@@ -0,0 +1,35 @@
#ifndef _BOARDHEADER_H_
#define _BOARDHEADER_H_
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
#define EEPROM_IMG_EACH (0x05000UL) // 800 * 480 * 2 / 8 = 0x17700
// Mac fixed part
// 06F66008B7D0 (B7D)
#define MAC_ID_0 0xB7
#define MAC_ID_1 0xD0
// AP mode definitions
#define HAS_EEPROM 1
#define HAS_SCREEN 1
#define AP_EMULATE_TAG 1
// hw type
#define HW_TYPE SOLUM_M3_BWR_43
#include "../include/uc_variant_043.h"
#define SCREEN_WIDTH 152
#define SCREEN_HEIGHT 522
#define SCREEN_XOFFSET 0
#define SCREEN_YOFFSET 0
#define EPD_MIRROR_H
#define EPD_DRAW_DIRECTION_RIGHT
#define NO_BUTTONS 1
#endif

View File

@@ -0,0 +1,30 @@
#ifndef _BOARDHEADER_H_
#define _BOARDHEADER_H_
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
// Mac fixed part
// 062E4793B899 (B29)
#define MAC_ID_0 0xB8
#define MAC_ID_1 0x90 // FIX FOR THIS TYPE!!
// AP mode definitions
#define HAS_EEPROM 1
#define HAS_SCREEN 1
#define AP_EMULATE_TAG 1
// hw type
#define HW_TYPE SOLUM_M3_BWR_60
#include "../include/uc8159.h"
#define SCREEN_WIDTH 600
#define SCREEN_HEIGHT 448
#define SCREEN_XOFFSET 0
#define SCREEN_YOFFSET 0
#define EEPROM_IMG_EACH (0x11000UL)
#endif

View File

@@ -4,19 +4,12 @@
#include "../../../../tag_types.h"
#include "HAL_Newton_M3.h"
// eeprom map
#define EEPROM_SETTINGS_AREA_START (0x01000UL)
#define EEPROM_SETTINGS_AREA_LEN (0x03000UL)
#define EEPROM_UPDATE_AREA_START (0x04000UL)
#define EEPROM_UPDATE_AREA_LEN (0x10000UL)
#define EEPROM_IMG_START (0x14000UL)
#define EEPROM_IMG_EACH (0x18000UL) // 800 * 480 * 2 / 8 = 0x17700
// Mac fixed part
// 7E22CC67B298 (B29)
#define MAC_ID_0 0xB2
#define MAC_ID_1 0x90 // FIX FOR THIS TYPE!!
#define MAC_ID_0 0xBC
#define MAC_ID_1 0x90
// AP mode definitions
#define HAS_EEPROM 1
#define HAS_SCREEN 1
@@ -32,4 +25,6 @@
#define SCREEN_XOFFSET 0
#define SCREEN_YOFFSET 0
#define EEPROM_IMG_EACH (0x18000UL) // 800 * 480 * 2 / 8 = 0x17700
#endif

View File

@@ -0,0 +1,66 @@
#include "eeprom_spi.h"
#include <Arduino.h>
#include "HAL_Newton_M3.h"
#include "wdt.h"
bool eepromHWSPIStatus = false;
bool eepromHWSPIFirst = true;
void setupEepromHWSPI(bool enable) {
if (eepromHWSPIStatus != enable) {
if (enable) {
pinMode(FLASH_MISO, INPUT);
// is this the first time we're called to activate HW SPI? Do the full setup
if (eepromHWSPIFirst) {
eepromHWSPIFirst = false;
NRF_SPI1->PSELSCK = FLASH_CLK;
NRF_SPI1->PSELMOSI = FLASH_MOSI;
NRF_SPI1->PSELMISO = FLASH_MISO;
NRF_SPI1->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
NRF_SPI1->CONFIG = (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos) | (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
NRF_SPI1->FREQUENCY = SPI_FREQUENCY_FREQUENCY_M8;
NRF_SPI1->EVENTS_READY = 0;
} else {
NRF_SPI1->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
}
} else {
NRF_SPI1->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
digitalWrite(FLASH_CS, HIGH);
digitalWrite(FLASH_MISO, HIGH);
pinMode(FLASH_MISO, OUTPUT);
}
eepromHWSPIStatus = enable;
}
}
uint8_t eepromSPIByte(uint8_t data) {
// setupEepromHWSPI(true);
NRF_SPI1->TXD = data;
while (!NRF_SPI1->EVENTS_READY) {
}
data = NRF_SPI1->RXD;
NRF_SPI1->EVENTS_READY = 0;
return data;
}
void eepromSPIBlockRead(uint8_t* dst, uint16_t len) {
while (len--) {
NRF_SPI1->TXD = 0x00;
while (!NRF_SPI1->EVENTS_READY) {
}
*dst++ = NRF_SPI1->RXD;
NRF_SPI1->EVENTS_READY = 0;
}
}
void eepromSPIBlockWrite(uint8_t* src, uint16_t len) {
uint8_t dummy = 0;
while (len--) {
NRF_SPI1->TXD = *src++;
while (!NRF_SPI1->EVENTS_READY) {
}
dummy = NRF_SPI1->RXD; // we have to read some data, otherwise SPI will clog up.
NRF_SPI1->EVENTS_READY = 0;
}
(void)dummy; // shut up that unused warning
}

View File

@@ -0,0 +1,7 @@
#pragma once
#include <stdint.h>
uint8_t eepromSPIByte(uint8_t data);
void eepromSPIBlockRead(uint8_t* dst, uint16_t len);
void eepromSPIBlockWrite(uint8_t* src, uint16_t len);
void setupEepromHWSPI(bool);

View File

@@ -4,6 +4,69 @@
#include "HAL_Newton_M3.h"
#include "wdt.h"
#include "stdarg.h"
bool epdGPIOActive = false;
void epdReset() {
digitalWrite(EPD_RST, HIGH);
delay(12);
digitalWrite(EPD_RST, LOW);
delay(20);
digitalWrite(EPD_RST, HIGH);
delay(20);
}
void epdConfigGPIO(bool setup) {
if (epdGPIOActive == setup)
return;
if (setup) {
pinMode(EPD_POWER, OUTPUT);
digitalWrite(EPD_POWER, HIGH);
pinMode(EPD_RST, OUTPUT);
pinMode(EPD_BS, OUTPUT);
pinMode(EPD_CS, OUTPUT);
pinMode(EPD_DC, OUTPUT);
pinMode(EPD_BUSY, INPUT);
pinMode(EPD_CLK, OUTPUT);
pinMode(EPD_MOSI, OUTPUT);
pinMode(EPD_HLT, OUTPUT);
pinMode(EPD_VPP, INPUT);
digitalWrite(EPD_BS, LOW); // low works!
digitalWrite(EPD_CS, HIGH);
digitalWrite(EPD_HLT, HIGH);
epdHardSPI(true);
} else {
epdHardSPI(false);
digitalWrite(EPD_POWER, LOW);
pinMode(EPD_RST, OUTPUT);
pinMode(EPD_BS, OUTPUT);
pinMode(EPD_CS, OUTPUT);
pinMode(EPD_DC, OUTPUT);
pinMode(EPD_BUSY, OUTPUT);
pinMode(EPD_CLK, OUTPUT);
pinMode(EPD_MOSI, OUTPUT);
pinMode(EPD_HLT, OUTPUT);
pinMode(EPD_VPP, OUTPUT);
digitalWrite(EPD_RST, LOW);
digitalWrite(EPD_BS, LOW);
digitalWrite(EPD_CS, LOW);
digitalWrite(EPD_DC, LOW);
digitalWrite(EPD_BUSY, LOW);
digitalWrite(EPD_CLK, LOW);
digitalWrite(EPD_MOSI, LOW);
digitalWrite(EPD_HLT, LOW);
digitalWrite(EPD_VPP, LOW);
}
epdGPIOActive = setup;
}
void epd_busy() {
}
@@ -39,14 +102,15 @@ void epdBusyWaitRising(uint32_t timeout) {
attachInterrupt(digitalPinToInterrupt(EPD_BUSY), epd_busy, RISING);
NRF_GPIO->PIN_CNF[EPD_BUSY] &= ~((uint32_t)GPIO_PIN_CNF_SENSE_Msk);
NRF_GPIO->PIN_CNF[EPD_BUSY] |= ((uint32_t)GPIO_PIN_CNF_SENSE_High << GPIO_PIN_CNF_SENSE_Pos);
while (millis() - start < timeout) {
initRTC0(100);
__WFE();
__SEV();
__WFE();
if (digitalRead(EPD_BUSY)) {
printf("Screen done %lu ms\n", millis() - start);
wdt30s();
digitalPinToInterrupt(EPD_BUSY);
return;
}
}
@@ -60,17 +124,134 @@ void epdBusyWaitRising(uint32_t timeout) {
}
}
static uint16_t epdSPIXferBytes;
static uint8_t* epdSPIWrite;
static uint8_t* epdSPIRead;
static volatile bool epdSPIWriteComplete = false;
#ifdef __cplusplus
extern "C" {
#endif
// Yes, this is the wrong interrupt handler. We're supposed to be using SPI0, I think. Something is not right in the definition :)
void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler(void) {
NRF_SPI0->EVENTS_READY = 0;
if (epdSPIRead != nullptr)
*epdSPIRead++ = NRF_SPI0->RXD;
else {
uint8_t dummy = NRF_SPI0->RXD;
(void)dummy;
}
epdSPIXferBytes--;
if (epdSPIXferBytes) {
if (epdSPIWrite != nullptr)
NRF_SPI0->TXD = *(epdSPIWrite++);
else
NRF_SPI0->TXD = 0x00;
} else {
epdSPIWriteComplete = true;
}
}
#ifdef __cplusplus
}
#endif
void epdSPIWait() {
while (!epdSPIWriteComplete)
;
}
bool HWSPIStatus = false;
bool HWSPIFirst = true;
void epdHardSPI(bool enable) {
if (HWSPIStatus != enable) {
if (enable) {
// is this the first time we're called to activate HW SPI? Do the full setup
if (HWSPIFirst) {
HWSPIFirst = false;
NRF_SPI0->PSELSCK = EPD_CLK;
NRF_SPI0->PSELMOSI = EPD_MOSI;
NRF_SPI0->PSELMISO = EPD_VPP;
NRF_SPI0->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
NRF_SPI0->CONFIG = (SPI_CONFIG_CPOL_ActiveHigh << SPI_CONFIG_CPOL_Pos) | (SPI_CONFIG_CPHA_Leading << SPI_CONFIG_CPHA_Pos);
NRF_SPI0->FREQUENCY = SPI_FREQUENCY_FREQUENCY_M8;
NRF_SPI0->EVENTS_READY = 0;
NVIC_ClearPendingIRQ(SPIM0_SPIS0_SPI0_IRQn);
NRF_SPI0->INTENSET = 0x04;
NVIC_EnableIRQ(SPIM0_SPIS0_SPI0_IRQn);
} else {
NRF_SPI0->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
}
} else {
NRF_SPI0->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
}
HWSPIStatus = enable;
}
}
void epdSPIAsyncWrite(uint8_t* data, uint16_t len) {
epdSPIWriteComplete = false;
epdSPIXferBytes = len;
epdSPIWrite = data;
epdSPIRead = nullptr;
NRF_SPI0->TXD = *(epdSPIWrite++);
}
void epdSPIReadBlock(uint8_t* data, uint16_t len) {
epdSPIWriteComplete = false;
epdSPIXferBytes = len;
epdSPIRead = data;
epdSPIWrite = nullptr;
NRF_SPI0->TXD = 0x00;
epdSPIWait();
}
void spi_write(uint8_t data) {
epdSPIWriteComplete = false;
epdSPIXferBytes = 1;
epdSPIWrite = &data;
epdSPIRead = nullptr;
NRF_SPI0->TXD = *(epdSPIWrite++);
epdSPIWait();
}
// This function is used by the UC8151 version of the code, for reading EEPROM LUT data
uint8_t spi_trans(uint8_t data) {
uint8_t b = 0;
for (uint8_t i = 0; i < 8; i++) {
b <<= 1;
digitalWrite(EPD_CLK, LOW);
if (data & 0x80) {
digitalWrite(EPD_MOSI, HIGH);
} else {
digitalWrite(EPD_MOSI, LOW);
}
if (digitalRead(EPD_VPP)) b |= 1;
data = (data << 1);
digitalWrite(EPD_CLK, HIGH);
}
return b;
}
// for reading 3-wire SPI data back from the EPD
uint8_t spi3_read() {
uint8_t b = 0;
digitalWrite(EPD_BS, HIGH);
digitalWrite(EPD_CLK, LOW);
digitalWrite(EPD_MOSI, HIGH);
digitalWrite(EPD_CS, LOW);
digitalWrite(EPD_CLK, HIGH);
pinMode(EPD_MOSI, INPUT);
for (uint8_t i = 0; i < 8; i++) {
b <<= 1;
digitalWrite(EPD_CLK, LOW);
if (digitalRead(EPD_MOSI)) b |= 1;
digitalWrite(EPD_CLK, HIGH);
}
pinMode(EPD_MOSI, OUTPUT);
digitalWrite(EPD_MOSI, LOW);
digitalWrite(EPD_CS, HIGH);
digitalWrite(EPD_BS, LOW);
return b;
}
void epd_cmd(uint8_t data) {
@@ -91,3 +272,19 @@ void waitBusy() {
while (digitalRead(EPD_BUSY) == HIGH) {
}
}
void epdWrite(uint8_t reg, uint8_t len, ...) {
va_list valist;
va_start(valist, len);
markCommand();
epdSelect();
spi_write(reg);
epdDeselect();
markData();
for (uint8_t i = 0; i < len; i++) {
epdSelect();
spi_write(va_arg(valist, int));
epdDeselect();
}
va_end(valist);
}

View File

@@ -6,4 +6,39 @@ void epd_cmd(uint8_t data);
void epd_data(uint8_t data);
void waitBusy();
void epdBusyWaitFalling(uint32_t timeout);
void epdBusyWaitRising(uint32_t timeout);
void epdBusyWaitRising(uint32_t timeout);
uint8_t spi3_read();
uint8_t spi_trans(uint8_t data);
void epdWrite(uint8_t reg, uint8_t len, ...);
void epdReset();
void epdConfigGPIO(bool setup);
extern bool epdGPIOActive;
void epdSPIAsyncWrite(uint8_t* data, uint16_t len);
void epdSPIWait();
void epdSPIReadBlock(uint8_t* data, uint16_t len);
void epdHardSPI(bool enable);
#define epdSelect() \
do \
{ \
digitalWrite(EPD_CS, LOW); \
} while (0)
#define epdDeselect() \
do \
{ \
digitalWrite(EPD_CS, HIGH); \
} while (0)
#define markCommand() \
do { \
digitalWrite(EPD_DC, LOW); \
} while (0)
#define markData() \
do { \
digitalWrite(EPD_DC, HIGH); \
} while (0)

View File

@@ -0,0 +1,202 @@
#pragma once
const uint8_t FreeSans9pt7bBitmaps[] PROGMEM = {
0xFF, 0xFF, 0xF8, 0xC0, 0xDE, 0xF7, 0x20, 0x09, 0x86, 0x41, 0x91, 0xFF,
0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, 0x10, 0x1F,
0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35,
0x33, 0xF0, 0x40, 0x20, 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40,
0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63,
0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, 0x0E, 0x06, 0x60, 0xCC, 0x19, 0x81,
0xE0, 0x18, 0x0F, 0x03, 0x36, 0xC2, 0xD8, 0x73, 0x06, 0x31, 0xE3, 0xC4,
0xFE, 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, 0x8C, 0x46,
0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, 0x25, 0x7E, 0xA5, 0x00, 0x30,
0xC3, 0x3F, 0x30, 0xC3, 0x0C, 0xD6, 0xF0, 0xC0, 0x08, 0x44, 0x21, 0x10,
0x84, 0x42, 0x11, 0x08, 0x00, 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33,
0x30, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18,
0x10, 0x08, 0x07, 0xF8, 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07,
0x03, 0xC3, 0xC3, 0x66, 0x3C, 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46,
0xFE, 0x18, 0x30, 0x60, 0xC0, 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3,
0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, 0x1E, 0x31, 0x98, 0x78,
0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, 0xFF,
0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30,
0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0,
0x6C, 0x63, 0xE0, 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03,
0x03, 0xC2, 0x66, 0x3C, 0xC0, 0x00, 0x30, 0xC0, 0x00, 0x00, 0x64, 0xA0,
0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, 0xFF,
0x80, 0x00, 0x1F, 0xF0, 0x00, 0x70, 0x0E, 0x01, 0xC0, 0x18, 0x38, 0x71,
0xC0, 0x80, 0x00, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18,
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01, 0x80, 0xC0,
0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0xC0, 0x78, 0x0F,
0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01,
0xB0, 0x61, 0xF0, 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04,
0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, 0xC1, 0x81, 0x30,
0xE1, 0x98, 0x70, 0xCC, 0x28, 0x66, 0x26, 0x21, 0x13, 0x30, 0xC8, 0x98,
0x6C, 0x4C, 0x14, 0x34, 0x0A, 0x1A, 0x07, 0x07, 0x03, 0x03, 0x80, 0x81,
0x80, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x0F, 0x00, 0xE0, 0x06, 0x00,
0xF0, 0x19, 0x01, 0x98, 0x30, 0xC6, 0x0E, 0x60, 0x60, 0xC0, 0x36, 0x06,
0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60,
0x06, 0x00, 0x60, 0x06, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03,
0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, 0xFB, 0x6D,
0xB6, 0xDB, 0x6D, 0xB6, 0xE0, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84,
0x10, 0x80, 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, 0x30, 0x60, 0xA2,
0x44, 0xD8, 0xA1, 0x80, 0xFF, 0xC0, 0xC6, 0x30, 0x7E, 0x71, 0xB0, 0xC0,
0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, 0xC0, 0x60, 0x30, 0x1B,
0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE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x3C, 0x07, 0xC3, 0xE3, 0x7E,
0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3,
0xC3, 0xC3, 0xC7, 0x7B, 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0,
0x28, 0x1C, 0x0C, 0x00, 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3,
0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, 0x43, 0x62, 0x36,
0x1C, 0x18, 0x1C, 0x3C, 0x26, 0x62, 0x43, 0xC1, 0x21, 0x98, 0xCC, 0x42,
0x61, 0xB0, 0xD0, 0x38, 0x1C, 0x0C, 0x06, 0x03, 0x01, 0x03, 0x00, 0xFE,
0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, 0x36, 0x66, 0x66, 0x6E,
0xCE, 0x66, 0x66, 0x66, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC6, 0x66,
0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, 0x61, 0x24, 0x38};
const GFXglyph FreeSans9pt7bGlyphs[] PROGMEM = {
{0, 0, 0, 5, 0, 1}, // 0x20 ' '
{0, 2, 13, 6, 2, -12}, // 0x21 '!'
{4, 5, 4, 6, 1, -12}, // 0x22 '"'
{7, 10, 12, 10, 0, -11}, // 0x23 '#'
{22, 9, 16, 10, 1, -13}, // 0x24 '$'
{40, 16, 13, 16, 1, -12}, // 0x25 '%'
{66, 11, 13, 12, 1, -12}, // 0x26 '&'
{84, 2, 4, 4, 1, -12}, // 0x27 '''
{85, 4, 17, 6, 1, -12}, // 0x28 '('
{94, 4, 17, 6, 1, -12}, // 0x29 ')'
{103, 5, 5, 7, 1, -12}, // 0x2A '*'
{107, 6, 8, 11, 3, -7}, // 0x2B '+'
{113, 2, 4, 5, 2, 0}, // 0x2C ','
{114, 4, 1, 6, 1, -4}, // 0x2D '-'
{115, 2, 1, 5, 1, 0}, // 0x2E '.'
{116, 5, 13, 5, 0, -12}, // 0x2F '/'
{125, 8, 13, 10, 1, -12}, // 0x30 '0'
{138, 4, 13, 10, 3, -12}, // 0x31 '1'
{145, 9, 13, 10, 1, -12}, // 0x32 '2'
{160, 8, 13, 10, 1, -12}, // 0x33 '3'
{173, 7, 13, 10, 2, -12}, // 0x34 '4'
{185, 9, 13, 10, 1, -12}, // 0x35 '5'
{200, 9, 13, 10, 1, -12}, // 0x36 '6'
{215, 8, 13, 10, 0, -12}, // 0x37 '7'
{228, 9, 13, 10, 1, -12}, // 0x38 '8'
{243, 8, 13, 10, 1, -12}, // 0x39 '9'
{256, 2, 10, 5, 1, -9}, // 0x3A ':'
{259, 3, 12, 5, 1, -8}, // 0x3B ';'
{264, 9, 9, 11, 1, -8}, // 0x3C '<'
{275, 9, 4, 11, 1, -5}, // 0x3D '='
{280, 9, 9, 11, 1, -8}, // 0x3E '>'
{291, 9, 13, 10, 1, -12}, // 0x3F '?'
{306, 17, 16, 18, 1, -12}, // 0x40 '@'
{340, 12, 13, 12, 0, -12}, // 0x41 'A'
{360, 11, 13, 12, 1, -12}, // 0x42 'B'
{378, 11, 13, 13, 1, -12}, // 0x43 'C'
{396, 11, 13, 13, 1, -12}, // 0x44 'D'
{414, 9, 13, 11, 1, -12}, // 0x45 'E'
{429, 8, 13, 11, 1, -12}, // 0x46 'F'
{442, 12, 13, 14, 1, -12}, // 0x47 'G'
{462, 11, 13, 13, 1, -12}, // 0x48 'H'
{480, 2, 13, 5, 2, -12}, // 0x49 'I'
{484, 7, 13, 10, 1, -12}, // 0x4A 'J'
{496, 11, 13, 12, 1, -12}, // 0x4B 'K'
{514, 8, 13, 10, 1, -12}, // 0x4C 'L'
{527, 13, 13, 15, 1, -12}, // 0x4D 'M'
{549, 11, 13, 13, 1, -12}, // 0x4E 'N'
{567, 13, 13, 14, 1, -12}, // 0x4F 'O'
{589, 10, 13, 12, 1, -12}, // 0x50 'P'
{606, 13, 14, 14, 1, -12}, // 0x51 'Q'
{629, 12, 13, 13, 1, -12}, // 0x52 'R'
{649, 10, 13, 12, 1, -12}, // 0x53 'S'
{666, 9, 13, 11, 1, -12}, // 0x54 'T'
{681, 11, 13, 13, 1, -12}, // 0x55 'U'
{699, 11, 13, 12, 0, -12}, // 0x56 'V'
{717, 17, 13, 17, 0, -12}, // 0x57 'W'
{745, 12, 13, 12, 0, -12}, // 0x58 'X'
{765, 12, 13, 12, 0, -12}, // 0x59 'Y'
{785, 10, 13, 11, 1, -12}, // 0x5A 'Z'
{802, 3, 17, 5, 1, -12}, // 0x5B '['
{809, 5, 13, 5, 0, -12}, // 0x5C '\'
{818, 3, 17, 5, 0, -12}, // 0x5D ']'
{825, 7, 7, 8, 1, -12}, // 0x5E '^'
{832, 10, 1, 10, 0, 3}, // 0x5F '_'
{834, 4, 3, 5, 0, -12}, // 0x60 '`'
{836, 9, 10, 10, 1, -9}, // 0x61 'a'
{848, 9, 13, 10, 1, -12}, // 0x62 'b'
{863, 8, 10, 9, 1, -9}, // 0x63 'c'
{873, 8, 13, 10, 1, -12}, // 0x64 'd'
{886, 8, 10, 10, 1, -9}, // 0x65 'e'
{896, 4, 13, 5, 1, -12}, // 0x66 'f'
{903, 8, 14, 10, 1, -9}, // 0x67 'g'
{917, 8, 13, 10, 1, -12}, // 0x68 'h'
{930, 2, 13, 4, 1, -12}, // 0x69 'i'
{934, 4, 17, 4, 0, -12}, // 0x6A 'j'
{943, 9, 13, 9, 1, -12}, // 0x6B 'k'
{958, 2, 13, 4, 1, -12}, // 0x6C 'l'
{962, 13, 10, 15, 1, -9}, // 0x6D 'm'
{979, 8, 10, 10, 1, -9}, // 0x6E 'n'
{989, 8, 10, 10, 1, -9}, // 0x6F 'o'
{999, 9, 13, 10, 1, -9}, // 0x70 'p'
{1014, 8, 13, 10, 1, -9}, // 0x71 'q'
{1027, 5, 10, 6, 1, -9}, // 0x72 'r'
{1034, 8, 10, 9, 1, -9}, // 0x73 's'
{1044, 4, 12, 5, 1, -11}, // 0x74 't'
{1050, 8, 10, 10, 1, -9}, // 0x75 'u'
{1060, 9, 10, 9, 0, -9}, // 0x76 'v'
{1072, 13, 10, 13, 0, -9}, // 0x77 'w'
{1089, 8, 10, 9, 0, -9}, // 0x78 'x'
{1099, 9, 14, 9, 0, -9}, // 0x79 'y'
{1115, 7, 10, 9, 1, -9}, // 0x7A 'z'
{1124, 4, 17, 6, 1, -12}, // 0x7B '{'
{1133, 2, 17, 4, 2, -12}, // 0x7C '|'
{1138, 4, 17, 6, 1, -12}, // 0x7D '}'
{1147, 7, 3, 9, 1, -7}}; // 0x7E '~'
const GFXfont FreeSans9pt7b PROGMEM = {(uint8_t *)FreeSans9pt7bBitmaps,
(GFXglyph *)FreeSans9pt7bGlyphs, 0x20,
0x7E, 22};
// Approx. 1822 bytes

View File

@@ -0,0 +1,481 @@
const uint8_t FreeSansBold18pt7bBitmaps[] PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xE7, 0x39, 0xCE, 0x73, 0x80,
0x0F, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF, 0xC7, 0xFE, 0x3F, 0xF1, 0xFF, 0x8F,
0xFC, 0x7D, 0xC1, 0xCE, 0x0E, 0x70, 0x70, 0x03, 0xC3, 0x80, 0x3C, 0x78,
0x03, 0xC7, 0x80, 0x38, 0x78, 0x07, 0x87, 0x07, 0xFF, 0xFF, 0x7F, 0xFF,
0xF7, 0xFF, 0xFF, 0x7F, 0xFF, 0xF0, 0xF0, 0xE0, 0x0F, 0x0E, 0x00, 0xF1,
0xE0, 0x0F, 0x1E, 0x00, 0xE1, 0xE0, 0xFF, 0xFF, 0xCF, 0xFF, 0xFC, 0xFF,
0xFF, 0xCF, 0xFF, 0xFC, 0x1C, 0x3C, 0x03, 0xC3, 0x80, 0x3C, 0x78, 0x03,
0xC7, 0x80, 0x38, 0x78, 0x03, 0x87, 0x80, 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FF, 0x07, 0x87,
0xC7, 0xE3, 0xF1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC1,
0xE0, 0xF0, 0xF9, 0xF8, 0xF0, 0x7E, 0x0F, 0x83, 0xC1, 0xE0, 0xF0, 0x78,
0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xFC, 0x7E, 0x1F, 0x07, 0x80,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xE0, 0xF0, 0x7C, 0x3E, 0x1F, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E,
0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x1F, 0x83, 0xC7, 0xE7, 0xC3,
0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC7, 0xE3, 0xE1,
0xF0, 0xF0, 0x00, 0x3C, 0x00, 0xFE, 0x0F, 0xFE, 0x1E, 0x1F, 0xFC, 0x0F,
0xC0, 0x0F, 0x00 };
const GFXglyph FreeSansBold18pt7bGlyphs[] PROGMEM = {
{ 0, 0, 0, 10, 0, 1 }, // 0x20 ' '
{ 0, 5, 25, 12, 4, -24 }, // 0x21 '!'
{ 16, 13, 9, 17, 2, -25 }, // 0x22 '"'
{ 31, 20, 24, 19, 0, -23 }, // 0x23 '#'
{ 91, 19, 29, 19, 0, -25 }, // 0x24 '$'
{ 160, 29, 25, 31, 1, -24 }, // 0x25 '%'
{ 251, 22, 25, 25, 2, -24 }, // 0x26 '&'
{ 320, 5, 9, 9, 2, -25 }, // 0x27 '''
{ 326, 9, 33, 12, 1, -25 }, // 0x28 '('
{ 364, 9, 33, 12, 1, -25 }, // 0x29 ')'
{ 402, 12, 11, 14, 0, -25 }, // 0x2A '*'
{ 419, 16, 16, 20, 2, -15 }, // 0x2B '+'
{ 451, 5, 11, 9, 2, -4 }, // 0x2C ','
{ 458, 9, 4, 12, 1, -10 }, // 0x2D '-'
{ 463, 5, 5, 9, 2, -4 }, // 0x2E '.'
{ 467, 9, 25, 10, 0, -24 }, // 0x2F '/'
{ 496, 17, 25, 19, 1, -24 }, // 0x30 '0'
{ 550, 10, 25, 19, 3, -24 }, // 0x31 '1'
{ 582, 17, 25, 19, 1, -24 }, // 0x32 '2'
{ 636, 17, 25, 19, 1, -24 }, // 0x33 '3'
{ 690, 16, 25, 19, 2, -24 }, // 0x34 '4'
{ 740, 17, 25, 19, 1, -24 }, // 0x35 '5'
{ 794, 18, 25, 19, 1, -24 }, // 0x36 '6'
{ 851, 17, 25, 19, 1, -24 }, // 0x37 '7'
{ 905, 17, 25, 19, 1, -24 }, // 0x38 '8'
{ 959, 17, 25, 19, 1, -24 }, // 0x39 '9'
{ 1013, 5, 18, 9, 2, -17 }, // 0x3A ':'
{ 1025, 5, 24, 9, 2, -17 }, // 0x3B ';'
{ 1040, 18, 17, 20, 1, -16 }, // 0x3C '<'
{ 1079, 17, 12, 20, 2, -13 }, // 0x3D '='
{ 1105, 18, 17, 20, 1, -16 }, // 0x3E '>'
{ 1144, 18, 26, 21, 2, -25 }, // 0x3F '?'
{ 1203, 32, 31, 34, 1, -25 }, // 0x40 '@'
{ 1327, 24, 26, 24, 0, -25 }, // 0x41 'A'
{ 1405, 20, 26, 25, 3, -25 }, // 0x42 'B'
{ 1470, 23, 26, 25, 1, -25 }, // 0x43 'C'
{ 1545, 21, 26, 25, 3, -25 }, // 0x44 'D'
{ 1614, 19, 26, 23, 3, -25 }, // 0x45 'E'
{ 1676, 17, 26, 22, 3, -25 }, // 0x46 'F'
{ 1732, 24, 26, 27, 1, -25 }, // 0x47 'G'
{ 1810, 20, 26, 26, 3, -25 }, // 0x48 'H'
{ 1875, 5, 26, 11, 3, -25 }, // 0x49 'I'
{ 1892, 16, 26, 20, 1, -25 }, // 0x4A 'J'
{ 1944, 22, 26, 25, 3, -25 }, // 0x4B 'K'
{ 2016, 17, 26, 22, 3, -25 }, // 0x4C 'L'
{ 2072, 24, 26, 30, 3, -25 }, // 0x4D 'M'
{ 2150, 20, 26, 26, 3, -25 }, // 0x4E 'N'
{ 2215, 25, 26, 27, 1, -25 }, // 0x4F 'O'
{ 2297, 19, 26, 24, 3, -25 }, // 0x50 'P'
{ 2359, 25, 27, 27, 1, -25 }, // 0x51 'Q'
{ 2444, 21, 26, 25, 3, -25 }, // 0x52 'R'
{ 2513, 20, 26, 24, 2, -25 }, // 0x53 'S'
{ 2578, 19, 26, 23, 2, -25 }, // 0x54 'T'
{ 2640, 20, 26, 26, 3, -25 }, // 0x55 'U'
{ 2705, 22, 26, 23, 1, -25 }, // 0x56 'V'
{ 2777, 32, 26, 34, 1, -25 }, // 0x57 'W'
{ 2881, 22, 26, 24, 1, -25 }, // 0x58 'X'
{ 2953, 21, 26, 22, 1, -25 }, // 0x59 'Y'
{ 3022, 19, 26, 21, 1, -25 }, // 0x5A 'Z'
{ 3084, 8, 33, 12, 2, -25 }, // 0x5B '['
{ 3117, 10, 25, 10, 0, -24 }, // 0x5C '\'
{ 3149, 8, 33, 12, 1, -25 }, // 0x5D ']'
{ 3182, 16, 15, 20, 2, -23 }, // 0x5E '^'
{ 3212, 21, 3, 19, -1, 5 }, // 0x5F '_'
{ 3220, 7, 5, 9, 1, -25 }, // 0x60 '`'
{ 3225, 18, 19, 20, 1, -18 }, // 0x61 'a'
{ 3268, 18, 26, 22, 2, -25 }, // 0x62 'b'
{ 3327, 17, 19, 20, 1, -18 }, // 0x63 'c'
{ 3368, 19, 26, 22, 1, -25 }, // 0x64 'd'
{ 3430, 18, 19, 20, 1, -18 }, // 0x65 'e'
{ 3473, 10, 26, 12, 1, -25 }, // 0x66 'f'
{ 3506, 18, 26, 21, 1, -18 }, // 0x67 'g'
{ 3565, 17, 26, 21, 2, -25 }, // 0x68 'h'
{ 3621, 5, 26, 10, 2, -25 }, // 0x69 'i'
{ 3638, 7, 33, 10, 0, -25 }, // 0x6A 'j'
{ 3667, 17, 26, 20, 2, -25 }, // 0x6B 'k'
{ 3723, 5, 26, 9, 2, -25 }, // 0x6C 'l'
{ 3740, 27, 19, 31, 2, -18 }, // 0x6D 'm'
{ 3805, 17, 19, 21, 2, -18 }, // 0x6E 'n'
{ 3846, 19, 19, 21, 1, -18 }, // 0x6F 'o'
{ 3892, 18, 26, 22, 2, -18 }, // 0x70 'p'
{ 3951, 19, 26, 22, 1, -18 }, // 0x71 'q'
{ 4013, 11, 19, 14, 2, -18 }, // 0x72 'r'
{ 4040, 17, 19, 19, 1, -18 }, // 0x73 's'
{ 4081, 9, 23, 12, 1, -22 }, // 0x74 't'
{ 4107, 17, 19, 21, 2, -18 }, // 0x75 'u'
{ 4148, 19, 19, 19, 0, -18 }, // 0x76 'v'
{ 4194, 27, 19, 27, 0, -18 }, // 0x77 'w'
{ 4259, 18, 19, 19, 1, -18 }, // 0x78 'x'
{ 4302, 19, 26, 19, 0, -18 }, // 0x79 'y'
{ 4364, 16, 19, 18, 1, -18 }, // 0x7A 'z'
{ 4402, 9, 33, 14, 1, -25 }, // 0x7B '{'
{ 4440, 3, 33, 10, 4, -25 }, // 0x7C '|'
{ 4453, 9, 33, 14, 3, -25 }, // 0x7D '}'
{ 4491, 15, 6, 18, 1, -10 } }; // 0x7E '~'
const GFXfont FreeSansBold18pt7b PROGMEM = {
(uint8_t *)FreeSansBold18pt7bBitmaps,
(GFXglyph *)FreeSansBold18pt7bGlyphs,
0x20, 0x7E, 42 };
// Approx. 5175 bytes

View File

@@ -0,0 +1,785 @@
#pragma once
const uint8_t FreeSansBold24pt7bBitmaps[] PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDF, 0x3E, 0x7C, 0xF9, 0xF3, 0xE7, 0xC7, 0x0E, 0x1C, 0x00, 0x00, 0x07,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFE, 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 0x7F, 0x80, 0x00, 0xF8};
const GFXglyph FreeSansBold24pt7bGlyphs[] PROGMEM = {
{0, 0, 0, 13, 0, 1}, // 0x20 ' '
{0, 7, 34, 16, 5, -33}, // 0x21 '!'
{30, 18, 12, 22, 2, -33}, // 0x22 '"'
{57, 26, 33, 26, 0, -31}, // 0x23 '#'
{165, 25, 40, 26, 1, -34}, // 0x24 '$'
{290, 39, 34, 42, 1, -32}, // 0x25 '%'
{456, 30, 35, 34, 3, -33}, // 0x26 '&'
{588, 7, 12, 12, 3, -33}, // 0x27 '''
{599, 13, 44, 16, 2, -33}, // 0x28 '('
{671, 13, 44, 16, 1, -33}, // 0x29 ')'
{743, 15, 15, 18, 1, -33}, // 0x2A '*'
{772, 23, 22, 27, 2, -21}, // 0x2B '+'
{836, 7, 15, 12, 2, -6}, // 0x2C ','
{850, 13, 6, 16, 1, -15}, // 0x2D '-'
{860, 7, 7, 12, 2, -6}, // 0x2E '.'
{867, 13, 34, 13, 0, -32}, // 0x2F '/'
{923, 24, 35, 26, 1, -33}, // 0x30 '0'
{1028, 14, 33, 26, 4, -32}, // 0x31 '1'
{1086, 23, 34, 26, 2, -33}, // 0x32 '2'
{1184, 23, 35, 26, 2, -33}, // 0x33 '3'
{1285, 22, 33, 26, 2, -32}, // 0x34 '4'
{1376, 23, 34, 26, 2, -32}, // 0x35 '5'
{1474, 23, 35, 26, 2, -33}, // 0x36 '6'
{1575, 23, 33, 26, 1, -32}, // 0x37 '7'
{1670, 24, 35, 26, 1, -33}, // 0x38 '8'
{1775, 24, 35, 26, 1, -33}, // 0x39 '9'
{1880, 7, 25, 12, 2, -24}, // 0x3A ':'
{1902, 7, 33, 12, 2, -24}, // 0x3B ';'
{1931, 23, 23, 27, 2, -22}, // 0x3C '<'
{1998, 23, 18, 27, 2, -19}, // 0x3D '='
{2050, 23, 23, 27, 2, -22}, // 0x3E '>'
{2117, 24, 35, 29, 3, -34}, // 0x3F '?'
{2222, 43, 41, 46, 1, -34}, // 0x40 '@'
{2443, 32, 34, 33, 0, -33}, // 0x41 'A'
{2579, 27, 34, 33, 4, -33}, // 0x42 'B'
{2694, 30, 36, 34, 2, -34}, // 0x43 'C'
{2829, 28, 34, 34, 4, -33}, // 0x44 'D'
{2948, 25, 34, 31, 4, -33}, // 0x45 'E'
{3055, 24, 34, 30, 4, -33}, // 0x46 'F'
{3157, 31, 36, 36, 2, -34}, // 0x47 'G'
{3297, 27, 34, 35, 4, -33}, // 0x48 'H'
{3412, 7, 34, 15, 4, -33}, // 0x49 'I'
{3442, 22, 35, 27, 1, -33}, // 0x4A 'J'
{3539, 30, 34, 34, 4, -33}, // 0x4B 'K'
{3667, 23, 34, 29, 4, -33}, // 0x4C 'L'
{3765, 33, 34, 41, 4, -33}, // 0x4D 'M'
{3906, 28, 34, 35, 4, -33}, // 0x4E 'N'
{4025, 33, 36, 37, 2, -34}, // 0x4F 'O'
{4174, 26, 34, 32, 4, -33}, // 0x50 'P'
{4285, 33, 37, 37, 2, -34}, // 0x51 'Q'
{4438, 28, 34, 34, 4, -33}, // 0x52 'R'
{4557, 28, 36, 32, 2, -34}, // 0x53 'S'
{4683, 27, 34, 30, 2, -33}, // 0x54 'T'
{4798, 27, 35, 35, 4, -33}, // 0x55 'U'
{4917, 29, 34, 31, 1, -33}, // 0x56 'V'
{5041, 43, 34, 45, 1, -33}, // 0x57 'W'
{5224, 30, 34, 32, 1, -33}, // 0x58 'X'
{5352, 29, 34, 30, 1, -33}, // 0x59 'Y'
{5476, 26, 34, 29, 1, -33}, // 0x5A 'Z'
{5587, 11, 43, 16, 3, -33}, // 0x5B '['
{5647, 14, 34, 13, -1, -32}, // 0x5C '\'
{5707, 11, 43, 16, 1, -33}, // 0x5D ']'
{5767, 22, 20, 27, 3, -32}, // 0x5E '^'
{5822, 28, 4, 26, -1, 6}, // 0x5F '_'
{5836, 9, 7, 12, 1, -35}, // 0x60 '`'
{5844, 24, 26, 27, 2, -24}, // 0x61 'a'
{5922, 25, 35, 29, 3, -33}, // 0x62 'b'
{6032, 23, 26, 26, 2, -24}, // 0x63 'c'
{6107, 25, 35, 29, 2, -33}, // 0x64 'd'
{6217, 24, 26, 27, 2, -24}, // 0x65 'e'
{6295, 14, 34, 16, 1, -33}, // 0x66 'f'
{6355, 24, 36, 29, 2, -24}, // 0x67 'g'
{6463, 23, 34, 28, 3, -33}, // 0x68 'h'
{6561, 7, 34, 13, 3, -33}, // 0x69 'i'
{6591, 10, 45, 13, 0, -33}, // 0x6A 'j'
{6648, 23, 34, 27, 3, -33}, // 0x6B 'k'
{6746, 7, 34, 13, 3, -33}, // 0x6C 'l'
{6776, 36, 25, 42, 3, -24}, // 0x6D 'm'
{6889, 23, 25, 29, 3, -24}, // 0x6E 'n'
{6961, 25, 26, 29, 2, -24}, // 0x6F 'o'
{7043, 25, 36, 29, 3, -24}, // 0x70 'p'
{7156, 25, 36, 29, 2, -24}, // 0x71 'q'
{7269, 15, 25, 18, 3, -24}, // 0x72 'r'
{7316, 24, 26, 26, 1, -24}, // 0x73 's'
{7394, 12, 32, 16, 2, -30}, // 0x74 't'
{7442, 23, 26, 29, 3, -24}, // 0x75 'u'
{7517, 25, 25, 25, 0, -24}, // 0x76 'v'
{7596, 35, 25, 37, 1, -24}, // 0x77 'w'
{7706, 24, 25, 26, 1, -24}, // 0x78 'x'
{7781, 25, 36, 26, 0, -24}, // 0x79 'y'
{7894, 21, 25, 24, 1, -24}, // 0x7A 'z'
{7960, 13, 43, 18, 2, -33}, // 0x7B '{'
{8030, 4, 44, 13, 5, -33}, // 0x7C '|'
{8052, 13, 43, 18, 3, -33}, // 0x7D '}'
{8122, 21, 8, 23, 1, -14}}; // 0x7E '~'
const GFXfont FreeSansBold24pt7b PROGMEM = {
(uint8_t *)FreeSansBold24pt7bBitmaps, (GFXglyph *)FreeSansBold24pt7bGlyphs,
0x20, 0x7E, 56};
// Approx. 8815 bytes

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,111 @@
#include <Arduino.h>
#include <stdint.h>
#define DRAWING_MIN_BITMAP_SIZE (128) //minimum size we'll consider
#define COLOR_RED 1
#define COLOR_BLACK 0
void set_offline(boolean state);
#define IMAGE_OR 1
#define IMAGE_REPLACE 0
#define DRAW_INVERTED 1
#define DRAW_NORMAL 0
typedef struct {
uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap
uint8_t width; ///< Bitmap dimensions in pixels
uint8_t height; ///< Bitmap dimensions in pixels
uint8_t xAdvance; ///< Distance to advance cursor (x axis)
int8_t xOffset; ///< X dist from cursor pos to UL corner
int8_t yOffset; ///< Y dist from cursor pos to UL corner
} GFXglyph;
/// Data stored for FONT AS A WHOLE
typedef struct {
uint8_t *bitmap; ///< Glyph bitmaps, concatenated
GFXglyph *glyph; ///< Glyph array
uint16_t first; ///< ASCII extents (first char)
uint16_t last; ///< ASCII extents (last char)
uint8_t yAdvance; ///< Newline distance (y axis)
} GFXfont;
enum rotation {
ROTATE_0,
ROTATE_90,
ROTATE_180,
ROTATE_270
};
void addBufferedImage(uint16_t x, uint16_t y, bool color, enum rotation ro, const uint8_t *image, bool mask);
void addFlashImage(uint16_t x, uint16_t y, bool color, enum rotation ro, const uint8_t *image);
void addQR(uint16_t x, uint16_t y, uint8_t version, uint8_t scale, const char *c, ...);
void drawImageAtAddress(uint32_t addr, uint8_t lut);
void drawImageFromBuffer(uint8_t* buffer, const uint8_t lut);
void drawRoundedRectangle(uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, bool color);
void drawMask(uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, bool color);
class drawItem {
public:
drawItem();
~drawItem();
void setRotation(enum rotation ro);
void addItem(uint8_t *data, uint16_t width, uint16_t height);
bool addToList();
static void shiftBytesRight(uint8_t *data, uint8_t shift, uint8_t len);
static void renderDrawLine(uint8_t *line, uint16_t number, uint8_t c);
static void flushDrawItems();
enum drawType {
DRAW_FONT,
DRAW_BUFFERED_1BPP,
DRAW_MASK,
DRAW_EEPROM_1BPP,
DRAW_EEPROM_2BPP,
} type;
int16_t xpos;
int16_t ypos;
enum rotation rotate = ROTATE_0;
uint8_t color = 0;
bool direction = false;
bool mirrorH = false;
bool mirrorV = false;
uint16_t width;
uint16_t height;
// if this is true, clean up the reference (free memory).
bool cleanUp = true;
protected:
void copyWithByteShift(uint8_t *dst, uint8_t *src, uint8_t src_len, uint8_t offset);
void reverseBytes(uint8_t *src, uint8_t src_len);
uint8_t bitReverse(uint8_t byte);
void getDrawLine(uint8_t *line, uint16_t number, uint8_t c);
void getXLine(uint8_t *line, uint16_t yPos, uint8_t color);
void getYLine(uint8_t *line, uint16_t xPos, uint8_t color);
uint8_t widthBytes = 0;
uint8_t *buffer;
};
class fontrender {
public:
void epdPrintf(uint16_t x, uint16_t y, bool color, enum rotation ro, const char *c, ...);
fontrender(const GFXfont *font);
void setFont(const GFXfont *font);
protected:
GFXfont *gfxFont; // = &FreeSansBold18pt7b;
uint16_t bufferByteWidth = 0;
uint8_t *fb = nullptr;
uint16_t Xpixels;
uint8_t drawChar(int32_t x, int32_t y, uint16_t c, uint8_t size);
uint8_t getCharWidth(uint16_t c);
void drawFastHLine(uint16_t x, uint16_t y, uint16_t w);
void fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
};
#endif

View File

@@ -30,17 +30,12 @@ void eepromReadStart(uint32_t addr) ;
#define EEPROM_IMG_INPROGRESS (0x7fffffffUL)
#define EEPROM_IMG_VALID (0x494d4721UL)
struct EepromImageHeader { //each image space is 0x17000 bytes, we have space for ten of them
struct EepromImageHeader {
uint64_t version;
uint32_t validMarker;
uint32_t size;
uint8_t dataType;
uint32_t id;
//image data here
//we pre-erase so progress can be calculated by finding the first non-0xff byte
};
#endif

View File

@@ -1,260 +1,5 @@
#pragma once
#include <Arduino.h>
static const uint8_t font[256][20]={ // https://raw.githubusercontent.com/basti79/LCD-fonts/master/10x16_vertikal_MSB_1.h
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x00
{0xE0,0x01,0x30,0x03,0x50,0x02,0x28,0x05,0x28,0x04,0x28,0x04,0x28,0x05,0x50,0x02,0x30,0x03,0xE0,0x01}, // 0x01
{0xE0,0x01,0xF0,0x03,0xB0,0x03,0xD8,0x06,0xD8,0x07,0xD8,0x07,0xD8,0x06,0xB0,0x03,0xF0,0x03,0xE0,0x01}, // 0x02
{0x00,0x3E,0x80,0x7F,0xE0,0x7F,0xF0,0x7F,0xF8,0x3F,0xF8,0x3F,0xF0,0x7F,0xE0,0x7F,0x80,0x7F,0x00,0x3E}, // 0x03
{0x00,0x01,0x80,0x03,0xC0,0x0F,0xE0,0x1F,0xF8,0x7F,0xF0,0x1F,0xE0,0x0F,0xC0,0x07,0x80,0x03,0x00,0x01}, // 0x04
{0x80,0x03,0xC0,0x07,0xC0,0x07,0xC0,0x3F,0xF8,0x7F,0xB8,0x7F,0xC0,0x3F,0xC0,0x07,0xC0,0x07,0x80,0x03}, // 0x05
{0x80,0x03,0xC0,0x07,0xC0,0x0F,0xC0,0x1F,0xF8,0x3F,0xB8,0x7F,0xC0,0x1F,0xC0,0x0F,0xC0,0x07,0x80,0x03}, // 0x06
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x07
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x08
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x09
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x0A
{0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x08,0x24,0x10,0x2E,0xE0,0x71,0x00,0x70,0x00,0x18}, // 0x0B
{0x00,0x00,0x00,0x1E,0x20,0x21,0xA0,0x40,0xF8,0x40,0xA0,0x40,0xA0,0x41,0x00,0x21,0x00,0x1E,0x00,0x00}, // 0x0C
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x0D
{0x06,0x00,0x0E,0x00,0x0E,0x00,0xFC,0x1F,0x00,0x18,0x30,0x10,0x70,0x30,0x70,0x20,0xE0,0x7F,0x00,0x00}, // 0x0E
{0x00,0x01,0xC0,0x0F,0xC0,0x04,0x40,0x08,0x60,0x18,0x40,0x08,0x40,0x04,0xC0,0x0C,0xC0,0x0B,0x00,0x01}, // 0x0F
{0xF8,0x0F,0xF0,0x07,0xF0,0x07,0xE0,0x03,0xE0,0x03,0xE0,0x03,0xC0,0x01,0xC0,0x01,0x80,0x00,0x80,0x00}, // 0x10
{0x80,0x00,0x80,0x00,0xC0,0x01,0xC0,0x01,0xE0,0x03,0xE0,0x03,0xE0,0x03,0xF0,0x07,0xF0,0x07,0xF8,0x0F}, // 0x11
{0x00,0x00,0x00,0x00,0x08,0x10,0x04,0x20,0xFE,0x7F,0x04,0x20,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x12
{0x00,0x00,0x00,0x00,0xD8,0x7F,0x00,0x00,0x00,0x00,0xD8,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x13
{0x00,0x00,0x00,0x38,0x00,0x7C,0x00,0x7E,0xFE,0x7F,0x00,0x40,0x00,0x40,0xFE,0x7F,0x00,0x00,0x00,0x00}, // 0x14
{0x00,0x00,0x00,0x00,0x86,0x3B,0xC2,0x4C,0x42,0x44,0x62,0x46,0x32,0x42,0xDC,0x41,0x00,0x00,0x00,0x00}, // 0x15
{0x00,0x00,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x00}, // 0x16
{0x00,0x00,0x00,0x00,0x11,0x10,0x09,0x20,0xFD,0x7F,0x09,0x20,0x11,0x10,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x17
{0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x20,0xFE,0x7F,0x00,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x18
{0x00,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0xFE,0x7F,0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x19
{0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xA0,0x02,0xC0,0x01,0x80,0x00,0x00,0x00}, // 0x1A
{0x00,0x00,0x80,0x00,0xC0,0x01,0xA0,0x02,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00,0x00}, // 0x1B
{0x00,0x00,0xF8,0x07,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00}, // 0x1C
{0x00,0x00,0x80,0x00,0xC0,0x01,0xA0,0x02,0x80,0x00,0x80,0x00,0xA0,0x02,0xC0,0x01,0x80,0x00,0x00,0x00}, // 0x1D
{0x08,0x00,0x18,0x00,0x78,0x00,0xF8,0x01,0xF8,0x03,0xF8,0x0F,0xF8,0x03,0xF8,0x00,0x38,0x00,0x08,0x00}, // 0x1E
{0x00,0x08,0x00,0x0C,0x00,0x0F,0xC0,0x0F,0xE0,0x0F,0xF8,0x0F,0xE0,0x0F,0x80,0x0F,0x00,0x0E,0x00,0x08}, // 0x1F
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x20
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x21
{0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x22
{0x80,0x00,0x98,0x04,0xE0,0x05,0x80,0x1E,0x98,0x64,0xE0,0x05,0x80,0x1E,0x80,0x64,0x80,0x04,0x00,0x00}, // 0x23
{0x00,0x00,0x00,0x00,0x18,0x38,0x08,0x64,0x08,0x42,0xFC,0xFF,0x88,0x41,0xF0,0x40,0x00,0x00,0x00,0x00}, // 0x24
{0x08,0x38,0x10,0x44,0x20,0x44,0xC0,0x44,0x00,0x39,0x70,0x02,0x88,0x0C,0x88,0x10,0x88,0x20,0x70,0x40}, // 0x25
{0xE0,0x00,0x10,0x01,0x08,0x3A,0x08,0x46,0x88,0x45,0xC8,0x4C,0x38,0x38,0x18,0x00,0x68,0x00,0x80,0x01}, // 0x26
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x27
{0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x07,0x18,0x18,0x0C,0x30,0x04,0x20,0x02,0x40,0x02,0x40,0x00,0x00}, // 0x28
{0x00,0x00,0x02,0x40,0x02,0x40,0x04,0x20,0x0C,0x30,0x18,0x18,0xE0,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x29
{0x00,0x00,0x00,0x10,0x00,0x18,0x00,0x0F,0x00,0x72,0x00,0x0F,0x00,0x18,0x00,0x10,0x00,0x00,0x00,0x00}, // 0x2A
{0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0xF8,0x07,0x40,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x00,0x00}, // 0x2B
{0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x2C
{0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x00,0x00}, // 0x2D
{0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x2E
{0x00,0x00,0x02,0x00,0x0C,0x00,0x30,0x00,0xC0,0x00,0x00,0x03,0x00,0x0C,0x00,0x30,0x00,0x40,0x00,0x00}, // 0x2F
{0x00,0x00,0xC0,0x0F,0x30,0x30,0x08,0x40,0x08,0x40,0x08,0x40,0x30,0x30,0xC0,0x0F,0x00,0x00,0x00,0x00}, // 0x30
{0x00,0x00,0x08,0x20,0x08,0x20,0x08,0x20,0xF8,0x7F,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x31
{0x00,0x00,0x18,0x60,0x28,0x40,0x48,0x40,0x88,0x40,0x08,0x43,0x08,0x3C,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x32
{0x00,0x00,0x00,0x00,0x08,0x40,0x08,0x42,0x08,0x42,0x08,0x42,0xF0,0x3D,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x33
{0xC0,0x00,0x40,0x03,0x40,0x04,0x40,0x18,0x40,0x20,0xF8,0x7F,0x40,0x00,0x40,0x00,0x00,0x00,0x00,0x00}, // 0x34
{0x00,0x00,0x00,0x00,0x08,0x7C,0x08,0x44,0x08,0x44,0x10,0x42,0xE0,0x41,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x35
{0x00,0x00,0xE0,0x0F,0x10,0x32,0x08,0x44,0x08,0x44,0x08,0x44,0x10,0x42,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x36
{0x00,0x00,0x00,0x40,0x18,0x40,0xE0,0x40,0x00,0x43,0x00,0x4C,0x00,0x50,0x00,0x60,0x00,0x00,0x00,0x00}, // 0x37
{0x00,0x00,0xF0,0x38,0x08,0x45,0x08,0x42,0x08,0x42,0x08,0x45,0x90,0x45,0x60,0x38,0x00,0x00,0x00,0x00}, // 0x38
{0x00,0x00,0x00,0x1E,0x08,0x21,0x88,0x40,0x88,0x40,0x88,0x40,0x30,0x21,0xC0,0x1F,0x00,0x00,0x00,0x00}, // 0x39
{0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x06,0x18,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x3A
{0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x06,0x1E,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x3B
{0x00,0x00,0x00,0x00,0xC0,0x00,0xC0,0x00,0x20,0x01,0x20,0x01,0x10,0x02,0x10,0x02,0x08,0x04,0x00,0x00}, // 0x3C
{0x00,0x00,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x00,0x00}, // 0x3D
{0x00,0x00,0x08,0x04,0x10,0x02,0x10,0x02,0x20,0x01,0x20,0x01,0xC0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00}, // 0x3E
{0x00,0x00,0x00,0x70,0x00,0x40,0xD8,0x40,0x00,0x41,0x00,0x42,0x00,0x64,0x00,0x38,0x00,0x00,0x00,0x00}, // 0x3F
{0xC0,0x0F,0x30,0x18,0x18,0x20,0xC8,0x47,0x28,0x48,0x68,0x50,0xD8,0x51,0xE0,0x3F,0x20,0x00,0x20,0x00}, // 0x40
{0x08,0x00,0x70,0x00,0xC0,0x01,0x40,0x0E,0x40,0x18,0x40,0x0C,0x40,0x03,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0x41
{0x00,0x00,0xF8,0x1F,0x08,0x11,0x08,0x11,0x08,0x11,0x08,0x11,0x88,0x12,0x70,0x0C,0x00,0x00,0x00,0x00}, // 0x42
{0xC0,0x03,0x30,0x0C,0x10,0x08,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x18,0x00,0x00,0x00,0x00}, // 0x43
{0x00,0x00,0xF8,0x1F,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x08,0xE0,0x07,0x00,0x00,0x00,0x00}, // 0x44
{0x00,0x00,0xF8,0x1F,0x88,0x10,0x88,0x10,0x88,0x10,0x88,0x10,0x88,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0x45
{0x00,0x00,0xF8,0x1F,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x00,0x10,0x00,0x00,0x00,0x00}, // 0x46
{0x00,0x00,0xC0,0x03,0x30,0x0C,0x10,0x08,0x08,0x10,0x08,0x10,0x88,0x10,0x88,0x10,0xF8,0x18,0x00,0x00}, // 0x47
{0x00,0x00,0xF8,0x1F,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00}, // 0x48
{0x00,0x00,0x08,0x10,0x08,0x10,0x08,0x10,0xF8,0x1F,0x08,0x10,0x08,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0x49
{0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x10,0x08,0x10,0x08,0x10,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x4A
{0x00,0x00,0xF8,0x1F,0x00,0x01,0x80,0x01,0x40,0x02,0x20,0x04,0x20,0x08,0x10,0x10,0x08,0x00,0x00,0x00}, // 0x4B
{0x00,0x00,0xF8,0x1F,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x4C
{0xF8,0x1F,0x00,0x1C,0x80,0x07,0xE0,0x00,0x60,0x00,0x80,0x03,0x00,0x1C,0xF8,0x1F,0x00,0x00,0x00,0x00}, // 0x4D
{0x00,0x00,0xF8,0x1F,0x00,0x08,0x00,0x06,0x80,0x01,0x60,0x00,0x10,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00}, // 0x4E
{0x00,0x00,0xE0,0x07,0x10,0x08,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0x4F
{0x00,0x00,0xF8,0x1F,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x00,0x11,0x00,0x0E,0x00,0x00,0x00,0x00}, // 0x50
{0x00,0x00,0xE0,0x07,0x10,0x08,0x08,0x10,0x08,0x10,0x08,0x10,0x0C,0x10,0x12,0x08,0xE2,0x07,0x00,0x00}, // 0x51
{0x00,0x00,0xF8,0x1F,0x80,0x10,0x80,0x10,0xC0,0x10,0x20,0x11,0x10,0x0E,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x52
{0x00,0x00,0x18,0x0E,0x08,0x12,0x08,0x11,0x08,0x11,0x88,0x10,0x90,0x10,0x70,0x18,0x00,0x00,0x00,0x00}, // 0x53
{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0xF8,0x1F,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x00}, // 0x54
{0x00,0x00,0xE0,0x1F,0x18,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0xE0,0x1F,0x00,0x00,0x00,0x00}, // 0x55
{0x00,0x10,0x00,0x0C,0x80,0x03,0x60,0x00,0x18,0x00,0x18,0x00,0xE0,0x00,0x00,0x03,0x00,0x0C,0x00,0x10}, // 0x56
{0x00,0x18,0xC0,0x07,0x38,0x00,0xF0,0x00,0x00,0x07,0x80,0x03,0x70,0x00,0x38,0x00,0xC0,0x07,0x00,0x18}, // 0x57
{0x08,0x10,0x10,0x08,0x20,0x04,0x40,0x02,0x80,0x01,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10}, // 0x58
{0x00,0x10,0x00,0x08,0x00,0x06,0x00,0x01,0xF8,0x00,0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10}, // 0x59
{0x00,0x00,0x18,0x10,0x28,0x10,0x48,0x10,0x88,0x10,0x08,0x11,0x08,0x12,0x08,0x14,0x08,0x18,0x00,0x00}, // 0x5A
{0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x7F,0x02,0x40,0x02,0x40,0x02,0x40,0x02,0x40,0x00,0x00,0x00,0x00}, // 0x5B
{0x00,0x00,0x00,0x40,0x00,0x30,0x00,0x0C,0x00,0x03,0xC0,0x00,0x30,0x00,0x0C,0x00,0x02,0x00,0x00,0x00}, // 0x5C
{0x00,0x00,0x02,0x40,0x02,0x40,0x02,0x40,0x02,0x40,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x5D
{0x00,0x00,0x20,0x00,0xC0,0x00,0x00,0x07,0x00,0x1C,0x00,0x70,0x00,0x0E,0xC0,0x01,0x20,0x00,0x00,0x00}, // 0x5E
{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00}, // 0x5F
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x60
{0x00,0x00,0x30,0x00,0x48,0x04,0x88,0x04,0x88,0x04,0x90,0x04,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x61
{0x00,0x00,0xF8,0x7F,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x06,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x62
{0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x08,0x04,0x08,0x04,0x00,0x00,0x00,0x00}, // 0x63
{0x00,0x00,0xE0,0x01,0x18,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x02,0xF8,0x7F,0x00,0x00,0x00,0x00}, // 0x64
{0x00,0x00,0xE0,0x01,0x90,0x02,0x88,0x04,0x88,0x04,0x88,0x04,0x88,0x04,0x88,0x03,0x00,0x00,0x00,0x00}, // 0x65
{0x00,0x00,0x00,0x04,0x00,0x04,0xF8,0x3F,0x00,0x24,0x00,0x44,0x00,0x44,0x00,0x44,0x00,0x44,0x00,0x00}, // 0x66
{0x00,0x00,0xE0,0x01,0x19,0x02,0x09,0x04,0x09,0x04,0x09,0x04,0x12,0x02,0xFC,0x07,0x00,0x00,0x00,0x00}, // 0x67
{0x00,0x00,0xF8,0x7F,0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x04,0xF8,0x03,0x00,0x00,0x00,0x00}, // 0x68
{0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x64,0xF8,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x69
{0x00,0x00,0x01,0x00,0x01,0x04,0x01,0x04,0x01,0x64,0xFE,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x6A
{0x00,0x00,0xF8,0x7F,0x80,0x00,0xC0,0x00,0x20,0x01,0x20,0x02,0x10,0x02,0x08,0x04,0x00,0x00,0x00,0x00}, // 0x6B
{0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x00,0x40,0xF8,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x6C
{0xF8,0x07,0x00,0x02,0x00,0x04,0x00,0x04,0xF8,0x03,0x00,0x02,0x00,0x04,0x00,0x04,0xF8,0x03,0x00,0x00}, // 0x6D
{0x00,0x00,0xF8,0x07,0x00,0x03,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x04,0xF8,0x03,0x00,0x00,0x00,0x00}, // 0x6E
{0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x02,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x6F
{0x00,0x00,0xFF,0x07,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x06,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x70
{0x00,0x00,0xE0,0x01,0x18,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x02,0xFF,0x07,0x00,0x00,0x00,0x00}, // 0x71
{0x00,0x00,0x00,0x00,0xF8,0x07,0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00}, // 0x72
{0x00,0x00,0x18,0x03,0x88,0x04,0x88,0x04,0x48,0x04,0x48,0x04,0x30,0x04,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x73
{0x00,0x00,0x00,0x04,0x00,0x04,0xF0,0x1F,0x08,0x04,0x08,0x04,0x08,0x04,0x08,0x04,0x00,0x00,0x00,0x00}, // 0x74
{0x00,0x00,0xF0,0x07,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x75
{0x00,0x04,0x80,0x03,0x60,0x00,0x18,0x00,0x08,0x00,0x30,0x00,0xC0,0x00,0x00,0x03,0x00,0x04,0x00,0x00}, // 0x76
{0x00,0x06,0xE0,0x01,0x18,0x00,0x70,0x00,0x80,0x03,0x80,0x01,0x70,0x00,0x18,0x00,0xE0,0x01,0x00,0x06}, // 0x77
{0x00,0x00,0x08,0x04,0x10,0x02,0x20,0x01,0xC0,0x00,0xC0,0x00,0x20,0x01,0x10,0x02,0x08,0x04,0x00,0x00}, // 0x78
{0x01,0x04,0x01,0x03,0xC1,0x00,0x62,0x00,0x1C,0x00,0x18,0x00,0x60,0x00,0x80,0x00,0x00,0x03,0x00,0x04}, // 0x79
{0x00,0x00,0x08,0x04,0x18,0x04,0x28,0x04,0x48,0x04,0x88,0x04,0x08,0x05,0x08,0x06,0x08,0x04,0x00,0x00}, // 0x7A
{0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x7C,0x3F,0x02,0x40,0x02,0x40,0x02,0x40,0x00,0x00,0x00,0x00}, // 0x7B
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x7C
{0x00,0x00,0x00,0x00,0x02,0x40,0x02,0x40,0x02,0x40,0x7C,0x3F,0x80,0x00,0x80,0x00,0x00,0x00,0x00,0x00}, // 0x7D
{0xC0,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x80,0x01}, // 0x7E
{0x00,0x00,0xF8,0x01,0x08,0x03,0x08,0x04,0x08,0x08,0x08,0x04,0x08,0x03,0xF8,0x01,0x00,0x00,0x00,0x00}, // 0x7F
{0xC0,0x03,0x30,0x0C,0x10,0x08,0x08,0x10,0x08,0x10,0x09,0x10,0x0D,0x10,0x0B,0x18,0x00,0x00,0x00,0x00}, // 0x80
{0x00,0x00,0xF0,0x07,0x08,0x20,0x08,0x00,0x08,0x00,0x10,0x20,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x81
{0x00,0x00,0xE0,0x01,0x90,0x02,0x88,0x04,0x88,0x24,0x88,0x44,0x88,0x04,0x88,0x03,0x00,0x00,0x00,0x00}, // 0x82
{0x00,0x00,0x30,0x00,0x48,0x24,0x88,0x44,0x88,0x44,0x90,0x24,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x83
{0x00,0x00,0x30,0x00,0x48,0x24,0x88,0x04,0x88,0x04,0x90,0x24,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x84
{0x00,0x00,0x30,0x00,0x48,0x44,0x88,0x24,0x88,0x04,0x90,0x04,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x85
{0x00,0x00,0x30,0x00,0x48,0x04,0x88,0x44,0x88,0xA4,0x90,0x44,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0x86
{0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x09,0x04,0x0D,0x04,0x0B,0x04,0x08,0x04,0x00,0x00,0x00,0x00}, // 0x87
{0x00,0x00,0xE0,0x01,0x90,0x22,0x88,0x44,0x88,0x44,0x88,0x24,0x88,0x04,0x88,0x03,0x00,0x00,0x00,0x00}, // 0x88
{0x00,0x00,0xE0,0x01,0x90,0x02,0x88,0x24,0x88,0x04,0x88,0x04,0x88,0x24,0x88,0x03,0x00,0x00,0x00,0x00}, // 0x89
{0x00,0x00,0xE0,0x01,0x90,0x02,0x88,0x44,0x88,0x24,0x88,0x04,0x88,0x04,0x88,0x03,0x00,0x00,0x00,0x00}, // 0x8A
{0x00,0x00,0x00,0x04,0x00,0x24,0x00,0x04,0xF8,0x07,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x8B
{0x00,0x00,0x00,0x04,0x00,0x24,0x00,0x44,0xF8,0x47,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x8C
{0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x44,0xF8,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x8D
{0x08,0x00,0x70,0x00,0xC0,0x81,0x40,0x0E,0x40,0x18,0x40,0x0C,0x40,0x83,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0x8E
{0x08,0x00,0x70,0x00,0xC0,0x01,0x40,0x4E,0x40,0xB0,0x40,0xB8,0x40,0x4F,0xC0,0x01,0x70,0x00,0x08,0x00}, // 0x8F
{0x00,0x00,0xF8,0x1F,0x88,0x10,0x88,0x10,0x88,0x50,0x88,0x90,0x88,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0x90
{0x70,0x04,0xC8,0x04,0x88,0x04,0x88,0x04,0xF0,0x03,0x98,0x04,0x88,0x04,0x88,0x04,0x88,0x03,0x00,0x00}, // 0x91
{0x08,0x00,0x30,0x00,0xE0,0x01,0x20,0x06,0x20,0x18,0xF8,0x1F,0x88,0x10,0x88,0x10,0x08,0x10,0x00,0x00}, // 0x92
{0x00,0x00,0xE0,0x01,0x10,0x22,0x08,0x44,0x08,0x44,0x08,0x24,0x10,0x02,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x93
{0x00,0x00,0xE0,0x01,0x10,0x22,0x08,0x04,0x08,0x04,0x08,0x24,0x10,0x02,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x94
{0x00,0x00,0xE0,0x01,0x10,0x42,0x08,0x24,0x08,0x04,0x08,0x04,0x10,0x02,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0x95
{0x00,0x00,0xF0,0x07,0x08,0x20,0x08,0x40,0x08,0x40,0x10,0x20,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x96
{0x00,0x00,0xF0,0x07,0x08,0x40,0x08,0x20,0x08,0x00,0x10,0x00,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0x97
{0x01,0x04,0x01,0x03,0xC1,0x20,0x62,0x00,0x1C,0x00,0x18,0x20,0x60,0x00,0x80,0x00,0x00,0x03,0x00,0x04}, // 0x98
{0x00,0x00,0xE0,0x07,0x10,0x88,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x90,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0x99
{0x00,0x00,0xE0,0x1F,0x18,0x80,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x80,0xE0,0x1F,0x00,0x00,0x00,0x00}, // 0x9A
{0x00,0x00,0xE8,0x01,0x10,0x02,0x28,0x04,0xC8,0x04,0x08,0x05,0x10,0x02,0xE0,0x05,0x00,0x00,0x00,0x00}, // 0x9B
{0x00,0x00,0x00,0x00,0x08,0x00,0x18,0x02,0xE8,0x3F,0x08,0x42,0x08,0x42,0x08,0x40,0x00,0x00,0x00,0x00}, // 0x9C
{0x00,0x00,0xE8,0x07,0x30,0x08,0x68,0x10,0x88,0x10,0x08,0x11,0x08,0x16,0x10,0x0C,0xE0,0x17,0x00,0x00}, // 0x9D
{0x00,0x00,0x08,0x04,0x10,0x02,0x20,0x01,0xC0,0x00,0xC0,0x00,0x20,0x01,0x10,0x02,0x08,0x04,0x00,0x00}, // 0x9E
{0x00,0x00,0x01,0x00,0x01,0x04,0x01,0x04,0xFE,0x7F,0x00,0x84,0x00,0x84,0x00,0x80,0x00,0x00,0x00,0x00}, // 0x9F
{0x00,0x00,0x30,0x00,0x48,0x04,0x88,0x04,0x88,0x24,0x90,0x44,0xF8,0x03,0x08,0x00,0x00,0x00,0x00,0x00}, // 0xA0
{0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x04,0xF8,0x27,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xA1
{0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x24,0x08,0x44,0x10,0x02,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0xA2
{0x00,0x00,0xF0,0x07,0x08,0x00,0x08,0x00,0x08,0x20,0x10,0x40,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xA3
{0x00,0x00,0xF8,0x07,0x00,0x23,0x00,0x42,0x00,0x24,0x00,0x24,0x00,0x44,0xF8,0x03,0x00,0x00,0x00,0x00}, // 0xA4
{0x00,0x00,0xF8,0x1F,0x00,0x48,0x00,0x86,0x80,0xC1,0x60,0x40,0x10,0x80,0xF8,0x1F,0x00,0x00,0x00,0x00}, // 0xA5
{0x00,0x00,0x00,0x00,0x00,0x4C,0x00,0x52,0x00,0x52,0x00,0x52,0x00,0x3E,0x00,0x02,0x00,0x00,0x00,0x00}, // 0xA6
{0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x3C,0x00,0x00,0x00,0x00}, // 0xA7
{0x00,0x00,0x0E,0x00,0x13,0x00,0x11,0x00,0x21,0x00,0xC1,0x06,0x01,0x00,0x07,0x00,0x00,0x00,0x00,0x00}, // 0xA8
{0x00,0x00,0x00,0x1C,0x00,0x22,0x00,0x5D,0x00,0x55,0x00,0x5D,0x00,0x22,0x00,0x1C,0x00,0x00,0x00,0x00}, // 0xA9
{0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0xE0,0x01,0x00,0x00}, // 0xAA
{0x08,0x40,0x30,0x7E,0x40,0x00,0x80,0x01,0x00,0x06,0x00,0x08,0x08,0x31,0x38,0x41,0x28,0x01,0xC8,0x00}, // 0xAB
{0x08,0x40,0x30,0x7E,0x40,0x00,0x80,0x01,0x00,0x06,0x60,0x08,0xA0,0x30,0x20,0x41,0xF8,0x01,0x20,0x00}, // 0xAC
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xAD
{0x00,0x00,0x80,0x00,0x40,0x01,0x20,0x02,0x10,0x04,0x80,0x00,0x40,0x01,0x20,0x02,0x10,0x04,0x00,0x00}, // 0xAE
{0x00,0x00,0x10,0x04,0x20,0x02,0x40,0x01,0x80,0x00,0x10,0x04,0x20,0x02,0x40,0x01,0x80,0x00,0x00,0x00}, // 0xAF
{0x36,0xDB,0x36,0xDB,0x00,0x00,0x36,0xDB,0x36,0xDB,0x00,0x00,0x36,0xDB,0x36,0xDB,0x00,0x00,0x00,0x00}, // 0xB0
{0xDB,0x36,0xDB,0x36,0x36,0xDB,0xFF,0xFF,0xDB,0x36,0x36,0xDB,0xFF,0xFF,0xDB,0x36,0x36,0xDB,0x36,0xDB}, // 0xB1
{0xFF,0xFF,0xFF,0xFF,0x36,0xDB,0xFF,0xFF,0xFF,0xFF,0x36,0xDB,0xFF,0xFF,0xFF,0xFF,0x36,0xDB,0x36,0xDB}, // 0xB2
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xB3
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xB4
{0x08,0x00,0x70,0x00,0xC0,0x01,0x40,0x0E,0x40,0x58,0x40,0x8C,0x40,0x03,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0xB5
{0x08,0x00,0x70,0x00,0xC0,0x01,0x40,0x4E,0x40,0x98,0x40,0x8C,0x40,0x43,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0xB6
{0x08,0x00,0x70,0x00,0xC0,0x01,0x40,0x8E,0x40,0x58,0x40,0x0C,0x40,0x03,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0xB7
{0xC0,0x0F,0x30,0x30,0x98,0x67,0xC8,0x4C,0x48,0x48,0x48,0x48,0x58,0x68,0x30,0x30,0xC0,0x0F,0x00,0x00}, // 0xB8
{0x40,0x01,0x40,0x01,0x40,0x01,0x7F,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xB9
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xBA
{0x40,0x01,0x40,0x01,0x40,0x01,0x7F,0x01,0x00,0x01,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xBB
{0x40,0x01,0x40,0x01,0x40,0x01,0x40,0xFF,0x40,0x00,0xC0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xBC
{0x00,0x00,0xC0,0x0F,0x20,0x10,0x30,0x20,0x10,0x20,0xF8,0x7F,0x10,0x20,0x10,0x20,0x00,0x00,0x00,0x00}, // 0xBD
{0x00,0x40,0x00,0x20,0x20,0x19,0x20,0x05,0xF8,0x03,0x20,0x05,0x20,0x09,0x00,0x10,0x00,0x20,0x00,0x40}, // 0xBE
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xBF
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC0
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0xFF,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC1
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC2
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC3
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC4
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0xFF,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xC5
{0x00,0x00,0x30,0x00,0x48,0x24,0x88,0x44,0x88,0x24,0x90,0x24,0xF8,0x43,0x08,0x00,0x00,0x00,0x00,0x00}, // 0xC6
{0x08,0x00,0x70,0x00,0xC0,0x41,0x40,0x8E,0x40,0xD8,0x40,0x4C,0x40,0x83,0xC0,0x00,0x30,0x00,0x08,0x00}, // 0xC7
{0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x40,0x00,0x40,0xFF,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xC8
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x01,0x7F,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xC9
{0x40,0x01,0x40,0x01,0x40,0x01,0x40,0xFF,0x40,0x00,0x40,0xFF,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xCA
{0x40,0x01,0x40,0x01,0x40,0x01,0x7F,0x01,0x00,0x01,0x7F,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xCB
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x7F,0xFF,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xCC
{0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xCD
{0x40,0x01,0x40,0x01,0x40,0x01,0x7F,0xFF,0x00,0x00,0x7F,0xFF,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01}, // 0xCE
{0x00,0x00,0x20,0x10,0xC0,0x0F,0x40,0x08,0x40,0x08,0x40,0x08,0x40,0x08,0xC0,0x0F,0x20,0x10,0x00,0x00}, // 0xCF
{0x00,0x00,0xE0,0x41,0x10,0x52,0x08,0x74,0x08,0x24,0x08,0x54,0x10,0x0E,0xE0,0x03,0x00,0x00,0x00,0x00}, // 0xD0
{0x00,0x01,0xF8,0x1F,0x08,0x11,0x08,0x11,0x08,0x10,0x08,0x10,0x10,0x08,0xE0,0x07,0x00,0x00,0x00,0x00}, // 0xD1
{0x00,0x00,0xF8,0x1F,0x88,0x10,0x88,0x50,0x88,0x90,0x88,0x90,0x88,0x50,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD2
{0x00,0x00,0xF8,0x1F,0x88,0x90,0x88,0x10,0x88,0x10,0x88,0x10,0x88,0x90,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD3
{0x00,0x00,0xF8,0x1F,0x88,0x10,0x88,0x10,0x88,0x90,0x88,0x50,0x88,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD4
{0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x04,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xD5
{0x00,0x00,0x08,0x10,0x08,0x10,0x08,0x10,0xF8,0x5F,0x08,0x90,0x08,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD6
{0x00,0x00,0x08,0x10,0x08,0x10,0x08,0x50,0xF8,0x9F,0x08,0x90,0x08,0x50,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD7
{0x00,0x00,0x08,0x10,0x08,0x90,0x08,0x10,0xF8,0x1F,0x08,0x10,0x08,0x90,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xD8
{0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xD9
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00}, // 0xDA
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, // 0xDB
{0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00}, // 0xDC
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xDD
{0x00,0x00,0x08,0x10,0x08,0x10,0x08,0x90,0xF8,0x5F,0x08,0x10,0x08,0x10,0x08,0x10,0x00,0x00,0x00,0x00}, // 0xDE
{0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF}, // 0xDF
{0x00,0x00,0xE0,0x07,0x10,0x08,0x08,0x10,0x08,0x50,0x08,0x90,0x08,0x10,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0xE0
{0x00,0x00,0xF8,0x3F,0x00,0x40,0x00,0x40,0x08,0x47,0x88,0x38,0x48,0x00,0x30,0x00,0x00,0x00,0x00,0x00}, // 0xE1
{0x00,0x00,0xE0,0x07,0x10,0x08,0x08,0x50,0x08,0x90,0x08,0x90,0x08,0x50,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0xE2
{0x00,0x00,0xE0,0x07,0x10,0x08,0x08,0x90,0x08,0x50,0x08,0x10,0x08,0x10,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0xE3
{0x00,0x00,0xE0,0x01,0x10,0x22,0x08,0x44,0x08,0x24,0x08,0x24,0x10,0x42,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0xE4
{0x00,0x00,0xE0,0x07,0x10,0x48,0x08,0x90,0x08,0xD0,0x08,0x50,0x08,0x90,0x10,0x08,0xE0,0x07,0x00,0x00}, // 0xE5
{0x00,0x00,0xFF,0x07,0x10,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0xF8,0x07,0x00,0x00,0x00,0x00}, // 0xE6
{0x00,0x00,0xFF,0x7F,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x04,0x10,0x06,0xE0,0x01,0x00,0x00,0x00,0x00}, // 0xE7
{0x00,0x00,0xF8,0x1F,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x40,0x04,0x80,0x03,0x00,0x00,0x00,0x00}, // 0xE8
{0x00,0x00,0xE0,0x1F,0x18,0x00,0x08,0x00,0x08,0x40,0x08,0x80,0x10,0x00,0xE0,0x1F,0x00,0x00,0x00,0x00}, // 0xE9
{0x00,0x00,0xE0,0x1F,0x18,0x00,0x08,0x40,0x08,0x80,0x08,0x80,0x10,0x40,0xE0,0x1F,0x00,0x00,0x00,0x00}, // 0xEA
{0x00,0x00,0xE0,0x1F,0x18,0x00,0x08,0x80,0x08,0x40,0x08,0x00,0x10,0x00,0xE0,0x1F,0x00,0x00,0x00,0x00}, // 0xEB
{0x01,0x04,0x01,0x03,0xC1,0x00,0x62,0x00,0x1C,0x20,0x18,0x40,0x60,0x00,0x80,0x00,0x00,0x03,0x00,0x04}, // 0xEC
{0x00,0x10,0x00,0x08,0x00,0x06,0x00,0x01,0xF8,0x40,0x00,0x81,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10}, // 0xED
{0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80}, // 0xEE
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xEF
{0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x00,0x00}, // 0xF0
{0x00,0x00,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0x01,0xC8,0x07,0x08,0x01,0x08,0x01,0x08,0x01,0x00,0x00}, // 0xF1
{0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00}, // 0xF2
{0x08,0x42,0x10,0x52,0x20,0x5A,0xC0,0x6C,0x00,0x01,0x60,0x02,0xA0,0x0C,0x20,0x11,0xF8,0x21,0x20,0x40}, // 0xF3
{0x00,0x00,0x00,0x38,0x00,0x7C,0x00,0x7E,0xFE,0x7F,0x00,0x40,0x00,0x40,0xFE,0x7F,0x00,0x00,0x00,0x00}, // 0xF4
{0x00,0x00,0x00,0x00,0x86,0x3B,0xC2,0x4C,0x42,0x44,0x62,0x46,0x32,0x42,0xDC,0x41,0x00,0x00,0x00,0x00}, // 0xF5
{0x00,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x58,0x06,0x58,0x06,0x40,0x00,0x40,0x00,0x40,0x00,0x00,0x00}, // 0xF6
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xF7
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x48,0x00,0x48,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xF8
{0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xF9
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xFA
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xFB
{0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x52,0x00,0x52,0x00,0x52,0x00,0x6C,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xFC
{0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x46,0x00,0x4A,0x00,0x4A,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00}, // 0xFD
{0x00,0x00,0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07,0xF8,0x07,0x00,0x00}, // 0xFE
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} // 0xFF
};
#include "FreeSans9pt7b.h"
#include "FreeSansBold18pt7b.h"
#include "FreeSansBold24pt7b.h"

View File

@@ -7,6 +7,17 @@
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif
#ifdef BUILD_NEWTON_M3_43_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_43_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif
#ifdef BUILD_NEWTON_M3_60_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_60_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"
#endif
#ifdef BUILD_NEWTON_M3_75_BWR
#include "../hal/Newton_M3_nRF52811/Newton_M3_nRF52811_75_BWR.h"
#include "../hal/Newton_M3_nRF52811/HAL_Newton_M3.h"

View File

@@ -1,19 +1,17 @@
#pragma once
#include <Arduino.h>
#define LUTGROUP_NEGATIVE 0
#define LUTGROUP_FASTBLINK 1
#define LUTGROUP_SLOWBLINK 2
#define LUTGROUP_SET 3
#define LUTGROUP_IMPROVE_SHARPNESS 4
#define LUTGROUP_IMPROVE_REDS 5
#define LUTGROUP_UNUSED 6
#define LUTGROUP_NEGATIVE 0
#define LUTGROUP_FASTBLINK 1
#define LUTGROUP_SLOWBLINK 2
#define LUTGROUP_SET 3
#define LUTGROUP_IMPROVE_SHARPNESS 4
#define LUTGROUP_IMPROVE_REDS 5
#define LUTGROUP_UNUSED 6
#define LUTGROUP_UNKNOWN 7
#define LUTGROUP_UNUSED3 8
#define LUTGROUP_UNUSED4 9
#define LUTGROUP_UNKNOWN 7
#define LUTGROUP_UNUSED3 8
#define LUTGROUP_UNUSED4 9
#pragma pack(1)
struct vgroup {
@@ -29,12 +27,26 @@ struct lut {
struct lut10 {
struct vgroup group[10];
} ;
};
struct lut12 {
struct vgroup group[12];
};
struct group {
uint8_t phaselength[4];
uint8_t repeat;
} ;
};
struct group12 {
uint8_t tp0a;
uint8_t tp0b;
uint8_t sr0ab;
uint8_t tp0c;
uint8_t tp0d;
uint8_t sr0cd;
uint8_t repeat;
};
struct waveform {
struct lut lut[5];
@@ -43,7 +55,7 @@ struct waveform {
uint8_t sourcelevel[3];
uint8_t dummyline;
uint8_t gatewidth;
} ;
};
struct waveform10 {
struct lut10 lut[5];
@@ -52,5 +64,12 @@ struct waveform10 {
uint8_t sourcelevel[3];
uint8_t dummyline;
uint8_t gatewidth;
} ;
};
struct waveform12 {
struct lut12 lut[5];
struct group12 group[12];
uint8_t fr[6];
uint8_t xon[3];
};
#pragma pack(0)

View File

@@ -44,9 +44,8 @@
#define MAXIMUM_PING_ATTEMPTS 20 // How many attempts to discover an AP the tag should do
#define PING_REPLY_WINDOW 5UL
#define LONG_DATAREQ_INTERVAL 300 // How often (in seconds, approximately) the tag should do a long datareq (including temperature)
#define VOLTAGE_CHECK_INTERVAL 288 // How often the tag should do a battery voltage check (multiplied by LONG_DATAREQ_INTERVAL)
#define BATTERY_VOLTAGE_MINIMUM 2450 // 2600 or below is the best we can do on the EPD
#define LONG_DATAREQ_INTERVAL 300 // How often (in seconds, approximately) the tag should do a long datareq (including temperature)
#define VOLTAGE_CHECK_INTERVAL 288 // How often the tag should do a battery voltage check (multiplied by LONG_DATAREQ_INTERVAL)
// power saving when no AP's were found (scanning every X)
#define VOLTAGEREADING_DURING_SCAN_INTERVAL 2 // how often we should read voltages; this is done every scan attempt in interval bracket 3
@@ -64,7 +63,7 @@ extern void powerUp(const uint8_t parts);
extern void powerDown(const uint8_t parts);
extern void initAfterWake();
extern void doSleep(const uint32_t t);
extern void doSleep(const uint32_t t);
extern void addAverageValue();
extern uint16_t getNextSleep();
@@ -72,17 +71,14 @@ extern uint16_t getNextSleep();
extern uint32_t getNextScanSleep(const bool increment);
extern void initPowerSaving(const uint16_t initialValue);
extern uint8_t wakeUpReason;
extern uint8_t wakeUpReason;
extern uint8_t capabilities;
extern uint8_t capabilities;
extern uint16_t nextCheckInFromAP;
extern uint8_t dataReqLastAttempt;
extern int8_t temperature;
extern uint16_t batteryVoltage;
extern bool lowBattery;
extern uint8_t scanAttempts;
extern uint16_t longDataReqCounter;
extern uint16_t voltageCheckCounter;
extern uint16_t nextCheckInFromAP;
extern uint8_t dataReqLastAttempt;
extern uint8_t scanAttempts;
extern uint16_t longDataReqCounter;
extern uint16_t voltageCheckCounter;
#endif

View File

@@ -3,8 +3,8 @@
#include <stdint.h>
#define FW_VERSION 017 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "BETA" // suffix, like -RC1 or whatever.
#define FW_VERSION 16 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "BETA3" // suffix, like -RC1 or whatever.
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
// #define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket
#endif

View File

@@ -7,17 +7,6 @@
#define EPD_SSD1619
#define epdSend spi_write
#define EPD_DIRECTION_X false
#define EPD_DIRECTION_Y true
#define EPD_SIZE_SINGLE false
#define EPD_SIZE_DOUBLE true
#define EPD_COLOR_RED true
#define EPD_COLOR_BLACK false
#define EPD_LOAD_CUSTOM_LUT true
#define EPD_LOAD_OTP_LUT false
#define EPD_MODE_NORMAL 0x00
#define EPD_MODE_INVERT 0x08
#define EPD_MODE_IGNORE 0x04
#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
@@ -25,60 +14,17 @@
#define EPD_LUT_FAST 3
#define EPD_LUT_OTA 0x10
#define epdSelect() \
do \
{ \
digitalWrite(EPD_CS, LOW); \
} while (0)
#define epdDeselect() \
do \
{ \
digitalWrite(EPD_CS, HIGH); \
} while (0)
void epdSetup();
void epdEnterSleep();
uint16_t epdGetBattery();
void epdConfigGPIO(bool setup);
extern bool epdGPIOActive;
extern uint8_t dispLutSize;
extern uint8_t customLUT[];
void setWindowX(uint16_t start, uint16_t end);
void setWindowY(uint16_t start, uint16_t end);
void setPosXY(uint16_t x, uint16_t y);
void setColorMode(uint8_t red, uint8_t bw);
void fillWindowWithPattern(bool color);
void clearWindow(bool color);
void clearScreen();
void draw();
void drawNoWait();
void drawWithSleep();
void epdWaitRdy();
void drawLineHorizontal(bool color, uint16_t x1, uint16_t x2, uint16_t y);
void drawLineVertical(bool color, uint16_t x, uint16_t y1, uint16_t y2);
void beginFullscreenImage();
void beginWriteFramebuffer(bool color);
void endWriteFramebuffer();
void loadRawBitmap(uint8_t *bmp, uint16_t x, uint16_t y, bool color);
void printBarcode(const uint8_t *string, uint16_t x, uint16_t y);
void selectLUT(uint8_t lut);
void ByteDecode(uint8_t byte);
void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool red);
void epdPrintEnd();
void beginFullscreenImage();
void beginWriteFramebuffer(bool color);
void lutTest();
// for printf.c
void writeCharEPD(uint8_t c);
void epdpr(const char *c, ...);
#endif

View File

@@ -0,0 +1,23 @@
#ifndef _JSCREEN_H_
#define _JSCREEN_H_
#include <stdbool.h>
#include <stdint.h>
#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3
void epdSetup();
void epdEnterSleep();
void draw();
void drawNoWait();
void epdWaitRdy();
void selectLUT(uint8_t lut);
#endif

View File

@@ -4,79 +4,21 @@
#include <stdbool.h>
#include <stdint.h>
#define epdSend spi_write
#define EPD_DIRECTION_X false
#define EPD_DIRECTION_Y true
#define EPD_SIZE_SINGLE false
#define EPD_SIZE_DOUBLE true
#define EPD_COLOR_RED true
#define EPD_COLOR_BLACK false
#define EPD_LOAD_CUSTOM_LUT true
#define EPD_LOAD_OTP_LUT false
#define EPD_MODE_NORMAL 0x00
#define EPD_MODE_INVERT 0x08
#define EPD_MODE_IGNORE 0x04
#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3
#define epdSelect() \
do \
{ \
digitalWrite(EPD_CS, LOW); \
} while (0)
#define epdDeselect() \
do \
{ \
digitalWrite(EPD_CS, HIGH); \
} while (0)
void epdSetup();
void epdEnterSleep();
uint16_t epdGetBattery();
void epdConfigGPIO(bool setup);
void epdSetup();
void epdEnterSleep();
uint16_t epdGetBattery();
void epdConfigGPIO(bool setup);
extern bool epdGPIOActive;
void setColorMode(uint8_t red, uint8_t bw) ;
void clearWindow(bool color);
void clearScreen();
void draw();
void drawNoWait();
void drawWithSleep();
void epdWaitRdy();
void beginFullscreenImage();
void beginWriteFramebuffer(bool color);
void endWriteFramebuffer();
void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) ;
void printBarcode(const uint8_t* string, uint16_t x, uint16_t y);
void selectLUT(uint8_t lut);
void ByteDecode(uint8_t byte);
void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool red);
void epdPrintEnd();
void beginFullscreenImage();
void beginWriteFramebuffer(bool color);
void lutTest();
void epdTest();
// for printf.c
void writeCharEPD(uint8_t c);
void epdpr(const char *c, ...);
#endif

View File

@@ -0,0 +1,23 @@
#ifndef _JSCREEN_H_
#define _JSCREEN_H_
#include <stdbool.h>
#include <stdint.h>
#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3
void epdSetup();
void epdEnterSleep();
void draw();
void drawNoWait();
void drawWithSleep();
void epdWaitRdy();
void selectLUT(uint8_t lut);
#endif

View File

@@ -11,6 +11,7 @@ lib_deps =
stevemarple/SoftWire @ ^2.0.9
stevemarple/AsyncDelay @ ^1.1.2
https://github.com/calebstewart/md5
https://github.com/ricmoo/QRCode
extra_scripts = post:preparefiles.py
@@ -21,7 +22,7 @@ extra_scripts = post:preparefiles.py
-D BUILD_NEWTON_M3_22_BWR
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<uc8179.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<uc_variant_043.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
[env:Newton_M3_29_BWR]
board_build.ldscript = nrf52811_bootloader.ld
@@ -30,7 +31,26 @@ extra_scripts = post:preparefiles.py
-D BUILD_NEWTON_M3_29_BWR
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<uc8179.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<uc_variant_043.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
[env:Newton_M3_43_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
-Wunused-macros
${env.build_flags}
-D BUILD_NEWTON_M3_43_BWR
-Tnrf52811_bootloader.ld
build_src_filter =
+<*>-<ssd1619.cpp>-<uc8179.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>
[env:Newton_M3_60_BWR]
board_build.ldscript = nrf52811_bootloader.ld
build_flags =
${env.build_flags}
-Tnrf52811_bootloader.ld
-D BUILD_NEWTON_M3_60_BWR
build_src_filter =
+<*>-<uc_variant_043.cpp>-<ssd1619.cpp>-<ssd1619.cpp>-<uc8179.cpp>+<../hal/Newton_M3_nRF52811/*>
[env:Newton_M3_75_BWR]
board_build.ldscript = nrf52811_bootloader.ld
@@ -39,4 +59,5 @@ extra_scripts = post:preparefiles.py
-Tnrf52811_bootloader.ld
-D BUILD_NEWTON_M3_75_BWR
build_src_filter =
+<*>-<ssd1619.cpp>+<../hal/Newton_M3_nRF52811/*>
+<*>-<uc_variant_043.cpp>-<ssd1619.cpp>-<uc8159.cpp>+<../hal/Newton_M3_nRF52811/*>

View File

@@ -1,101 +1,661 @@
#include "drawing.h"
#include <stdint.h>
#include <Arduino.h>
#include <stdbool.h>
#include <stdarg.h>
#include <stdlib.h>
#include "eeprom.h"
#include "proto.h"
#include "userinterface.h" // for addIcons
#include "powermgt.h"
#include "hal.h"
#include "qrcode.h"
#define EEPROM_XFER_BLOCKSIZE 512 // shouldn't be any less than 256 bytes probably
#define DRAWITEM_LIST_SIZE 24
static drawItem *drawItems[DRAWITEM_LIST_SIZE] = {0};
#if (SCREEN_WIDTH == 152)
void drawImageFromBuffer(uint8_t *buffer, const uint8_t lut) {
printf("Doing raw 1bpp\n");
epdSetup();
if (lut)
selectLUT(lut);
beginFullscreenImage();
clearScreen();
beginWriteFramebuffer(EPD_COLOR_BLACK);
epdSelect();
for (uint16_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++) {
epdSend(buffer[c]);
}
epdDeselect();
endWriteFramebuffer();
addOverlay();
drawWithSleep();
}
#ifdef EPD_DRAW_DIRECTION_RIGHT
static bool drawDirection = true;
#else
static bool drawDirection = false;
#endif
#define EEPROM_XFER_BLOCKSIZE 512 // shouldn't be any less than 256 bytes probably
void addBufferedImage(uint16_t x, uint16_t y, bool color, enum rotation ro, const uint8_t *image, bool mask) {
drawItem *di = new drawItem;
di->setRotation(ro);
if (di->direction ^ drawDirection) {
int16_t temp = x;
x = y;
y = temp;
}
uint16_t originalWidthBytes = (((uint16_t *)image)[0]) / 8;
uint16_t size = 0;
uint16_t width = ((uint16_t *)image)[0];
// find out if the original data was aligned in one byte; if not, add a byte
if (((uint16_t *)image)[0] % 8) originalWidthBytes++;
// if we're drawing in X direction, we shift the content here. Add extra space for shifting!
if (!di->direction) {
width += x % 8;
}
// check if the size is aligned in bytes; if not, add an extra for good measure;
if (width % 8) {
width /= 8;
width++;
} else {
width /= 8;
}
size = width * ((uint16_t *)image)[1];
size += 2; // not needed
uint8_t *im = (uint8_t *)calloc(size, 1);
for (uint16_t copyY = 0; copyY < ((uint16_t *)image)[1]; copyY++) {
memcpy(im + (copyY * width), image + 4 + (copyY * originalWidthBytes), originalWidthBytes);
// if we draw in X direction, we need to shift bytes in the array
if (!di->direction && (x % 8)) {
drawItem::shiftBytesRight(im + (copyY * width), x % 8, width);
}
}
di->addItem(im, width * 8, ((uint16_t *)image)[1]);
di->xpos = x;
di->ypos = y;
di->color = color;
if (mask)
di->type = drawItem::drawType::DRAW_MASK;
else
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->addToList();
}
void addFlashImage(uint16_t x, uint16_t y, bool color, enum rotation ro, const uint8_t *image) {
drawItem *di = new drawItem;
di->setRotation(ro);
if (di->direction ^ drawDirection) {
int16_t temp = x;
x = y;
y = temp;
}
di->addItem((uint8_t *)(image + 4), ((uint16_t *)image)[0], ((uint16_t *)image)[1]);
di->xpos = x;
di->ypos = y;
di->color = color;
di->cleanUp = false;
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->addToList();
}
void addQR(uint16_t x, uint16_t y, uint8_t version, uint8_t scale, const char *c, ...) {
char out_buffer[256];
va_list lst;
va_start(lst, c);
vsnprintf(out_buffer, 255, c, lst);
va_end(lst);
QRCode qrcode;
// Allocate a chunk of memory to store the QR code
uint8_t qrcodeBytes[qrcode_getBufferSize(version)];
qrcode_initText(&qrcode, qrcodeBytes, version, ECC_LOW, out_buffer);
drawItem *di = new drawItem;
di->setRotation(rotation::ROTATE_0);
uint8_t xbytes = (qrcode.size * scale) / 8;
if (qrcode.size % 8) xbytes++;
uint16_t size = xbytes * (qrcode.size * scale);
uint8_t *im = (uint8_t *)calloc(size + 1, 1);
uint8_t *qrbuf = im;
for (uint8_t qry = 0; qry < qrcode.size; qry++) {
for (uint8_t scale_y = 0; scale_y < scale; scale_y++) {
for (uint8_t qrx = 0; qrx < qrcode.size; qrx++) {
for (uint8_t scale_x = 0; scale_x < scale; scale_x++) {
if (qrcode_getModule(&qrcode, qrx, qry)) {
// Calculate the position in the framebuffer for the scaled pixel
uint8_t scaled_qrx = (qrx * scale) + scale_x;
uint8_t scaled_qry = (qry * scale) + scale_y;
// Calculate the byte and bit positions in the framebuffer
uint8_t fb_byte = scaled_qrx / 8;
uint8_t fb_bit = 7 - (scaled_qrx % 8);
// Set the bit in the framebuffer
qrbuf[fb_byte + (scaled_qry * xbytes)] |= (1 << fb_bit);
}
}
}
}
}
di->addItem(im, xbytes * 8, qrcode.size * scale);
di->xpos = x;
di->ypos = y;
di->color = 0;
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->addToList();
}
void drawImageAtAddress(uint32_t addr, uint8_t lut) {
uint8_t* xferbuffer = (uint8_t*)malloc(EEPROM_XFER_BLOCKSIZE);
powerUp(INIT_EEPROM);
uint8_t *xferbuffer = (uint8_t *)malloc(EEPROM_XFER_BLOCKSIZE);
struct EepromImageHeader *eih = (struct EepromImageHeader *)xferbuffer;
eepromRead(addr, xferbuffer, sizeof(struct EepromImageHeader));
switch (eih->dataType) {
case DATATYPE_IMG_RAW_1BPP:
printf("Doing raw 1bpp\n");
epdSetup();
if (lut)
selectLUT(lut);
beginFullscreenImage();
clearScreen();
beginWriteFramebuffer(EPD_COLOR_BLACK);
epdSelect();
for (uint32_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++) {
if (c % EEPROM_XFER_BLOCKSIZE == 0) {
epdDeselect();
eepromRead(addr + sizeof(struct EepromImageHeader) + c, xferbuffer, EEPROM_XFER_BLOCKSIZE);
epdSelect();
}
epdSend(xferbuffer[c % EEPROM_XFER_BLOCKSIZE]);
}
epdDeselect();
endWriteFramebuffer();
break;
case DATATYPE_IMG_RAW_2BPP:
printf("Doing raw 2bpp\n");
epdSetup();
if (lut)
selectLUT(lut);
beginFullscreenImage();
beginWriteFramebuffer(EPD_COLOR_BLACK);
epdSelect();
for (uint32_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++) {
if (c % EEPROM_XFER_BLOCKSIZE == 0) {
epdDeselect();
eepromRead(addr + sizeof(struct EepromImageHeader) + c, xferbuffer, EEPROM_XFER_BLOCKSIZE);
epdSelect();
}
epdSend(xferbuffer[c % EEPROM_XFER_BLOCKSIZE]);
}
epdDeselect();
endWriteFramebuffer();
beginWriteFramebuffer(EPD_COLOR_RED);
epdSelect();
for (uint32_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++) {
if (c % EEPROM_XFER_BLOCKSIZE == 0) {
epdDeselect();
eepromRead(addr + sizeof(struct EepromImageHeader) + (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)) + c, xferbuffer, EEPROM_XFER_BLOCKSIZE);
epdSelect();
}
epdSend(xferbuffer[c % EEPROM_XFER_BLOCKSIZE]);
}
epdDeselect();
endWriteFramebuffer();
break;
default: // prevent drawing from an unknown file image type
printf("Image with type 0x%02X was requested, but we don't know what to do with that currently...\n", eih->dataType);
free(xferbuffer);
return;
case DATATYPE_IMG_RAW_1BPP: {
drawItem *di = new drawItem;
// di->setRotation(ro);
di->xpos = 0;
di->ypos = 0;
di->color = 0;
di->addItem((uint8_t *)addr, SCREEN_WIDTH, SCREEN_HEIGHT);
di->type = drawItem::drawType::DRAW_EEPROM_1BPP;
di->direction = false;
di->cleanUp = false;
di->addToList();
} break;
case DATATYPE_IMG_RAW_2BPP: {
drawItem *di = new drawItem;
// di->setRotation(ro);
di->xpos = 0;
di->ypos = 0;
di->color = 0;
di->addItem((uint8_t *)addr, SCREEN_WIDTH, SCREEN_HEIGHT);
di->type = drawItem::drawType::DRAW_EEPROM_2BPP;
di->direction = false;
di->cleanUp = false;
di->addToList();
} break;
}
free(xferbuffer);
addOverlay();
drawWithSleep();
}
draw();
}
void drawRoundedRectangle(uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, bool color) {
uint16_t widthBytes = width / 8;
if (width % 8) widthBytes++;
uint32_t framebufferSize = widthBytes * height;
uint8_t *framebuffer = (uint8_t *)calloc(framebufferSize + 4, 1);
if (framebuffer == NULL) {
return;
}
((uint16_t *)framebuffer)[0] = width;
((uint16_t *)framebuffer)[1] = height;
framebuffer += 4;
uint16_t w = width - 2;
uint16_t x = 1;
while (w--) {
framebuffer[(x / 8)] |= (uint8_t)(1 << (7 - ((uint8_t)x % 8)));
x++;
}
for (uint16_t curY = 1; curY < (height - 1); curY++) {
framebuffer[widthBytes * curY] = 0x80;
if (width % 8)
framebuffer[(widthBytes * curY) + widthBytes - 1] = (uint8_t)(1 << (7 - ((uint8_t)width % 8)));
else
framebuffer[(widthBytes * curY) + widthBytes - 1] = 0x01;
}
w = width - 2;
x = 1;
while (w--) {
framebuffer[(x / 8) + ((height - 1) * widthBytes)] |= (uint8_t)(1 << (7 - ((uint8_t)x % 8)));
x++;
}
framebuffer -= 4;
addBufferedImage(xpos, ypos, color, rotation::ROTATE_0, framebuffer, DRAW_NORMAL);
free(framebuffer);
}
void drawMask(uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, bool color) {
uint16_t widthBytes = width / 8;
if (width % 8) widthBytes++;
uint32_t framebufferSize = widthBytes * height;
uint8_t *framebuffer = (uint8_t *)calloc(framebufferSize + 4, 1);
if (framebuffer == NULL) {
return;
}
((uint16_t *)framebuffer)[0] = width;
((uint16_t *)framebuffer)[1] = height;
framebuffer += 4;
for (uint16_t curY = 0; curY < height; curY++) {
uint16_t w = width;
uint16_t x = 0;
while (w--) {
framebuffer[(x / 8) + (curY * widthBytes)] |= (uint8_t)(1 << (7 - ((uint8_t)x % 8)));
x++;
}
}
framebuffer -= 4;
addBufferedImage(xpos, ypos, color, rotation::ROTATE_0, framebuffer, DRAW_INVERTED);
free(framebuffer);
}
// drawItem (sprite) functions
void drawItem::shiftBytesRight(uint8_t *data, uint8_t shift, uint8_t len) {
// Ensure the shift value is within bounds (0 to 7)
shift = shift % 8;
// Handle the case where shift is 0 or len is 0
if (shift == 0 || len == 0) {
return;
}
// Loop through the array from right to left
for (int i = len - 1; i > 0; i--) {
// Perform the shift by combining bits from the current byte
// and the next byte to its right
data[i] = (data[i] >> shift) | (data[i - 1] << (8 - shift));
}
// For the leftmost byte, simply shift it to the right
data[0] >>= shift;
}
uint8_t drawItem::bitReverse(uint8_t byte) {
byte = ((byte >> 1) & 0x55) | ((byte << 1) & 0xAA);
byte = ((byte >> 2) & 0x33) | ((byte << 2) & 0xCC);
byte = (byte >> 4) | (byte << 4);
return byte;
}
void drawItem::reverseBytes(uint8_t *src, uint8_t src_len) {
// Check for valid input
if (src == NULL || src_len == 0) {
return;
}
// Reverse the entire source array
for (uint8_t i = 0; i < src_len / 2; i++) {
uint8_t temp = src[i];
src[i] = src[src_len - i - 1];
src[src_len - i - 1] = temp;
}
// Reverse the bits within the bytes
for (uint8_t i = 0; i < src_len; i++) {
src[i] = bitReverse(src[i]);
}
}
void drawItem::copyWithByteShift(uint8_t *dst, uint8_t *src, uint8_t src_len, uint8_t offset) {
switch (type) {
case DRAW_MASK:
for (uint8_t i = 0; i < src_len; i++) {
dst[i + offset] &= ~(src[i]);
}
break;
default:
for (uint8_t i = 0; i < src_len; i++) {
dst[i + offset] |= src[i];
}
break;
}
}
void drawItem::renderDrawLine(uint8_t *line, uint16_t number, uint8_t c) {
drawItem *curDrawItem;
for (uint8_t i = 0; i < DRAWITEM_LIST_SIZE; i++) {
curDrawItem = drawItems[i];
if (curDrawItem != nullptr) {
curDrawItem->getDrawLine(line, number, c);
}
}
}
void drawItem::flushDrawItems() {
drawItem *curDrawItem;
for (uint8_t i = 0; i < DRAWITEM_LIST_SIZE; i++) {
curDrawItem = drawItems[i];
if (curDrawItem != nullptr) {
delete curDrawItem;
drawItems[i] = nullptr;
}
}
}
void drawItem::getXLine(uint8_t *line, uint16_t y, uint8_t c) {
switch (type) {
case DRAW_FONT:
case DRAW_BUFFERED_1BPP:
case DRAW_MASK:
if (c != color) return;
if ((y >= ypos) && (y < height + ypos)) { // was y > ypos, not >=
// y = height-y;
if (mirrorV) {
if (mirrorH) {
reverseBytes(&buffer[((height - (y - ypos)) * widthBytes)], widthBytes);
// reverseBytes(&buffer[((y - ypos) * widthBytes)], widthBytes);
} else {
reverseBytes(&buffer[((y - ypos) * widthBytes)], widthBytes);
}
}
if (mirrorH) {
copyWithByteShift(line, &buffer[((height - (y - ypos)) * widthBytes)], widthBytes, xpos / 8);
} else {
copyWithByteShift(line, &buffer[((y - ypos) * widthBytes)], widthBytes, xpos / 8);
}
}
break;
case DRAW_EEPROM_1BPP:
if (c != color) return;
#ifdef EPD_DRAW_DIRECTION_RIGHT
y = SCREEN_HEIGHT - 1 - y;
#endif
eepromRead((uint32_t)buffer + sizeof(struct EepromImageHeader) + (y * (SCREEN_WIDTH / 8)), line, (SCREEN_WIDTH / 8));
break;
case DRAW_EEPROM_2BPP:
#ifdef EPD_DRAW_DIRECTION_RIGHT
y = SCREEN_HEIGHT - 1 - y;
#endif
eepromRead((uint32_t)buffer + sizeof(struct EepromImageHeader) + ((y + (c * SCREEN_HEIGHT)) * (SCREEN_WIDTH / 8)), line, (SCREEN_WIDTH / 8));
break;
}
}
void drawItem::getYLine(uint8_t *line, uint16_t x, uint8_t c) {
switch (type) {
case DRAW_FONT:
case DRAW_BUFFERED_1BPP:
if (c != color) return;
if ((x >= xpos) && (x < width + xpos)) {
x -= xpos;
for (uint16_t curY = 0; curY < height; curY++) {
uint16_t curYMirrored = curY;
if (!mirrorH) curYMirrored = height - 1 - curY;
if (mirrorV) {
if (buffer[((width - x) / 8) + (curYMirrored * widthBytes)] & (1 << (7 - ((width - x) % 8)))) {
line[(curY + ypos) / 8] |= (1 << (7 - ((curY + ypos) % 8)));
}
} else {
if (buffer[(x / 8) + (curYMirrored * widthBytes)] & (1 << (7 - (x % 8)))) {
line[(curY + ypos) / 8] |= (1 << (7 - ((curY + ypos) % 8)));
}
}
}
}
break;
case DRAW_MASK:
if (c != color) return;
if ((x >= xpos) && (x < width + xpos)) {
x -= xpos;
for (uint16_t curY = 0; curY < height; curY++) {
uint16_t curYMirrored = curY;
if (!mirrorH) curYMirrored = height - 1 - curY;
if (mirrorV) {
if (buffer[((width - x) / 8) + (curYMirrored * widthBytes)] & (1 << (7 - ((width - x) % 8)))) {
line[(curY + ypos) / 8] &= ~(1 << (7 - ((curY + ypos) % 8)));
}
} else {
if (buffer[(x / 8) + (curYMirrored * widthBytes)] & (1 << (7 - (x % 8)))) {
line[(curY + ypos) / 8] &= ~(1 << (7 - ((curY + ypos) % 8)));
}
}
}
}
break;
default:
break;
}
}
void drawItem::getDrawLine(uint8_t *line, uint16_t number, uint8_t c) {
if (direction) {
getYLine(line, number, c);
} else {
getXLine(line, number, c);
}
}
void drawItem::addItem(uint8_t *data, uint16_t w, uint16_t h) {
width = w;
height = h;
widthBytes = w / 8;
if (w % 8) widthBytes++;
buffer = data;
}
bool drawItem::addToList() {
for (uint8_t i = 0; i < DRAWITEM_LIST_SIZE; i++) {
if (drawItems[i] == nullptr) {
drawItems[i] = this;
return true;
};
}
return false;
}
drawItem::~drawItem() {
if (cleanUp) {
free(buffer);
}
}
drawItem::drawItem() {
#ifdef EPD_DRAW_DIRECTION_RIGHT
direction = true;
#endif
#ifdef EPD_MIRROR_H
mirrorH = true;
#endif
#ifdef EPD_MIRROR_V
mirrorV = true;
#endif
}
void drawItem::setRotation(enum rotation ro) {
#ifdef EPD_DRAW_DIRECTION_RIGHT
direction = true;
#endif
#ifdef EPD_MIRROR_H
mirrorH = true;
#endif
#ifdef EPD_MIRROR_V
mirrorV = true;
#endif
switch (ro) {
case ROTATE_0:
break;
case ROTATE_270:
direction = !direction;
mirrorH = !mirrorH;
mirrorV = !mirrorV;
break;
case ROTATE_180:
mirrorH = !mirrorH;
mirrorV = !mirrorV;
break;
case ROTATE_90:
direction = !direction;
break;
};
}
// font rendering functions
fontrender::fontrender(const GFXfont *font) {
gfxFont = (GFXfont *)font;
}
void fontrender::setFont(const GFXfont *font) {
gfxFont = (GFXfont *)font;
}
void fontrender::drawFastHLine(uint16_t x, uint16_t y, uint16_t w) {
while (w--) {
fb[(x / 8) + (y * bufferByteWidth)] |= (uint8_t)(1 << (7 - ((uint8_t)x % 8)));
x++;
}
}
void fontrender::fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h) {
for (uint16_t curY = y; curY < y + h; curY++) {
drawFastHLine(x, curY, w);
}
}
uint8_t fontrender::getCharWidth(uint16_t c) {
if ((c >= gfxFont->first) && (c <= gfxFont->last)) {
c -= gfxFont->first;
// GFXglyph *glyph = &(((GFXglyph *)pgm_read_dword(&gfxFont->glyph))[c]);
GFXglyph *glyph = &(gfxFont->glyph[c]);
return glyph->xAdvance;
}
return 0;
}
uint8_t fontrender::drawChar(int32_t x, int32_t y, uint16_t c, uint8_t size) {
// Filter out bad characters not present in font
if ((c >= gfxFont->first) && (c <= gfxFont->last)) {
c -= gfxFont->first;
GFXglyph *glyph = &(gfxFont->glyph[c]);
uint8_t *bitmap = (uint8_t *)gfxFont->bitmap;
uint32_t bo = glyph->bitmapOffset;
uint8_t w = glyph->width,
h = glyph->height;
int8_t xo = glyph->xOffset,
yo = glyph->yOffset;
uint8_t xx, yy, bits = 0, bit = 0;
int16_t xo16 = 0, yo16 = 0;
if (size > 1) {
xo16 = xo;
yo16 = yo;
}
// GFXFF rendering speed up
uint16_t hpc = 0; // Horizontal foreground pixel count
for (yy = 0; yy < h; yy++) {
for (xx = 0; xx < w; xx++) {
if (bit == 0) {
bits = bitmap[bo++];
bit = 0x80;
}
if (bits & bit)
hpc++;
else {
if (hpc) {
if (size == 1)
drawFastHLine(x + xo + xx - hpc, y + yo + yy, hpc);
else
fillRect(x + (xo16 + xx - hpc) * size, y + (yo16 + yy) * size, size * hpc, size);
hpc = 0;
}
}
bit >>= 1;
}
// Draw pixels for this line as we are about to increment yy
if (hpc) {
if (size == 1)
drawFastHLine(x + xo + xx - hpc, y + yo + yy, hpc);
else
fillRect(x + (xo16 + xx - hpc) * size, y + (yo16 + yy) * size, size * hpc, size);
hpc = 0;
}
}
return glyph->xAdvance;
}
return 0;
}
void fontrender::epdPrintf(uint16_t x, uint16_t y, bool color, enum rotation ro, const char *c, ...) {
drawItem *di = new drawItem;
if (di == nullptr) return;
di->setRotation(ro);
// prepare a drawItem, exchange x/y if necessary.
if (di->direction ^ drawDirection) {
int16_t temp = x;
x = y;
y = temp;
}
// output string using vsnprintf
char out_buffer[256];
va_list lst;
va_start(lst, c);
uint8_t len = vsnprintf(out_buffer, 255, c, lst);
va_end(lst);
// account for offset in font rendering
if (!di->direction) {
Xpixels = x % 8; // total drawing width increased by x%8
} else {
Xpixels = 0;
}
// find out the total length of the string
for (uint8_t c = 0; c < len; c++) {
Xpixels += (uint16_t)getCharWidth(out_buffer[c]);
}
// find out the high and low points for given font
int8_t high = 0;
int8_t low = 0;
for (uint8_t curchar = 0; curchar < len; curchar++) {
uint8_t c = out_buffer[curchar];
if ((c >= gfxFont->first) && (c <= gfxFont->last)) {
c -= gfxFont->first;
int8_t glyphUL = gfxFont->glyph[c].yOffset;
if (glyphUL < high) high = glyphUL;
int8_t glyphHeight = gfxFont->glyph[c].height;
if ((glyphUL + glyphHeight) > low) low = glyphUL + glyphHeight;
}
}
// Actual font height (reduces memory footprint)
int8_t height = -1 * (high - low) + 1;
// determine actual width
bufferByteWidth = Xpixels / 8;
if (Xpixels % 8) bufferByteWidth++;
// allocate framebuffer
fb = (uint8_t *)calloc(bufferByteWidth * height, 1);
if (!fb) {
printf("Failed to allocate buffer for drawitem, we can't render this text!\n");
delete di;
return;
}
uint16_t curX;
if (!di->direction) {
curX = x % 8; // start drawing at x%8s
} else {
curX = 0;
}
for (uint8_t c = 0; c < len; c++) {
curX += (uint16_t)drawChar(curX, height - low, out_buffer[c], 1);
}
di->addItem(fb, curX, height);
di->ypos = y;
di->xpos = x;
di->color = color;
di->type = drawItem::drawType::DRAW_FONT;
di->addToList();
}

View File

@@ -6,6 +6,19 @@
#include "syncedproto.h"
#include "hal.h"
// *****************************************************************************
// when using HW SPI, this file requires the following to be present in the HAL
// uint8_t eepromSPIByte(uint8_t data);
// void eepromSPIBlockRead(uint8_t* dst, uint16_t len);
// void eepromSPIBlockWrite(uint8_t* src, uint16_t len);
#define EEPROM_USE_HW_SPI
#ifdef EEPROM_USE_HW_SPI
#define eepromByte eepromSPIByte
#endif
#ifndef EEPROM_USE_HW_SPI
uint8_t eepromByte(uint8_t data) {
uint8_t temp = 0;
for (uint8_t i = 0; i < 8; i++) {
@@ -22,6 +35,7 @@ uint8_t eepromByte(uint8_t data) {
}
return temp;
}
#endif
static uint32_t mEepromSize;
static uint8_t mOpcodeErz4K = 0, mOpcodeErz32K = 0, mOpcodeErz64K = 0;
@@ -49,9 +63,12 @@ void eepromRead(uint32_t addr, void *dstP, uint16_t len) {
eepromByte(addr >> 16);
eepromByte(addr >> 8);
eepromByte(addr & 0xff);
#ifdef EEPROM_USE_HW_SPI
eepromSPIBlockRead(dst, len);
#else
while (len--)
*dst++ = eepromByte(0);
#endif
eepromPrvDeselect();
}
@@ -84,8 +101,12 @@ static bool eepromWriteLL(uint32_t addr, const void *srcP, uint16_t len) {
eepromByte(addr >> 8);
eepromByte(addr & 0xff);
#ifdef EEPROM_USE_HW_SPI
eepromSPIBlockWrite((uint8_t *)src, len);
#else
while (len--)
eepromByte(*src++);
#endif
eepromPrvDeselect();
return eepromPrvBusyWait();

View File

@@ -47,7 +47,7 @@ uint8_t showChannelSelect() { // returns 0 if no accesspoints were found
}
}
powerDown(INIT_RADIO);
epdWaitRdy();
// epdWaitRdy();
mLastLqi = highestLqi;
return highestSlot;
}
@@ -144,24 +144,29 @@ void setup() {
delay(50);
}
Serial.println("Finished");
Serial.println((uint8_t)0x55 << 1);
sw.beginTransmission(30);
sw.write(uint8_t(0)); // Access the first register
sw.endTransmission();
digitalWrite(NFC_POWER,LOW);
pinMode(NFC_POWER, INPUT_PULLDOWN);
powerDown(INIT_I2C);
*/
//we always have NFC + NFC wake
// we always have NFC + NFC wake
capabilities |= CAPABILITY_HAS_NFC;
capabilities |= CAPABILITY_NFC_WAKE;
setupBatteryVoltage();
getVoltage();
setupTemperature();
getTemperature();
printf("MAC>%02X%02X", mSelfMac[0], mSelfMac[1]);
printf("%02X%02X", mSelfMac[2], mSelfMac[3]);
printf("%02X%02X", mSelfMac[4], mSelfMac[5]);
@@ -223,8 +228,11 @@ void loop() {
powerUp(INIT_UART);
wdt10s();
if (currentChannel) {
#ifdef NO_BUTTONS
disablePinInterruptSleep = true;
#endif
// associated
struct AvailDataInfo *avail;
// Is there any reason why we should do a long (full) get data request (including reason, status)?
if ((longDataReqCounter > LONG_DATAREQ_INTERVAL) || wakeUpReason != WAKEUP_REASON_TIMED) {
@@ -304,6 +312,9 @@ void loop() {
doSleep(getNextSleep() * 1000UL);
}
} else {
#ifdef NO_BUTTONS
disablePinInterruptSleep = false;
#endif
// not associated
if (((scanAttempts != 0) && (scanAttempts % VOLTAGEREADING_DURING_SCAN_INTERVAL == 0)) || (scanAttempts > (INTERVAL_1_ATTEMPTS + INTERVAL_2_ATTEMPTS))) {
powerUp(INIT_RADIO); // load down the battery using the radio to get a good reading

View File

@@ -19,9 +19,6 @@ uint16_t nextCheckInFromAP = 0;
uint8_t wakeUpReason = 0;
uint8_t scanAttempts = 0;
int8_t temperature = 0;
uint16_t batteryVoltage = 0;
bool lowBattery = false;
uint16_t longDataReqCounter = 0;
uint16_t voltageCheckCounter = 0;
@@ -37,17 +34,17 @@ uint8_t checkButtonOrJig() {
return DETECT_P1_0_NOTHING;
}
void button1wake(){
void button1wake() {
wakeUpReason = WAKEUP_REASON_BUTTON1;
resettimer();
}
void button2wake(){
void button2wake() {
wakeUpReason = WAKEUP_REASON_BUTTON2;
resettimer();
}
void nfcwake(){
void nfcwake() {
wakeUpReason = WAKEUP_REASON_NFC;
resettimer();
}
@@ -64,12 +61,19 @@ void setupPortsInitial() {
pinMode(NFC_POWER, INPUT_PULLDOWN);
pinMode(NFC_IRQ, INPUT_PULLDOWN);
pinMode(EPD_POWER, DEFAULT);
pinMode(FLASH_MISO, INPUT);
pinMode(FLASH_CLK, OUTPUT);
pinMode(FLASH_MOSI, OUTPUT);
digitalWrite(FLASH_CS, HIGH);
pinMode(FLASH_CS, OUTPUT);
// pinMode(EPD_VPP, OUTPUT);
// digitalWrite(EPD_VPP, HIGH);
// pinMode(EPD_HLT, OUTPUT);
// digitalWrite(EPD_HLT, HIGH);
attachInterrupt(digitalPinToInterrupt(BUTTON1), button1wake, FALLING);
attachInterrupt(digitalPinToInterrupt(BUTTON2), button2wake, FALLING);
attachInterrupt(digitalPinToInterrupt(NFC_IRQ), nfcwake, RISING);
@@ -86,19 +90,22 @@ static void configSPI(const bool setup) {
}
static void configUART(const bool setup) {
/* if (setup == uartActive)
return;
uartActive = setup;
if (setup)
Serial.begin(115200);
else
Serial.end();*/
return;
if (setup == uartActive)
return;
uartActive = setup;
if (setup) {
NRF_UART0->ENABLE = 4;
} else {
NRF_UART0->ENABLE = 0;
}
}
static void configEEPROM(const bool setup) {
if (setup == eepromActive)
return;
if (setup) {
setupEepromHWSPI(true);
if (!eepromInit()) {
printf("Eeprom init error\r\n");
powerDown(INIT_RADIO);
@@ -109,19 +116,20 @@ static void configEEPROM(const bool setup) {
NVIC_SystemReset();
}
} else {
digitalWrite(FLASH_CS, HIGH);
setupEepromHWSPI(false);
}
eepromActive = setup;
}
static void configI2C(const bool setup) {
if (setup == i2cActive)
return;
if (setup) {
pinMode(NFC_I2C_SCL,OUTPUT);
pinMode(NFC_I2C_SDA,OUTPUT);
pinMode(NFC_I2C_SCL, OUTPUT);
pinMode(NFC_I2C_SDA, OUTPUT);
} else {
pinMode(NFC_I2C_SDA,INPUT);
pinMode(NFC_I2C_SCL,INPUT);
pinMode(NFC_I2C_SDA, INPUT);
pinMode(NFC_I2C_SCL, INPUT);
}
i2cActive = setup;
}
@@ -141,16 +149,12 @@ void powerUp(const uint8_t parts) {
}
if (parts & INIT_EPD_VOLTREADING) {
epdConfigGPIO(true);
configSPI(true);
batteryVoltage = epdGetBattery();
getVoltage();
if (batteryVoltage < BATTERY_VOLTAGE_MINIMUM) {
lowBattery = true;
} else {
lowBattery = false;
}
configSPI(false);
epdConfigGPIO(false);
}
if (parts & INIT_UART) {
@@ -163,7 +167,7 @@ void powerUp(const uint8_t parts) {
}
if (parts & INIT_TEMPREADING) {
//temperature = nrf_temp_read();
getTemperature();
}
if (parts & INIT_RADIO) {
@@ -207,7 +211,7 @@ void powerDown(const uint8_t parts) {
}
void doSleep(const uint32_t t) {
printf("Sleeping for: %d ms\r\n", t);
printf("Sleeping for: %lu ms\r\n", t);
sleepForMs(t);
}

View File

@@ -7,12 +7,13 @@
#include <stdlib.h>
#include <string.h>
#include "font.h"
#include "lut.h"
#include "settings.h"
#include "hal.h"
#include "wdt.h"
#include "drawing.h"
#define CMD_DRV_OUTPUT_CTRL 0x01
#define CMD_SOFT_START_CTRL 0x0C
#define CMD_ENTER_SLEEP 0x10
@@ -26,7 +27,7 @@
#define CMD_DISP_UPDATE_CTRL2 0x22
#define CMD_WRITE_FB_BW 0x24
#define CMD_WRITE_FB_RED 0x26
#define CMD_UNKNOWN_1 0x2B
#define CMD_VCOM_GLITCH_CTRL 0x2B
#define CMD_LOAD_OTP_LUT 0x31
#define CMD_WRITE_LUT 0x32
#define CMD_BORDER_WAVEFORM_CTRL 0x3C
@@ -63,30 +64,25 @@
digitalWrite(EPD_DC, HIGH); \
} while (0)
extern void dump(uint8_t *a, uint16_t l); // remove me when done
extern void dump(const uint8_t *a, const uint16_t l); // remove me when done
static uint8_t epdCharSize = 1; // character size, 1 or 2 (doubled)
static bool directionY = true; // print direction, X or Y (true)
static uint8_t rbuffer[32]; // used to rotate bits around
static uint16_t fontCurXpos = 0; // current X value we're working with
static uint8_t currentLut = 0;
uint8_t dispLutSize = 0; // we'll need to expose this in the 'capabilities' flag
static bool isInited = false;
bool epdGPIOActive = false;
#define LUT_BUFFER_SIZE 128
#define LUT_BUFFER_SIZE 256
static uint8_t waveformbuffer[LUT_BUFFER_SIZE];
uint8_t customLUT[LUT_BUFFER_SIZE] = {0};
struct waveform10 *waveform10 = (struct waveform10 *)waveformbuffer; // holds the LUT/waveform
struct waveform *waveform7 = (struct waveform *)waveformbuffer; // holds the LUT/waveform
struct waveform12 *waveform12 = (struct waveform12 *)waveformbuffer; // holds the LUT/waveform
static void commandReadBegin(uint8_t cmd) {
epdSelect();
markCommand();
spi_write(cmd); // dump LUT
spi_write(cmd);
pinMode(EPD_MOSI, INPUT);
markData();
}
@@ -139,33 +135,18 @@ static void commandBegin(uint8_t cmd) {
spi_write(cmd);
markData();
}
static void epdReset() {
delay(12);
digitalWrite(EPD_RST, LOW);
delay(20);
digitalWrite(EPD_RST, HIGH);
delay(20);
shortCommand(CMD_SOFT_RESET); // software reset
delay(10);
shortCommand(CMD_SOFT_RESET2);
delay(10);
void setWindowX(uint16_t start, uint16_t end) {
epdWrite(CMD_WINDOW_X_SIZE, 2, start / 8, end / 8 - 1);
}
void epdConfigGPIO(bool setup) {
if (epdGPIOActive == setup)
return;
if (setup) {
pinMode(EPD_RST, OUTPUT);
pinMode(EPD_BS, OUTPUT);
pinMode(EPD_CS, OUTPUT);
pinMode(EPD_DC, OUTPUT);
pinMode(EPD_BUSY, INPUT);
pinMode(EPD_CLK, OUTPUT);
pinMode(EPD_MOSI, OUTPUT);
} else {
}
epdGPIOActive = setup;
void setWindowY(uint16_t start, uint16_t end) {
epdWrite(CMD_WINDOW_Y_SIZE, 4, (start)&0xff, (start) >> 8, (end - 1) & 0xff, (end - 1) >> 8);
}
void setPosXY(uint16_t x, uint16_t y) {
epdWrite(CMD_XSTART_POS, 1, (uint8_t)(x / 8));
epdWrite(CMD_YSTART_POS, 2, (y)&0xff, (y) >> 8);
}
void epdEnterSleep() {
digitalWrite(EPD_RST, LOW);
delay(10);
@@ -178,31 +159,20 @@ void epdEnterSleep() {
}
void epdSetup() {
epdReset();
shortCommand1(CMD_ANALOG_BLK_CTRL, 0x54);
shortCommand1(CMD_DIGITAL_BLK_CTRL, 0x3B);
shortCommand2(CMD_UNKNOWN_1, 0x04, 0x63);
/*commandBegin(CMD_SOFT_START_CTRL);
epdSend(0x8f);
epdSend(0x8f);
epdSend(0x8f);
epdSend(0x3f);
commandEnd();*/
commandBegin(CMD_DRV_OUTPUT_CTRL);
epdSend((SCREEN_HEIGHT - 1) & 0xff);
epdSend((SCREEN_HEIGHT - 1) >> 8);
epdSend(0x00);
commandEnd();
// shortCommand1(CMD_DATA_ENTRY_MODE, 0x03);
// shortCommand1(CMD_BORDER_WAVEFORM_CTRL, 0xC0); // blurry edges
shortCommand1(CMD_BORDER_WAVEFORM_CTRL, 0x01);
shortCommand1(CMD_TEMP_SENSOR_CONTROL, 0x80);
shortCommand1(CMD_DISP_UPDATE_CTRL2, 0xB1); // mode 1 (i2C)
// shortCommand1(CMD_DISP_UPDATE_CTRL2, 0xB9); // mode 2?
shortCommand(CMD_ACTIVATION);
epdBusyWaitFalling(1000);
shortCommand(CMD_SOFT_RESET); // software reset
delay(10);
shortCommand(CMD_SOFT_RESET2);
delay(10);
epdWrite(CMD_ANALOG_BLK_CTRL, 1, 0x54);
epdWrite(CMD_DIGITAL_BLK_CTRL, 1, 0x3B);
epdWrite(CMD_VCOM_GLITCH_CTRL, 2, 0x04, 0x63);
epdWrite(CMD_DRV_OUTPUT_CTRL, 3, (SCREEN_HEIGHT - 1) & 0xff, (SCREEN_HEIGHT - 1) >> 8, 0x00);
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00);
epdWrite(CMD_BORDER_WAVEFORM_CTRL, 1, 0x01);
epdWrite(CMD_TEMP_SENSOR_CONTROL, 1, 0x80);
epdWrite(CMD_DISP_UPDATE_CTRL2, 1, 0xB1);
epdWrite(CMD_ACTIVATION, 0);
epdBusyWaitFalling(10000);
isInited = true;
currentLut = EPD_LUT_DEFAULT;
}
@@ -213,41 +183,6 @@ static uint8_t epdGetStatus() {
commandReadEnd();
return sta;
}
uint16_t epdGetBattery(void) {
uint16_t voltage = 2600;
uint8_t val;
delay(50);
digitalWrite(EPD_RST, LOW);
delay(50);
digitalWrite(EPD_RST, HIGH);
delay(50);
shortCommand(CMD_SOFT_RESET); // software reset
epdBusyWaitFalling(30);
shortCommand(CMD_SOFT_RESET2);
epdBusyWaitFalling(30);
shortCommand1(CMD_DISP_UPDATE_CTRL2, SCREEN_CMD_CLOCK_ON | SCREEN_CMD_ANALOG_ON);
shortCommand(CMD_ACTIVATION);
epdBusyWaitFalling(100);
for (val = 3; val < 8; val++) {
shortCommand1(CMD_SETUP_VOLT_DETECT, val);
epdBusyWaitFalling(100);
if (epdGetStatus() & 0x10) { // set if voltage is less than threshold ( == 1.9 + val / 10)
voltage = 1850 + (val * 100);
break;
}
}
shortCommand(CMD_SOFT_RESET2);
epdBusyWaitFalling(15);
shortCommand1(CMD_ENTER_SLEEP, 0x03);
return voltage;
}
void loadFixedTempOTPLUT() {
shortCommand1(0x18, 0x48); // external temp sensor
@@ -258,15 +193,17 @@ void loadFixedTempOTPLUT() {
}
static void writeLut() {
commandBegin(CMD_WRITE_LUT);
for (uint8_t i = 0; i < (dispLutSize * 10); i++)
epdSend(waveformbuffer[i]);
if (dispLutSize == 12) {
for (uint8_t i = 0; i < 153; i++)
epdSend(waveformbuffer[i]);
} else {
for (uint8_t i = 0; i < (dispLutSize * 10); i++)
epdSend(waveformbuffer[i]);
}
commandEnd();
}
static void readLut() {
commandReadBegin(0x33);
uint16_t checksum = 0;
uint16_t ident = 0;
uint16_t shortl = 0;
for (uint16_t c = 0; c < LUT_BUFFER_SIZE; c++) {
waveformbuffer[c] = epdReadByte();
}
@@ -287,40 +224,67 @@ end:;
return ref + 1;
}
static void lutGroupDisable(uint8_t group) {
if (dispLutSize == 7) {
memset(&(waveform7->group[group]), 0x00, 5);
} else {
memset(&(waveform10->group[group]), 0x00, 5);
switch (dispLutSize) {
case 7:
memset(&(waveform7->group[group]), 0x00, 5);
break;
case 10:
memset(&(waveform10->group[group]), 0x00, 5);
break;
case 12:
memset(&(waveform12->group[group]), 0x00, sizeof(waveform12->group[0]));
break;
}
}
static void lutGroupSpeedup(uint8_t group, uint8_t speed) {
if (dispLutSize == 7) {
for (uint8_t i = 0; i < 4; i++) {
waveform7->group[group].phaselength[i] = 1 + (waveform7->group[group].phaselength[i] / speed);
}
} else {
for (uint8_t i = 0; i < 4; i++) {
waveform10->group[group].phaselength[i] = 1 + (waveform10->group[group].phaselength[i] / speed);
}
switch (dispLutSize) {
case 7:
for (uint8_t i = 0; i < 4; i++) {
waveform7->group[group].phaselength[i] = 1 + (waveform7->group[group].phaselength[i] / speed);
}
break;
case 10:
for (uint8_t i = 0; i < 4; i++) {
waveform10->group[group].phaselength[i] = 1 + (waveform10->group[group].phaselength[i] / speed);
}
break;
case 12:
waveform12->group[group].tp0a = 1 + (waveform12->group[group].tp0a / speed);
waveform12->group[group].tp0b = 1 + (waveform12->group[group].tp0b / speed);
waveform12->group[group].tp0c = 1 + (waveform12->group[group].tp0c / speed);
waveform12->group[group].tp0d = 1 + (waveform12->group[group].tp0d / speed);
break;
}
}
static void lutGroupRepeat(uint8_t group, uint8_t repeat) {
if (dispLutSize == 7) {
waveform7->group[group].repeat = repeat;
} else {
waveform10->group[group].repeat = repeat;
switch (dispLutSize) {
case 7:
waveform7->group[group].repeat = repeat;
break;
case 10:
waveform10->group[group].repeat = repeat;
break;
case 12:
waveform12->group[group].repeat = repeat;
break;
}
}
static void lutGroupRepeatReduce(uint8_t group, uint8_t factor) {
if (dispLutSize == 7) {
waveform7->group[group].repeat = waveform7->group[group].repeat / factor;
} else {
waveform10->group[group].repeat = waveform10->group[group].repeat / factor;
switch (dispLutSize) {
case 7:
waveform7->group[group].repeat = waveform7->group[group].repeat / factor;
break;
case 10:
waveform10->group[group].repeat = waveform10->group[group].repeat / factor;
break;
case 12:
waveform12->group[group].repeat = waveform12->group[group].repeat / factor;
break;
}
}
void selectLUT(uint8_t lut) {
if (currentLut == lut) {
// return;
// return;
}
// Handling if we received an OTA LUT
@@ -352,10 +316,11 @@ void selectLUT(uint8_t lut) {
dispLutSize = getLutSize();
dispLutSize /= 10;
printf("lut size = %d\n", dispLutSize);
dispLutSize = 12;
#ifdef PRINT_LUT
dump(waveformbuffer, LUT_BUFFER_SIZE);
#endif
memcpy(customLUT, waveformbuffer, dispLutSize * 10);
memcpy(customLUT, waveformbuffer, LUT_BUFFER_SIZE);
}
switch (lut) {
@@ -401,391 +366,71 @@ void selectLUT(uint8_t lut) {
writeLut();
}
void setWindowX(uint16_t start, uint16_t end) {
shortCommand2(CMD_WINDOW_X_SIZE, start / 8, end / 8 - 1);
}
void setWindowY(uint16_t start, uint16_t end) {
commandBegin(CMD_WINDOW_Y_SIZE);
epdSend((start)&0xff);
epdSend((start) >> 8);
epdSend((end - 1) & 0xff);
epdSend((end - 1) >> 8);
commandEnd();
}
void setPosXY(uint16_t x, uint16_t y) {
shortCommand1(CMD_XSTART_POS, (uint8_t)(x / 8));
commandBegin(CMD_YSTART_POS);
epdSend((y)&0xff);
epdSend((y) >> 8);
commandEnd();
}
void setColorMode(uint8_t red, uint8_t bw) {
shortCommand1(CMD_DISP_UPDATE_CTRL, (red << 4) | bw);
}
void fillWindowWithPattern(bool color) {
if (color == EPD_COLOR_RED) {
shortCommand1(CMD_WRITE_PATTERN_RED, 0x00);
} else {
shortCommand1(CMD_WRITE_PATTERN_BW, 0x00);
}
}
void clearWindow(bool color) {
if (color == EPD_COLOR_RED) {
shortCommand1(CMD_WRITE_PATTERN_RED, 0x66);
} else {
shortCommand1(CMD_WRITE_PATTERN_BW, 0x66);
}
}
void clearScreen() {
void epdWriteDisplayData() {
setWindowX(SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
setWindowY(0, SCREEN_HEIGHT);
setPosXY(0, 0);
shortCommand1(CMD_DATA_ENTRY_MODE, 3); // was 3
shortCommand1(CMD_WRITE_PATTERN_BW, 0x66);
epdBusyWaitFalling(100);
shortCommand1(CMD_WRITE_PATTERN_RED, 0x66);
epdBusyWaitFalling(100);
setPosXY(SCREEN_XOFFSET, 0);
// epdWrite(CMD_DISP_UPDATE_CTRL, 1, 0x08);
// this display expects two entire framebuffers worth of data to be written, one for b/w and one for red
uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
for (uint8_t c = 0; c < 2; c++) {
if (c == 0) epd_cmd(CMD_WRITE_FB_BW);
if (c == 1) epd_cmd(CMD_WRITE_FB_RED);
markData();
epdSelect();
for (uint16_t curY = 0; curY < SCREEN_HEIGHT; curY += 2) {
// Get 'even' screen line
buf[0] = (uint8_t *)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[0], curY, c);
// on the first pass, the second (buf[1]) buffer is unused, so we don't have to wait for it to flush to the display / free it
if (buf[1]) {
// wait for 'odd' display line to finish writing to the screen
epdSPIWait();
free(buf[1]);
}
// start transfer of even data line to the screen
epdSPIAsyncWrite(buf[0], (SCREEN_WIDTH / 8));
// Get 'odd' screen display line
buf[1] = (uint8_t *)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[1], curY + 1, c);
// wait until the 'even' data has finished writing
epdSPIWait();
free(buf[0]);
// start transfer of the 'odd' data line
epdSPIAsyncWrite(buf[1], (SCREEN_WIDTH / 8));
}
// check if this was the first pass. If it was, we'll need to wait until the last display line finished writing
if (c == 0) {
epdSPIWait();
epdDeselect();
free(buf[1]);
buf[1] = nullptr;
}
}
// flush the draw list, make sure items don't appear on subsequent screens
drawItem::flushDrawItems();
// wait until the last line of display has finished writing and clean our stuff up
epdSPIWait();
epdDeselect();
if (buf[1]) free(buf[1]);
}
void draw() {
shortCommand1(0x22, 0xF7);
// shortCommand1(0x22, SCREEN_CMD_REFRESH);
shortCommand(0x20);
drawNoWait();
getVoltage();
epdBusyWaitFalling(120000);
}
void drawNoWait() {
shortCommand1(0x22, 0xF7);
// shortCommand1(0x22, SCREEN_CMD_REFRESH);
shortCommand(0x20);
}
void drawWithSleep() {
shortCommand1(0x22, 0xF7);
// shortCommand1(0x22, SCREEN_CMD_REFRESH);
shortCommand(0x20);
/*uint8_t tmp_P2FUNC = P2FUNC;
uint8_t tmp_P2DIR = P2DIR;
uint8_t tmp_P2PULL = P2PULL;
uint8_t tmp_P2LVLSEL = P2LVLSEL;
P2FUNC &= 0xfd;
P2DIR |= 2;
P2PULL |= 2;
P2LVLSEL |= 2;
P2CHSTA &= 0xfd;
P2INTEN |= 2;
P2CHSTA &= 0xfd;
sleepForMsec(TIMER_TICKS_PER_SECOND * 120);
wdtOn();
P2CHSTA &= 0xfd;
P2INTEN &= 0xfd;
P2FUNC = tmp_P2FUNC;
P2DIR = tmp_P2DIR;
P2PULL = tmp_P2PULL;
P2LVLSEL = tmp_P2LVLSEL;*/
epdBusyWaitFalling(100000);
eepromPrvDeselect();
epdWriteDisplayData();
epdWrite(0x22, 1, 0xF7);
epdWrite(0x20, 0);
}
void epdWaitRdy() {
epdBusyWaitFalling(120000);
}
void drawLineHorizontal(bool color, uint16_t x1, uint16_t x2, uint16_t y) {
x1 = x1 + SCREEN_XOFFSET;
x2 = x2 + SCREEN_XOFFSET;
setWindowX(x1, x2);
setWindowY(y, y + 1);
if (color) {
shortCommand1(CMD_WRITE_PATTERN_RED, 0xE6);
} else {
shortCommand1(CMD_WRITE_PATTERN_BW, 0xE6);
}
epdBusyWaitFalling(100);
}
void drawLineVertical(bool color, uint16_t x, uint16_t y1, uint16_t y2) {
x = x + SCREEN_XOFFSET;
setWindowY(y1, y2);
setWindowX(x, x + 8);
shortCommand1(CMD_DATA_ENTRY_MODE, 3);
setPosXY(x, y1);
if (color) {
commandBegin(CMD_WRITE_FB_RED);
} else {
commandBegin(CMD_WRITE_FB_BW);
}
uint8_t c = 0x80;
c >>= (x % 8);
for (; y1 < y2; y1++) {
epdSend(c);
}
commandEnd();
}
void beginFullscreenImage() {
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
setWindowX(SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
setWindowY(0, SCREEN_HEIGHT);
shortCommand1(CMD_DATA_ENTRY_MODE, 3);
setPosXY(0, 0);
}
void beginWriteFramebuffer(bool color) {
if (color == EPD_COLOR_RED) {
commandBegin(CMD_WRITE_FB_RED);
} else {
commandBegin(CMD_WRITE_FB_BW);
}
epdDeselect();
}
void endWriteFramebuffer() {
commandEnd();
}
void loadRawBitmap(uint8_t *bmp, uint16_t x, uint16_t y, bool color) {
x = x + SCREEN_XOFFSET;
uint16_t xsize = bmp[0] / 8;
if (bmp[0] % 8)
xsize++;
uint16_t size = xsize * bmp[1];
setWindowX(x, x + (xsize * 8));
setWindowY(y, bmp[1] + y);
setPosXY(x, y);
shortCommand1(CMD_DATA_ENTRY_MODE, 3);
if (color) {
commandBegin(CMD_WRITE_FB_RED);
} else {
commandBegin(CMD_WRITE_FB_BW);
}
bmp += 2;
while (size--) {
epdSend(*(bmp++));
}
commandEnd();
}
void printBarcode(const uint8_t *string, uint16_t x, uint16_t y) {
}
// stuff for printing text
static void pushXFontBytesToEPD(uint8_t byte1, uint8_t byte2) {
if (epdCharSize == 1) {
uint8_t offset = 7 - (fontCurXpos % 8);
for (uint8_t c = 0; c < 8; c++) {
if (byte2 & (1 << (7 - c)))
rbuffer[c] |= (1 << offset);
}
for (uint8_t c = 0; c < 8; c++) {
if (byte1 & (1 << (7 - c)))
rbuffer[8 + c] |= (1 << offset);
}
fontCurXpos++;
} else {
uint8_t offset = 6 - (fontCurXpos % 8);
// double font size
for (uint8_t c = 0; c < 8; c++) {
if (byte2 & (1 << (7 - c))) {
rbuffer[c * 2] |= (3 << offset);
rbuffer[(c * 2) + 1] |= (3 << offset);
}
}
for (uint8_t c = 0; c < 8; c++) {
if (byte1 & (1 << (7 - c))) {
rbuffer[(c * 2) + 16] |= (3 << offset);
rbuffer[(c * 2) + 17] |= (3 << offset);
}
}
fontCurXpos += 2;
}
if (fontCurXpos % 8 == 0) {
// next byte, flush current byte to EPD
for (uint8_t i = 0; i < (16 * epdCharSize); i++) {
epdSend(rbuffer[i]);
}
memset(rbuffer, 0, 32);
}
}
static void bufferByteShift(uint8_t byte) {
/*
rbuffer[0] = 0; // previous value
rbuffer[1] = y%8; // offset
rbuffer[2] = 0; // current byte counter;
rbuffer[3] = 1+(epdCharsize*2);
*/
if (rbuffer[1] == 0) {
epdSend(byte);
} else {
uint8_t offset = rbuffer[1];
rbuffer[0] |= (byte >> offset);
epdSend(rbuffer[0]);
// epdSend(byte);
rbuffer[0] = (byte << (8 - offset));
rbuffer[2]++;
if (rbuffer[2] == rbuffer[3]) {
epdSend(rbuffer[0]);
rbuffer[0] = 0;
rbuffer[2] = 0;
}
}
}
static void pushYFontBytesToEPD(uint8_t byte1, uint8_t byte2) {
if (epdCharSize == 2) {
for (uint8_t j = 0; j < 2; j++) {
uint8_t c = 0;
for (uint8_t i = 7; i != 255; i--) {
if (byte1 & (1 << i))
c |= (0x03 << ((i % 4) * 2));
if ((i % 4) == 0) {
bufferByteShift(c);
c = 0;
}
}
for (uint8_t i = 7; i != 255; i--) {
if (byte2 & (1 << i))
c |= (0x03 << ((i % 4) * 2));
if ((i % 4) == 0) {
bufferByteShift(c);
c = 0;
}
}
}
} else {
bufferByteShift(byte1);
bufferByteShift(byte2);
}
}
void writeCharEPD(uint8_t c) {
// Writes a single character to the framebuffer
bool empty = true;
for (uint8_t i = 0; i < 20; i++) {
if (font[c][i])
empty = false;
}
if (empty) {
for (uint8_t i = 0; i < 8; i++) {
if (directionY) {
pushYFontBytesToEPD(0x00, 0x00);
} else {
pushXFontBytesToEPD(0x00, 0x00);
}
}
return;
}
uint8_t begin = 0;
while (font[c][begin] == 0x00 && font[c][begin + 1] == 0x00) {
begin += 2;
}
uint8_t end = 20;
while (font[c][end - 1] == 0x00 && font[c][end - 2] == 0x00) {
end -= 2;
}
for (uint8_t pos = begin; pos < end; pos += 2) {
if (directionY) {
pushYFontBytesToEPD(font[c][pos + 1], font[c][pos]);
} else {
pushXFontBytesToEPD(font[c][pos], font[c][pos + 1]);
}
}
// spacing between characters
if (directionY) {
pushYFontBytesToEPD(0x00, 0x00);
} else {
pushXFontBytesToEPD(0x00, 0x00);
}
}
// Print text to the EPD. Origin is top-left
void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool color) {
x = x + SCREEN_XOFFSET;
directionY = direction;
epdCharSize = 1 + fontsize;
if (directionY) {
uint8_t extra = 0;
// provisions for dealing with font in Y direction, byte-unaligned
if (x % 8) {
extra = 8;
rbuffer[0] = 0; // previous value
rbuffer[1] = x % 8; // offset
rbuffer[2] = 0; // current byte counter;
rbuffer[3] = (epdCharSize * 2);
} else {
rbuffer[1] = 0;
}
setWindowY(y, 1);
if (epdCharSize == 2) {
setWindowX(x, x + 32 + extra);
setPosXY(x, y);
} else {
setWindowX(x, x + 16 + extra);
setPosXY(x, y);
}
shortCommand1(CMD_DATA_ENTRY_MODE, 1); // was 3
} else {
if (epdCharSize == 2) {
x /= 2;
x *= 2;
setWindowY(y, y + 32);
} else {
setWindowY(y, y + 16);
}
setPosXY(x, y);
fontCurXpos = x;
setWindowX(x + SCREEN_XOFFSET, SCREEN_WIDTH + SCREEN_XOFFSET);
shortCommand1(CMD_DATA_ENTRY_MODE, 7);
memset(rbuffer, 0, 32);
}
if (color) {
commandBegin(CMD_WRITE_FB_RED);
} else {
commandBegin(CMD_WRITE_FB_BW);
}
}
void epdPrintEnd() {
if (!directionY && ((fontCurXpos % 8) != 0)) {
for (uint8_t i = 0; i < (16 * epdCharSize); i++) {
epdSend(rbuffer[i]);
}
}
commandEnd();
}
extern uint8_t blockXferBuffer[];
void readRam() {
setWindowY(296, 0);
setWindowX(0, 8);
setPosXY(0, 296);
shortCommand1(CMD_DATA_ENTRY_MODE, 1); // was 3
shortCommand1(0x41, 0x00);
commandReadBegin(0x27);
epdReadByte();
for (uint16_t c = 0; c < 293; c++) {
blockXferBuffer[c] = epdReadByte() | 0x10;
}
commandReadEnd();
commandBegin(CMD_WRITE_FB_BW);
for (uint16_t c = 0; c < 296; c++) {
epdSend(blockXferBuffer[c]);
}
commandEnd();
}
static void epdPutchar(uint8_t data) {
writeCharEPD(data);
}
void epdpr(const char *c, ...) {
char out_buffer[512]; // you can define your own buffers size
va_list lst;
va_start(lst, c);
vsprintf(out_buffer, c, lst);
va_end(lst);
int posi = 0;
while (out_buffer[posi] != 0) {
epdPutchar(out_buffer[posi]);
posi++;
}
}
}

View File

@@ -22,6 +22,8 @@ struct fwmetadata {
uint32_t magic2;
};
#define EEPROM_SETTINGS_SIZE 4096
// download-stuff
uint8_t blockXferBuffer[BLOCK_XFER_BUFFER_SIZE] = {0};
static struct blockRequest curBlock = {0}; // used by the block-requester, contains the next request that we'll send
@@ -434,13 +436,13 @@ static bool validateEepromMD5(uint64_t ver, uint32_t eepromstart, uint32_t flen)
return isValid;
}
static uint32_t getAddressForSlot(const uint8_t s) {
return EEPROM_IMG_START + (EEPROM_IMG_EACH * s);
return (EEPROM_IMG_EACH * s);
}
static void getNumSlots() {
uint32_t eeSize = eepromGetSize();
uint16_t nSlots = (eeSize - EEPROM_IMG_START) / (EEPROM_IMG_EACH >> 8) >> 8;
if (eeSize < EEPROM_IMG_START || !nSlots) {
uint16_t nSlots = (eeSize - EEPROM_SETTINGS_SIZE) / (EEPROM_IMG_EACH >> 8) >> 8;
if (!nSlots) {
printf("eeprom is too small\n");
while (1)
;

View File

@@ -0,0 +1,245 @@
#include "uc8159.h"
#include <Arduino.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hal.h"
#include "lut.h"
#include "settings.h"
#include "wdt.h"
#include "drawing.h"
#define CMD_PANEL_SETTING 0x00
#define CMD_POWER_SETTING 0x01
#define CMD_POWER_OFF 0x02
#define CMD_POWER_OFF_SEQUENCE 0x03
#define CMD_POWER_ON 0x04
#define CMD_BOOSTER_SOFT_START 0x06
#define CMD_DEEP_SLEEP 0x07
#define CMD_DISPLAY_START_TRANSMISSION_DTM1 0x10
#define CMD_DATA_STOP 0x11
#define CMD_DISPLAY_REFRESH 0x12
#define CMD_DISPLAY_IMAGE_PROCESS 0x13
#define CMD_VCOM_LUT_C 0x20
#define CMD_LUT_B 0x21
#define CMD_LUT_W 0x22
#define CMD_LUT_G1 0x23
#define CMD_LUT_G2 0x24
#define CMD_LUT_R0 0x25
#define CMD_LUT_R1 0x26
#define CMD_LUT_R2 0x27
#define CMD_LUT_R3 0x28
#define CMD_LUT_XON 0x29
#define CMD_PLL_CONTROL 0x30
#define CMD_TEMPERATURE_DOREADING 0x40
#define CMD_TEMPERATURE_SELECT 0x41
#define CMD_TEMPERATURE_WRITE 0x42
#define CMD_TEMPERATURE_READ 0x43
#define CMD_VCOM_INTERVAL 0x50
#define CMD_LOWER_POWER_DETECT 0x51
#define CMD_TCON_SETTING 0x60
#define CMD_RESOLUTION_SETING 0x61
#define CMD_SPI_FLASH_CONTROL 0x65
#define CMD_REVISION 0x70
#define CMD_STATUS 0x71
#define CMD_AUTO_MEASUREMENT_VCOM 0x80
#define CMD_READ_VCOM 0x81
#define CMD_VCOM_DC_SETTING 0x82
#define CMD_PARTIAL_WINDOW 0x90
#define CMD_PARTIAL_IN 0x91
#define CMD_PARTIAL_OUT 0x92
#define CMD_PROGRAM_MODE 0xA0
#define CMD_ACTIVE_PROGRAM 0xA1
#define CMD_READ_OTP 0xA2
#define CMD_EPD_EEPROM_SLEEP 0xB9
#define CMD_EPD_EEPROM_WAKE 0xAB
#define CMD_CASCADE_SET 0xE0
#define CMD_POWER_SAVING 0xE3
#define CMD_FORCE_TEMPERATURE 0xE5
#define CMD_LOAD_FLASH_LUT 0xE5
#define epdEepromSelect() \
do { \
digitalWrite(EPD_HLT, LOW); \
} while (0)
#define epdEepromDeselect() \
do { \
digitalWrite(EPD_HLT, HIGH); \
} while (0)
void dump(const uint8_t *a, const uint16_t l);
static void epdEepromRead(uint16_t addr, uint8_t *data, uint16_t len) {
// return;
epdWrite(CMD_SPI_FLASH_CONTROL, 1, 0x01);
delay(1);
epdEepromSelect();
spi_write(0x03); // EEPROM READ;
spi_write(0x00);
spi_write(addr >> 8);
spi_write(addr & 0xFF);
epdSPIReadBlock(data, len);
epdEepromDeselect();
delay(1);
epdWrite(CMD_SPI_FLASH_CONTROL, 1, 0x00);
}
uint8_t getTempBracket() {
uint8_t temptable[10];
epdEepromRead(25002, temptable, 10);
epdWrite(CMD_TEMPERATURE_DOREADING, 0);
epdBusyWaitRising(1500);
epdHardSPI(false);
int8_t temp = spi3_read();
temp <<= 1;
temp |= (spi3_read() >> 7);
uint8_t bracket = 0;
for (int i = 0; i < 9; i++) {
if ((((char)temp - (uint8_t)temptable[i]) & 0x80) != 0) {
bracket = i;
break;
}
}
epdHardSPI(true);
return bracket;
}
static void loadFrameRatePLL(uint8_t bracket) {
uint8_t pllvalue;
uint8_t plltable[10];
epdEepromRead(0x6410, plltable, 10);
pllvalue = plltable[bracket];
if (!pllvalue) pllvalue = 0x3C; // check if there's a valid pll value; if not; load preset
epdWrite(CMD_PLL_CONTROL, 1, pllvalue);
}
static void loadTempVCOMDC(uint8_t bracket) {
uint8_t vcomvalue;
uint8_t vcomtable[10];
epdEepromRead(25049, vcomtable, 10);
vcomvalue = vcomtable[bracket];
if (!vcomvalue) {
// if we couldn't find the vcom table, then it's a fixed value sitting at 0x6400
epdEepromRead(0x6400, vcomtable, 10);
if (vcomtable[0])
vcomvalue = vcomtable[0];
else
vcomvalue = 0x1E; // check if there's a valid vcomvalue; if not; load preset
}
epdWrite(CMD_VCOM_DC_SETTING, 1, vcomvalue);
}
void epdEnterSleep() {
epdWrite(CMD_POWER_OFF, 0);
epdBusyWaitRising(250);
}
void epdSetup() {
epdReset();
digitalWrite(EPD_BS, LOW);
epdWrite(CMD_PANEL_SETTING, 2, 0xEF, 0x08); // default = 0xE7-0x08 // 0xEF-0x08 = right-side up
epdWrite(CMD_POWER_SETTING, 4, 0x37, 0x00, 0x05, 0x05);
epdWrite(CMD_POWER_OFF_SEQUENCE, 1, 0x00);
epdWrite(CMD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x1D);
epdBusyWaitRising(250);
epdWrite(CMD_POWER_ON, 0);
epdBusyWaitRising(250);
epdWrite(CMD_DISPLAY_IMAGE_PROCESS, 1, 0x00);
epdWrite(CMD_PLL_CONTROL, 1, 0x3C);
epdWrite(CMD_TEMPERATURE_SELECT, 1, 0x00);
epdWrite(CMD_VCOM_INTERVAL, 1, 0x77);
epdWrite(CMD_TCON_SETTING, 1, 0x22);
epdWrite(CMD_RESOLUTION_SETING, 4, 0x02, 0x58, 0x01, 0xC0); // set for 600x448
epdWrite(CMD_SPI_FLASH_CONTROL, 1, 0x00);
uint8_t bracket = getTempBracket();
loadFrameRatePLL(bracket);
epdBusyWaitRising(250);
loadTempVCOMDC(bracket);
epdBusyWaitRising(250);
}
static void interleaveColorToBuffer(uint8_t *dst, uint8_t b, uint8_t r) {
b ^= 0xFF;
uint8_t b_out = 0;
for (int8_t shift = 3; shift >= 0; shift--) {
b_out = 0;
if (((b >> 2 * shift) & 0x01) && ((r >> 2 * shift) & 0x01)) {
b_out |= 0x04; // 0x30
} else if ((b >> 2 * shift) & 0x01) {
b_out |= 0x03; // 0x30
} else if ((r >> 2 * shift) & 0x01) { // 4 or 5
b_out |= 0x04; // 0x30
} else {
}
if (((b >> 2 * shift) & 0x02) && ((r >> 2 * shift) & 0x02)) {
b_out |= 0x40; // 0x30
} else if ((b >> 2 * shift) & 0x02) {
b_out |= 0x30; // 0x30
} else if ((r >> 2 * shift) & 0x02) {
b_out |= 0x40; // 0x30
} else {
}
*dst++ = b_out;
}
}
void selectLUT(uint8_t lut) {
// implement alternative LUTs here. Currently just reset the watchdog to two minutes,
// to ensure it doesn't reset during the much longer bootup procedure
lut += 1; // make the compiler a happy camper
wdt120s();
return;
}
static void epdWriteDisplayData() {
uint8_t screenrow_bw[SCREEN_WIDTH / 8];
uint8_t screenrow_r[SCREEN_WIDTH / 8];
uint8_t screenrowInterleaved[SCREEN_WIDTH / 8 * 4];
epd_cmd(CMD_DISPLAY_START_TRANSMISSION_DTM1);
markData();
epdSelect();
for (uint16_t curY = 0; curY < SCREEN_HEIGHT; curY++) {
memset(screenrow_bw, 0, SCREEN_WIDTH / 8);
memset(screenrow_r, 0, SCREEN_WIDTH / 8);
drawItem::renderDrawLine(screenrow_bw, curY, 0);
drawItem::renderDrawLine(screenrow_r, curY, 1);
if (curY != 0) {
epdSPIWait();
epdDeselect();
epdSelect();
}
for (uint16_t curX = 0; curX < (SCREEN_WIDTH / 8); curX++) {
interleaveColorToBuffer(screenrowInterleaved + (curX * 4), screenrow_bw[curX], screenrow_r[curX]);
}
epdSPIAsyncWrite(screenrowInterleaved, SCREEN_WIDTH / 8 * 4);
}
epdSPIWait();
epdDeselect();
epd_cmd(CMD_DATA_STOP);
drawItem::flushDrawItems();
}
void draw() {
delay(1);
drawNoWait();
epdBusyWaitRising(25000);
}
void drawNoWait() {
epdWriteDisplayData();
// epdWrite(CMD_LOAD_FLASH_LUT, 1, 0x03);
epdWrite(CMD_DISPLAY_REFRESH, 0);
}
void drawWithSleep() {
draw();
}
void epdWaitRdy() {
epdBusyWaitRising(25000);
}

View File

@@ -7,8 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include "font.h"
#include "lut.h"
#include "drawing.h"
#include "settings.h"
#include "hal.h"
#include "wdt.h"
@@ -49,375 +48,27 @@
#define CMD_POWER_SAVING 0xE3
#define CMD_FORCE_TEMPERATURE 0xE5
enum PSR_FLAGS {
RES_96x230 = 0b00000000,
RES_96x252 = 0b01000000,
RES_128x296 = 0b10000000,
RES_160x296 = 0b11000000,
LUT_OTP = 0b00000000,
LUT_REG = 0b00100000,
FORMAT_BWR = 0b00000000,
FORMAT_BW = 0b00010000,
SCAN_DOWN = 0b00000000,
SCAN_UP = 0b00001000,
SHIFT_LEFT = 0b00000000,
SHIFT_RIGHT = 0b00000100,
BOOSTER_OFF = 0b00000000,
BOOSTER_ON = 0b00000010,
RESET_SOFT = 0b00000000,
RESET_NONE = 0b00000001
};
enum PWR_FLAGS_1 {
VDS_EXTERNAL = 0b00000000,
VDS_INTERNAL = 0b00000010,
VDG_EXTERNAL = 0b00000000,
VDG_INTERNAL = 0b00000001
};
enum PWR_FLAGS_2 {
VCOM_VD = 0b00000000,
VCOM_VG = 0b00000100,
VGHL_16V = 0b00000000,
VGHL_15V = 0b00000001,
VGHL_14V = 0b00000010,
VGHL_13V = 0b00000011
};
enum BOOSTER_FLAGS {
START_10MS = 0b00000000,
START_20MS = 0b01000000,
START_30MS = 0b10000000,
START_40MS = 0b11000000,
STRENGTH_1 = 0b00000000,
STRENGTH_2 = 0b00001000,
STRENGTH_3 = 0b00010000,
STRENGTH_4 = 0b00011000,
STRENGTH_5 = 0b00100000,
STRENGTH_6 = 0b00101000,
STRENGTH_7 = 0b00110000,
STRENGTH_8 = 0b00111000,
OFF_0_27US = 0b00000000,
OFF_0_34US = 0b00000001,
OFF_0_40US = 0b00000010,
OFF_0_54US = 0b00000011,
OFF_0_80US = 0b00000100,
OFF_1_54US = 0b00000101,
OFF_3_34US = 0b00000110,
OFF_6_58US = 0b00000111
};
enum PFS_FLAGS {
FRAMES_1 = 0b00000000,
FRAMES_2 = 0b00010000,
FRAMES_3 = 0b00100000,
FRAMES_4 = 0b00110000
};
enum TSE_FLAGS {
TEMP_INTERNAL = 0b00000000,
TEMP_EXTERNAL = 0b10000000,
OFFSET_0 = 0b00000000,
OFFSET_1 = 0b00000001,
OFFSET_2 = 0b00000010,
OFFSET_3 = 0b00000011,
OFFSET_4 = 0b00000100,
OFFSET_5 = 0b00000101,
OFFSET_6 = 0b00000110,
OFFSET_7 = 0b00000111,
OFFSET_MIN_8 = 0b00001000,
OFFSET_MIN_7 = 0b00001001,
OFFSET_MIN_6 = 0b00001010,
OFFSET_MIN_5 = 0b00001011,
OFFSET_MIN_4 = 0b00001100,
OFFSET_MIN_3 = 0b00001101,
OFFSET_MIN_2 = 0b00001110,
OFFSET_MIN_1 = 0b00001111
};
enum PLL_FLAGS {
// other frequency options exist but there doesn't seem to be much
// point in including them - this is a fair range of options...
HZ_29 = 0b00111111,
HZ_33 = 0b00111110,
HZ_40 = 0b00111101,
HZ_50 = 0b00111100,
HZ_67 = 0b00111011,
HZ_100 = 0b00111010,
HZ_200 = 0b00111001
};
#define commandEnd() \
do { \
digitalWrite(EPD_CS, HIGH); \
} while (0)
#define markCommand() \
do { \
digitalWrite(EPD_DC, LOW); \
} while (0)
#define markData() \
do { \
digitalWrite(EPD_DC, HIGH); \
} while (0)
extern void dump(uint8_t *a, uint16_t l); // remove me when done
static uint8_t epdCharSize = 1; // character size, 1 or 2 (doubled)
static bool directionY = true; // print direction, X or Y (true)
static uint8_t rbuffer[32]; // used to rotate bits around
static uint16_t fontCurXpos = 0; // current X value we're working with
static uint16_t fontCurYpos = 0; // current Y value we're working with
static uint8_t currentLut = 0;
static uint8_t dispLutSize = 0;
static bool drawDirection = false;
static bool isInited = false;
bool epdGPIOActive = false;
#define LUT_BUFFER_SIZE 128
uint8_t waveformbuffer[LUT_BUFFER_SIZE];
struct waveform10 *waveform10 = (struct waveform10 *)waveformbuffer; // holds the LUT/waveform
struct waveform *waveform7 = (struct waveform *)waveformbuffer; // holds the LUT/waveform
static void epdBusySleep(uint32_t timeout) {
epdBusyWaitFalling(timeout);
}
static void commandReadBegin(uint8_t cmd) {
epdSelect();
markCommand();
spi_write(cmd); // dump LUT
pinMode(EPD_MOSI, INPUT);
markData();
}
static void commandReadEnd() {
// set up pins for spi (0.0,0.1,0.2)
pinMode(EPD_MOSI, OUTPUT);
epdDeselect();
}
static uint8_t epdReadByte() {
uint8_t val = 0, i;
for (i = 0; i < 8; i++) {
digitalWrite(EPD_CLK, HIGH);
delayMicroseconds(1);
val <<= 1;
if (digitalRead(EPD_MOSI))
val++;
digitalWrite(EPD_CLK, LOW);
delayMicroseconds(1);
}
return val;
}
static void shortCommand(uint8_t cmd) {
epdSelect();
markCommand();
spi_write(cmd);
epdDeselect();
}
static void shortCommand1(uint8_t cmd, uint8_t arg) {
epdSelect();
markCommand();
spi_write(cmd);
markData();
spi_write(arg);
epdDeselect();
}
static void shortCommand2(uint8_t cmd, uint8_t arg1, uint8_t arg2) {
epdSelect();
markCommand();
spi_write(cmd);
markData();
spi_write(arg1);
spi_write(arg2);
epdDeselect();
}
static void commandBegin(uint8_t cmd) {
epdSelect();
markCommand();
spi_write(cmd);
markData();
}
static void epdReset() {
digitalWrite(EPD_RST, HIGH);
delay(12);
digitalWrite(EPD_RST, LOW);
delay(20);
digitalWrite(EPD_RST, HIGH);
delay(20);
}
void epdConfigGPIO(bool setup) {
if (epdGPIOActive == setup)
return;
if (setup) {
pinMode(EPD_POWER, OUTPUT);
digitalWrite(EPD_POWER, HIGH);
pinMode(EPD_RST, OUTPUT);
pinMode(EPD_BS, OUTPUT);
pinMode(EPD_CS, OUTPUT);
pinMode(EPD_DC, OUTPUT);
pinMode(EPD_BUSY, INPUT);
pinMode(EPD_CLK, OUTPUT);
pinMode(EPD_MOSI, OUTPUT);
} else {
digitalWrite(EPD_POWER, LOW);
pinMode(EPD_POWER, DEFAULT);
}
epdGPIOActive = setup;
}
void epdEnterSleep() {
shortCommand1(CMD_VCOM_INTERVAL, 0x17);
shortCommand1(CMD_VCOM_DC_SETTING, 0x00);
// shortCommand(CMD_POWER_OFF);
// epdWaitRdy();
shortCommand1(CMD_DEEP_SLEEP, 0xA5);
epdWrite(CMD_VCOM_INTERVAL, 1, 0x17);
delay(10);
epdWrite(CMD_VCOM_DC_SETTING, 1, 0x00);
delay(10);
epdWrite(CMD_POWER_OFF, 0);
delay(10);
epdWrite(CMD_DEEP_SLEEP, 1, 0xA5);
delay(10);
isInited = false;
}
static void epdDrawDirection(bool direction) {
if (direction == drawDirection)
return;
drawDirection = direction;
uint8_t psr_setting = RES_160x296 | FORMAT_BWR | BOOSTER_ON | RESET_NONE | LUT_OTP | SHIFT_RIGHT;
if (drawDirection) {
psr_setting |= SCAN_DOWN;
} else {
psr_setting |= SCAN_UP;
}
shortCommand2(CMD_PANEL_SETTING, psr_setting, 0);
}
void epdSetup() {
epdReset();
drawDirection = false;
epdDrawDirection(true);
shortCommand2(CMD_VCOM_INTERVAL, 0x30, 0x07);
commandBegin(CMD_RESOLUTION_SETING);
epdSend(SCREEN_WIDTH >> 8);
epdSend(SCREEN_WIDTH & 0xFF);
epdSend(SCREEN_HEIGHT >> 8);
epdSend(SCREEN_HEIGHT & 0xFF);
commandEnd();
/* commandBegin(CMD_POWER_SETTING);
epdSend(VDS_INTERNAL | VDG_INTERNAL);
epdSend(VCOM_VD | VGHL_16V);
epdSend(0b101011);
epdSend(0b101011);
epdSend(0b101011);
commandEnd();
shortCommand(CMD_POWER_ON);
epdWaitRdy();
commandBegin(CMD_BOOSTER_SOFT_START);
epdSend(START_10MS | STRENGTH_3 | OFF_6_58US);
epdSend(START_10MS | STRENGTH_3 | OFF_6_58US);
epdSend(START_10MS | STRENGTH_3 | OFF_6_58US);
commandEnd();
commandBegin(CMD_RESOLUTION_SETING);
epdSend(SCREEN_WIDTH >> 8);
epdSend(SCREEN_WIDTH & 0xFF);
epdSend(SCREEN_HEIGHT >> 8);
epdSend(SCREEN_HEIGHT & 0xFF);
commandEnd();
shortCommand1(CMD_POWER_OFF_SEQUENCE, FRAMES_1);
shortCommand1(CMD_TEMPERATURE_SELECT, TEMP_INTERNAL | OFFSET_0);
shortCommand1(CMD_TCON_SETTING, 0x22);
shortCommand1(CMD_VCOM_INTERVAL, 0x8d); // 0x87
shortCommand1(CMD_PLL_CONTROL, HZ_200);
epdWaitRdy();*/
shortCommand(CMD_POWER_ON);
epdWaitRdy();
}
static uint8_t epdGetStatus() {
uint8_t sta;
commandReadBegin(0x2F);
sta = epdReadByte();
commandReadEnd();
return sta;
}
uint16_t epdGetBattery(void) {
return 0;
epdWrite(CMD_PANEL_SETTING, 1, 0x0F);
epdWrite(CMD_VCOM_INTERVAL, 2, 0x30, 0x07);
epdWrite(CMD_RESOLUTION_SETING, 4, SCREEN_WIDTH >> 8, SCREEN_WIDTH & 0xFF, SCREEN_HEIGHT >> 8, SCREEN_HEIGHT & 0xFF);
}
static void readLut() {
commandReadBegin(0x33);
uint16_t checksum = 0;
uint16_t ident = 0;
uint16_t shortl = 0;
for (uint16_t c = 0; c < LUT_BUFFER_SIZE; c++) {
waveformbuffer[c] = epdReadByte();
}
commandReadEnd();
}
static uint8_t getLutSize() {
uint8_t ref = 0;
for (uint8_t c = (LUT_BUFFER_SIZE - 4); c > 16; c--) {
uint8_t check = waveformbuffer[c];
for (uint8_t d = 1; d < 4; d++) {
if (waveformbuffer[c + d] != check) {
ref = c;
goto end;
}
}
}
end:;
return ref + 1;
}
static void lutGroupDisable(uint8_t group) {
if (dispLutSize == 7) {
memset(&(waveform7->group[group]), 0x00, 5);
} else {
memset(&(waveform10->group[group]), 0x00, 5);
}
}
static void lutGroupSpeedup(uint8_t group, uint8_t speed) {
if (dispLutSize == 7) {
for (uint8_t i = 0; i < 4; i++) {
waveform7->group[group].phaselength[i] = 1 + (waveform7->group[group].phaselength[i] / speed);
}
} else {
for (uint8_t i = 0; i < 4; i++) {
waveform10->group[group].phaselength[i] = 1 + (waveform10->group[group].phaselength[i] / speed);
}
}
}
static void lutGroupRepeat(uint8_t group, uint8_t repeat) {
if (dispLutSize == 7) {
waveform7->group[group].repeat = repeat;
} else {
waveform10->group[group].repeat = repeat;
}
}
static void lutGroupRepeatReduce(uint8_t group, uint8_t factor) {
if (dispLutSize == 7) {
waveform7->group[group].repeat = waveform7->group[group].repeat / factor;
} else {
waveform10->group[group].repeat = waveform10->group[group].repeat / factor;
}
}
void selectLUT(uint8_t lut) {
// implement alternative LUTs here. Currently just reset the watchdog to two minutes,
// to ensure it doesn't reset during the much longer bootup procedure
@@ -426,322 +77,69 @@ void selectLUT(uint8_t lut) {
return;
}
void setWindowXY(uint16_t xstart, uint16_t xend, uint16_t ystart, uint16_t yend) {
shortCommand(CMD_PARTIAL_IN);
commandBegin(CMD_PARTIAL_WINDOW);
epdSend(xstart >> 8);
epdSend(xstart & 0xFF);
epdSend((xend - 1) >> 8);
epdSend((xend - 1) & 0xff);
epdSend(ystart >> 8);
epdSend(ystart & 0xFF);
epdSend((yend - 1) >> 8);
epdSend((yend - 1) & 0xff);
epdSend(0x01);
commandEnd();
void epdWriteDisplayData() {
uint32_t start = millis();
// this display expects two entire framebuffers worth of data to be written, one for b/w and one for red
uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
for (uint8_t c = 0; c < 2; c++) {
if (c == 0) epd_cmd(CMD_DISPLAY_START_TRANSMISSION_DTM1);
if (c == 1) epd_cmd(CMD_DISPLAY_START_TRANSMISSION_DTM2);
markData();
epdSelect();
for (uint16_t curY = 0; curY < SCREEN_HEIGHT; curY += 2) {
// Get 'even' screen line
buf[0] = (uint8_t *)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[0], curY, c);
// on the first pass, the second (buf[1]) buffer is unused, so we don't have to wait for it to flush to the display / free it
if (buf[1]) {
// wait for 'odd' display line to finish writing to the screen
epdSPIWait();
free(buf[1]);
}
// start transfer of even data line to the screen
epdSPIAsyncWrite(buf[0], (SCREEN_WIDTH / 8));
// Get 'odd' screen display line
buf[1] = (uint8_t *)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[1], curY + 1, c);
// wait until the 'even' data has finished writing
epdSPIWait();
free(buf[0]);
// start transfer of the 'odd' data line
epdSPIAsyncWrite(buf[1], (SCREEN_WIDTH / 8));
}
// check if this was the first pass. If it was, we'll need to wait until the last display line finished writing
if (c == 0) {
epdSPIWait();
epdDeselect();
free(buf[1]);
buf[1] = nullptr;
}
}
// flush the draw list, make sure items don't appear on subsequent screens
drawItem::flushDrawItems();
// wait until the last line of display has finished writing and clean our stuff up
epdSPIWait();
epdDeselect();
if (buf[1]) free(buf[1]);
printf("draw took %lu ms\n", millis() - start);
}
void setColorMode(uint8_t red, uint8_t bw) {
// this does exactly nothing, just keeps the compiler from barking
red = 1;
bw = 0;
return;
}
void clearScreen() {
shortCommand(CMD_PARTIAL_OUT);
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
for (uint16_t c = 0; c < ((1UL * SCREEN_HEIGHT * SCREEN_WIDTH) / 8); c++) {
epdSend(0x00);
}
commandEnd();
epdWaitRdy();
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM1);
for (uint16_t c = 0; c < ((1UL * SCREEN_HEIGHT * SCREEN_WIDTH) / 8); c++) {
epdSend(0x00);
}
commandEnd();
}
void draw() {
shortCommand(CMD_DISPLAY_REFRESH);
drawNoWait();
epdWaitRdy();
}
void drawNoWait() {
shortCommand(CMD_DISPLAY_REFRESH);
}
void drawWithSleep() {
shortCommand(CMD_DISPLAY_REFRESH);
epdBusyWaitFalling(120000);
epdWriteDisplayData();
epdWrite(CMD_POWER_ON, 0);
epdWaitRdy();
epdWrite(CMD_DISPLAY_REFRESH, 0);
}
void epdWaitRdy() {
epdBusyWaitFalling(120000);
}
void beginFullscreenImage() {
shortCommand(CMD_PARTIAL_OUT);
epdDrawDirection(false);
// shortCommand1(CMD_DATA_ENTRY_MODE, 3);
// setPosXY(0, 0);
}
void beginWriteFramebuffer(bool color) {
if (color == EPD_COLOR_RED) {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
} else {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM1);
}
epdDeselect();
}
void endWriteFramebuffer() {
commandEnd();
}
void loadRawBitmap(uint8_t *bmp, uint16_t x, uint16_t y, bool color) {
// this function is very badly hurt by the switch to UC8151, taking up LOTS of valuable idata space. Only defining variables
// as static, or the function as reentrant (relegating variables to the stack) seemed to fix the idata issue. Fix me, or put me out of my misery...
uint16_t xsize = bmp[0] / 8;
if (bmp[0] % 8)
xsize++;
uint16_t ysize = bmp[1];
uint16_t size = xsize * bmp[1];
// shortCommand1(CMD_DATA_ENTRY_MODE, 3);
bmp += 2;
uint16_t c = 0;
uint16_t curY = y;
while (1) {
if (c % xsize == 0) {
commandEnd();
if (drawDirection) {
setWindowXY(x, x + xsize * 8, SCREEN_HEIGHT - curY - 1, SCREEN_HEIGHT - curY);
} else {
setWindowXY(x, x + xsize * 8, curY - 1, curY);
}
curY++;
if (color) {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
} else {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM1);
}
}
epdSend(*(bmp++));
c++;
if (!size--)
break;
}
commandEnd();
shortCommand(CMD_PARTIAL_OUT);
}
void printBarcode(const uint8_t *string, uint16_t x, uint16_t y) {
}
// stuff for printing text
static void pushXFontBytesToEPD(uint8_t byte1, uint8_t byte2) {
if (epdCharSize == 1) {
uint8_t offset = 7 - (fontCurXpos % 8);
for (uint8_t c = 0; c < 8; c++) {
if (byte2 & (1 << (7 - c)))
rbuffer[c] |= (1 << offset);
}
for (uint8_t c = 0; c < 8; c++) {
if (byte1 & (1 << (7 - c)))
rbuffer[8 + c] |= (1 << offset);
}
fontCurXpos++;
} else {
uint8_t offset = 6 - (fontCurXpos % 8);
// double font size
for (uint8_t c = 0; c < 8; c++) {
if (byte2 & (1 << (7 - c))) {
rbuffer[c * 2] |= (3 << offset);
rbuffer[(c * 2) + 1] |= (3 << offset);
}
}
for (uint8_t c = 0; c < 8; c++) {
if (byte1 & (1 << (7 - c))) {
rbuffer[(c * 2) + 16] |= (3 << offset);
rbuffer[(c * 2) + 17] |= (3 << offset);
}
}
fontCurXpos += 2;
}
if (fontCurXpos % 8 == 0) {
// next byte, flush current byte to EPD
for (uint8_t i = 0; i < (16 * epdCharSize); i++) {
epdSend(rbuffer[i]);
}
memset(rbuffer, 0, 32);
}
}
static void bufferByteShift(uint8_t byte) {
/*
rbuffer[0] = 0; // previous value
rbuffer[1] = y%8; // offset
rbuffer[2] = 0; // current byte counter;
rbuffer[3] = 1+(epdCharsize*2);
*/
if (rbuffer[1] == 0) {
epdSend(byte);
} else {
uint8_t offset = rbuffer[1];
rbuffer[0] |= (byte >> offset);
epdSend(rbuffer[0]);
// epdSend(byte);
rbuffer[0] = (byte << (8 - offset));
rbuffer[2]++;
if (rbuffer[2] == rbuffer[3]) {
epdSend(rbuffer[0]);
rbuffer[0] = 0;
rbuffer[2] = 0;
}
}
}
static void pushYFontBytesToEPD(uint8_t byte1, uint8_t byte2) {
if (epdCharSize == 2) {
for (uint8_t j = 0; j < 2; j++) {
uint8_t c = 0;
for (uint8_t i = 7; i != 255; i--) {
if (byte1 & (1 << i))
c |= (0x03 << ((i % 4) * 2));
if ((i % 4) == 0) {
bufferByteShift(c);
c = 0;
}
}
for (uint8_t i = 7; i != 255; i--) {
if (byte2 & (1 << i))
c |= (0x03 << ((i % 4) * 2));
if ((i % 4) == 0) {
bufferByteShift(c);
c = 0;
}
}
}
} else {
bufferByteShift(byte1);
bufferByteShift(byte2);
}
}
void writeCharEPD(uint8_t c) {
// Writes a single character to the framebuffer
bool empty = true;
for (uint8_t i = 0; i < 20; i++) {
if (font[c][i])
empty = false;
}
if (empty) {
for (uint8_t i = 0; i < 8; i++) {
if (directionY) {
pushYFontBytesToEPD(0x00, 0x00);
} else {
pushXFontBytesToEPD(0x00, 0x00);
}
}
return;
}
uint8_t begin = 0;
while (font[c][begin] == 0x00 && font[c][begin + 1] == 0x00) {
begin += 2;
}
uint8_t end = 20;
while (font[c][end - 1] == 0x00 && font[c][end - 2] == 0x00) {
end -= 2;
}
for (uint8_t pos = begin; pos < end; pos += 2) {
if (directionY) {
pushYFontBytesToEPD(font[c][pos + 1], font[c][pos]);
} else {
pushXFontBytesToEPD(font[c][pos], font[c][pos + 1]);
}
}
// spacing between characters
if (directionY) {
pushYFontBytesToEPD(0x00, 0x00);
} else {
pushXFontBytesToEPD(0x00, 0x00);
}
}
// Print text to the EPD. Origin is top-left
void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool color) {
directionY = direction;
epdCharSize = 1 + fontsize;
if (directionY) {
uint8_t extra = 0;
// provisions for dealing with font in Y direction, byte-unaligned
if (x % 8) {
extra = 8;
rbuffer[0] = 0; // previous value
rbuffer[1] = x % 8; // offset
rbuffer[2] = 0; // current byte counter;
rbuffer[3] = (epdCharSize * 2);
} else {
rbuffer[1] = 0;
}
// setWindowY(y, 1);
if (epdCharSize == 2) {
setWindowXY(x, x + 32 + extra, SCREEN_HEIGHT - y, SCREEN_HEIGHT);
// setPosXY(x, y);
} else {
setWindowXY(x, x + 16 + extra, SCREEN_HEIGHT - y, SCREEN_HEIGHT);
// setPosXY(x, y);
}
// shortCommand1(CMD_DATA_ENTRY_MODE, 1); // was 3
} else {
if (epdCharSize == 2) {
x /= 2;
x *= 2;
setWindowXY(x, SCREEN_WIDTH, y, y + 32);
} else {
setWindowXY(x, SCREEN_WIDTH, y, y + 16);
}
// setPosXY(x, y);
fontCurXpos = x;
// setWindowXY(x, SCREEN_WIDTH);
// shortCommand1(CMD_DATA_ENTRY_MODE, 7);
memset(rbuffer, 0, 32);
}
if (color) {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM2);
} else {
commandBegin(CMD_DISPLAY_START_TRANSMISSION_DTM1);
}
}
void epdPrintEnd() {
if (!directionY && ((fontCurXpos % 8) != 0)) {
for (uint8_t i = 0; i < (16 * epdCharSize); i++) {
epdSend(rbuffer[i]);
}
}
commandEnd();
shortCommand(CMD_PARTIAL_OUT);
epdDrawDirection(true);
}
extern uint8_t blockXferBuffer[];
static void epdPutchar(uint8_t data) {
writeCharEPD(data);
}
void epdpr(const char *c, ...) {
char out_buffer[512]; // you can define your own buffers size
va_list lst;
va_start(lst, c);
vsprintf(out_buffer, c, lst);
va_end(lst);
int posi = 0;
while (out_buffer[posi] != 0) {
epdPutchar(out_buffer[posi]);
posi++;
}
}
epdBusyWaitRising(120000);
}

View File

@@ -0,0 +1,126 @@
#include "uc_variant_043.h"
#include <Arduino.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hal.h"
#include "lut.h"
#include "settings.h"
#include "wdt.h"
#include "drawing.h"
#define EPD_CMD_POWER_OFF 0x02
#define EPD_CMD_POWER_ON 0x04
#define EPD_CMD_BOOSTER_SOFT_START 0x06
#define EPD_CMD_DEEP_SLEEP 0x07
#define EPD_CMD_DISPLAY_START_TRANSMISSION_DTM1 0x10
#define EPD_CMD_DISPLAY_REFRESH 0x12
#define EPD_CMD_DISPLAY_START_TRANSMISSION_DTM2 0x13
#define EPD_CMD_VCOM_INTERVAL 0x50
#define EPD_CMD_RESOLUTION_SETTING 0x61
#define EPD_CMD_UNKNOWN 0xF8
void epdEnterSleep() {
epd_cmd(EPD_CMD_POWER_OFF);
epdBusyWaitRising(50000);
epdWrite(EPD_CMD_DEEP_SLEEP, 1, 0xA5);
delay(200);
delay(1);
}
void epdSetup() {
epdReset();
epdWrite(EPD_CMD_UNKNOWN, 2, 0x60, 0x05);
epdWrite(EPD_CMD_UNKNOWN, 2, 0xA1, 0x00);
epdWrite(EPD_CMD_UNKNOWN, 2, 0x73, 0x05);
epdWrite(EPD_CMD_UNKNOWN, 2, 0x7E, 0x31);
epdWrite(EPD_CMD_UNKNOWN, 2, 0xB8, 0x80);
epdWrite(EPD_CMD_UNKNOWN, 2, 0x92, 0x00);
epdWrite(EPD_CMD_UNKNOWN, 2, 0x87, 0x11);
epdWrite(EPD_CMD_UNKNOWN, 2, 0x88, 0x06);
epdWrite(EPD_CMD_UNKNOWN, 2, 0xA8, 0x30);
epdWrite(EPD_CMD_RESOLUTION_SETTING, 4, 0x00, 0x98, 0x02, 0x0A);
epdWrite(EPD_CMD_BOOSTER_SOFT_START, 3, 0x57, 0x63, 0x3A);
epdWrite(EPD_CMD_VCOM_INTERVAL, 1, 0x87); // 47
}
void epdWriteDisplayData() {
// send a dummy byte. Don't ask me why, it's what she likes. She'll sometimes display garbage on the b/w framebuffer if she doesn't get the dummy byte.
epd_data(0x00);
// this display expects two entire framebuffers worth of data to be written, one for b/w and one for red
uint8_t* buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
for (uint8_t c = 0; c < 2; c++) {
if (c == 0) epd_cmd(EPD_CMD_DISPLAY_START_TRANSMISSION_DTM1);
if (c == 1) epd_cmd(EPD_CMD_DISPLAY_START_TRANSMISSION_DTM2);
markData();
epdSelect();
for (uint16_t curY = 0; curY < SCREEN_HEIGHT; curY += 2) {
// Get 'even' screen line
buf[0] = (uint8_t*)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[0], curY, c);
// on the first pass, the second (buf[1]) buffer is unused, so we don't have to wait for it to flush to the display / free it
if (buf[1]) {
// wait for 'odd' display line to finish writing to the screen
epdSPIWait();
free(buf[1]);
}
// start transfer of even data line to the screen
epdSPIAsyncWrite(buf[0], (SCREEN_WIDTH / 8));
// Get 'odd' screen display line
buf[1] = (uint8_t*)calloc(SCREEN_WIDTH / 8, 1);
drawItem::renderDrawLine(buf[1], curY + 1, c);
// wait until the 'even' data has finished writing
epdSPIWait();
free(buf[0]);
// start transfer of the 'odd' data line
epdSPIAsyncWrite(buf[1], (SCREEN_WIDTH / 8));
}
// check if this was the first pass. If it was, we'll need to wait until the last display line finished writing
if (c == 0) {
epdSPIWait();
epdDeselect();
free(buf[1]);
buf[1] = nullptr;
}
}
// flush the draw list, make sure items don't appear on subsequent screens
drawItem::flushDrawItems();
// wait until the last line of display has finished writing and clean our stuff up
epdSPIWait();
epdDeselect();
if(buf[1])free(buf[1]);
}
void selectLUT(uint8_t lut) {
// implement alternative LUTs here. Currently just reset the watchdog to two minutes,
// to ensure it doesn't reset during the much longer bootup procedure
lut += 1; // make the compiler a happy camper
wdt120s();
return;
}
void draw() {
drawNoWait();
epdBusyWaitRising(50000);
}
void drawNoWait() {
epdWriteDisplayData();
epd_cmd(EPD_CMD_POWER_ON);
epdBusyWaitRising(200);
epd_cmd(EPD_CMD_DISPLAY_REFRESH);
}
void epdWaitRdy() {
epdBusyWaitRising(50000);
}

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@ const uint8_t channelList[6] = {11, 15, 20, 25, 26, 27};
struct pendingData pendingDataArr[MAX_PENDING_MACS];
// VERSION GOES HERE!
uint16_t version = 0x0018;
uint16_t version = 0x0019;
#define RAW_PKT_PADDING 2
@@ -64,8 +64,9 @@ uint8_t lastAckMac[8] = {0};
#define CONCURRENT_REQUEST_DELAY 1200UL
uint32_t lastBlockRequest = 0;
uint8_t lastBlockMac[8];
uint8_t lastTagReturn[8];
uint8_t curChannel = 11;
uint8_t curChannel = 25;
uint8_t curPower = 10;
uint8_t curPendingData = 0;
@@ -325,13 +326,15 @@ void processSerial(uint8_t lastchar) {
}
goto SCPfailed;
SCPchannelFound:
curChannel = scp->channel;
curPower = scp->power;
radioSetChannel(scp->channel);
pr("ACK>");
if (curChannel != scp->channel) {
radioSetChannel(scp->channel);
curChannel = scp->channel;
}
curPower = scp->power;
radioSetTxPower(scp->power);
ESP_LOGI(TAG, "Set channel: %d power: %d", curChannel, curPower);
pr("ACK>");
} else {
} else {
SCPfailed:
pr("NOK>");
}
@@ -408,6 +411,30 @@ void espNotifyAPInfo() {
pr("NOP>%02X", curNoUpdate);
}
void espNotifyTagReturnData(uint8_t *src, uint8_t len) {
struct tagReturnData *trd = (struct tagReturnData *)(radiorxbuffer + sizeof(struct MacFrameBcast) + 1); // oh how I'd love to pass this as an argument, but sdcc won't let me
struct espTagReturnData *etrd = (struct espTagReturnData *)radiotxbuffer;
if (memcmp((void *) & trd->dataVer, lastTagReturn, 8) == 0) {
return;
} else {
memcpy(lastTagReturn, &trd->dataVer, 8);
}
memcpy(etrd->src, src, 8);
etrd->len = len;
memcpy(&etrd->returnData, trd, len);
addCRC(etrd, len + 10);
uartTx('T');
uartTx('R');
uartTx('D');
uartTx('>');
for (uint8_t c = 0; c < len + 10; c++) {
uartTx(((uint8_t *)etrd)[c]);
}
}
// process data from tag
void processBlockRequest(const uint8_t *buffer, uint8_t forceBlockDownload) {
struct MacFrameNormal *rxHeader = (struct MacFrameNormal *) buffer;
@@ -555,6 +582,26 @@ void processXferComplete(uint8_t *buffer) {
}
}
void processTagReturnData(uint8_t *buffer, uint8_t len) {
struct MacFrameBcast *rxframe = (struct MacFrameBcast *)buffer;
struct MacFrameNormal *frameHeader = (struct MacFrameNormal *)(radiotxbuffer + 1);
if (!checkCRC((buffer + sizeof(struct MacFrameBcast) + 1), len - (sizeof(struct MacFrameBcast) + 1))) {
return;
}
radiotxbuffer[sizeof(struct MacFrameNormal) + 1] = PKT_TAG_RETURN_DATA_ACK;
radiotxbuffer[0] = sizeof(struct MacFrameNormal) + 1 + RAW_PKT_PADDING;
memcpy(frameHeader->src, mSelfMac, 8);
memcpy(frameHeader->dst, rxframe->src, 8);
radiotxbuffer[1] = 0x41; // fast way to set the appropriate bits
radiotxbuffer[2] = 0xCC; // normal frame
frameHeader->seq = seq++;
frameHeader->pan = rxframe->srcPan;
radioTx(radiotxbuffer);
espNotifyTagReturnData(rxframe->src, len - (sizeof(struct MacFrameBcast) + 1));
}
// send block data to the tag
void sendPart(uint8_t partNo) {
struct MacFrameNormal *frameHeader = (struct MacFrameNormal *) (radiotxbuffer + 1);
@@ -637,25 +684,24 @@ void sendPong(void *buf) {
}
void app_main(void) {
esp_event_loop_create_default();
init_nvs();
init_led();
init_led();
init_second_uart();
esp_event_loop_create_default();
radio_init();
requestedData.blockId = 0xFF;
// clear the array with pending information
memset(pendingDataArr, 0, sizeof(pendingDataArr));
radioSetChannel(curChannel);
radio_init(curChannel);
radioSetTxPower(10);
pr("RES>");
pr("RDY>");
ESP_LOGI(TAG, "C6 ready!");
housekeepingTimer = getMillis();
housekeepingTimer = getMillis();
while (1) {
while ((getMillis() - housekeepingTimer) < ((1000 * HOUSEKEEPING_INTERVAL) - 100)) {
int8_t ret = commsRxUnencrypted(radiorxbuffer);
@@ -695,8 +741,11 @@ void app_main(void) {
processAvailDataReq(radiorxbuffer);
}
break;
default:
ESP_LOGI(TAG, "t=%02X" , getPacketType(radiorxbuffer));
case PKT_TAG_RETURN_DATA:
processTagReturnData(radiorxbuffer, ret);
break;
default:
ESP_LOGI(TAG, "t=%02X" , getPacketType(radiorxbuffer));
break;
}
} else if (blockStartTimer == 0) {
@@ -714,7 +763,8 @@ void app_main(void) {
}
}
for (uint8_t cCount = 0; cCount < MAX_PENDING_MACS; cCount++) {
memset(&lastTagReturn, 0, 8);
for (uint8_t cCount = 0; cCount < MAX_PENDING_MACS; cCount++) {
if (pendingDataArr[cCount].attemptsLeft == 1) {
if (pendingDataArr[cCount].availdatainfo.dataType != DATATYPE_NOUPDATE) {
espNotifyTimeOut(pendingDataArr[cCount].targetMac);

View File

@@ -58,6 +58,8 @@ struct MacFrameBcast {
uint8_t src[8];
} __attribute__((packed, aligned(1)));
#define PKT_TAG_RETURN_DATA 0xE1
#define PKT_TAG_RETURN_DATA_ACK 0xE2
#define PKT_AVAIL_DATA_SHORTREQ 0xE3
#define PKT_AVAIL_DATA_REQ 0xE5
#define PKT_AVAIL_DATA_INFO 0xE6
@@ -125,9 +127,14 @@ struct blockData {
uint8_t data[];
} __attribute__((packed, aligned(1)));
struct burstMacData {
uint16_t offset;
uint8_t targetMac[8];
#define TAG_RETURN_DATA_SIZE 90
struct tagReturnData {
uint8_t checksum;
uint8_t partId;
uint64_t dataVer;
uint8_t dataType;
uint8_t data[TAG_RETURN_DATA_SIZE];
} __attribute__((packed, aligned(1)));
#define BLOCK_PART_DATA_SIZE 99
@@ -173,4 +180,11 @@ struct espSetChannelPower {
uint8_t power;
} __attribute__((packed, aligned(1)));
struct espTagReturnData {
uint8_t checksum;
uint8_t src[8];
uint8_t len;
struct tagReturnData returnData;
} __attribute__((packed, aligned(1)));
#endif

View File

@@ -47,19 +47,44 @@ void esp_ieee802154_transmit_done(const uint8_t *frame, const uint8_t *ack, esp_
ESP_EARLY_LOGI(TAG, "TX %d", frame[0]);
}
void radio_init() {
packet_buffer = xQueueCreate(32, 130);
esp_ieee802154_enable();
radioSetChannel(11);
esp_ieee802154_set_panid(PROTO_PAN_ID);
esp_ieee802154_set_promiscuous(false); // Filter for our mac and PAN
void radio_init(uint8_t ch) {
if (packet_buffer == NULL) packet_buffer = xQueueCreate(32, 130);
// this will trigger a "IEEE802154 MAC sleep init failed" when called a second time, but it works
esp_ieee802154_enable();
esp_ieee802154_set_channel(ch);
// esp_ieee802154_set_txpower(int8_t power);
esp_ieee802154_set_panid(PROTO_PAN_ID);
esp_ieee802154_set_promiscuous(false);
esp_ieee802154_set_coordinator(false);
esp_ieee802154_set_pending_mode(ESP_IEEE802154_AUTO_PENDING_ZIGBEE);
esp_read_mac(mSelfMac, ESP_MAC_IEEE802154);
esp_ieee802154_set_extended_address(mSelfMac);
esp_ieee802154_set_short_address(0xFFFE);
// esp_ieee802154_set_extended_address needs the MAC in reversed byte order
esp_read_mac(mSelfMac, ESP_MAC_IEEE802154);
uint8_t eui64_rev[8] = {0};
for (int i = 0; i < 8; i++) {
eui64_rev[7 - i] = mSelfMac[i];
}
esp_ieee802154_set_extended_address(eui64_rev);
esp_ieee802154_get_extended_address(mSelfMac);
esp_ieee802154_set_short_address(0xFFFE);
esp_ieee802154_set_rx_when_idle(true);
esp_ieee802154_receive();
led_flash(1);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_flash(0);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_flash(1);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_flash(0);
ESP_LOGI(TAG, "Receiver ready, panId=0x%04x, channel=%d, long=%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x, short=%04x",
esp_ieee802154_get_panid(), esp_ieee802154_get_channel(),
mSelfMac[0], mSelfMac[1], mSelfMac[2], mSelfMac[3],
mSelfMac[4], mSelfMac[5], mSelfMac[6], mSelfMac[7],
esp_ieee802154_get_short_address());
}
uint32_t lastZbTx = 0;
@@ -77,7 +102,9 @@ bool radioTx(uint8_t *packet) {
return true;
}
void radioSetChannel(uint8_t ch) { esp_ieee802154_set_channel(ch); }
void radioSetChannel(uint8_t ch) {
radio_init(ch);
}
void radioSetTxPower(uint8_t power) {}

View File

@@ -4,7 +4,7 @@
extern uint8_t mSelfMac[8];
void radio_init();
void radio_init(uint8_t ch);
bool radioTx(uint8_t *packet);
void radioSetChannel(uint8_t ch);
void radioSetTxPower(uint8_t power);

View File

@@ -32,7 +32,8 @@ volatile int curr_buff_pos = 0;
volatile int worked_buff_pos = 0;
volatile uint8_t buff_pos[MAX_BUFF_POS + 5];
#define S3_TX_PIN 3
#define S3_RX_PIN 2
static void uart_event_task(void *pvParameters);
void init_second_uart() {
@@ -46,9 +47,9 @@ void init_second_uart() {
};
ESP_ERROR_CHECK(uart_driver_install(1, BUF_SIZE * 2, BUF_SIZE * 2, 20, &uart0_queue, 0));
ESP_ERROR_CHECK(uart_param_config(1, &uart_config));
ESP_ERROR_CHECK(uart_set_pin(1, 3, 2, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE));
ESP_ERROR_CHECK(uart_set_pin(1, S3_TX_PIN, S3_RX_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE));
xTaskCreate(uart_event_task, "uart_event_task", 16384, NULL, 12, NULL);
xTaskCreate(uart_event_task, "uart_event_task", 16384, NULL, 12, NULL);
}
void uart_switch_speed(int baudrate) {
@@ -92,7 +93,7 @@ static void uart_event_task(void *pvParameters) {
}
break;
default:
ESP_LOGI(TAG, "uart event type: %d", event.type);
// ESP_LOGI(TAG, "uart event type: %d", event.type);
break;
}
}

View File

@@ -0,0 +1,5 @@
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,0x6000,,
factory,app,factory,0x10000,1M,,
littlefs,data,spiffs,,3008K,,
1 # ESP-IDF Partition Table
2 # Name, Type, SubType, Offset, Size, Flags
3 nvs,data,nvs,0x9000,0x6000,,
4 factory,app,factory,0x10000,1M,,
5 littlefs,data,spiffs,,3008K,,

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file. DO NOT EDIT.
# Espressif IoT Development Framework (ESP-IDF) 5.1.0 Project Configuration
# Espressif IoT Development Framework (ESP-IDF) 5.1.1 Project Configuration
#
CONFIG_SOC_ADC_SUPPORTED=y
CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y
@@ -72,6 +72,9 @@ CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333
CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611
CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12
CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12
CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y
CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y
CONFIG_SOC_ADC_CALIB_CHAN_COMPENS_SUPPORTED=y
CONFIG_SOC_ADC_TEMPERATURE_SHARE_INTR=y
CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y
CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y
@@ -115,6 +118,7 @@ CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8
CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y
CONFIG_SOC_I2C_NUM=1
CONFIG_SOC_I2C_FIFO_LEN=32
CONFIG_SOC_I2C_CMD_REG_NUM=8
CONFIG_SOC_I2C_SUPPORT_SLAVE=y
CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y
CONFIG_SOC_I2C_SUPPORT_XTAL=y
@@ -255,6 +259,7 @@ CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y
CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32
CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y
CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y
CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED=y
CONFIG_SOC_UART_NUM=2
CONFIG_SOC_UART_FIFO_LEN=128
CONFIG_SOC_UART_BITRATE_MAX=5000000
@@ -264,6 +269,7 @@ CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y
CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y
CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y
CONFIG_SOC_COEX_HW_PTI=y
CONFIG_SOC_EXTERNAL_COEX_ADVANCE=y
CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21
CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12
CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y
@@ -277,12 +283,14 @@ CONFIG_SOC_PM_SUPPORT_RC32K_PD=y
CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y
CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y
CONFIG_SOC_PM_SUPPORT_TOP_PD=y
CONFIG_SOC_PM_SUPPORT_HP_AON_PD=y
CONFIG_SOC_PM_SUPPORT_MAC_BB_PD=y
CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y
CONFIG_SOC_PM_SUPPORT_PMU_MODEM_STATE=y
CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y
CONFIG_SOC_PM_CPU_RETENTION_BY_SW=y
CONFIG_SOC_PM_MODEM_RETENTION_BY_REGDMA=y
CONFIG_SOC_PM_RETENTION_HAS_CLOCK_BUG=y
CONFIG_SOC_PM_PAU_LINK_NUM=4
CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y
CONFIG_SOC_MODEM_CLOCK_IS_INDEPENDENT=y
@@ -293,7 +301,6 @@ CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y
CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_XTAL=y
CONFIG_SOC_TEMPERATURE_SENSOR_INTR_SUPPORT=y
CONFIG_SOC_WIFI_HW_TSF=y
CONFIG_SOC_WIFI_FTM_SUPPORT=y
CONFIG_SOC_WIFI_GCMP_SUPPORT=y
CONFIG_SOC_WIFI_WAPI_SUPPORT=y
CONFIG_SOC_WIFI_CSI_SUPPORT=y
@@ -306,6 +313,8 @@ CONFIG_SOC_BLE_50_SUPPORTED=y
CONFIG_SOC_BLE_DEVICE_PRIVACY_SUPPORTED=y
CONFIG_SOC_BLE_POWER_CONTROL_SUPPORTED=y
CONFIG_SOC_BLUFI_SUPPORTED=y
CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y
CONFIG_SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND=y
CONFIG_IDF_CMAKE=y
CONFIG_IDF_TARGET_ARCH_RISCV=y
CONFIG_IDF_TARGET_ARCH="riscv"
@@ -422,14 +431,14 @@ CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set
CONFIG_ESPTOOLPY_BEFORE_RESET=y
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
@@ -443,12 +452,12 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
#
# Partition Table
#
CONFIG_PARTITION_TABLE_SINGLE_APP=y
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table
@@ -750,9 +759,9 @@ CONFIG_ESP32C6_UNIVERSAL_MAC_ADDRESSES=4
# Sleep Config
#
# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set
CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y
CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y
# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set
CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y
# end of Sleep Config
#
@@ -790,6 +799,16 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
CONFIG_XTAL_FREQ_40=y
CONFIG_XTAL_FREQ=40
# end of Main XTAL Config
#
# Crypto DPA Protection
#
CONFIG_ESP_CRYPTO_DPA_PROTECTION_AT_STARTUP=y
CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL_LOW=y
# CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL_MEDIUM is not set
# CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL_HIGH is not set
CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL=1
# end of Crypto DPA Protection
# end of Hardware Settings
#
@@ -815,6 +834,7 @@ CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120
CONFIG_ESP_NETIF_TCPIP_LWIP=y
# CONFIG_ESP_NETIF_LOOPBACK is not set
CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y
# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set
# CONFIG_ESP_NETIF_L2_TAP is not set
# CONFIG_ESP_NETIF_BRIDGE_EN is not set
# end of ESP NETIF Adapter
@@ -974,7 +994,6 @@ CONFIG_ESP_WIFI_ENABLE_SAE_PK=y
CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y
# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set
# CONFIG_ESP_WIFI_FTM_ENABLE is not set
CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y
# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set
# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set
@@ -1148,6 +1167,7 @@ CONFIG_IEEE802154_CCA_THRESHOLD=-60
CONFIG_IEEE802154_PENDING_TABLE_SIZE=20
# CONFIG_IEEE802154_MULTI_PAN_ENABLE is not set
# CONFIG_IEEE802154_TIMING_OPTIMIZATION is not set
# CONFIG_IEEE802154_DEBUG is not set
# end of IEEE 802.15.4
#
@@ -1309,6 +1329,9 @@ CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y
CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y
# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set
# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set
CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y
# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set
# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set
CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y
# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set
# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set
@@ -1491,6 +1514,17 @@ CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y
# OpenThread
#
# CONFIG_OPENTHREAD_ENABLED is not set
#
# Thread Operational Dataset
#
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP"
CONFIG_OPENTHREAD_NETWORK_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_PANID=0x1234
CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe"
CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff"
CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53"
# end of Thread Operational Dataset
# end of OpenThread
#
@@ -1514,9 +1548,9 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
#
# MMU Config
#
CONFIG_MMU_PAGE_SIZE_32KB=y
CONFIG_MMU_PAGE_MODE="32KB"
CONFIG_MMU_PAGE_SIZE=0x8000
CONFIG_MMU_PAGE_SIZE_64KB=y
CONFIG_MMU_PAGE_MODE="64KB"
CONFIG_MMU_PAGE_SIZE=0x10000
# end of MMU Config
#
@@ -1640,6 +1674,7 @@ CONFIG_VFS_SUPPORT_DIR=y
CONFIG_VFS_SUPPORT_SELECT=y
CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_VFS_SUPPORT_TERMIOS=y
CONFIG_VFS_MAX_COUNT=8
#
# Host File System I/O (Semihosting)

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 2,
"options": ["button", "customlut"],
"template": {
"1": {
"weekday": [ 76, 10, "fonts/calibrib30" ],

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 2,
"options": ["button", "customlut"],
"template": {
"1": {
"weekday": [148, 10, "fonts/calibrib60"],

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 1,
"options": ["button"],
"template": {
"1": {
"weekday": [ 200, 25, "fonts/calibrib60" ],

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 1,
"options": [],
"template": {
"1": {
"weekday": [ 200, 25, "fonts/calibrib60" ],

View File

@@ -11,6 +11,7 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 0,
"options": ["button"],
"usetemplate": 1
}

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 0,
"options": ["button", "led"],
"template": {
"1": {
"weekday": [148, 10, "fonts/calibrib60"],

View File

@@ -11,7 +11,8 @@
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"capabilities": ["button", "customlut"],
"shortlut": 0,
"options": ["button", "led"],
"template": {
"1": {
"weekday": [148, 10, "fonts/calibrib60"],

View File

@@ -11,7 +11,8 @@
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"capabilities": [ ],
"shortlut": 0,
"options": [],
"contentids": [ 0, 1, 2, 3, 4, 8, 16, 9, 7, 19, 10, 11, 21 ],
"usetemplate": 1,
"template": {

View File

@@ -6,7 +6,8 @@
"bpp": 1,
"colors": 0,
"colortable": {},
"capabilities": [],
"shortlut": 0,
"options": [],
"template": {
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -1,82 +1,14 @@
#include <Arduino.h>
#pragma pack(push, 1)
#include "../../tag_types.h"
#include "../../oepl-definitions.h"
#include "../../oepl-proto.h"
#include "../../oepl-esp-ap-proto.h"
struct espBlockRequest {
uint8_t checksum;
uint64_t ver;
uint8_t blockId;
uint8_t src[8];
} __packed;
struct espXferComplete {
uint8_t checksum;
uint8_t src[8];
} __packed;
struct espSetChannelPower {
uint8_t checksum;
uint8_t channel;
uint8_t power;
} __packed;
struct blockData {
uint16_t size;
uint16_t checksum;
uint8_t data[];
} __packed;
struct AvailDataReq {
uint8_t checksum;
uint8_t lastPacketLQI;
int8_t lastPacketRSSI;
int8_t temperature;
uint16_t batteryMv;
uint8_t hwType;
uint8_t wakeupReason;
uint8_t capabilities;
uint16_t tagSoftwareVersion;
uint8_t currentChannel;
uint8_t customMode;
uint8_t reserved[8];
} __packed;
struct espAvailDataReq {
uint8_t checksum;
uint8_t src[8];
struct AvailDataReq adr;
} __packed;
#define EPD_LUT_DEFAULT 0
#define EPD_LUT_NO_REPEATS 1
#define EPD_LUT_FAST_NO_REDS 2
#define EPD_LUT_FAST 3
#define EPD_LUT_OTA 0x10
struct AvailDataInfo {
uint8_t checksum;
uint64_t dataVer; // MD5 of potential traffic
uint32_t dataSize;
uint8_t dataType; // allows for 16 different datatypes
uint8_t dataTypeArgument; // extra specification or instruction for the tag (LUT to be used for drawing image)
uint16_t nextCheckIn; // when should the tag check-in again? Measured in minutes
} __packed;
struct pendingData {
struct AvailDataInfo availdatainfo;
uint16_t attemptsLeft;
uint8_t targetMac[8];
} __packed;
#define BLOCK_DATA_SIZE 4096
#define BLOCK_XFER_BUFFER_SIZE BLOCK_DATA_SIZE + sizeof(struct blockData)
#define PKT_AVAIL_DATA_REQ 0xE5
#define PKT_AVAIL_DATA_INFO 0xE6
#define PKT_XFER_COMPLETE 0xEA
#define PKT_XFER_TIMEOUT 0xED
#define PKT_CANCEL_XFER 0xEC
#define PKT_APLIST_REQ 0x80
#define PKT_APLIST_REPLY 0x81
#define PKT_TAGINFO 0x82
@@ -111,35 +43,5 @@ struct TagInfo {
uint8_t contentMode;
} __packed;
struct tagsettings {
uint8_t settingsVer; // the version of the struct as written to the infopage
uint8_t enableFastBoot; // default 0; if set, it will skip splashscreen
uint8_t enableRFWake; // default 0; if set, it will enable RF wake. This will add about ~0.9µA idle power consumption
uint8_t enableTagRoaming; // default 0; if set, the tag will scan for an accesspoint every few check-ins. This will increase power consumption quite a bit
uint8_t enableScanForAPAfterTimeout; // default 1; if a the tag failed to check in, after a few attempts it will try to find a an AP on other channels
uint8_t enableLowBatSymbol; // default 1; tag will show 'low battery' icon on screen if the battery is depleted
uint8_t enableNoRFSymbol; // default 1; tag will show 'no signal' icon on screen if it failed to check in for a longer period of time
uint8_t fastBootCapabilities; // holds the byte with 'capabilities' as detected during a normal tag boot; allows the tag to skip detecting buttons and NFC chip
uint8_t customMode; // default 0; if anything else, tag will bootup in a different 'mode'
uint16_t batLowVoltage; // Low battery threshold voltage (2450 for 2.45v). defaults to BATTERY_VOLTAGE_MINIMUM from powermgt.h
uint16_t minimumCheckInTime; // defaults to BASE_INTERVAL from powermgt.h
uint8_t fixedChannel; // default 0; if set to a valid channel number, the tag will stick to that channel
} __packed;
struct ledFlash {
uint8_t mode : 4;
uint8_t flashDuration : 4;
uint8_t color1;
uint8_t flashCount1 : 4;
uint8_t delay1 : 4;
uint8_t color2;
uint8_t flashCount2 : 4;
uint8_t delay2 : 4;
uint8_t color3;
uint8_t flashCount3 : 4;
uint8_t delay3 : 4;
uint8_t repeats;
uint8_t spare;
} __packed;
#pragma pack(pop)

View File

@@ -31,7 +31,8 @@ bool getCalFeed(String &filename, String URL, String title, tagRecord *&taginfo,
void drawQR(String &filename, String qrcontent, String title, tagRecord *&taginfo, imgParam &imageParams);
uint8_t drawBuienradar(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams);
void drawAPinfo(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams);
int getJsonTemplateFile(String &filename, String jsonfile, tagRecord *&taginfo, imgParam &imageParams);
bool getJsonTemplateFile(String &filename, String jsonfile, tagRecord *&taginfo, imgParam &imageParams);
extern bool getJsonTemplateFileExtractVariables(String &filename, String jsonfile, JsonDocument &variables, tagRecord *&taginfo, imgParam &imageParams);
int getJsonTemplateUrl(String &filename, String URL, time_t fetched, String MAC, tagRecord *&taginfo, imgParam &imageParams);
void drawJsonStream(Stream &stream, String &filename, tagRecord *&taginfo, imgParam &imageParams);
void drawElement(const JsonObject &element, TFT_eSprite &spr);

View File

@@ -0,0 +1,59 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "esp_loader_io.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
uint32_t baud_rate; /*!< Initial baud rate, can be changed later */
uint32_t uart_port; /*!< UART port */
uint32_t uart_rx_pin; /*!< This pin will be configured as UART Rx pin */
uint32_t uart_tx_pin; /*!< This pin will be configured as UART Tx pin */
uint32_t reset_trigger_pin; /*!< This pin will be used to reset target chip */
uint32_t gpio0_trigger_pin; /*!< This pin will be used to toggle set IO0 of target chip */
uint32_t rx_buffer_size; /*!< Set to zero for default RX buffer size */
uint32_t tx_buffer_size; /*!< Set to zero for default TX buffer size */
uint32_t queue_size; /*!< Set to zero for default UART queue size */
QueueHandle_t *uart_queue; /*!< Set to NULL, if UART queue handle is not
necessary. Otherwise, it will be assigned here */
} loader_esp32_config_t;
/**
* @brief Initializes serial interface.
*
* @param baud_rate[in] Communication speed.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_FAIL Initialization failure
*/
esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config);
/**
* @brief Deinitialize serial interface.
*/
void loader_port_esp32_deinit(void);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,4 @@
#include <Arduino.h>
#include <LittleFS.h>
bool doC6flash(uint8_t doDownload);

View File

@@ -5,6 +5,10 @@
extern TFT_eSPI tft;
#define SHORTLUT_DISABLED 0
#define SHORTLUT_ONLY_BLACK 1
#define SHORTLUT_ALLOWED 2
struct imgParam {
bool hasRed;
uint8_t dataType;
@@ -21,6 +25,9 @@ struct imgParam {
char segments[12];
uint16_t symbols;
bool invert;
uint8_t lut;
uint8_t shortlut;
};
void spr2buffer(TFT_eSprite &spr, String &fileout, imgParam &imageParams);

View File

@@ -7,11 +7,12 @@ extern void processBlockRequest(struct espBlockRequest* br);
extern void prepareCancelPending(const uint8_t dst[8]);
extern void prepareIdleReq(const uint8_t* dst, uint16_t nextCheckin);
extern void prepareDataAvail(uint8_t* data, uint16_t len, uint8_t dataType, const uint8_t* dst);
extern bool prepareDataAvail(String& filename, uint8_t dataType, const uint8_t* dst, uint16_t nextCheckin, bool resend = false);
extern bool prepareDataAvail(String& filename, uint8_t dataType, uint8_t dataTypeArgument, const uint8_t* dst, uint16_t nextCheckin, bool resend = false);
extern void prepareExternalDataAvail(struct pendingData* pending, IPAddress remoteIP);
extern void processXferComplete(struct espXferComplete* xfc, bool local);
extern void processXferTimeout(struct espXferComplete* xfc, bool local);
extern void processDataReq(struct espAvailDataReq* adr, bool local);
extern void processTagReturnData(struct espTagReturnData* trd, uint8_t len, bool local);
extern bool sendTagCommand(const uint8_t* dst, uint8_t cmd, bool local, const uint8_t* payload = nullptr);
extern bool sendAPSegmentedData(const uint8_t* dst, String data, uint16_t icons, bool inverted, bool local);

View File

@@ -9,4 +9,5 @@ void handleUpdateOTA(AsyncWebServerRequest* request);
void firmwareUpdateTask(void* parameter);
void updateFirmware(const char* url, const char* expectedMd5, const size_t size);
void handleRollback(AsyncWebServerRequest* request);
void handleUpdateC6(AsyncWebServerRequest* request);
void handleUpdateActions(AsyncWebServerRequest* request);

View File

@@ -29,7 +29,8 @@ void APTask(void* parameter);
bool sendCancelPending(struct pendingData* pending);
bool sendDataAvail(struct pendingData* pending);
bool sendPing();
void APEnterEarlyReset();
bool sendChannelPower(struct espSetChannelPower* scp);
bool sendChannelPower(struct espSetChannelPower* scp);
void rxSerialTask2(void* parameter);
void APTagReset();
bool bringAPOnline();

View File

@@ -77,6 +77,7 @@ struct HwType {
uint16_t height;
uint8_t rotatebuffer;
uint8_t bpp;
uint8_t shortlut;
};
struct varStruct {
@@ -105,5 +106,6 @@ extern void initAPconfig();
extern void saveAPconfig();
extern HwType getHwType(const uint8_t id);
extern bool setVarDB(const std::string& key, const String& value);
extern void cleanupCurrent();
#pragma pack(pop)

View File

@@ -78,7 +78,7 @@ static bool httpGetJson(String &url, JsonDocument &json, const uint16_t timeout,
const int httpCode = http.GET();
if (httpCode != 200) {
http.end();
wsErr("http " + httpCode);
wsErr(String("[httpGetJson] http code") + httpCode);
return false;
}
@@ -90,7 +90,7 @@ static bool httpGetJson(String &url, JsonDocument &json, const uint16_t timeout,
}
http.end();
if (error) {
Serial.println(error.c_str());
Serial.printf("[httpGetJson] JSON: %s\n", error.c_str());
return false;
}
return true;

View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,155 @@
# esp-serial-flasher
`esp-serial-flasher` is a portable C library for flashing or loading apps to RAM of Espressif SoCs from other host microcontrollers.
## Using the library
Espressif SoCs are normally programmed via serial interface (UART). The port layer for the given host microcontroller has to be implemented if not available. Details can be found in section below.
Supported **host** microcontrollers:
- STM32
- Raspberry Pi SBC
- ESP32
- Any MCU running Zephyr OS
Supported **target** microcontrollers:
- ESP32
- ESP8266
- ESP32-S2
- ESP32-S3
- ESP32-C3
- ESP32-C2
- ESP32-H2
- ESP32-C6
Supported hardware interfaces:
- UART
- SPI (only for RAM download, experimental)
For example usage check the `examples` directory.
## Supporting a new host target
In order to support a new target, following functions have to be implemented by user:
- `loader_port_read()`
- `loader_port_write()`
- `loader_port_enter_bootloader()`
- `loader_port_delay_ms()`
- `loader_port_start_timer()`
- `loader_port_remaining_time()`
For the SPI interface ports
- `loader_port_spi_set_cs()`
needs to be implemented as well.
The following functions are part of the [io.h](include/io.h) header for convenience, however, the user does not have to strictly follow function signatures, as there are not called directly from library.
- `loader_port_change_transmission_rate()`
- `loader_port_reset_target()`
- `loader_port_debug_print()`
Prototypes of all functions mentioned above can be found in [io.h](include/io.h).
## Configuration
These are the configuration toggles available to the user:
* `SERIAL_FLASHER_INTERFACE_UART/SERIAL_FLASHER_INTERFACE_SPI`
This defines the hardware interface to use. SPI interface only supports RAM download mode and is in experimental stage and can undergo changes.
Default: SERIAL_FLASHER_INTERFACE_UART
* `MD5_ENABLED`
If enabled, `esp-serial-flasher` is capable of verifying flash integrity after writing to flash.
Default: Enabled
> Warning: As ROM bootloader of the ESP8266 does not support MD5_CHECK, this option has to be disabled!
* `SERIAL_FLASHER_RESET_HOLD_TIME_MS`
This is the time for which the reset pin is asserted when doing a hard reset in milliseconds.
Default: 100
* `SERIAL_FLASHER_BOOT_HOLD_TIME_MS`
This is the time for which the boot pin is asserted when doing a hard reset in milliseconds.
Default: 50
Configuration can be passed to `cmake` via command line:
```
cmake -DMD5_ENABLED=1 .. && cmake --build .
```
### STM32 support
The STM32 port makes use of STM32 HAL libraries, and these do not come with CMake support. In order to compile the project, `stm32-cmake` (a `CMake` support package) has to be pulled as submodule.
```
git clone --recursive https://github.com/espressif/esp-serial-flasher.git
```
If you have cloned this repository without the `--recursive` flag, you can initialize the submodule using the following command:
```
git submodule update --init
```
In addition to configuration parameters mentioned above, following definitions has to be set:
- TOOLCHAIN_PREFIX: path to arm toolchain (i.e /home/user/gcc-arm-none-eabi-9-2019-q4-major)
- STM32Cube_DIR: path to STM32 Cube libraries (i.e /home/user/STM32Cube/Repository/STM32Cube_FW_F4_V1.25.0)
- STM32_CHIP: name of STM32 for which project should be compiled (i.e STM32F407VG)
- PORT: STM32
This can be achieved by passing definitions to the command line, such as:
```
cmake -DTOOLCHAIN_PREFIX="/path_to_toolchain" -DSTM32Cube_DIR="path_to_stm32Cube" -DSTM32_CHIP="STM32F407VG" -DPORT="STM32" .. && cmake --build .
```
Alternatively, those variables can be set in the top level `cmake` directory:
```
set(TOOLCHAIN_PREFIX path_to_toolchain)
set(STM32Cube_DIR path_to_stm32_HAL)
set(STM32_CHIP STM32F407VG)
set(PORT STM32)
```
### Zephyr support
The Zephyr port is ready to be integrated into Zephyr apps as a Zephyr module. In the manifest file (west.yml), add:
```
- name: esp-flasher
url: https://github.com/espressif/esp-serial-flasher
revision: master
path: modules/lib/esp_flasher
```
And add
```
CONFIG_ESP_SERIAL_FLASHER=y
CONFIG_CONSOLE_GETCHAR=y
CONFIG_SERIAL_FLASHER_MD5_ENABLED=y
```
to the project configuration `prj.conf`.
For the C/C++ source code, the example code provided in `examples/zephyr_example` can be used as a starting point.
## Licence
Code is distributed under Apache 2.0 license.
## Known limitations
Size of new binary image has to be known before flashing.

View File

@@ -0,0 +1,61 @@
#include <Arduino.h>
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "esp_loader_io.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
uint32_t baud_rate; /*!< Initial baud rate, can be changed later */
uint32_t uart_port; /*!< UART port */
uint32_t uart_rx_pin; /*!< This pin will be configured as UART Rx pin */
uint32_t uart_tx_pin; /*!< This pin will be configured as UART Tx pin */
uint32_t reset_trigger_pin; /*!< This pin will be used to reset target chip */
uint32_t gpio0_trigger_pin; /*!< This pin will be used to toggle set IO0 of target chip */
uint32_t rx_buffer_size; /*!< Set to zero for default RX buffer size */
uint32_t tx_buffer_size; /*!< Set to zero for default TX buffer size */
uint32_t queue_size; /*!< Set to zero for default UART queue size */
QueueHandle_t *uart_queue; /*!< Set to NULL, if UART queue handle is not
necessary. Otherwise, it will be assigned here */
} loader_esp32_config_t;
/**
* @brief Initializes serial interface.
*
* @param baud_rate[in] Communication speed.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_FAIL Initialization failure
*/
esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config);
/**
* @brief Deinitialize serial interface.
*/
void loader_port_esp32_deinit(void);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,300 @@
#include <Arduino.h>
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Used for backwards compatibility with the previous API */
#define esp_loader_change_baudrate esp_loader_change_transmission_rate
/**
* Macro which can be used to check the error code,
* and return in case the code is not ESP_LOADER_SUCCESS.
*/
#define RETURN_ON_ERROR(x) do { \
esp_loader_error_t _err_ = (x); \
if (_err_ != ESP_LOADER_SUCCESS) { \
return _err_; \
} \
} while(0)
/**
* @brief Error codes
*/
typedef enum {
ESP_LOADER_SUCCESS, /*!< Success */
ESP_LOADER_ERROR_FAIL, /*!< Unspecified error */
ESP_LOADER_ERROR_TIMEOUT, /*!< Timeout elapsed */
ESP_LOADER_ERROR_IMAGE_SIZE, /*!< Image size to flash is larger than flash size */
ESP_LOADER_ERROR_INVALID_MD5, /*!< Computed and received MD5 does not match */
ESP_LOADER_ERROR_INVALID_PARAM, /*!< Invalid parameter passed to function */
ESP_LOADER_ERROR_INVALID_TARGET, /*!< Connected target is invalid */
ESP_LOADER_ERROR_UNSUPPORTED_CHIP, /*!< Attached chip is not supported */
ESP_LOADER_ERROR_UNSUPPORTED_FUNC, /*!< Function is not supported on attached target */
ESP_LOADER_ERROR_INVALID_RESPONSE /*!< Internal error */
} esp_loader_error_t;
/**
* @brief Supported targets
*/
typedef enum {
ESP8266_CHIP = 0,
ESP32_CHIP = 1,
ESP32S2_CHIP = 2,
ESP32C3_CHIP = 3,
ESP32S3_CHIP = 4,
ESP32C2_CHIP = 5,
ESP32H4_CHIP = 6,
ESP32H2_CHIP = 7,
ESP32C6_CHIP = 8,
ESP_MAX_CHIP = 9,
ESP_UNKNOWN_CHIP = 9
} target_chip_t;
/**
* @brief Application binary header
*/
typedef struct {
uint8_t magic;
uint8_t segments;
uint8_t flash_mode;
uint8_t flash_size_freq;
uint32_t entrypoint;
} esp_loader_bin_header_t;
/**
* @brief Segment binary header
*/
typedef struct {
uint32_t addr;
uint32_t size;
uint8_t *data;
} esp_loader_bin_segment_t;
/**
* @brief Connection arguments
*/
typedef struct {
uint32_t sync_timeout; /*!< Maximum time to wait for response from serial interface. */
int32_t trials; /*!< Number of trials to connect to target. If greater than 1,
100 millisecond delay is inserted after each try. */
} esp_loader_connect_args_t;
#define ESP_LOADER_CONNECT_DEFAULT() { \
.sync_timeout = 100, \
.trials = 10, \
}
/**
* @brief Connects to the target
*
* @param connect_args[in] Timing parameters to be used for connecting to target.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_connect(esp_loader_connect_args_t *connect_args);
/**
* @brief Returns attached target chip.
*
* @warning This function can only be called after connection with target
* has been successfully established by calling esp_loader_connect().
*
* @return One of target_chip_t
*/
target_chip_t esp_loader_get_target(void);
#ifdef SERIAL_FLASHER_INTERFACE_UART
/**
* @brief Initiates flash operation
*
* @param offset[in] Address from which flash operation will be performed.
* @param image_size[in] Size of the whole binary to be loaded into flash.
* @param block_size[in] Size of buffer used in subsequent calls to esp_loader_flash_write.
*
* @note image_size is size of the whole image, whereas, block_size is chunk of data sent
* to the target, each time esp_loader_flash_write function is called.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_flash_start(uint32_t offset, uint32_t image_size, uint32_t block_size);
/**
* @brief Writes supplied data to target's flash memory.
*
* @param payload[in] Data to be flashed into target's memory.
* @param size[in] Size of payload in bytes.
*
* @note size must not be greater that block_size supplied to previously called
* esp_loader_flash_start function. If size is less than block_size,
* remaining bytes of payload buffer will be padded with 0xff.
* Therefore, size of payload buffer has to be equal or greater than block_size.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_flash_write(void *payload, uint32_t size);
/**
* @brief Ends flash operation.
*
* @param reboot[in] reboot the target if true.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_flash_finish(bool reboot);
#endif /* SERIAL_FLASHER_INTERFACE_UART */
/**
* @brief Initiates mem operation, initiates loading for program into target RAM
*
* @param offset[in] Address from which mem operation will be performed.
* @param size[in] Size of the whole binary to be loaded into mem.
* @param block_size[in] Size of buffer used in subsequent calls to esp_loader_mem_write.
*
* @note image_size is size of the whole image, whereas, block_size is chunk of data sent
* to the target, each time esp_mem_flash_write function is called.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_mem_start(uint32_t offset, uint32_t size, uint32_t block_size);
/**
* @brief Writes supplied data to target's mem memory.
*
* @param payload[in] Data to be loaded into target's memory.
* @param size[in] Size of data in bytes.
*
* @note size must not be greater that block_size supplied to previously called
* esp_loader_mem_start function.
* Therefore, size of data buffer has to be equal or greater than block_size.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_mem_write(const void *payload, uint32_t size);
/**
* @brief Ends mem operation, finish loading for program into target RAM
* and send the entrypoint of ram_loadable app
*
* @param entrypoint[in] entrypoint of ram program.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_mem_finish(uint32_t entrypoint);
/**
* @brief Writes register.
*
* @param address[in] Address of register.
* @param reg_value[in] New register value.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_write_register(uint32_t address, uint32_t reg_value);
/**
* @brief Reads register.
*
* @param address[in] Address of register.
* @param reg_value[out] Register value.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
*/
esp_loader_error_t esp_loader_read_register(uint32_t address, uint32_t *reg_value);
/**
* @brief Change baud rate.
*
* @note Baud rate has to be also adjusted accordingly on host MCU, as
* target's baud rate is changed upon return from this function.
*
* @param transmission_rate[in] new baud rate to be set.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
* - ESP_LOADER_ERROR_UNSUPPORTED_FUNC Unsupported on the target
*/
esp_loader_error_t esp_loader_change_transmission_rate(uint32_t transmission_rate);
/**
* @brief Verify target's flash integrity by checking MD5.
* MD5 checksum is computed from data pushed to target's memory by calling
* esp_loader_flash_write() function and compared against target's MD5.
* Target computes checksum based on offset and image_size passed to
* esp_loader_flash_start() function.
*
* @note This function is only available if MD5_ENABLED is set.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_INVALID_MD5 MD5 does not match
* - ESP_LOADER_ERROR_TIMEOUT Timeout
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
* - ESP_LOADER_ERROR_UNSUPPORTED_FUNC Unsupported on the target
*/
#if MD5_ENABLED
esp_loader_error_t esp_loader_flash_verify(void);
#endif
/**
* @brief Toggles reset pin.
*/
void esp_loader_reset_target(void);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,112 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include "esp_loader.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Changes the transmission rate of the used peripheral.
*/
esp_loader_error_t loader_port_change_transmission_rate(uint32_t transmission_rate);
/**
* @brief Writes data over the io interface.
*
* @param data[in] Buffer with data to be written.
* @param size[in] Size of data in bytes.
* @param timeout[in] Timeout in milliseconds.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout elapsed
*/
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout);
/**
* @brief Reads data from the io interface.
*
* @param data[out] Buffer into which received data will be written.
* @param size[in] Number of bytes to read.
* @param timeout[in] Timeout in milliseconds.
*
* @return
* - ESP_LOADER_SUCCESS Success
* - ESP_LOADER_ERROR_TIMEOUT Timeout elapsed
*/
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout);
/**
* @brief Delay in milliseconds.
*
* @param ms[in] Number of milliseconds.
*
*/
void loader_port_delay_ms(uint32_t ms);
/**
* @brief Starts timeout timer.
*
* @param ms[in] Number of milliseconds.
*
*/
void loader_port_start_timer(uint32_t ms);
/**
* @brief Returns remaining time since timer was started by calling esp_loader_start_timer.
* 0 if timer has elapsed.
*
* @return Number of milliseconds.
*
*/
uint32_t loader_port_remaining_time(void);
/**
* @brief Asserts bootstrap pins to enter boot mode and toggles reset pin.
*
* @note Reset pin should stay asserted for at least 20 milliseconds.
*/
void loader_port_enter_bootloader(void);
/**
* @brief Toggles reset pin.
*
* @note Reset pin should stay asserted for at least 20 milliseconds.
*/
void loader_port_reset_target(void);
/**
* @brief Function can be defined by user to print debug message.
*
* @note Empty weak function is used, otherwise.
*
*/
void loader_port_debug_print(const char *str);
#ifdef SERIAL_FLASHER_INTERFACE_SPI
/**
* @brief Sets the chip select to a defined level
*/
void loader_port_spi_set_cs(uint32_t level);
#endif /* SERIAL_FLASHER_INTERFACE_SPI */
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,33 @@
/* Copyright 2020 Espressif Systems (Shanghai) PTE LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include "esp_loader.h"
typedef struct {
uint32_t cmd;
uint32_t usr;
uint32_t usr1;
uint32_t usr2;
uint32_t w0;
uint32_t mosi_dlen;
uint32_t miso_dlen;
} target_registers_t;
esp_loader_error_t loader_detect_chip(target_chip_t *target, const target_registers_t **regs);
esp_loader_error_t loader_read_spi_config(target_chip_t target_chip, uint32_t *spi_config);
bool encryption_in_begin_flash_cmd(target_chip_t target);

View File

@@ -0,0 +1,28 @@
/*
* MD5 hash implementation and interface functions
* Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
struct MD5Context {
uint32_t buf[4];
uint32_t bits[2];
uint8_t in[64];
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,236 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "esp_loader.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STATUS_FAILURE 1
#define STATUS_SUCCESS 0
#define READ_DIRECTION 1
#define WRITE_DIRECTION 0
#define MD5_SIZE 32
typedef enum __attribute__((packed))
{
FLASH_BEGIN = 0x02,
FLASH_DATA = 0x03,
FLASH_END = 0x04,
MEM_BEGIN = 0x05,
MEM_END = 0x06,
MEM_DATA = 0x07,
SYNC = 0x08,
WRITE_REG = 0x09,
READ_REG = 0x0a,
SPI_SET_PARAMS = 0x0b,
SPI_ATTACH = 0x0d,
CHANGE_BAUDRATE = 0x0f,
FLASH_DEFL_BEGIN = 0x10,
FLASH_DEFL_DATA = 0x11,
FLASH_DEFL_END = 0x12,
SPI_FLASH_MD5 = 0x13,
} command_t;
typedef enum __attribute__((packed))
{
RESPONSE_OK = 0x00,
INVALID_COMMAND = 0x05, // parameters or length field is invalid
COMMAND_FAILED = 0x06, // Failed to act on received message
INVALID_CRC = 0x07, // Invalid CRC in message
FLASH_WRITE_ERR = 0x08, // After writing a block of data to flash, the ROM loader reads the value back and the 8-bit CRC is compared to the data read from flash. If they don't match, this error is returned.
FLASH_READ_ERR = 0x09, // SPI read failed
READ_LENGTH_ERR = 0x0a, // SPI read request length is too long
DEFLATE_ERROR = 0x0b, // ESP32 compressed uploads only
} error_code_t;
typedef struct __attribute__((packed))
{
uint8_t direction;
uint8_t command; // One of command_t
uint16_t size;
uint32_t checksum;
} command_common_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t erase_size;
uint32_t packet_count;
uint32_t packet_size;
uint32_t offset;
uint32_t encrypted;
} flash_begin_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t data_size;
uint32_t sequence_number;
uint32_t zero_0;
uint32_t zero_1;
} data_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t stay_in_loader;
} flash_end_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t total_size;
uint32_t blocks;
uint32_t block_size;
uint32_t offset;
} mem_begin_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t stay_in_loader;
uint32_t entry_point_address;
} mem_end_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint8_t sync_sequence[36];
} sync_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t address;
uint32_t value;
uint32_t mask;
uint32_t delay_us;
} write_reg_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t address;
} read_reg_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t configuration;
uint32_t zero; // ESP32 ROM only
} spi_attach_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t new_baudrate;
uint32_t old_baudrate;
} change_baudrate_command_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t address;
uint32_t size;
uint32_t reserved_0;
uint32_t reserved_1;
} spi_flash_md5_command_t;
typedef struct __attribute__((packed))
{
uint8_t direction;
uint8_t command; // One of command_t
uint16_t size;
uint32_t value;
} common_response_t;
typedef struct __attribute__((packed))
{
uint8_t failed;
uint8_t error;
} response_status_t;
typedef struct __attribute__((packed))
{
common_response_t common;
response_status_t status;
} response_t;
typedef struct __attribute__((packed))
{
common_response_t common;
uint8_t md5[MD5_SIZE]; // ROM only
response_status_t status;
} rom_md5_response_t;
typedef struct __attribute__((packed))
{
command_common_t common;
uint32_t id;
uint32_t total_size;
uint32_t block_size;
uint32_t sector_size;
uint32_t page_size;
uint32_t status_mask;
} write_spi_command_t;
esp_loader_error_t loader_initialize_conn(esp_loader_connect_args_t *connect_args);
#ifdef SERIAL_FLASHER_INTERFACE_UART
esp_loader_error_t loader_flash_begin_cmd(uint32_t offset, uint32_t erase_size, uint32_t block_size, uint32_t blocks_to_write, bool encryption);
esp_loader_error_t loader_flash_data_cmd(const uint8_t *data, uint32_t size);
esp_loader_error_t loader_flash_end_cmd(bool stay_in_loader);
esp_loader_error_t loader_sync_cmd(void);
esp_loader_error_t loader_spi_attach_cmd(uint32_t config);
esp_loader_error_t loader_md5_cmd(uint32_t address, uint32_t size, uint8_t *md5_out);
esp_loader_error_t loader_spi_parameters(uint32_t total_size);
#endif /* SERIAL_FLASHER_INTERFACE_UART */
esp_loader_error_t loader_mem_begin_cmd(uint32_t offset, uint32_t size, uint32_t blocks_to_write, uint32_t block_size);
esp_loader_error_t loader_mem_data_cmd(const uint8_t *data, uint32_t size);
esp_loader_error_t loader_mem_end_cmd(uint32_t entrypoint);
esp_loader_error_t loader_mem_begin_cmd(uint32_t offset, uint32_t size, uint32_t blocks_to_write, uint32_t block_size);
esp_loader_error_t loader_mem_data_cmd(const uint8_t *data, uint32_t size);
esp_loader_error_t loader_mem_end_cmd(uint32_t entrypoint);
esp_loader_error_t loader_write_reg_cmd(uint32_t address, uint32_t value, uint32_t mask, uint32_t delay_us);
esp_loader_error_t loader_read_reg_cmd(uint32_t address, uint32_t *reg);
esp_loader_error_t loader_change_baudrate_cmd(uint32_t baudrate);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,31 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "esp_loader.h"
#include "protocol.h"
void log_loader_internal_error(error_code_t error);
esp_loader_error_t send_cmd(const void *cmd_data, uint32_t size, uint32_t *reg_value);
esp_loader_error_t send_cmd_with_data(const void *cmd_data, size_t cmd_size,
const void *data, size_t data_size);
esp_loader_error_t send_cmd_md5(const void *cmd_data, size_t cmd_size, uint8_t md5_out[MD5_SIZE]);

View File

@@ -0,0 +1,24 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#warning Please replace serial_io.h with esp_loader_io.h and change the function names \
to match the new API
/* Defines used to avoid breaking existing ports */
#define loader_port_change_baudrate loader_port_change_transmission_rate
#define loader_port_serial_write loader_port_write
#define loader_port_serial_read loader_port_read
#include "esp_loader_io.h"

View File

@@ -0,0 +1,28 @@
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "esp_loader.h"
#include <stdint.h>
#include <stdlib.h>
esp_loader_error_t SLIP_receive_data(uint8_t *buff, size_t size);
esp_loader_error_t SLIP_receive_packet(uint8_t *buff, size_t size);
esp_loader_error_t SLIP_send(const uint8_t *data, size_t size);
esp_loader_error_t SLIP_send_delimiter(void);

View File

@@ -0,0 +1,4 @@
{
"name": "esp-serial-flasher",
"version": "0.0.0+20230909102418"
}

View File

@@ -0,0 +1,186 @@
#include <Arduino.h>
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "esp32_port.h"
#include "driver/uart.h"
#include "driver/gpio.h"
#include "esp_timer.h"
#include "esp_log.h"
#include "esp_idf_version.h"
#include <unistd.h>
#ifdef SERIAL_FLASHER_DEBUG_TRACE
static void transfer_debug_print(const uint8_t *data, uint16_t size, bool write)
{
static bool write_prev = false;
if (write_prev != write) {
write_prev = write;
printf("\n%s %d bytes: ", write ? "Write" : "Read", size);
}
for (uint32_t i = 0; i < size; i++) {
printf("%02x", data[i]);
if ((i + 1) % 16 == 0) {
printf("\n");
}
}
}
#endif
static int64_t s_time_end;
static int32_t s_uart_port;
static int32_t s_reset_trigger_pin;
static int32_t s_gpio0_trigger_pin;
esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config)
{
s_uart_port = config->uart_port;
s_reset_trigger_pin = config->reset_trigger_pin;
s_gpio0_trigger_pin = config->gpio0_trigger_pin;
// Initialize UART
uart_config_t uart_config = {
.baud_rate = config->baud_rate,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
.source_clk = UART_SCLK_DEFAULT,
#endif
};
int rx_buffer_size = config->rx_buffer_size ? config->rx_buffer_size : 400;
int tx_buffer_size = config->tx_buffer_size ? config->tx_buffer_size : 400;
QueueHandle_t *uart_queue = config->uart_queue ? config->uart_queue : NULL;
int queue_size = config->queue_size ? config->queue_size : 0;
if ( uart_param_config(s_uart_port, &uart_config) != ESP_OK ) {
return ESP_LOADER_ERROR_FAIL;
}
if ( uart_set_pin(s_uart_port, config->uart_tx_pin, config->uart_rx_pin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE) != ESP_OK ) {
return ESP_LOADER_ERROR_FAIL;
}
if ( uart_driver_install(s_uart_port, rx_buffer_size, tx_buffer_size, queue_size, uart_queue, 0) != ESP_OK ) {
return ESP_LOADER_ERROR_FAIL;
}
// Initialize boot pin selection pins
gpio_reset_pin(s_reset_trigger_pin);
gpio_set_pull_mode(s_reset_trigger_pin, GPIO_PULLUP_ONLY);
gpio_set_direction(s_reset_trigger_pin, GPIO_MODE_OUTPUT);
gpio_reset_pin(s_gpio0_trigger_pin);
gpio_set_pull_mode(s_gpio0_trigger_pin, GPIO_PULLUP_ONLY);
gpio_set_direction(s_gpio0_trigger_pin, GPIO_MODE_OUTPUT);
return ESP_LOADER_SUCCESS;
}
void loader_port_esp32_deinit(void)
{
uart_driver_delete(s_uart_port);
}
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout)
{
uart_write_bytes(s_uart_port, (const char *)data, size);
esp_err_t err = uart_wait_tx_done(s_uart_port, pdMS_TO_TICKS(timeout));
if (err == ESP_OK) {
#ifdef SERIAL_FLASHER_DEBUG_TRACE
transfer_debug_print(data, size, true);
#endif
return ESP_LOADER_SUCCESS;
} else if (err == ESP_ERR_TIMEOUT) {
return ESP_LOADER_ERROR_TIMEOUT;
} else {
return ESP_LOADER_ERROR_FAIL;
}
}
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout)
{
int read = uart_read_bytes(s_uart_port, data, size, pdMS_TO_TICKS(timeout));
if (read < 0) {
return ESP_LOADER_ERROR_FAIL;
} else if (read < size) {
#ifdef SERIAL_FLASHER_DEBUG_TRACE
transfer_debug_print(data, read, false);
#endif
return ESP_LOADER_ERROR_TIMEOUT;
} else {
#ifdef SERIAL_FLASHER_DEBUG_TRACE
transfer_debug_print(data, read, false);
#endif
return ESP_LOADER_SUCCESS;
}
}
// Set GPIO0 LOW, then
// assert reset pin for 50 milliseconds.
void loader_port_enter_bootloader(void)
{
gpio_set_level(s_gpio0_trigger_pin, 0);
loader_port_reset_target();
loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
gpio_set_level(s_gpio0_trigger_pin, 1);
}
void loader_port_reset_target(void)
{
gpio_set_level(s_reset_trigger_pin, 0);
loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
gpio_set_level(s_reset_trigger_pin, 1);
}
void loader_port_delay_ms(uint32_t ms)
{
usleep(ms * 1000);
}
void loader_port_start_timer(uint32_t ms)
{
s_time_end = esp_timer_get_time() + ms * 1000;
}
uint32_t loader_port_remaining_time(void)
{
int64_t remaining = (s_time_end - esp_timer_get_time()) / 1000;
return (remaining > 0) ? (uint32_t)remaining : 0;
}
void loader_port_debug_print(const char *str)
{
printf("DEBUG: %s\n", str);
}
esp_loader_error_t loader_port_change_transmission_rate(uint32_t baudrate)
{
esp_err_t err = uart_set_baudrate(s_uart_port, baudrate);
return (err == ESP_OK) ? ESP_LOADER_SUCCESS : ESP_LOADER_ERROR_FAIL;
}

Some files were not shown because too many files have changed in this diff Show More