Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 5:ea7377f3d1af, committed 2017-10-11
- Comitter:
- Pokitto
- Date:
- Wed Oct 11 20:35:27 2017 +0000
- Parent:
- 4:ecf2fe370c1c
- Child:
- 6:72f87b7c7400
- Commit message:
- Fixed PokittoLib. Includes a working custom mbed-src
Changed in this revision
--- a/POKITTO_CORE/FONTS/TIC806x6.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-
-//RECREATED BY @ROGB_UK
-//Original font by nesbox, under a creative commons license
-//https://fontstruct.com/fontstructions/show/1334143/tic-computer-6x6-font
-
-
-#include "PokittoFonts.h"
-
-const unsigned char fontTIC806x6[] = {
- 6,6,32,0,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x03, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, // Code for char !
- 0x04, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, // Code for char "
- 0x05, 0x0A, 0x1F, 0x0A, 0x1F, 0x0A, 0x00, // Code for char #
- 0x05, 0x12, 0x15, 0x1F, 0x15, 0x09, 0x00, // Code for char $
- 0x05, 0x11, 0x08, 0x04, 0x02, 0x11, 0x00, // Code for char %
- 0x05, 0x0A, 0x15, 0x16, 0x08, 0x14, 0x00, // Code for char &
- 0x03, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // Code for char '
- 0x04, 0x00, 0x00, 0x0E, 0x11, 0x00, 0x00, // Code for char (
- 0x03, 0x00, 0x11, 0x0E, 0x00, 0x00, 0x00, // Code for char )
- 0x04, 0x00, 0x0A, 0x04, 0x0A, 0x00, 0x00, // Code for char *
- 0x04, 0x00, 0x04, 0x0E, 0x04, 0x00, 0x00, // Code for char +
- 0x03, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, // Code for char ,
- 0x04, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, // Code for char -
- 0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, // Code for char .
- 0x05, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, // Code for char /
- 0x05, 0x0E, 0x19, 0x15, 0x13, 0x0E, 0x00, // Code for char 0
- 0x04, 0x00, 0x12, 0x1F, 0x10, 0x00, 0x00, // Code for char 1
- 0x05, 0x19, 0x15, 0x15, 0x15, 0x12, 0x00, // Code for char 2
- 0x05, 0x09, 0x11, 0x15, 0x15, 0x0B, 0x00, // Code for char 3
- 0x05, 0x08, 0x0C, 0x0A, 0x1F, 0x08, 0x00, // Code for char 4
- 0x05, 0x17, 0x15, 0x15, 0x15, 0x09, 0x00, // Code for char 5
- 0x05, 0x0E, 0x15, 0x15, 0x15, 0x08, 0x00, // Code for char 6
- 0x05, 0x01, 0x11, 0x09, 0x05, 0x03, 0x00, // Code for char 7
- 0x05, 0x0A, 0x15, 0x15, 0x15, 0x0A, 0x00, // Code for char 8
- 0x06, 0x02, 0x15, 0x15, 0x15, 0x15, 0x0E, // Code for char 9
- 0x03, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, // Code for char :
- 0x03, 0x00, 0x10, 0x0A, 0x00, 0x00, 0x00, // Code for char ;
- 0x04, 0x00, 0x04, 0x0A, 0x11, 0x00, 0x00, // Code for char <
- 0x05, 0x00, 0x0A, 0x0A, 0x0A, 0x0A, 0x00, // Code for char =
- 0x04, 0x00, 0x11, 0x0A, 0x04, 0x00, 0x00, // Code for char >
- 0x05, 0x00, 0x01, 0x15, 0x05, 0x02, 0x00, // Code for char ?
- 0x05, 0x0E, 0x11, 0x17, 0x15, 0x06, 0x00, // Code for char @
- 0x05, 0x1E, 0x09, 0x09, 0x09, 0x1E, 0x00, // Code for char A
- 0x05, 0x1F, 0x15, 0x15, 0x15, 0x0A, 0x00, // Code for char B
- 0x05, 0x0E, 0x11, 0x11, 0x11, 0x11, 0x00, // Code for char C
- 0x05, 0x1F, 0x11, 0x11, 0x11, 0x0E, 0x00, // Code for char D
- 0x05, 0x1F, 0x15, 0x15, 0x15, 0x11, 0x00, // Code for char E
- 0x05, 0x1F, 0x05, 0x05, 0x05, 0x01, 0x00, // Code for char F
- 0x05, 0x0E, 0x11, 0x11, 0x15, 0x1D, 0x00, // Code for char G
- 0x05, 0x1F, 0x04, 0x04, 0x04, 0x1F, 0x00, // Code for char H
- 0x05, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x00, // Code for char I
- 0x05, 0x11, 0x11, 0x11, 0x11, 0x0F, 0x00, // Code for char J
- 0x05, 0x1F, 0x04, 0x04, 0x0A, 0x11, 0x00, // Code for char K
- 0x05, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x00, // Code for char L
- 0x05, 0x1F, 0x02, 0x04, 0x02, 0x1F, 0x00, // Code for char M
- 0x05, 0x1F, 0x02, 0x04, 0x08, 0x1F, 0x00, // Code for char N
- 0x05, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00, // Code for char O
- 0x05, 0x1F, 0x09, 0x09, 0x09, 0x06, 0x00, // Code for char P
- 0x05, 0x0E, 0x11, 0x11, 0x19, 0x1E, 0x00, // Code for char Q
- 0x05, 0x1F, 0x09, 0x09, 0x09, 0x16, 0x00, // Code for char R
- 0x05, 0x12, 0x15, 0x15, 0x15, 0x09, 0x00, // Code for char S
- 0x05, 0x01, 0x01, 0x1F, 0x01, 0x01, 0x00, // Code for char T
- 0x05, 0x0F, 0x10, 0x10, 0x10, 0x0F, 0x00, // Code for char U
- 0x05, 0x07, 0x08, 0x10, 0x08, 0x07, 0x00, // Code for char V
- 0x05, 0x0F, 0x10, 0x0C, 0x10, 0x0F, 0x00, // Code for char W
- 0x05, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x00, // Code for char X
- 0x05, 0x03, 0x04, 0x18, 0x04, 0x03, 0x00, // Code for char Y
- 0x05, 0x11, 0x19, 0x15, 0x13, 0x11, 0x00, // Code for char Z
- 0x04, 0x00, 0x00, 0x1F, 0x11, 0x00, 0x00, // Code for char [
- 0x05, 0x01, 0x02, 0x04, 0x08, 0x10, 0x00, // Code for char BackSlash
- 0x03, 0x00, 0x11, 0x1F, 0x00, 0x00, 0x00, // Code for char ]
- 0x05, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, // Code for char ^
- 0x05, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // Code for char _
- 0x04, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, // Code for char `
- 0x05, 0x00, 0x0C, 0x12, 0x12, 0x1E, 0x00, // Code for char a
- 0x05, 0x00, 0x1F, 0x12, 0x12, 0x0C, 0x00, // Code for char b
- 0x05, 0x00, 0x0C, 0x12, 0x12, 0x12, 0x00, // Code for char c
- 0x05, 0x00, 0x0C, 0x12, 0x12, 0x1F, 0x00, // Code for char d
- 0x05, 0x00, 0x0C, 0x16, 0x16, 0x04, 0x00, // Code for char e
- 0x05, 0x00, 0x04, 0x1E, 0x05, 0x05, 0x00, // Code for char f
- 0x05, 0x00, 0x04, 0x2A, 0x2A, 0x1C, 0x00, // Code for char g
- 0x05, 0x00, 0x1F, 0x02, 0x02, 0x1C, 0x00, // Code for char h
- 0x04, 0x00, 0x00, 0x04, 0x1D, 0x00, 0x00, // Code for char i
- 0x04, 0x00, 0x00, 0x10, 0x0D, 0x00, 0x00, // Code for char j
- 0x05, 0x00, 0x1F, 0x04, 0x04, 0x1A, 0x00, // Code for char k
- 0x04, 0x00, 0x00, 0x01, 0x1E, 0x00, 0x00, // Code for char l
- 0x05, 0x1E, 0x02, 0x1C, 0x02, 0x1C, 0x00, // Code for char m
- 0x05, 0x00, 0x1E, 0x02, 0x02, 0x1C, 0x00, // Code for char n
- 0x05, 0x00, 0x0C, 0x12, 0x12, 0x0C, 0x00, // Code for char o
- 0x05, 0x00, 0x3E, 0x12, 0x12, 0x0C, 0x00, // Code for char p
- 0x05, 0x00, 0x0C, 0x12, 0x12, 0x3E, 0x00, // Code for char q
- 0x05, 0x00, 0x1E, 0x02, 0x02, 0x04, 0x00, // Code for char r
- 0x05, 0x00, 0x14, 0x16, 0x1A, 0x0A, 0x00, // Code for char s
- 0x05, 0x00, 0x02, 0x0F, 0x12, 0x12, 0x00, // Code for char t
- 0x05, 0x00, 0x0E, 0x10, 0x10, 0x1E, 0x00, // Code for char u
- 0x05, 0x00, 0x0E, 0x10, 0x08, 0x06, 0x00, // Code for char v
- 0x05, 0x0E, 0x10, 0x08, 0x10, 0x0E, 0x00, // Code for char w
- 0x05, 0x00, 0x12, 0x0C, 0x0C, 0x12, 0x00, // Code for char x
- 0x05, 0x00, 0x06, 0x28, 0x28, 0x1E, 0x00, // Code for char y
- 0x05, 0x00, 0x12, 0x1A, 0x16, 0x12, 0x00, // Code for char z
- 0x04, 0x00, 0x04, 0x1F, 0x11, 0x00, 0x00, // Code for char {
- 0x03, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, // Code for char |
- 0x04, 0x00, 0x11, 0x1F, 0x04, 0x00, 0x00, // Code for char }
- 0x05, 0x00, 0x04, 0x02, 0x04, 0x02, 0x00, // Code for char ~
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/ZXSpec.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//RECREATED BY @ROGB_UK
-
-
-#include "PokittoFonts.h"
-
-const unsigned char fontZXSpec[] = {
- 8,8,32,0,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x04, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, // Code for char "
- 0x07, 0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00, // Code for char #
- 0x07, 0x00, 0x00, 0x5C, 0x54, 0xFE, 0x54, 0x74, 0x00, // Code for char $
- 0x07, 0x00, 0x46, 0x26, 0x10, 0x08, 0x64, 0x62, 0x00, // Code for char %
- 0x07, 0x00, 0x20, 0x54, 0x4A, 0x54, 0x20, 0x50, 0x00, // Code for char &
- 0x05, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, // Code for char '
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x42, 0x00, 0x00, // Code for char (
- 0x04, 0x00, 0x00, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x07, 0x00, 0x00, 0x10, 0x54, 0x38, 0x54, 0x10, 0x00, // Code for char *
- 0x07, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, // Code for char +
- 0x05, 0x00, 0x00, 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, // Code for char ,
- 0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, // Code for char -
- 0x05, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // Code for char .
- 0x07, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, // Code for char /
- 0x07, 0x00, 0x3C, 0x62, 0x52, 0x4A, 0x46, 0x3C, 0x00, // Code for char 0
- 0x07, 0x00, 0x00, 0x44, 0x42, 0x7E, 0x40, 0x40, 0x00, // Code for char 1
- 0x07, 0x00, 0x64, 0x52, 0x52, 0x52, 0x52, 0x4C, 0x00, // Code for char 2
- 0x07, 0x00, 0x24, 0x42, 0x42, 0x4A, 0x4A, 0x34, 0x00, // Code for char 3
- 0x07, 0x00, 0x30, 0x28, 0x24, 0x7E, 0x20, 0x20, 0x00, // Code for char 4
- 0x07, 0x00, 0x2E, 0x4A, 0x4A, 0x4A, 0x4A, 0x32, 0x00, // Code for char 5
- 0x07, 0x00, 0x3C, 0x4A, 0x4A, 0x4A, 0x4A, 0x30, 0x00, // Code for char 6
- 0x07, 0x00, 0x02, 0x02, 0x62, 0x12, 0x0A, 0x06, 0x00, // Code for char 7
- 0x07, 0x00, 0x34, 0x4A, 0x4A, 0x4A, 0x4A, 0x34, 0x00, // Code for char 8
- 0x07, 0x00, 0x0C, 0x52, 0x52, 0x52, 0x52, 0x3C, 0x00, // Code for char 9
- 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x04, 0x00, 0x00, 0x80, 0x64, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x06, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, // Code for char <
- 0x07, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, // Code for char =
- 0x06, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x00, 0x00, // Code for char >
- 0x07, 0x00, 0x04, 0x02, 0x02, 0x52, 0x0A, 0x04, 0x00, // Code for char ?
- 0x07, 0x00, 0x3C, 0x42, 0x5A, 0x56, 0x5A, 0x1C, 0x00, // Code for char @
- 0x07, 0x00, 0x7C, 0x12, 0x12, 0x12, 0x12, 0x7C, 0x00, // Code for char A
- 0x07, 0x00, 0x7E, 0x4A, 0x4A, 0x4A, 0x4A, 0x34, 0x00, // Code for char B
- 0x07, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x24, 0x00, // Code for char C
- 0x07, 0x00, 0x7E, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, // Code for char D
- 0x07, 0x00, 0x7E, 0x4A, 0x4A, 0x4A, 0x4A, 0x42, 0x00, // Code for char E
- 0x07, 0x00, 0x7E, 0x0A, 0x0A, 0x0A, 0x0A, 0x02, 0x00, // Code for char F
- 0x07, 0x00, 0x3C, 0x42, 0x42, 0x52, 0x52, 0x34, 0x00, // Code for char G
- 0x07, 0x00, 0x7E, 0x08, 0x08, 0x08, 0x08, 0x7E, 0x00, // Code for char H
- 0x07, 0x00, 0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00, // Code for char I
- 0x07, 0x00, 0x30, 0x40, 0x40, 0x40, 0x40, 0x3E, 0x00, // Code for char J
- 0x07, 0x00, 0x7E, 0x08, 0x08, 0x14, 0x22, 0x40, 0x00, // Code for char K
- 0x07, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char L
- 0x07, 0x00, 0x7E, 0x04, 0x08, 0x08, 0x04, 0x7E, 0x00, // Code for char M
- 0x07, 0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, // Code for char N
- 0x07, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, // Code for char O
- 0x07, 0x00, 0x7E, 0x12, 0x12, 0x12, 0x12, 0x0C, 0x00, // Code for char P
- 0x07, 0x00, 0x3C, 0x42, 0x52, 0x62, 0x42, 0x3C, 0x00, // Code for char Q
- 0x07, 0x00, 0x7E, 0x12, 0x12, 0x12, 0x32, 0x4C, 0x00, // Code for char R
- 0x07, 0x00, 0x24, 0x4A, 0x4A, 0x4A, 0x4A, 0x30, 0x00, // Code for char S
- 0x07, 0x02, 0x02, 0x02, 0x7E, 0x02, 0x02, 0x02, 0x00, // Code for char T
- 0x07, 0x00, 0x3E, 0x40, 0x40, 0x40, 0x40, 0x3E, 0x00, // Code for char U
- 0x07, 0x00, 0x1E, 0x20, 0x40, 0x40, 0x20, 0x1E, 0x00, // Code for char V
- 0x07, 0x00, 0x3E, 0x40, 0x20, 0x20, 0x40, 0x3E, 0x00, // Code for char W
- 0x07, 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00, // Code for char X
- 0x07, 0x02, 0x04, 0x08, 0x70, 0x08, 0x04, 0x02, 0x00, // Code for char Y
- 0x07, 0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00, // Code for char Z
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x42, 0x42, 0x00, // Code for char [
- 0x06, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, // Code for char BackSlash
- 0x04, 0x00, 0x42, 0x42, 0x7E, 0x00, 0x00, 0x00, 0x00, // Code for char ]
- 0x06, 0x00, 0x04, 0x02, 0x7F, 0x02, 0x04, 0x00, 0x00, // Code for char ^
- 0x08, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // Code for char _
- 0x07, 0x00, 0x48, 0x7C, 0x4A, 0x4A, 0x42, 0x44, 0x00, // Code for char `
- 0x06, 0x00, 0x20, 0x54, 0x54, 0x54, 0x78, 0x00, 0x00, // Code for char a
- 0x07, 0x00, 0x00, 0x7E, 0x48, 0x48, 0x48, 0x30, 0x00, // Code for char b
- 0x06, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x00, 0x00, // Code for char c
- 0x06, 0x00, 0x30, 0x48, 0x48, 0x48, 0x7E, 0x00, 0x00, // Code for char d
- 0x06, 0x00, 0x38, 0x54, 0x54, 0x54, 0x48, 0x00, 0x00, // Code for char e
- 0x06, 0x00, 0x00, 0x00, 0x7C, 0x0A, 0x02, 0x00, 0x00, // Code for char f
- 0x06, 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C, 0x00, 0x00, // Code for char g
- 0x06, 0x00, 0x7E, 0x08, 0x08, 0x08, 0x70, 0x00, 0x00, // Code for char h
- 0x05, 0x00, 0x00, 0x48, 0x7A, 0x40, 0x00, 0x00, 0x00, // Code for char i
- 0x06, 0x00, 0x00, 0x40, 0x80, 0x80, 0x7A, 0x00, 0x00, // Code for char j
- 0x06, 0x00, 0x00, 0x7E, 0x18, 0x24, 0x40, 0x00, 0x00, // Code for char k
- 0x06, 0x00, 0x00, 0x00, 0x3E, 0x40, 0x40, 0x00, 0x00, // Code for char l
- 0x06, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, 0x00, // Code for char m
- 0x06, 0x00, 0x7C, 0x04, 0x04, 0x04, 0x78, 0x00, 0x00, // Code for char n
- 0x06, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, // Code for char o
- 0x06, 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, // Code for char p
- 0x07, 0x00, 0x18, 0x24, 0x24, 0x24, 0xFC, 0x80, 0x00, // Code for char q
- 0x06, 0x00, 0x00, 0x78, 0x04, 0x04, 0x04, 0x00, 0x00, // Code for char r
- 0x06, 0x00, 0x48, 0x54, 0x54, 0x54, 0x20, 0x00, 0x00, // Code for char s
- 0x06, 0x00, 0x00, 0x04, 0x3E, 0x44, 0x40, 0x00, 0x00, // Code for char t
- 0x06, 0x00, 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00, 0x00, // Code for char u
- 0x06, 0x00, 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00, 0x00, // Code for char v
- 0x06, 0x00, 0x3C, 0x40, 0x3C, 0x40, 0x3C, 0x00, 0x00, // Code for char w
- 0x06, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, // Code for char x
- 0x06, 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C, 0x00, 0x00, // Code for char y
- 0x06, 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x00, // Code for char z
- 0x07, 0x00, 0x00, 0x08, 0x08, 0x76, 0x42, 0x42, 0x00, // Code for char {
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, // Code for char |
- 0x06, 0x00, 0x42, 0x42, 0x76, 0x08, 0x08, 0x00, 0x00, // Code for char }
- 0x07, 0x00, 0x00, 0x00, 0x04, 0x02, 0x04, 0x02, 0x00, // Code for char ~
- 0x08, 0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x81, 0x42, 0x3C // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/adventurer12x16.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : Adventurer12x16
-//GLCD FontSize : 12 x 16
-#include "PokittoFonts.h"
-
-const unsigned char fontAdventurer[] = {
- 12,16,32,0, // width, height, start character, only caps
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x04, 0x00, 0x10, 0xFC, 0x1B, 0xFE, 0x0B, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x06, 0x02, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char "
- 0x0B, 0x80, 0x00, 0x98, 0x00, 0xD8, 0x07, 0xFE, 0x03, 0xBF, 0x00, 0xD8, 0x07, 0xFE, 0x03, 0xBF, 0x00, 0xBF, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, // Code for char #
- 0x07, 0x00, 0x00, 0x38, 0x01, 0x3C, 0x03, 0xAC, 0x0F, 0x7F, 0x02, 0xCC, 0x01, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $
- 0x0B, 0x0C, 0x00, 0x1C, 0x08, 0x12, 0x08, 0x1E, 0x07, 0x0C, 0x07, 0xE0, 0x00, 0xFC, 0x06, 0x1C, 0x0E, 0x1E, 0x09, 0x02, 0x07, 0x02, 0x06, 0x00, 0x00, // Code for char %
- 0x0C, 0x00, 0x0F, 0xBC, 0x1F, 0xF6, 0x38, 0xC2, 0x30, 0xC2, 0x21, 0xE6, 0x33, 0x3E, 0x1F, 0x9C, 0x07, 0x80, 0x0F, 0x80, 0x18, 0x80, 0x30, 0x00, 0x20, // Code for char &
- 0x03, 0x02, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x05, 0xF0, 0x03, 0xF8, 0x0F, 0x0C, 0x1E, 0x02, 0x38, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x06, 0x00, 0x00, 0x03, 0x20, 0x07, 0x18, 0x1E, 0x0C, 0xFC, 0x07, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x0A, 0x00, 0x00, 0x40, 0x02, 0x50, 0x01, 0x58, 0x01, 0xFC, 0x00, 0xE0, 0x03, 0x58, 0x01, 0x58, 0x00, 0x4C, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char *
- 0x08, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x07, 0xF8, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char +
- 0x03, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char -
- 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xC0, 0x01, 0x70, 0x00, 0x18, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
- 0x09, 0xF8, 0x03, 0xFC, 0x07, 0xC4, 0x0C, 0x62, 0x08, 0x32, 0x08, 0x1E, 0x0C, 0x0E, 0x06, 0xFC, 0x07, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
- 0x04, 0x08, 0x00, 0x0C, 0x00, 0xFE, 0x1F, 0xFE, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
- 0x08, 0x1C, 0x0E, 0x04, 0x0F, 0x82, 0x0B, 0xC2, 0x08, 0x42, 0x08, 0x66, 0x08, 0x3E, 0x0C, 0x1C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
- 0x09, 0x02, 0x06, 0x06, 0x0C, 0x02, 0x08, 0x22, 0x08, 0x32, 0x08, 0x6A, 0x04, 0xC6, 0x07, 0x82, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
- 0x09, 0x40, 0x00, 0x60, 0x00, 0x50, 0x00, 0x4C, 0x00, 0x40, 0x00, 0xFC, 0x1F, 0xFE, 0x0F, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4
- 0x08, 0xFC, 0x01, 0xFC, 0x00, 0x64, 0x00, 0x24, 0x40, 0x64, 0x20, 0xE4, 0x30, 0xC4, 0x1F, 0x84, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
- 0x08, 0xF0, 0x03, 0xF8, 0x07, 0x4C, 0x0C, 0x24, 0x08, 0x22, 0x08, 0x62, 0x08, 0xC0, 0x07, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
- 0x09, 0x02, 0x00, 0x06, 0x00, 0x02, 0x00, 0xE2, 0x1F, 0xFA, 0x0F, 0x1E, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
- 0x08, 0x3C, 0x07, 0xBE, 0x0F, 0xF6, 0x1C, 0x42, 0x18, 0xC2, 0x10, 0xC6, 0x19, 0xBC, 0x1F, 0x9C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
- 0x08, 0x38, 0x00, 0x7C, 0x08, 0xC2, 0x08, 0x82, 0x08, 0x82, 0x04, 0xC6, 0x06, 0xFC, 0x03, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9
- 0x03, 0x00, 0x00, 0x60, 0x0C, 0x60, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x03, 0x00, 0x04, 0x60, 0x3C, 0x60, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x06, 0x80, 0x00, 0xC0, 0x01, 0xC0, 0x03, 0x20, 0x07, 0x20, 0x0E, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char <
- 0x07, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char =
- 0x06, 0x20, 0x08, 0x78, 0x04, 0xE0, 0x04, 0xC0, 0x03, 0x80, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char >
- 0x08, 0x1C, 0x00, 0x06, 0x00, 0x02, 0x20, 0x82, 0x37, 0x82, 0x11, 0xC6, 0x00, 0x7E, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ?
- 0x0B, 0xF0, 0x01, 0xF8, 0x03, 0x18, 0x06, 0xC4, 0x0D, 0xC4, 0x0B, 0x24, 0x0A, 0xE4, 0x09, 0xDC, 0x0B, 0xFC, 0x0B, 0x38, 0x02, 0xF0, 0x01, 0x00, 0x00, // Code for char @
- 0x09, 0xF0, 0x0F, 0xF8, 0x1F, 0x8C, 0x20, 0xC2, 0x00, 0x42, 0x00, 0xC2, 0x00, 0xFE, 0x0F, 0xFE, 0x07, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A
- 0x09, 0xFE, 0x0F, 0xFE, 0x0F, 0x42, 0x08, 0x22, 0x08, 0x26, 0x08, 0x7E, 0x0C, 0xEC, 0x0F, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B
- 0x0A, 0xF8, 0x03, 0xFC, 0x07, 0x06, 0x0E, 0x02, 0x0C, 0x02, 0x08, 0x02, 0x08, 0x06, 0x0C, 0x1E, 0x04, 0x1E, 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, // Code for char C
- 0x09, 0xFE, 0x0F, 0xFE, 0x0F, 0x02, 0x08, 0x02, 0x08, 0x04, 0x08, 0x0C, 0x0C, 0xF8, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D
- 0x09, 0xFE, 0x0F, 0xFE, 0x0F, 0x42, 0x08, 0x72, 0x08, 0x32, 0x08, 0x32, 0x08, 0x06, 0x0E, 0x02, 0x0C, 0x02, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E
- 0x0A, 0x00, 0x20, 0xFE, 0x3F, 0xFE, 0x1F, 0x22, 0x00, 0x32, 0x00, 0x32, 0x00, 0x32, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F
- 0x0A, 0xF8, 0x03, 0xFC, 0x07, 0x06, 0x0C, 0x02, 0x0C, 0x02, 0x08, 0x02, 0x08, 0x06, 0x08, 0x0E, 0x1F, 0x8E, 0x1F, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G
- 0x0A, 0xFE, 0x0F, 0xFF, 0x07, 0x31, 0x00, 0x38, 0x00, 0x18, 0x00, 0x18, 0x40, 0x38, 0x30, 0xF0, 0x1F, 0xF0, 0x1F, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, // Code for char H
- 0x04, 0x00, 0x00, 0xFE, 0x0F, 0xFE, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x04, 0x00, 0x80, 0x02, 0x60, 0xFE, 0x3F, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
- 0x0A, 0xFE, 0x0F, 0xFE, 0x07, 0x70, 0x00, 0x30, 0x00, 0x3C, 0x00, 0x3E, 0x40, 0x76, 0x70, 0xF2, 0x3F, 0xE2, 0x1F, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, // Code for char K
- 0x09, 0xFC, 0x0F, 0xFE, 0x0F, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L
- 0x0B, 0xF8, 0x0F, 0xFC, 0x07, 0x1E, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x0C, 0x40, 0x06, 0x70, 0x0E, 0x30, 0xFC, 0x1F, 0xF8, 0x0F, 0x00, 0x00, // Code for char M
- 0x09, 0xFE, 0x0F, 0xFE, 0x07, 0x78, 0x00, 0x40, 0x00, 0xC0, 0x00, 0x80, 0x03, 0xFC, 0x0F, 0xFE, 0x3F, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N
- 0x0A, 0xF8, 0x03, 0xFC, 0x07, 0x04, 0x0E, 0x02, 0x0C, 0x02, 0x08, 0x02, 0x08, 0x06, 0x0C, 0x0E, 0x06, 0xFC, 0x03, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char O
- 0x09, 0x00, 0x20, 0xFE, 0x1F, 0xFE, 0x0F, 0x02, 0x01, 0x02, 0x01, 0x06, 0x01, 0x8E, 0x01, 0xFC, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P
- 0x0A, 0xF8, 0x03, 0xFC, 0x07, 0x04, 0x0E, 0x02, 0x0C, 0x02, 0x08, 0x02, 0x0A, 0x06, 0x0E, 0x0E, 0x1C, 0xFC, 0x3F, 0xF8, 0x43, 0x00, 0x00, 0x00, 0x00, // Code for char Q
- 0x0A, 0xFE, 0x0F, 0xFE, 0x1F, 0x02, 0x00, 0x02, 0x03, 0x06, 0x07, 0x8E, 0x0E, 0xFC, 0x1C, 0x78, 0x38, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, // Code for char R
- 0x09, 0x1C, 0x08, 0x3E, 0x1C, 0x36, 0x18, 0x22, 0x10, 0x22, 0x10, 0x62, 0x10, 0xE6, 0x18, 0xCC, 0x0F, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
- 0x09, 0x1E, 0x00, 0x06, 0x00, 0x06, 0x00, 0xFE, 0x1F, 0xFE, 0x0F, 0x06, 0x00, 0x06, 0x00, 0x1E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T
- 0x09, 0xE0, 0x03, 0xF2, 0x07, 0x1A, 0x0C, 0x0E, 0x08, 0x02, 0x08, 0x00, 0x08, 0x0E, 0x08, 0xFE, 0x0F, 0xFE, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U
- 0x09, 0x7E, 0x00, 0xFE, 0x03, 0x82, 0x0F, 0x00, 0x1C, 0x00, 0x0C, 0x00, 0x06, 0xC0, 0x03, 0xFE, 0x01, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V
- 0x0B, 0xFC, 0x1F, 0xFE, 0x1F, 0x02, 0x0C, 0x00, 0x06, 0x00, 0x03, 0x80, 0x03, 0x00, 0x07, 0x00, 0x0E, 0x02, 0x1C, 0xFC, 0x0F, 0xF8, 0x07, 0x00, 0x00, // Code for char W
- 0x09, 0x02, 0x08, 0x0E, 0x04, 0x3C, 0x03, 0xF0, 0x01, 0xC0, 0x03, 0x30, 0x0F, 0x0C, 0x1C, 0x02, 0x30, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X
- 0x08, 0x04, 0x00, 0x0C, 0x00, 0x38, 0x00, 0x60, 0x20, 0xE0, 0x1F, 0xFC, 0x0F, 0x3E, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y
- 0x0A, 0x02, 0x1C, 0x0E, 0x1E, 0x06, 0x17, 0x82, 0x13, 0xC2, 0x11, 0xE2, 0x10, 0x72, 0x10, 0x3A, 0x10, 0x1E, 0x18, 0x0E, 0x1C, 0x00, 0x00, 0x00, 0x00, // Code for char Z
- 0x04, 0xFE, 0x1F, 0xFE, 0x1F, 0x02, 0x10, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x07, 0x04, 0x00, 0x1E, 0x00, 0x7C, 0x00, 0xF0, 0x01, 0xC0, 0x07, 0x00, 0x0F, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash
- 0x04, 0x02, 0x10, 0x02, 0x10, 0xFE, 0x1F, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ]
- 0x07, 0x10, 0x00, 0x08, 0x00, 0x06, 0x00, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^
- 0x08, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _
- 0x05, 0x04, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x30, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char `
- 0x08, 0x00, 0x06, 0x80, 0x0E, 0x40, 0x0D, 0x40, 0x09, 0x40, 0x0D, 0xC0, 0x07, 0x80, 0x0F, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a
- 0x07, 0xFC, 0x07, 0xFE, 0x0F, 0x81, 0x0C, 0xC0, 0x08, 0xC0, 0x08, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b
- 0x07, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x0C, 0x40, 0x08, 0xC0, 0x08, 0xC0, 0x09, 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c
- 0x08, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x0C, 0x40, 0x08, 0x80, 0x08, 0xFC, 0x07, 0xFE, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d
- 0x07, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x0C, 0x40, 0x0A, 0xC0, 0x09, 0xC0, 0x09, 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e
- 0x05, 0x40, 0x40, 0xF8, 0x3F, 0xFC, 0x1F, 0x42, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f
- 0x07, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x8C, 0x40, 0x48, 0xC0, 0x64, 0x80, 0x3F, 0xC0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g
- 0x07, 0xFC, 0x0F, 0xFE, 0x07, 0x81, 0x00, 0x40, 0x00, 0xC0, 0x20, 0xC0, 0x1F, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h
- 0x03, 0x08, 0x00, 0xCC, 0x0F, 0xCC, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
- 0x03, 0x50, 0x80, 0xD8, 0x7F, 0xD8, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j
- 0x07, 0xFC, 0x0F, 0xFE, 0x07, 0x41, 0x00, 0x60, 0x00, 0xD8, 0x20, 0xD8, 0x1F, 0x98, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k
- 0x03, 0xFE, 0x0F, 0xFF, 0x1F, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
- 0x0C, 0x80, 0x0F, 0xC0, 0x07, 0x80, 0x00, 0x40, 0x00, 0xC0, 0x00, 0xC0, 0x0F, 0x80, 0x07, 0xC0, 0x00, 0x40, 0x00, 0xC0, 0x20, 0xC0, 0x1F, 0x80, 0x0F, // Code for char m
- 0x07, 0x80, 0x0F, 0xC0, 0x07, 0x80, 0x00, 0x40, 0x00, 0xC0, 0x20, 0xC0, 0x1F, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n
- 0x07, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x0C, 0x40, 0x08, 0xC0, 0x08, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o
- 0x08, 0x00, 0x80, 0x80, 0x7F, 0xC0, 0x3F, 0x80, 0x0C, 0x40, 0x08, 0xC0, 0x08, 0x80, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p
- 0x07, 0x00, 0x07, 0x80, 0x0F, 0x40, 0x0C, 0x40, 0x08, 0xC0, 0x08, 0x80, 0xFF, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q
- 0x07, 0x80, 0x0F, 0xC0, 0x07, 0x80, 0x00, 0x40, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r
- 0x07, 0x00, 0x00, 0x80, 0x09, 0xC0, 0x19, 0x40, 0x11, 0x40, 0x13, 0x40, 0x1E, 0x80, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s
- 0x04, 0x40, 0x00, 0xF0, 0x1F, 0xF8, 0x0F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t
- 0x08, 0x80, 0x07, 0xC0, 0x0F, 0x40, 0x0C, 0x00, 0x08, 0x00, 0x08, 0x80, 0x07, 0xC0, 0x0F, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u
- 0x07, 0x80, 0x00, 0xC0, 0x03, 0x00, 0x0F, 0x00, 0x0C, 0x00, 0x03, 0xC0, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v
- 0x0B, 0x80, 0x00, 0xC0, 0x03, 0x00, 0x0F, 0x00, 0x06, 0x80, 0x01, 0xC0, 0x03, 0x00, 0x0F, 0x00, 0x06, 0x00, 0x03, 0xC0, 0x00, 0x20, 0x00, 0x00, 0x00, // Code for char w
- 0x07, 0x40, 0x08, 0xE0, 0x04, 0xC0, 0x03, 0x80, 0x07, 0x80, 0x1E, 0x40, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x
- 0x07, 0x80, 0x00, 0x00, 0x03, 0x00, 0x8C, 0x00, 0x78, 0x00, 0x3E, 0x80, 0x07, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y
- 0x07, 0x40, 0x08, 0xC0, 0x0C, 0x40, 0x0E, 0x40, 0x0B, 0xC0, 0x08, 0x40, 0x0C, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z
- 0x08, 0x80, 0x00, 0x80, 0x00, 0x80, 0x01, 0x78, 0x0F, 0x3C, 0x1E, 0x02, 0x30, 0x02, 0x20, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char {
- 0x02, 0xFC, 0x7F, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
- 0x08, 0x02, 0x20, 0x02, 0x20, 0x06, 0x20, 0x3C, 0x1E, 0x78, 0x0F, 0xC0, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char }
- 0x09, 0x80, 0x00, 0x80, 0x00, 0x40, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x01, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ~
- 0x04, 0xF0, 0x1F, 0xF0, 0x1F, 0xF0, 0x1F, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/donut7x10.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : Donut7x10
-//GLCD FontSize : 7 x 10
-#include "PokittoFonts.h"
-
-const unsigned char fontDonut[] = {
- 7,11,32,1, //width,height,start,only caps
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x04, 0xFF, 0x03, 0xC1, 0x02, 0xC1, 0x02, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x06, 0x0F, 0x00, 0x09, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x09, 0x00, 0x07, 0x00, 0x00, 0x00, // Code for char "
- 0x07, 0xFE, 0x01, 0x33, 0x03, 0x01, 0x02, 0x33, 0x03, 0x01, 0x02, 0x33, 0x03, 0xFE, 0x01, // Code for char #
- 0x07, 0xFC, 0x01, 0x66, 0x03, 0x4B, 0x03, 0x01, 0x02, 0x4B, 0x03, 0x9B, 0x01, 0xFE, 0x00, // Code for char $
- 0x07, 0xFE, 0x01, 0x32, 0x01, 0x12, 0x03, 0xDE, 0x03, 0x46, 0x02, 0x64, 0x02, 0xFC, 0x03, // Code for char %
- 0x07, 0xFE, 0x01, 0x13, 0x03, 0xC9, 0x02, 0x89, 0x02, 0x23, 0x03, 0xDE, 0x02, 0xFC, 0x03, // Code for char &
- 0x03, 0x0F, 0x00, 0x09, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x05, 0xFE, 0x01, 0x03, 0x03, 0x01, 0x02, 0xFD, 0x02, 0x87, 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x05, 0x87, 0x03, 0xFD, 0x02, 0x01, 0x02, 0x03, 0x03, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x06, 0x36, 0x00, 0x49, 0x00, 0x63, 0x00, 0x63, 0x00, 0x49, 0x00, 0x36, 0x00, 0x00, 0x00, // Code for char *
- 0x07, 0x78, 0x00, 0x48, 0x00, 0xCE, 0x01, 0x02, 0x01, 0xCE, 0x01, 0x48, 0x00, 0x78, 0x00, // Code for char +
- 0x03, 0xC0, 0x03, 0x40, 0x02, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x06, 0x70, 0x00, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x70, 0x00, 0x00, 0x00, // Code for char -
- 0x03, 0x80, 0x03, 0x80, 0x02, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x07, 0xC0, 0x03, 0x60, 0x02, 0x1C, 0x03, 0xC7, 0x01, 0x71, 0x00, 0x1D, 0x00, 0x07, 0x00, // Code for char /
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x79, 0x02, 0x79, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 0
- 0x05, 0x0F, 0x00, 0xF9, 0x03, 0x01, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char 1
- 0x06, 0xFF, 0x03, 0x09, 0x02, 0x49, 0x02, 0x49, 0x02, 0x41, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 2
- 0x06, 0xFF, 0x03, 0x49, 0x02, 0x49, 0x02, 0x49, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 3
- 0x06, 0x7F, 0x00, 0x41, 0x00, 0x4F, 0x00, 0xCF, 0x03, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 4
- 0x06, 0xFF, 0x03, 0x41, 0x02, 0x49, 0x02, 0x49, 0x02, 0x09, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 5
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x49, 0x02, 0x49, 0x02, 0x09, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 6
- 0x06, 0x0F, 0x00, 0x09, 0x00, 0x09, 0x00, 0xF9, 0x03, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 7
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x49, 0x02, 0x49, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 8
- 0x06, 0xFF, 0x03, 0x41, 0x02, 0x49, 0x02, 0x49, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char 9
- 0x03, 0x9C, 0x03, 0x94, 0x02, 0x9C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x04, 0x80, 0x03, 0xDC, 0x02, 0x54, 0x03, 0xDC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x06, 0xF0, 0x00, 0x98, 0x01, 0x0C, 0x03, 0x64, 0x02, 0xF4, 0x02, 0x9C, 0x03, 0x00, 0x00, // Code for char <
- 0x06, 0xDC, 0x01, 0x54, 0x01, 0x54, 0x01, 0x54, 0x01, 0x54, 0x01, 0xDC, 0x01, 0x00, 0x00, // Code for char =
- 0x06, 0x9C, 0x03, 0xF4, 0x02, 0x64, 0x02, 0x0C, 0x03, 0x98, 0x01, 0xF0, 0x00, 0x00, 0x00, // Code for char >
- 0x06, 0x1E, 0x00, 0xF3, 0x03, 0x99, 0x02, 0x99, 0x02, 0xC3, 0x03, 0x7E, 0x00, 0x00, 0x00, // Code for char ?
- 0x07, 0xFE, 0x01, 0x03, 0x03, 0x71, 0x02, 0x49, 0x02, 0x49, 0x02, 0x23, 0x03, 0xFE, 0x01, // Code for char @
- 0x06, 0xFE, 0x03, 0x03, 0x02, 0xB1, 0x03, 0xB1, 0x03, 0x03, 0x02, 0xFE, 0x03, 0x00, 0x00, // Code for char A
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x4D, 0x02, 0x4D, 0x02, 0x13, 0x03, 0xFE, 0x01, 0x00, 0x00, // Code for char B
- 0x06, 0xFE, 0x01, 0x03, 0x03, 0x71, 0x02, 0x51, 0x02, 0x51, 0x02, 0xDF, 0x03, 0x00, 0x00, // Code for char C
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x71, 0x02, 0x71, 0x02, 0x03, 0x03, 0xFE, 0x01, 0x00, 0x00, // Code for char D
- 0x06, 0xFE, 0x03, 0x03, 0x02, 0x49, 0x02, 0x49, 0x02, 0x49, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char E
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0xC9, 0x03, 0x49, 0x00, 0x49, 0x00, 0x7F, 0x00, 0x00, 0x00, // Code for char F
- 0x06, 0xFE, 0x01, 0x03, 0x03, 0x71, 0x02, 0x79, 0x02, 0x09, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char G
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0xCF, 0x03, 0xCF, 0x03, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char H
- 0x05, 0xFF, 0x03, 0x79, 0x02, 0x01, 0x02, 0x79, 0x02, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x06, 0xF0, 0x01, 0x1F, 0x03, 0x79, 0x02, 0x79, 0x02, 0x01, 0x03, 0xFF, 0x01, 0x00, 0x00, // Code for char J
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x8F, 0x03, 0xA7, 0x03, 0x21, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char K
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x7F, 0x02, 0x40, 0x02, 0x40, 0x02, 0xC0, 0x03, 0x00, 0x00, // Code for char L
- 0x07, 0xFF, 0x03, 0x01, 0x02, 0xF1, 0x03, 0x02, 0x02, 0xF1, 0x03, 0x01, 0x02, 0xFF, 0x03, // Code for char M
- 0x07, 0xFF, 0x03, 0x01, 0x02, 0xE3, 0x03, 0xC4, 0x00, 0x8F, 0x03, 0x01, 0x02, 0xFF, 0x03, // Code for char N
- 0x06, 0xFE, 0x01, 0x03, 0x03, 0xF1, 0x02, 0xF1, 0x02, 0x03, 0x03, 0xFE, 0x01, 0x00, 0x00, // Code for char O
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x91, 0x03, 0x91, 0x00, 0xC3, 0x00, 0x7E, 0x00, 0x00, 0x00, // Code for char P
- 0x06, 0xFE, 0x00, 0x83, 0x00, 0xB1, 0x01, 0x71, 0x03, 0x03, 0x02, 0xFE, 0x03, 0x00, 0x00, // Code for char Q
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0xB9, 0x03, 0x81, 0x03, 0x23, 0x02, 0xFE, 0x03, 0x00, 0x00, // Code for char R
- 0x06, 0xFE, 0x01, 0x23, 0x03, 0x69, 0x02, 0x69, 0x02, 0x0B, 0x03, 0xFE, 0x01, 0x00, 0x00, // Code for char S
- 0x07, 0x3F, 0x00, 0x31, 0x00, 0xF1, 0x03, 0x01, 0x02, 0xF1, 0x03, 0x31, 0x00, 0x3F, 0x00, // Code for char T
- 0x06, 0xFF, 0x03, 0x01, 0x02, 0x7F, 0x02, 0x7F, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char U
- 0x06, 0xFF, 0x00, 0x81, 0x03, 0x1F, 0x02, 0x1F, 0x02, 0x81, 0x03, 0xFF, 0x00, 0x00, 0x00, // Code for char V
- 0x07, 0xFF, 0x03, 0x01, 0x02, 0x7F, 0x02, 0x01, 0x01, 0x7F, 0x02, 0x01, 0x02, 0xFF, 0x03, // Code for char W
- 0x06, 0xFF, 0x03, 0x31, 0x02, 0xCF, 0x03, 0xCF, 0x03, 0x31, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char X
- 0x06, 0x3F, 0x00, 0xE1, 0x03, 0x0F, 0x02, 0x0F, 0x02, 0xE1, 0x03, 0x3F, 0x00, 0x00, 0x00, // Code for char Y
- 0x06, 0xFF, 0x03, 0x19, 0x02, 0x59, 0x02, 0x69, 0x02, 0x61, 0x02, 0xFF, 0x03, 0x00, 0x00, // Code for char Z
- 0x04, 0xFF, 0x03, 0x01, 0x02, 0x79, 0x02, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x07, 0x07, 0x00, 0x1D, 0x00, 0x71, 0x00, 0xC7, 0x01, 0x1C, 0x03, 0x60, 0x02, 0xC0, 0x03, // Code for char BackSlash
- 0x04, 0xFF, 0x03, 0x79, 0x02, 0x01, 0x02, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char ]
- };
-
-
--- a/POKITTO_CORE/FONTS/dragon6x8.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : Dragon6x8
-//GLCD FontSize : 6 x 8
-#include "PokittoFonts.h"
-
-const unsigned char fontDragon[] = {
- 6,8,32,0, // width, height, start, only caps
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, // Code for char "
- 0x05, 0x74, 0x1C, 0x77, 0x1C, 0x17, 0x00, // Code for char #
- 0x05, 0x04, 0x2A, 0x7F, 0x2A, 0x10, 0x00, // Code for char $
- 0x05, 0x62, 0x10, 0x08, 0x04, 0x23, 0x00, // Code for char %
- 0x05, 0x7A, 0x4D, 0x6B, 0x38, 0x48, 0x00, // Code for char &
- 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0x7E, 0x81, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x02, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x05, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00, // Code for char *
- 0x05, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, // Code for char +
- 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x03, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, // Code for char -
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x03, 0x60, 0x1C, 0x03, 0x00, 0x00, 0x00, // Code for char /
- 0x03, 0x7E, 0x41, 0x3F, 0x00, 0x00, 0x00, // Code for char 0
- 0x02, 0x02, 0x7F, 0x00, 0x00, 0x00, 0x00, // Code for char 1
- 0x03, 0x62, 0x59, 0x47, 0x00, 0x00, 0x00, // Code for char 2
- 0x03, 0x25, 0x47, 0x39, 0x00, 0x00, 0x00, // Code for char 3
- 0x03, 0x18, 0x16, 0x7F, 0x00, 0x00, 0x00, // Code for char 4
- 0x03, 0x27, 0x45, 0x39, 0x00, 0x00, 0x00, // Code for char 5
- 0x03, 0x3E, 0x45, 0x38, 0x00, 0x00, 0x00, // Code for char 6
- 0x03, 0x71, 0x0D, 0x03, 0x00, 0x00, 0x00, // Code for char 7
- 0x03, 0x76, 0x4D, 0x3B, 0x00, 0x00, 0x00, // Code for char 8
- 0x03, 0x0E, 0x51, 0x3E, 0x00, 0x00, 0x00, // Code for char 9
- 0x01, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x04, 0x10, 0x28, 0x28, 0x44, 0x00, 0x00, // Code for char <
- 0x04, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, // Code for char =
- 0x04, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, // Code for char >
- 0x04, 0x02, 0x51, 0x09, 0x07, 0x00, 0x00, // Code for char ?
- 0x06, 0x3C, 0x42, 0x99, 0xA5, 0x32, 0x1C, // Code for char @
- 0x05, 0x82, 0x7F, 0x05, 0x05, 0x7F, 0x00, // Code for char A
- 0x05, 0x81, 0x7F, 0x45, 0x47, 0x7D, 0x00, // Code for char B
- 0x04, 0x3E, 0x41, 0x81, 0x43, 0x00, 0x00, // Code for char C
- 0x05, 0x82, 0x7F, 0x21, 0x11, 0x0F, 0x00, // Code for char D
- 0x05, 0x02, 0x3F, 0x45, 0x85, 0x43, 0x00, // Code for char E
- 0x05, 0x81, 0x7F, 0x05, 0x05, 0x01, 0x00, // Code for char F
- 0x04, 0x1E, 0x21, 0x41, 0xF3, 0x00, 0x00, // Code for char G
- 0x05, 0x81, 0x7F, 0x08, 0x09, 0x7F, 0x00, // Code for char H
- 0x02, 0x82, 0x7F, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x03, 0x82, 0x41, 0x3F, 0x00, 0x00, 0x00, // Code for char J
- 0x05, 0x81, 0x7F, 0x04, 0x0A, 0x71, 0x00, // Code for char K
- 0x05, 0x81, 0xFF, 0x41, 0x40, 0x60, 0x00, // Code for char L
- 0x06, 0x82, 0x7F, 0x02, 0x7F, 0x02, 0x7F, // Code for char M
- 0x05, 0x82, 0x7F, 0x02, 0x01, 0x7F, 0x00, // Code for char N
- 0x04, 0x7E, 0x81, 0x41, 0x3F, 0x00, 0x00, // Code for char O
- 0x05, 0x02, 0x7F, 0x89, 0x05, 0x03, 0x00, // Code for char P
- 0x04, 0x7E, 0xA1, 0x61, 0x9F, 0x00, 0x00, // Code for char Q
- 0x05, 0x82, 0x7F, 0x05, 0x0B, 0x71, 0x00, // Code for char R
- 0x04, 0x22, 0x45, 0x89, 0x73, 0x00, 0x00, // Code for char S
- 0x05, 0x02, 0x41, 0x7F, 0x81, 0x03, 0x00, // Code for char T
- 0x05, 0x02, 0x3F, 0x40, 0x40, 0xFF, 0x00, // Code for char U
- 0x05, 0x02, 0x3F, 0xC0, 0x30, 0x0F, 0x00, // Code for char V
- 0x06, 0x02, 0xFF, 0x40, 0x3C, 0x60, 0x1F, // Code for char W
- 0x05, 0x82, 0x73, 0x0C, 0x0C, 0x73, 0x00, // Code for char X
- 0x05, 0x02, 0x5F, 0x48, 0x84, 0x7F, 0x00, // Code for char Y
- 0x05, 0x42, 0x71, 0x49, 0x47, 0x81, 0x00, // Code for char Z
- 0x02, 0xFF, 0x81, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x03, 0x03, 0x1C, 0x60, 0x00, 0x00, 0x00, // Code for char BackSlash
- 0x02, 0x81, 0xFF, 0x00, 0x00, 0x00, 0x00, // Code for char ]
- 0x05, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, // Code for char ^
- 0x05, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, // Code for char _
- 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, // Code for char `
- 0x03, 0x74, 0x4C, 0x7C, 0x00, 0x00, 0x00, // Code for char a
- 0x03, 0x7F, 0x44, 0x3C, 0x00, 0x00, 0x00, // Code for char b
- 0x02, 0x3C, 0x44, 0x00, 0x00, 0x00, 0x00, // Code for char c
- 0x03, 0x78, 0x44, 0x7F, 0x00, 0x00, 0x00, // Code for char d
- 0x03, 0x38, 0x54, 0x1C, 0x00, 0x00, 0x00, // Code for char e
- 0x02, 0x7E, 0x09, 0x00, 0x00, 0x00, 0x00, // Code for char f
- 0x03, 0x38, 0xA4, 0x7C, 0x00, 0x00, 0x00, // Code for char g
- 0x03, 0x7F, 0x08, 0x7C, 0x00, 0x00, 0x00, // Code for char h
- 0x01, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
- 0x02, 0x80, 0x7D, 0x00, 0x00, 0x00, 0x00, // Code for char j
- 0x03, 0x7F, 0x08, 0x74, 0x00, 0x00, 0x00, // Code for char k
- 0x01, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
- 0x05, 0x7C, 0x08, 0x7C, 0x08, 0x7C, 0x00, // Code for char m
- 0x04, 0x08, 0x7C, 0x04, 0x78, 0x00, 0x00, // Code for char n
- 0x03, 0x78, 0x44, 0x3C, 0x00, 0x00, 0x00, // Code for char o
- 0x03, 0xFC, 0x24, 0x1C, 0x00, 0x00, 0x00, // Code for char p
- 0x03, 0x38, 0x24, 0xFC, 0x00, 0x00, 0x00, // Code for char q
- 0x03, 0x7C, 0x08, 0x1C, 0x00, 0x00, 0x00, // Code for char r
- 0x02, 0x4C, 0x34, 0x00, 0x00, 0x00, 0x00, // Code for char s
- 0x02, 0x3E, 0x44, 0x00, 0x00, 0x00, 0x00, // Code for char t
- 0x03, 0x3C, 0x40, 0x7C, 0x00, 0x00, 0x00, // Code for char u
- 0x03, 0x7C, 0x20, 0x1C, 0x00, 0x00, 0x00, // Code for char v
- 0x05, 0x1C, 0x60, 0x1C, 0x60, 0x1C, 0x00, // Code for char w
- 0x03, 0x64, 0x18, 0x64, 0x00, 0x00, 0x00, // Code for char x
- 0x03, 0x3C, 0x90, 0x7C, 0x00, 0x00, 0x00, // Code for char y
- 0x03, 0x64, 0x54, 0x4C, 0x00, 0x00, 0x00, // Code for char z
- 0x03, 0x18, 0x7E, 0x81, 0x00, 0x00, 0x00, // Code for char {
- 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
- 0x03, 0x81, 0x7E, 0x18, 0x00, 0x00, 0x00, // Code for char }
- 0x05, 0x00, 0x10, 0x08, 0x10, 0x08, 0x00, // Code for char ~
- 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/font3x3.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * (C) Copyright 2014 Aurélien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifndef FONT3x3_C
-#define FONT3x3_C
-
-#include <stdint.h> //jonne
-#include "PokittoFonts.h"
-
-//standard ascii 3x3font
-#define PROGMEM
-const uint8_t font3x3[] PROGMEM = {
- 3,3,0,0,//width and height
- 3,0x07, 0x05, 0x07, // 0
- 3,0x05, 0x04, 0x05, // 1
- 3,0x05, 0x04, 0x05, // 2
- 3,0x03, 0x06, 0x03, // 3
- 3,0x02, 0x07, 0x02, // 4
- 3,0x02, 0x01, 0x02, // 5
- 3,0x02, 0x03, 0x02, // 6
- 3,0x0E, 0x09, 0x0E, // 7
- 3,0x0E, 0x0D, 0x0E, // 8
- 3,0x0E, 0x0F, 0x0E, // 9
- 3,0x07, 0x05, 0x07, // 10
- 3,0x05, 0x03, 0x07, // 11
- 3,0x05, 0x0F, 0x05, // 12
- 3,0x07, 0x05, 0x07, // 13
- 3,0x06, 0x07, 0x01, // 14
- 3,0x02, 0x05, 0x02, // 15
- 3,0x00, 0x07, 0x02, // 16
- 3,0x02, 0x07, 0x00, // 17
- 3,0x02, 0x07, 0x02, // 18
- 3,0x00, 0x02, 0x07, // 19
- 3,0x02, 0x00, 0x07, // 20
- 3,0x06, 0x03, 0x06, // 21
- 3,0x07, 0x07, 0x02, // 22
- 3,0x02, 0x05, 0x05, // 23
- 3,0x02, 0x01, 0x02, // 24
- 3,0x02, 0x04, 0x02, // 25
- 3,0x00, 0x05, 0x02, // 26
- 3,0x02, 0x05, 0x00, // 27
- 3,0x06, 0x07, 0x05, // 28
- 3,0x05, 0x07, 0x05, // 29
- 3,0x02, 0x03, 0x02, // 30
- 3,0x02, 0x06, 0x02, // 31
- 3,0x00, 0x00, 0x00, // 32
- 3,0x00, 0x0B, 0x00, // 33
- 3,0x03, 0x00, 0x03, // 34
- 3,0x07, 0x05, 0x07, // 35
- 3,0x04, 0x07, 0x01, // 36
- 3,0x05, 0x02, 0x05, // 37
- 3,0x07, 0x07, 0x04, // 38
- 3,0x00, 0x03, 0x00, // 39
- 3,0x00, 0x07, 0x05, // 40
- 3,0x05, 0x07, 0x00, // 41
- 3,0x05, 0x00, 0x05, // 42
- 3,0x02, 0x07, 0x02, // 43
- 3,0x00, 0x0C, 0x00, // 44
- 3,0x02, 0x02, 0x02, // 45
- 3,0x00, 0x04, 0x00, // 46
- 3,0x04, 0x02, 0x01, // 47
- 3,0x07, 0x05, 0x07, // 48
- 3,0x05, 0x07, 0x04, // 49
- 3,0x01, 0x07, 0x04, // 50
- 3,0x05, 0x07, 0x02, // 51
- 3,0x03, 0x02, 0x07, // 52
- 3,0x04, 0x07, 0x01, // 53
- 3,0x07, 0x06, 0x06, // 54
- 3,0x01, 0x01, 0x07, // 55
- 3,0x07, 0x07, 0x07, // 56
- 3,0x03, 0x03, 0x07, // 57
- 3,0x00, 0x05, 0x00, // 58
- 3,0x00, 0x0D, 0x00, // 59
- 3,0x02, 0x05, 0x00, // 60
- 3,0x05, 0x05, 0x05, // 61
- 3,0x00, 0x05, 0x02, // 62
- 3,0x01, 0x07, 0x03, // 63
- 3,0x0F, 0x09, 0x03, // 64
- 3,0x06, 0x03, 0x06, // 65
- 3,0x07, 0x07, 0x02, // 66
- 3,0x02, 0x05, 0x05, // 67
- 3,0x07, 0x07, 0x02, // 68
- 3,0x07, 0x07, 0x05, // 69
- 3,0x07, 0x03, 0x01, // 70
- 3,0x07, 0x05, 0x06, // 71
- 3,0x07, 0x02, 0x07, // 72
- 3,0x05, 0x07, 0x05, // 73
- 3,0x04, 0x04, 0x03, // 74
- 3,0x07, 0x02, 0x05, // 75
- 3,0x07, 0x04, 0x04, // 76
- 3,0x07, 0x03, 0x07, // 77
- 3,0x07, 0x01, 0x06, // 78
- 3,0x07, 0x05, 0x07, // 79
- 3,0x07, 0x03, 0x03, // 80
- 3,0x07, 0x05, 0x03, // 81
- 3,0x07, 0x03, 0x06, // 82
- 3,0x04, 0x07, 0x01, // 83
- 3,0x01, 0x07, 0x01, // 84
- 3,0x07, 0x04, 0x07, // 85
- 3,0x03, 0x04, 0x03, // 86
- 3,0x07, 0x06, 0x07, // 87
- 3,0x05, 0x02, 0x05, // 88
- 3,0x01, 0x06, 0x01, // 89
- 3,0x01, 0x07, 0x04, // 90
- 3,0x00, 0x07, 0x05, // 91
- 3,0x01, 0x02, 0x04, // 92
- 3,0x05, 0x07, 0x00, // 93
- 3,0x02, 0x01, 0x02, // 94
- 3,0x08, 0x08, 0x08, // 95
- 3,0x00, 0x03, 0x00, // 96
- 3,0x06, 0x03, 0x06, // 97
- 3,0x07, 0x07, 0x02, // 98
- 3,0x02, 0x05, 0x05, // 99
- 3,0x07, 0x05, 0x02, // 100
- 3,0x07, 0x07, 0x05, // 101
- 3,0x07, 0x03, 0x01, // 102
- 3,0x07, 0x05, 0x06, // 103
- 3,0x07, 0x02, 0x07, // 104
- 3,0x05, 0x07, 0x05, // 105
- 3,0x04, 0x04, 0x03, // 106
- 3,0x07, 0x02, 0x05, // 107
- 3,0x07, 0x04, 0x04, // 108
- 3,0x07, 0x03, 0x07, // 109
- 3,0x07, 0x01, 0x06, // 110
- 3,0x07, 0x05, 0x07, // 111
- 3,0x07, 0x03, 0x03, // 112
- 3,0x07, 0x05, 0x03, // 113
- 3,0x07, 0x03, 0x06, // 114
- 3,0x04, 0x07, 0x01, // 115
- 3,0x01, 0x07, 0x01, // 116
- 3,0x07, 0x04, 0x07, // 117
- 3,0x03, 0x04, 0x03, // 118
- 3,0x07, 0x06, 0x07, // 119
- 3,0x05, 0x02, 0x05, // 120
- 3,0x01, 0x06, 0x01, // 121
- 3,0x01, 0x07, 0x04, // 122
- 3,0x02, 0x07, 0x05, // 123
- 3,0x00, 0x07, 0x00, // 124
- 3,0x05, 0x07, 0x02, // 125
- 3,0x06, 0x02, 0x03, // 126
- 3,0x07, 0x05, 0x07 // 127
-};
-
-#endif
-
--- a/POKITTO_CORE/FONTS/font3x5.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * (C) Copyright 2014 Aurélien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifndef FONT3X5_C
-#define FONT3X5_C
-
-#include <stdint.h>
-#include "PokittoFonts.h"
-
-#define PROGMEM
-
-const uint8_t font3x5[] PROGMEM = {
- 3,5,0,0, //width and height, start char and only caps
- 3, 0x3F, 0x21, 0x3F, // 0
- 3,0x12, 0x08, 0x12, // 1
- 3,0x0A, 0x10, 0x0A, // 2
- 3,0x0E, 0x1C, 0x0E, // 3
- 3,0x0C, 0x1E, 0x0C, // 4
- 3,0x14, 0x1A, 0x14, // 5
- 3,0x16, 0x1F, 0x16, // 6
- 3,0x1E, 0x13, 0x1E, // 7
- 3,0x1E, 0x1B, 0x1E, // 8
- 3,0x1E, 0x1F, 0x1E, // 9
- 3,0x3F, 0x21, 0x3F, // 10
- 3,0x3A, 0x2F, 0x3A, // 11
- 3,0x17, 0x3D, 0x17, // 12
- 3,0x3F, 0x21, 0x3F, // 13
- 3,0x18, 0x1F, 0x02, // 14
- 3,0x04, 0x0A, 0x04, // 15
- 3,0x1F, 0x0E, 0x04, // 16
- 3,0x04, 0x0E, 0x1F, // 17
- 3,0x0A, 0x1F, 0x0A, // 18
- 3,0x0E, 0x0E, 0x1F, // 19
- 3,0x04, 0x11, 0x0E, // 20
- 3,0x2E, 0x25, 0x2E, // 21
- 3,0x2F, 0x2A, 0x2E, // 22
- 3,0x26, 0x29, 0x29, // 23
- 3,0x02, 0x1F, 0x02, // 24
- 3,0x08, 0x1F, 0x08, // 25
- 3,0x15, 0x0E, 0x04, // 26
- 3,0x04, 0x0E, 0x15, // 27
- 3,0x0E, 0x15, 0x15, // 28
- 3,0x1B, 0x15, 0x1B, // 29
- 3,0x04, 0x06, 0x04, // 30
- 3,0x04, 0x0C, 0x04, // 31
- 3,0x00, 0x00, 0x00, // 32
- 3,0x00, 0x17, 0x00, // 33
- 3,0x03, 0x00, 0x03, // 34
- 3,0x1F, 0x0A, 0x1F, // 35
- 3,0x16, 0x37, 0x1A, // 36
- 3,0x19, 0x04, 0x13, // 37
- 3,0x0A, 0x15, 0x3A, // 38
- 3,0x00, 0x03, 0x00, // 39
- 3,0x00, 0x0E, 0x11, // 40
- 3,0x11, 0x0E, 0x00, // 41
- 3,0x0A, 0x04, 0x0A, // 42
- 3,0x04, 0x0E, 0x04, // 43
- 3,0x00, 0x30, 0x00, // 44
- 3,0x04, 0x04, 0x04, // 45
- 3,0x00, 0x10, 0x00, // 46
- 3,0x18, 0x04, 0x03, // 47
- 3,0x1F, 0x11, 0x1F, // 48
- 3,0x12, 0x1F, 0x10, // 49
- 3,0x1D, 0x15, 0x17, // 50
- 3,0x11, 0x15, 0x1F, // 51
- 3,0x07, 0x04, 0x1F, // 52
- 3,0x17, 0x15, 0x1D, // 53
- 3,0x1F, 0x15, 0x1D, // 54
- 3,0x01, 0x01, 0x1F, // 55
- 3,0x1F, 0x15, 0x1F, // 56
- 3,0x17, 0x15, 0x1F, // 57
- 3,0x00, 0x0A, 0x00, // 58
- 3,0x00, 0x32, 0x00, // 59
- 3,0x04, 0x0A, 0x11, // 60
- 3,0x0A, 0x0A, 0x0A, // 61
- 3,0x11, 0x0A, 0x04, // 62
- 3,0x01, 0x15, 0x02, // 63
- 3,0x0E, 0x11, 0x17, // 64
- 3,0x1E, 0x05, 0x1E, // 65
- 3,0x1F, 0x15, 0x0A, // 66
- 3,0x0E, 0x11, 0x0A, // 67
- 3,0x1F, 0x11, 0x0E, // 68
- 3,0x1F, 0x15, 0x11, // 69
- 3,0x1F, 0x05, 0x01, // 70
- 3,0x0E, 0x11, 0x1D, // 71
- 3,0x1F, 0x04, 0x1F, // 72
- 3,0x11, 0x1F, 0x11, // 73
- 3,0x08, 0x10, 0x0F, // 74
- 3,0x1F, 0x04, 0x1B, // 75
- 3,0x1F, 0x10, 0x10, // 76
- 3,0x1F, 0x06, 0x1F, // 77
- 3,0x1E, 0x04, 0x0F, // 78
- 3,0x0E, 0x11, 0x0E, // 79
- 3,0x1F, 0x09, 0x06, // 80
- 3,0x0E, 0x11, 0x2E, // 81
- 3,0x1F, 0x05, 0x1A, // 82
- 3,0x12, 0x15, 0x09, // 83
- 3,0x01, 0x1F, 0x01, // 84
- 3,0x1F, 0x10, 0x1F, // 85
- 3,0x0F, 0x18, 0x0F, // 86
- 3,0x1F, 0x0C, 0x1F, // 87
- 3,0x1B, 0x04, 0x1B, // 88
- 3,0x03, 0x1C, 0x03, // 89
- 3,0x19, 0x15, 0x13, // 90
- 3,0x00, 0x1F, 0x11, // 91
- 3,0x03, 0x04, 0x18, // 92
- 3,0x11, 0x1F, 0x00, // 93
- 3,0x02, 0x01, 0x02, // 94
- 3,0x20, 0x20, 0x20, // 95
- 3,0x00, 0x01, 0x02, // 96
- 3,0x0C, 0x12, 0x1E, // 97
- 3,0x1F, 0x12, 0x0C, // 98
- 3,0x0C, 0x12, 0x12, // 99
- 3,0x0C, 0x12, 0x1F, // 100
- 3,0x0C, 0x1A, 0x14, // 101
- 3,0x04, 0x1E, 0x05, // 102
- 3,0x24, 0x2A, 0x1E, // 103
- 3,0x1F, 0x02, 0x1C, // 104
- 3,0x14, 0x1D, 0x10, // 105
- 3,0x20, 0x20, 0x1D, // 106
- 3,0x1F, 0x08, 0x14, // 107
- 3,0x11, 0x1F, 0x10, // 108
- 3,0x1E, 0x04, 0x1E, // 109
- 3,0x1E, 0x02, 0x1C, // 110
- 3,0x0C, 0x12, 0x0C, // 111
- 3,0x3E, 0x0A, 0x04, // 112
- 3,0x0C, 0x12, 0x3E, // 113
- 3,0x1E, 0x04, 0x02, // 114
- 3,0x14, 0x16, 0x0A, // 115
- 3,0x02, 0x0F, 0x12, // 116
- 3,0x0E, 0x10, 0x1E, // 117
- 3,0x0E, 0x10, 0x0E, // 118
- 3,0x1E, 0x08, 0x1E, // 119
- 3,0x12, 0x0C, 0x12, // 120
- 3,0x26, 0x28, 0x1E, // 121
- 3,0x32, 0x2A, 0x26, // 122
- 3,0x04, 0x1E, 0x21, // 123
- 3,0x00, 0x1F, 0x00, // 124
- 3,0x21, 0x1E, 0x04, // 125
- 3,0x01, 0x02, 0x01, // 126
- 3,0x3F, 0x21, 0x3F // 127
-};
-
-#endif
-
--- a/POKITTO_CORE/FONTS/font5x7.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*
- * (C) Copyright 2014 Aurélien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifndef FONT5X7_C
-#define FONT5X7_C
-
-#include <stdint.h>
-#include "PokittoFonts.h"
-
-#define PROGMEM
-
-
-// standard ascii 5x7 font
-const uint8_t font5x7[] PROGMEM = {
- 5,7,0,0, // width and height, start char and only caps ?
- 5, 0x7F, 0x41, 0x41, 0x41, 0x7F, // 0
- 5, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, // 1 sad
- 5, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, // 2 happy
- 5, 0x18, 0x3C, 0x78, 0x3C, 0x18, // 3 heart
- 5, 0x18, 0x3C, 0x7E, 0x3C, 0x18, // 4 diamond
- 5, 0x1C, 0x57, 0x7D, 0x57, 0x1C, // 5 clover
- 5, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, // 6 spade
- 5, 0x00, 0x7E, 0x43, 0x43, 0x7E, // 7 bat low
- 5, 0x00, 0x7E, 0x73, 0x73, 0x7E, // 8 bat med
- 5, 0x00, 0x7E, 0x7F, 0x7F, 0x7E, // 9 bat high
- 5, 0x7F, 0x41, 0x41, 0x41, 0x7F, // 10 line feed
- 5, 0x30, 0x48, 0x3A, 0x06, 0x0E, // 11 male
- 5, 0x06, 0x29, 0x79, 0x29, 0x06, // 12 female
- 5, 0x7F, 0x41, 0x41, 0x41, 0x7F, // 13 carriage return
- 5, 0x60, 0x70, 0x3F, 0x02, 0x04, // 14 note
- 5, 0x2A, 0x1C, 0x36, 0x1C, 0x2A, // 15 sun
- 5, 0x7F, 0x3E, 0x1C, 0x08, 0x00, // 16 right triangle
- 5, 0x00, 0x08, 0x1C, 0x3E, 0x7F, // 17 left triangle
- 5, 0x14, 0x22, 0x7F, 0x22, 0x14, // 18 double arrow
- 5, 0x3C, 0x3C, 0x3C, 0x7E, 0xFF, // 19 speaker
- 5, 0x18, 0x42, 0x3C, 0x81, 0x7E, // 20 sound
- 5, 0x3E, 0x63, 0x75, 0x63, 0x3E, // 21 A button
- 5, 0x3E, 0x61, 0x6B, 0x63, 0x3E, // 22 B button
- 5, 0x3E, 0x63, 0x6B, 0x6B, 0x3E, // 23 C button
- 5, 0x04, 0x02, 0x7F, 0x02, 0x04, // 24 up arrow
- 5, 0x10, 0x20, 0x7F, 0x20, 0x10, // 25 down arrow
- 5, 0x08, 0x08, 0x2A, 0x1C, 0x08, // 26 right arrow
- 5, 0x08, 0x1C, 0x2A, 0x08, 0x08, // 27 left arrow
- 5, 0x14, 0x3E, 0x55, 0x41, 0x22, // 28 euro
- 5, 0x63, 0x75, 0x69, 0x75, 0x63, // 29 timer
- 5, 0x10, 0x18, 0x1C, 0x18, 0x10, // 30 up triangle
- 5, 0x04, 0x0C, 0x1C, 0x0C, 0x04, // 31 down triangle
- 5, 0x00, 0x00, 0x00, 0x00, 0x00, // 32 space
- 5, 0x00, 0x00, 0x5F, 0x00, 0x00, // 33
- 5, 0x00, 0x07, 0x00, 0x07, 0x00, // 34
- 5, 0x14, 0x7F, 0x14, 0x7F, 0x14, // 35
- 5, 0x04, 0x2A, 0x7F, 0x2A, 0x10, // 36
- 5, 0x23, 0x13, 0x08, 0x64, 0x62, // 37
- 5, 0x36, 0x49, 0x56, 0x20, 0x50, // 38
- 5, 0x00, 0x08, 0x07, 0x03, 0x00, // 39
- 5, 0x00, 0x1C, 0x22, 0x41, 0x00, // 40
- 5, 0x00, 0x41, 0x22, 0x1C, 0x00, // 41
- 5, 0x2A, 0x1C, 0x3E, 0x1C, 0x2A, // 42
- 5, 0x08, 0x08, 0x3E, 0x08, 0x08, // 43
- 5, 0x00, 0xE0, 0x60, 0x00, 0x00, // 44
- 5, 0x08, 0x08, 0x08, 0x08, 0x08, // 45
- 5, 0x00, 0x60, 0x60, 0x00, 0x00, // 46
- 5, 0x60, 0x10, 0x08, 0x04, 0x03, // 47
- 5, 0x3E, 0x51, 0x49, 0x45, 0x3E, // 48 0
- 5, 0x00, 0x42, 0x7F, 0x40, 0x00, // 49 1
- 5, 0x62, 0x51, 0x49, 0x49, 0x46, // 50 2
- 5, 0x21, 0x41, 0x49, 0x4D, 0x33, // 51 3
- 5, 0x18, 0x14, 0x12, 0x7F, 0x10, // 52 4
- 5, 0x27, 0x45, 0x45, 0x45, 0x39, // 53 5
- 5, 0x3C, 0x4A, 0x49, 0x49, 0x30, // 54 6
- 5, 0x41, 0x21, 0x11, 0x09, 0x07, // 55 7
- 5, 0x36, 0x49, 0x49, 0x49, 0x36, // 56 8
- 5, 0x06, 0x49, 0x49, 0x29, 0x1E, // 57 9
- 5, 0x00, 0x00, 0x24, 0x00, 0x00, // 58
- 5, 0x00, 0x80, 0x64, 0x00, 0x00, // 59
- 5, 0x08, 0x14, 0x22, 0x41, 0x00, // 60
- 5, 0x14, 0x14, 0x14, 0x14, 0x14, // 61
- 5, 0x00, 0x41, 0x22, 0x14, 0x08, // 62
- 5, 0x02, 0x01, 0x59, 0x09, 0x06, // 63
- 5, 0x3E, 0x41, 0x5D, 0x59, 0x4E, // 64
- 5, 0x7C, 0x12, 0x11, 0x12, 0x7C, // 65 A
- 5, 0x7F, 0x49, 0x49, 0x49, 0x36, // 66 B
- 5, 0x3E, 0x41, 0x41, 0x41, 0x22, // 67 C
- 5, 0x7F, 0x41, 0x41, 0x22, 0x1C, // 68 D
- 5, 0x7F, 0x49, 0x49, 0x49, 0x41, // 69 E
- 5, 0x7F, 0x09, 0x09, 0x09, 0x01, // 70 F
- 5, 0x3E, 0x41, 0x41, 0x51, 0x32, // 71 G
- 5, 0x7F, 0x08, 0x08, 0x08, 0x7F, // 72 H
- 5, 0x00, 0x41, 0x7F, 0x41, 0x00, // 73 I
- 5, 0x20, 0x41, 0x41, 0x3F, 0x01, // 74 J
- 5, 0x7F, 0x08, 0x14, 0x22, 0x41, // 75 K
- 5, 0x7F, 0x40, 0x40, 0x40, 0x40, // 76 L
- 5, 0x7F, 0x02, 0x0C, 0x02, 0x7F, // 77 M
- 5, 0x7F, 0x02, 0x04, 0x08, 0x7F, // 78 N
- 5, 0x3E, 0x41, 0x41, 0x41, 0x3E, // 79 O
- 5, 0x7F, 0x09, 0x09, 0x09, 0x06, // 80 P
- 5, 0x3E, 0x41, 0x61, 0x41, 0xBE, // 81 Q
- 5, 0x7F, 0x09, 0x19, 0x29, 0x46, // 82 R
- 5, 0x26, 0x49, 0x49, 0x49, 0x32, // 83 S
- 5, 0x01, 0x01, 0x7F, 0x01, 0x01, // 84 T
- 5, 0x3F, 0x40, 0x40, 0x40, 0x3F, // 85 U
- 5, 0x1F, 0x20, 0x40, 0x20, 0x1F, // 86 V
- 5, 0x3F, 0x40, 0x38, 0x40, 0x3F, // 87 W
- 5, 0x63, 0x14, 0x08, 0x14, 0x63, // 88 X
- 5, 0x03, 0x04, 0x78, 0x04, 0x03, // 89 Y
- 5, 0x61, 0x51, 0x49, 0x45, 0x43, // 90 Z
- 5, 0x00, 0x7F, 0x41, 0x41, 0x00, // 91
- 5, 0x03, 0x04, 0x08, 0x10, 0x60, // 92
- 5, 0x00, 0x41, 0x41, 0x7F, 0x00, // 93
- 5, 0x04, 0x02, 0x01, 0x02, 0x04, // 94
- 5, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
- 5, 0x00, 0x03, 0x07, 0x08, 0x00, // 96
- 5, 0x20, 0x54, 0x54, 0x78, 0x40, // 97 a
- 5, 0x7F, 0x28, 0x44, 0x44, 0x38, // 98 b
- 5, 0x38, 0x44, 0x44, 0x44, 0x28, // 99 c
- 5, 0x38, 0x44, 0x44, 0x28, 0x7F, // 100 d
- 5, 0x38, 0x54, 0x54, 0x54, 0x18, // 101 e
- 5, 0x08, 0x7E, 0x09, 0x09, 0x02, // 102 f
- 5, 0x18, 0xA4, 0xA4, 0x9C, 0x78, // 103 g
- 5, 0x7F, 0x08, 0x04, 0x04, 0x78, // 104 h
- 5, 0x00, 0x44, 0x7D, 0x40, 0x00, // 105 i
- 5, 0x00, 0x60, 0x80, 0x84, 0x7D, // 106 j
- 5, 0x7F, 0x10, 0x10, 0x28, 0x44, // 107 k
- 5, 0x00, 0x41, 0x7F, 0x40, 0x00, // 108 l
- 5, 0x7C, 0x04, 0x78, 0x04, 0x78, // 109 m
- 5, 0x7C, 0x08, 0x04, 0x04, 0x78, // 110 n
- 5, 0x38, 0x44, 0x44, 0x44, 0x38, // 111 o
- 5, 0xFC, 0x18, 0x24, 0x24, 0x18, // 112 p
- 5, 0x18, 0x24, 0x24, 0x18, 0xFC, // 113 q
- 5, 0x7C, 0x08, 0x04, 0x04, 0x08, // 114 r
- 5, 0x08, 0x54, 0x54, 0x54, 0x20, // 115 s
- 5, 0x04, 0x3F, 0x44, 0x44, 0x20, // 116 t
- 5, 0x3C, 0x40, 0x40, 0x20, 0x7C, // 117 u
- 5, 0x1C, 0x20, 0x40, 0x20, 0x1C, // 118 v
- 5, 0x3C, 0x40, 0x20, 0x40, 0x3C, // 119 w
- 5, 0x44, 0x28, 0x10, 0x28, 0x44, // 120 x
- 5, 0x4C, 0x90, 0x90, 0x90, 0x7C, // 121 y
- 5, 0x44, 0x64, 0x54, 0x4C, 0x44, // 122 z
- 5, 0x00, 0x08, 0x36, 0x41, 0x00, // 123
- 5, 0x00, 0x00, 0x7F, 0x00, 0x00, // 124
- 5, 0x00, 0x41, 0x36, 0x08, 0x00, // 125
- 5, 0x18, 0x04, 0x08, 0x10, 0x0C, // 126
- 5, 0x7F, 0x41, 0x41, 0x41, 0x7F // 127
-};
-
-#endif
-
--- a/POKITTO_CORE/FONTS/fontC64.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-
-//WARNING: This Font is usable only with MikroE GLCD Lib.
-// X-GLCD Lib does not handle this font.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroeElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : C64Font8x8
-//GLCD FontSize : 8 x 8
-#include "PokittoFonts.h"
-
-const unsigned char fontC64[] = {
- 8,8,32,0, // width, height, start character, only caps
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x08, 0x00, 0x00, 0x00, 0x4F, 0x4F, 0x00, 0x00, 0x00, // Code for char !
- 0x08, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x00, // Code for char "
- 0x08, 0x14, 0x7F, 0x7F, 0x14, 0x14, 0x7F, 0x7F, 0x14, // Code for char #
- 0x08, 0x00, 0x24, 0x2E, 0x6B, 0x6B, 0x3A, 0x12, 0x00, // Code for char $
- 0x08, 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00, // Code for char %
- 0x08, 0x00, 0x32, 0x7F, 0x4D, 0x4D, 0x77, 0x72, 0x50, // Code for char &
- 0x08, 0x00, 0x00, 0x00, 0x04, 0x06, 0x03, 0x01, 0x00, // Code for char '
- 0x08, 0x00, 0x00, 0x1C, 0x3E, 0x63, 0x41, 0x00, 0x00, // Code for char (
- 0x08, 0x00, 0x00, 0x41, 0x63, 0x3E, 0x1C, 0x00, 0x00, // Code for char )
- 0x08, 0x08, 0x2A, 0x3E, 0x1C, 0x1C, 0x3E, 0x2A, 0x08, // Code for char *
- 0x08, 0x00, 0x08, 0x08, 0x3E, 0x3E, 0x08, 0x08, 0x00, // Code for char +
- 0x08, 0x00, 0x00, 0x80, 0xE0, 0x60, 0x00, 0x00, 0x00, // Code for char ,
- 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, // Code for char -
- 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // Code for char .
- 0x08, 0x00, 0x40, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, // Code for char /
- 0x08, 0x00, 0x3E, 0x7F, 0x49, 0x45, 0x7F, 0x3E, 0x00, // Code for char 0
- 0x08, 0x00, 0x40, 0x44, 0x7F, 0x7F, 0x40, 0x40, 0x00, // Code for char 1
- 0x08, 0x00, 0x62, 0x73, 0x51, 0x49, 0x4F, 0x46, 0x00, // Code for char 2
- 0x08, 0x00, 0x22, 0x63, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char 3
- 0x08, 0x00, 0x00, 0x18, 0x14, 0x16, 0x7F, 0x7F, 0x10, // Code for char 4
- 0x08, 0x00, 0x27, 0x67, 0x45, 0x45, 0x7D, 0x39, 0x00, // Code for char 5
- 0x08, 0x00, 0x3E, 0x7F, 0x49, 0x49, 0x7B, 0x32, 0x00, // Code for char 6
- 0x08, 0x00, 0x03, 0x03, 0x79, 0x7D, 0x07, 0x03, 0x00, // Code for char 7
- 0x08, 0x00, 0x36, 0x7F, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char 8
- 0x08, 0x00, 0x26, 0x6F, 0x49, 0x49, 0x7F, 0x3E, 0x00, // Code for char 9
- 0x08, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, // Code for char :
- 0x08, 0x00, 0x00, 0x80, 0xE4, 0x64, 0x00, 0x00, 0x00, // Code for char ;
- 0x08, 0x00, 0x08, 0x1C, 0x36, 0x63, 0x41, 0x41, 0x00, // Code for char <
- 0x08, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, // Code for char =
- 0x08, 0x00, 0x41, 0x41, 0x63, 0x36, 0x1C, 0x08, 0x00, // Code for char >
- 0x08, 0x00, 0x02, 0x03, 0x51, 0x59, 0x0F, 0x06, 0x00, // Code for char ?
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x4D, 0x6F, 0x2E, 0x00, // Code for char @
- 0x08, 0x00, 0x7C, 0x7E, 0x0B, 0x0B, 0x7E, 0x7C, 0x00, // Code for char A
- 0x08, 0x00, 0x7F, 0x7F, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char B
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x41, 0x63, 0x22, 0x00, // Code for char C
- 0x08, 0x00, 0x7F, 0x7F, 0x41, 0x63, 0x3E, 0x1C, 0x00, // Code for char D
- 0x08, 0x00, 0x7F, 0x7F, 0x49, 0x49, 0x41, 0x41, 0x00, // Code for char E
- 0x08, 0x00, 0x7F, 0x7F, 0x09, 0x09, 0x01, 0x01, 0x00, // Code for char F
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x49, 0x7B, 0x3A, 0x00, // Code for char G
- 0x08, 0x00, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, // Code for char H
- 0x08, 0x00, 0x00, 0x41, 0x7F, 0x7F, 0x41, 0x00, 0x00, // Code for char I
- 0x08, 0x00, 0x20, 0x61, 0x41, 0x7F, 0x3F, 0x01, 0x00, // Code for char J
- 0x08, 0x00, 0x7F, 0x7F, 0x1C, 0x36, 0x63, 0x41, 0x00, // Code for char K
- 0x08, 0x00, 0x7F, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char L
- 0x08, 0x00, 0x7F, 0x7F, 0x06, 0x0C, 0x06, 0x7F, 0x7F, // Code for char M
- 0x08, 0x00, 0x7F, 0x7F, 0x0E, 0x1C, 0x7F, 0x7F, 0x00, // Code for char N
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x41, 0x7F, 0x3E, 0x00, // Code for char O
- 0x08, 0x00, 0x7F, 0x7F, 0x09, 0x09, 0x0F, 0x06, 0x00, // Code for char P
- 0x08, 0x00, 0x1E, 0x3F, 0x21, 0x61, 0x7F, 0x5E, 0x00, // Code for char Q
- 0x08, 0x00, 0x7F, 0x7F, 0x19, 0x39, 0x6F, 0x46, 0x00, // Code for char R
- 0x08, 0x00, 0x26, 0x6F, 0x49, 0x49, 0x7B, 0x32, 0x00, // Code for char S
- 0x08, 0x00, 0x01, 0x01, 0x7F, 0x7F, 0x01, 0x01, 0x00, // Code for char T
- 0x08, 0x00, 0x3F, 0x7F, 0x40, 0x40, 0x7F, 0x3F, 0x00, // Code for char U
- 0x08, 0x00, 0x1F, 0x3F, 0x60, 0x60, 0x3F, 0x1F, 0x00, // Code for char V
- 0x08, 0x00, 0x7F, 0x7F, 0x30, 0x18, 0x30, 0x7F, 0x7F, // Code for char W
- 0x08, 0x00, 0x63, 0x77, 0x1C, 0x1C, 0x77, 0x63, 0x00, // Code for char X
- 0x08, 0x00, 0x07, 0x0F, 0x78, 0x78, 0x0F, 0x07, 0x00, // Code for char Y
- 0x08, 0x00, 0x61, 0x71, 0x59, 0x4D, 0x47, 0x43, 0x00, // Code for char Z
- 0x08, 0x00, 0x00, 0x7F, 0x7F, 0x41, 0x41, 0x00, 0x00, // Code for char [
- 0x08, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00, // Code for char BackSlash
- 0x08, 0x00, 0x00, 0x41, 0x41, 0x7F, 0x7F, 0x00, 0x00, // Code for char ]
- 0x08, 0x00, 0x08, 0x0C, 0xFE, 0xFE, 0x0C, 0x08, 0x00, // Code for char ^
- 0x08, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char _
- 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x04, 0x00, // Code for char `
- 0x08, 0x00, 0x20, 0x74, 0x54, 0x54, 0x7C, 0x78, 0x00, // Code for char a
- 0x08, 0x00, 0x7E, 0x7E, 0x48, 0x48, 0x78, 0x30, 0x00, // Code for char b
- 0x08, 0x00, 0x38, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, // Code for char c
- 0x08, 0x00, 0x30, 0x78, 0x48, 0x48, 0x7E, 0x7E, 0x00, // Code for char d
- 0x08, 0x00, 0x38, 0x7C, 0x54, 0x54, 0x5C, 0x18, 0x00, // Code for char e
- 0x08, 0x00, 0x00, 0x08, 0x7C, 0x7E, 0x0A, 0x0A, 0x00, // Code for char f
- 0x08, 0x00, 0x98, 0xBC, 0xA4, 0xA4, 0xFC, 0x7C, 0x00, // Code for char g
- 0x08, 0x00, 0x7E, 0x7E, 0x08, 0x08, 0x78, 0x70, 0x00, // Code for char h
- 0x08, 0x00, 0x00, 0x48, 0x7A, 0x7A, 0x40, 0x00, 0x00, // Code for char i
- 0x08, 0x00, 0x00, 0x80, 0x80, 0x80, 0xFA, 0x7A, 0x00, // Code for char j
- 0x08, 0x00, 0x7E, 0x7E, 0x10, 0x38, 0x68, 0x40, 0x00, // Code for char k
- 0x08, 0x00, 0x00, 0x42, 0x7E, 0x7E, 0x40, 0x00, 0x00, // Code for char l
- 0x08, 0x00, 0x7C, 0x7C, 0x18, 0x38, 0x1C, 0x7C, 0x78, // Code for char m
- 0x08, 0x00, 0x7C, 0x7C, 0x04, 0x04, 0x7C, 0x78, 0x00, // Code for char n
- 0x08, 0x00, 0x38, 0x7C, 0x44, 0x44, 0x7C, 0x38, 0x00, // Code for char o
- 0x08, 0x00, 0xFC, 0xFC, 0x24, 0x24, 0x3C, 0x18, 0x00, // Code for char p
- 0x08, 0x00, 0x18, 0x3C, 0x24, 0x24, 0xFC, 0xFC, 0x00, // Code for char q
- 0x08, 0x00, 0x7C, 0x7C, 0x04, 0x04, 0x0C, 0x08, 0x00, // Code for char r
- 0x08, 0x00, 0x48, 0x5C, 0x54, 0x54, 0x74, 0x24, 0x00, // Code for char s
- 0x08, 0x00, 0x04, 0x04, 0x3E, 0x7E, 0x44, 0x44, 0x00, // Code for char t
- 0x08, 0x00, 0x3C, 0x7C, 0x40, 0x40, 0x7C, 0x7C, 0x00, // Code for char u
- 0x08, 0x00, 0x1C, 0x3C, 0x60, 0x60, 0x3C, 0x1C, 0x00, // Code for char v
- 0x08, 0x00, 0x1C, 0x7C, 0x70, 0x38, 0x70, 0x7C, 0x1C, // Code for char w
- 0x08, 0x00, 0x44, 0x6C, 0x38, 0x38, 0x6C, 0x44, 0x00, // Code for char x
- 0x08, 0x00, 0x9C, 0xBC, 0xA0, 0xE0, 0x7C, 0x3C, 0x00, // Code for char y
- 0x08, 0x00, 0x44, 0x64, 0x74, 0x5C, 0x4C, 0x44, 0x00, // Code for char z
- 0x08, 0x00, 0x08, 0x7F, 0x77, 0x41, 0x41, 0x00, 0x00, // Code for char {
- 0x08, 0x00, 0x00, 0x00, 0xE7, 0xE7, 0x00, 0x00, 0x00, // Code for char |
- 0x08, 0x00, 0x00, 0x41, 0x41, 0x77, 0x7F, 0x08, 0x00, // Code for char }
- 0x08, 0x00, 0x02, 0x06, 0x04, 0x02, 0x06, 0x04, 0x00, // Code for char ~
- 0x08, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C // Code for char
-};
-
-
--- a/POKITTO_CORE/FONTS/fontC64UIGfx.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-
-// This font contains a special UI graphics in lower case letters. It is meant to be used with Pokitto UI Widgets.
-
-//WARNING: This Font is usable only with MikroE GLCD Lib.
-// X-GLCD Lib does not handle this font.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroeElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : C64Font8x8
-//GLCD FontSize : 8 x 8
-#include "PokittoFonts.h"
-
-const unsigned char fntC64UIGfx[] = {
- 8,8,32,0, //width, height, start char, boolean truncated to only caps
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x08, 0x00, 0x00, 0x00, 0x4F, 0x4F, 0x00, 0x00, 0x00, // Code for char !
- 0x08, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x00, // Code for char "
- 0x08, 0x14, 0x7F, 0x7F, 0x14, 0x14, 0x7F, 0x7F, 0x14, // Code for char #
- 0x08, 0x00, 0x24, 0x2E, 0x6B, 0x6B, 0x3A, 0x12, 0x00, // Code for char $
- 0x08, 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00, // Code for char %
- 0x08, 0x00, 0x32, 0x7F, 0x4D, 0x4D, 0x77, 0x72, 0x50, // Code for char &
- 0x08, 0x00, 0x00, 0x00, 0x04, 0x06, 0x03, 0x01, 0x00, // Code for char '
- 0x08, 0x00, 0x00, 0x1C, 0x3E, 0x63, 0x41, 0x00, 0x00, // Code for char (
- 0x08, 0x00, 0x00, 0x41, 0x63, 0x3E, 0x1C, 0x00, 0x00, // Code for char )
- 0x08, 0x08, 0x2A, 0x3E, 0x1C, 0x1C, 0x3E, 0x2A, 0x08, // Code for char *
- 0x08, 0x00, 0x08, 0x08, 0x3E, 0x3E, 0x08, 0x08, 0x00, // Code for char +
- 0x08, 0x00, 0x00, 0x80, 0xE0, 0x60, 0x00, 0x00, 0x00, // Code for char ,
- 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, // Code for char -
- 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, // Code for char .
- 0x08, 0x00, 0x40, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, // Code for char /
- 0x08, 0x00, 0x3E, 0x7F, 0x49, 0x45, 0x7F, 0x3E, 0x00, // Code for char 0
- 0x08, 0x00, 0x40, 0x44, 0x7F, 0x7F, 0x40, 0x40, 0x00, // Code for char 1
- 0x08, 0x00, 0x62, 0x73, 0x51, 0x49, 0x4F, 0x46, 0x00, // Code for char 2
- 0x08, 0x00, 0x22, 0x63, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char 3
- 0x08, 0x00, 0x00, 0x18, 0x14, 0x16, 0x7F, 0x7F, 0x10, // Code for char 4
- 0x08, 0x00, 0x27, 0x67, 0x45, 0x45, 0x7D, 0x39, 0x00, // Code for char 5
- 0x08, 0x00, 0x3E, 0x7F, 0x49, 0x49, 0x7B, 0x32, 0x00, // Code for char 6
- 0x08, 0x00, 0x03, 0x03, 0x79, 0x7D, 0x07, 0x03, 0x00, // Code for char 7
- 0x08, 0x00, 0x36, 0x7F, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char 8
- 0x08, 0x00, 0x26, 0x6F, 0x49, 0x49, 0x7F, 0x3E, 0x00, // Code for char 9
- 0x08, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, // Code for char :
- 0x08, 0x00, 0x00, 0x80, 0xE4, 0x64, 0x00, 0x00, 0x00, // Code for char ;
- 0x08, 0x00, 0x08, 0x1C, 0x36, 0x63, 0x41, 0x41, 0x00, // Code for char <
- 0x08, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, // Code for char =
- 0x08, 0x00, 0x41, 0x41, 0x63, 0x36, 0x1C, 0x08, 0x00, // Code for char >
- 0x08, 0x00, 0x02, 0x03, 0x51, 0x59, 0x0F, 0x06, 0x00, // Code for char ?
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x4D, 0x6F, 0x2E, 0x00, // Code for char @
- 0x08, 0x00, 0x7C, 0x7E, 0x0B, 0x0B, 0x7E, 0x7C, 0x00, // Code for char A
- 0x08, 0x00, 0x7F, 0x7F, 0x49, 0x49, 0x7F, 0x36, 0x00, // Code for char B
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x41, 0x63, 0x22, 0x00, // Code for char C
- 0x08, 0x00, 0x7F, 0x7F, 0x41, 0x63, 0x3E, 0x1C, 0x00, // Code for char D
- 0x08, 0x00, 0x7F, 0x7F, 0x49, 0x49, 0x41, 0x41, 0x00, // Code for char E
- 0x08, 0x00, 0x7F, 0x7F, 0x09, 0x09, 0x01, 0x01, 0x00, // Code for char F
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x49, 0x7B, 0x3A, 0x00, // Code for char G
- 0x08, 0x00, 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x00, // Code for char H
- 0x08, 0x00, 0x00, 0x41, 0x7F, 0x7F, 0x41, 0x00, 0x00, // Code for char I
- 0x08, 0x00, 0x20, 0x61, 0x41, 0x7F, 0x3F, 0x01, 0x00, // Code for char J
- 0x08, 0x00, 0x7F, 0x7F, 0x1C, 0x36, 0x63, 0x41, 0x00, // Code for char K
- 0x08, 0x00, 0x7F, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char L
- 0x08, 0x00, 0x7F, 0x7F, 0x06, 0x0C, 0x06, 0x7F, 0x7F, // Code for char M
- 0x08, 0x00, 0x7F, 0x7F, 0x0E, 0x1C, 0x7F, 0x7F, 0x00, // Code for char N
- 0x08, 0x00, 0x3E, 0x7F, 0x41, 0x41, 0x7F, 0x3E, 0x00, // Code for char O
- 0x08, 0x00, 0x7F, 0x7F, 0x09, 0x09, 0x0F, 0x06, 0x00, // Code for char P
- 0x08, 0x00, 0x1E, 0x3F, 0x21, 0x61, 0x7F, 0x5E, 0x00, // Code for char Q
- 0x08, 0x00, 0x7F, 0x7F, 0x19, 0x39, 0x6F, 0x46, 0x00, // Code for char R
- 0x08, 0x00, 0x26, 0x6F, 0x49, 0x49, 0x7B, 0x32, 0x00, // Code for char S
- 0x08, 0x00, 0x01, 0x01, 0x7F, 0x7F, 0x01, 0x01, 0x00, // Code for char T
- 0x08, 0x00, 0x3F, 0x7F, 0x40, 0x40, 0x7F, 0x3F, 0x00, // Code for char U
- 0x08, 0x00, 0x1F, 0x3F, 0x60, 0x60, 0x3F, 0x1F, 0x00, // Code for char V
- 0x08, 0x00, 0x7F, 0x7F, 0x30, 0x18, 0x30, 0x7F, 0x7F, // Code for char W
- 0x08, 0x00, 0x63, 0x77, 0x1C, 0x1C, 0x77, 0x63, 0x00, // Code for char X
- 0x08, 0x00, 0x07, 0x0F, 0x78, 0x78, 0x0F, 0x07, 0x00, // Code for char Y
- 0x08, 0x00, 0x61, 0x71, 0x59, 0x4D, 0x47, 0x43, 0x00, // Code for char Z
- 0x08, 0x00, 0x00, 0x7F, 0x7F, 0x41, 0x41, 0x00, 0x00, // Code for char [
- 0x08, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00, // Code for char BackSlash
- 0x08, 0x00, 0x00, 0x41, 0x41, 0x7F, 0x7F, 0x00, 0x00, // Code for char ]
- 0x08, 0x00, 0x08, 0x0C, 0xFE, 0xFE, 0x0C, 0x08, 0x00, // Code for char ^
- 0x08, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, // Code for char _
- 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x04, 0x00, // Code for char `
- 0x08, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0x38, 0x18, 0x18, // Code for char a, UI graphics
- 0x08, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, // Code for char b, UI graphics
- 0x08, 0x18, 0x18, 0x38, 0xF0, 0xE0, 0x00, 0x00, 0x00, // Code for char c, UI graphics
- 0x08, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x1C, 0x18, 0x18, // Code for char d, UI graphics
- 0x08, 0x18, 0x18, 0x1C, 0x0F, 0x07, 0x00, 0x00, 0x00, // Code for char e, UI graphics
- 0x08, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0x00, 0x00, // Code for char f, UI graphics
- 0x08, 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66, // Code for char g, UI graphics
- 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Code for char h, UI graphics
- 0x08, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x09, 0x09, 0x07, // Code for char i, Pokitto image.
- 0x08, 0xF1, 0xF1, 0xF1, 0xF1, 0x71, 0x71, 0xF1, 0xF1, // Code for char j, Pokitto image.
- 0x08, 0xF1, 0xF1, 0x71, 0x71, 0xF1, 0xF1, 0xF1, 0xF1, // Code for char k, Pokitto image.
- 0x08, 0x07, 0x09, 0x09, 0xFE, 0x00, 0x00, 0x00, 0x00, // Code for char l, Pokitto image.
- 0x08, 0x00, 0x0C, 0x12, 0x12, 0xFF, 0x00, 0x00, 0x00, // Code for char m, Pokitto image.
- 0x08, 0xFF, 0xFF, 0xFF, 0xFE, 0xF7, 0xEF, 0xEE, 0xEF, // Code for char n, Pokitto image.
- 0x08, 0xEF, 0xEE, 0xEF, 0xF7, 0xFE, 0xFF, 0xFF, 0xFF, // Code for char o, Pokitto image.
- 0x08, 0x00, 0x00, 0x00, 0xFF, 0x12, 0x12, 0x0C, 0x00, // Code for char p, Pokitto image.
- 0x08, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, // Code for char q, Pokitto image.
- 0x08, 0x30, 0x30, 0xFC, 0xFC, 0x30, 0x30, 0x00, 0x00, // Code for char r, Pokitto image.
- 0x08, 0x00, 0x00, 0x70, 0x70, 0x70, 0x00, 0x1C, 0x1C, // Code for char s, Pokitto image.
- 0x08, 0x1C, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, // Code for char t, Pokitto image.
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x92, 0x92, 0x7C, // Code for char u, Pokitto image.
- 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x12, // Code for char v, Pokitto image.
- 0x08, 0x12, 0x12, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // Code for char w, Pokitto image.
- 0x08, 0x7C, 0x92, 0x92, 0x7F, 0x00, 0x00, 0x00, 0x00, // Code for char x, Pokitto image.
- 0x08, 0x00, 0x9C, 0xBC, 0xA0, 0xE0, 0x7C, 0x3C, 0x00, // Code for char y
- 0x08, 0x00, 0x44, 0x64, 0x74, 0x5C, 0x4C, 0x44, 0x00, // Code for char z
- 0x08, 0x00, 0x08, 0x7F, 0x77, 0x41, 0x41, 0x00, 0x00, // Code for char {
- 0x08, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, // Code for char |
- 0x08, 0x00, 0x00, 0x41, 0x41, 0x77, 0x7F, 0x08, 0x00, // Code for char }
- 0x08, 0x00, 0x02, 0x06, 0x04, 0x02, 0x06, 0x04, 0x00, // Code for char ~
- 0x08, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C // Code for char
-};
-
-
--- a/POKITTO_CORE/FONTS/karateka8x11.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : Karateka
-//GLCD FontSize : 8 x 11
-#include "PokittoFonts.h"
-
-const unsigned char fontKarateka[] = {
- 8,10,32,0,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x03, 0x00, 0x00, 0x70, 0x01, 0x7C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x04, 0x1C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char "
- 0x06, 0xA0, 0x01, 0xF8, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xF8, 0x01, 0xA0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char #
- 0x05, 0x80, 0x01, 0x98, 0x01, 0x64, 0x07, 0x37, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $
- 0x08, 0x00, 0x01, 0x98, 0x01, 0xD4, 0x00, 0x6C, 0x00, 0x30, 0x00, 0xD8, 0x00, 0xAC, 0x01, 0xEC, 0x01, // Code for char %
- 0x06, 0xC0, 0x01, 0xF8, 0x01, 0x24, 0x01, 0x54, 0x01, 0x88, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char &
- 0x02, 0x18, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x03, 0xE0, 0x01, 0xF8, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x03, 0x04, 0x04, 0xF8, 0x03, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x06, 0xA0, 0x00, 0xE8, 0x00, 0x70, 0x00, 0x70, 0x00, 0xE8, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char *
- 0x06, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char +
- 0x02, 0x00, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x05, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char -
- 0x02, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x05, 0x00, 0x01, 0xC0, 0x01, 0xF8, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
- 0x06, 0xE0, 0x00, 0xF8, 0x01, 0x0C, 0x01, 0x84, 0x01, 0xF8, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
- 0x02, 0xC8, 0x01, 0xFC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
- 0x05, 0x88, 0x01, 0xC4, 0x01, 0x64, 0x01, 0x24, 0x01, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
- 0x06, 0x80, 0x01, 0x88, 0x01, 0x24, 0x01, 0x24, 0x01, 0xD8, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
- 0x06, 0x40, 0x00, 0x60, 0x00, 0x50, 0x00, 0xC8, 0x01, 0xFC, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4
- 0x05, 0xB0, 0x00, 0x28, 0x01, 0x24, 0x01, 0xE4, 0x01, 0xC4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
- 0x06, 0xC0, 0x00, 0xF0, 0x00, 0x28, 0x01, 0x24, 0x01, 0xC4, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
- 0x04, 0xC4, 0x01, 0xE4, 0x01, 0x14, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
- 0x06, 0xC0, 0x00, 0xD8, 0x00, 0x24, 0x01, 0x24, 0x01, 0xD8, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
- 0x04, 0x18, 0x01, 0xA4, 0x01, 0xE4, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9
- 0x03, 0x00, 0x01, 0xB0, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x03, 0x00, 0x06, 0x40, 0x03, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x06, 0x20, 0x00, 0x60, 0x00, 0xD0, 0x00, 0xD0, 0x00, 0x88, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char <
- 0x03, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char =
- 0x06, 0x88, 0x00, 0xC8, 0x00, 0xD0, 0x00, 0x70, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char >
- 0x05, 0x08, 0x00, 0x44, 0x01, 0x64, 0x01, 0x34, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ?
- 0x08, 0xE0, 0x01, 0xF0, 0x03, 0x08, 0x04, 0xE4, 0x05, 0x14, 0x05, 0xF4, 0x05, 0xC4, 0x01, 0xF8, 0x00, // Code for char @
- 0x06, 0xE0, 0x01, 0xF8, 0x01, 0x24, 0x00, 0x24, 0x00, 0xF8, 0x01, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char A
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x24, 0x01, 0x24, 0x01, 0x24, 0x01, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B
- 0x05, 0xE0, 0x01, 0xF8, 0x01, 0x04, 0x01, 0x04, 0x01, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D
- 0x05, 0xE0, 0x01, 0xFC, 0x01, 0x24, 0x01, 0x24, 0x01, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E
- 0x05, 0xE0, 0x01, 0xFC, 0x01, 0x24, 0x00, 0x24, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F
- 0x06, 0xE0, 0x01, 0xF8, 0x01, 0x04, 0x01, 0x24, 0x01, 0x24, 0x01, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x20, 0x00, 0x20, 0x00, 0xFC, 0x01, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char H
- 0x02, 0xE0, 0x01, 0xFC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x04, 0x00, 0x04, 0x00, 0x04, 0xE4, 0x03, 0xFC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x20, 0x00, 0x50, 0x00, 0x88, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char K
- 0x05, 0xE0, 0x01, 0xFC, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L
- 0x08, 0xE0, 0x01, 0xF8, 0x01, 0x04, 0x00, 0x0C, 0x00, 0x38, 0x00, 0x04, 0x00, 0xF8, 0x01, 0xE0, 0x01, // Code for char M
- 0x07, 0xE0, 0x01, 0xFC, 0x01, 0x18, 0x00, 0x30, 0x00, 0x40, 0x00, 0xE0, 0x00, 0xFC, 0x01, 0x00, 0x00, // Code for char N
- 0x07, 0xE0, 0x00, 0xF8, 0x00, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xF8, 0x00, 0xE0, 0x00, 0x00, 0x00, // Code for char O
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x24, 0x00, 0x24, 0x00, 0x24, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P
- 0x07, 0xE0, 0x00, 0xF8, 0x01, 0x04, 0x01, 0x04, 0x01, 0x84, 0x01, 0xF8, 0x03, 0xE0, 0x02, 0x00, 0x00, // Code for char Q
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x24, 0x00, 0x64, 0x00, 0xA4, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char R
- 0x05, 0x80, 0x01, 0x98, 0x01, 0x24, 0x01, 0x24, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
- 0x05, 0x04, 0x00, 0xE4, 0x01, 0xFC, 0x01, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T
- 0x06, 0xE0, 0x01, 0xFC, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFC, 0x01, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char U
- 0x05, 0xE0, 0x01, 0xFC, 0x01, 0x00, 0x01, 0xC0, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V
- 0x07, 0xE0, 0x01, 0xFC, 0x01, 0x00, 0x01, 0xC0, 0x01, 0x00, 0x01, 0xFC, 0x01, 0xE0, 0x01, 0x00, 0x00, // Code for char W
- 0x07, 0x80, 0x01, 0xCC, 0x01, 0x50, 0x00, 0x20, 0x00, 0x50, 0x00, 0xCC, 0x01, 0x80, 0x01, 0x00, 0x00, // Code for char X
- 0x05, 0x0C, 0x00, 0xD0, 0x01, 0xE0, 0x01, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y
- 0x06, 0x84, 0x01, 0xC4, 0x01, 0x64, 0x01, 0x24, 0x01, 0x14, 0x01, 0x0C, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char Z
- 0x04, 0xC0, 0x07, 0xFC, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x05, 0x04, 0x00, 0x1C, 0x00, 0xF0, 0x00, 0xE0, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash
- 0x03, 0x04, 0x04, 0xC4, 0x07, 0xFC, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ]
- 0x04, 0x30, 0x00, 0x18, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^
- 0x05, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _
- 0x02, 0x1C, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char `
- 0x06, 0xC0, 0x01, 0xE0, 0x01, 0x50, 0x00, 0x50, 0x00, 0xE0, 0x01, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char a
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x50, 0x01, 0x50, 0x01, 0x50, 0x01, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b
- 0x05, 0xC0, 0x01, 0xE0, 0x01, 0x10, 0x01, 0x10, 0x01, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d
- 0x05, 0xC0, 0x01, 0xF0, 0x01, 0x50, 0x01, 0x50, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e
- 0x05, 0xC0, 0x01, 0xF0, 0x01, 0x50, 0x00, 0x50, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f
- 0x06, 0xC0, 0x01, 0xE0, 0x01, 0x10, 0x01, 0x50, 0x01, 0x50, 0x01, 0xD0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char g
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x40, 0x00, 0x40, 0x00, 0xF0, 0x01, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char h
- 0x02, 0xC0, 0x01, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
- 0x04, 0x00, 0x04, 0x00, 0x04, 0xD0, 0x03, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j
- 0x05, 0xC0, 0x01, 0xF0, 0x01, 0x40, 0x00, 0xA0, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k
- 0x05, 0xC0, 0x01, 0xF0, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
- 0x08, 0xC0, 0x01, 0xE0, 0x01, 0x10, 0x00, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0xE0, 0x01, 0xC0, 0x01, // Code for char m
- 0x07, 0xC0, 0x01, 0xF0, 0x01, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0xF0, 0x01, 0xC0, 0x01, 0x00, 0x00, // Code for char n
- 0x07, 0xC0, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xE0, 0x00, 0xC0, 0x00, 0x00, 0x00, // Code for char o
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p
- 0x07, 0xC0, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x10, 0x01, 0x90, 0x01, 0xE0, 0x03, 0xC0, 0x02, 0x00, 0x00, // Code for char q
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x50, 0x00, 0xD0, 0x00, 0x50, 0x01, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char r
- 0x05, 0x80, 0x01, 0xA0, 0x01, 0x50, 0x01, 0x50, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s
- 0x05, 0x10, 0x00, 0xD0, 0x01, 0xF0, 0x01, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t
- 0x06, 0xC0, 0x01, 0xF0, 0x01, 0x00, 0x01, 0x00, 0x01, 0xF0, 0x01, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char u
- 0x05, 0xC0, 0x01, 0xF0, 0x01, 0x00, 0x01, 0xC0, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v
- 0x07, 0xC0, 0x01, 0xF0, 0x01, 0x00, 0x01, 0xC0, 0x01, 0x00, 0x01, 0xF0, 0x01, 0xC0, 0x01, 0x00, 0x00, // Code for char w
- 0x07, 0x00, 0x01, 0x90, 0x01, 0xA0, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x90, 0x01, 0x00, 0x01, 0x00, 0x00, // Code for char x
- 0x05, 0x10, 0x00, 0xA0, 0x01, 0xC0, 0x01, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y
- 0x05, 0x90, 0x01, 0xD0, 0x01, 0x50, 0x01, 0x30, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z
- 0x05, 0x40, 0x00, 0xB8, 0x03, 0x84, 0x07, 0x04, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char {
- 0x02, 0xC0, 0x03, 0xFE, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
- 0x05, 0x00, 0x04, 0x04, 0x04, 0x84, 0x07, 0xB8, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char }
- 0x07, 0x20, 0x00, 0x10, 0x00, 0x30, 0x00, 0x60, 0x00, 0x40, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, // Code for char ~
- 0x06, 0xE0, 0x03, 0xFE, 0x03, 0xFE, 0x03, 0xFE, 0x03, 0xFE, 0x03, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/koubit7x7.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : koubit
-//GLCD FontSize : 7 x 7
-#include "PokittoFonts.h"
-
-const unsigned char fontKoubit[] = {
- 7,7,32,1,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x02, 0x2E, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, // Code for char "
- 0x05, 0x14, 0x3E, 0x14, 0x3E, 0x14, 0x00, 0x00, // Code for char #
- 0x06, 0x00, 0x2E, 0x2A, 0x3E, 0x2A, 0x3A, 0x00, // Code for char $
- 0x05, 0x0C, 0x2C, 0x18, 0x34, 0x30, 0x00, 0x00, // Code for char %
- 0x06, 0x30, 0x4C, 0x4A, 0x7C, 0x30, 0x68, 0x00, // Code for char &
- 0x02, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0x1C, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x02, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x06, 0x22, 0x14, 0x3E, 0x3E, 0x14, 0x22, 0x00, // Code for char *
- 0x06, 0x08, 0x08, 0x3E, 0x3E, 0x08, 0x08, 0x00, // Code for char +
- 0x02, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x03, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, // Code for char -
- 0x02, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x06, 0x20, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, // Code for char /
- 0x06, 0x3E, 0x3E, 0x22, 0x22, 0x3E, 0x3E, 0x00, // Code for char 0
- 0x06, 0x22, 0x22, 0x3E, 0x3E, 0x20, 0x20, 0x00, // Code for char 1
- 0x06, 0x3A, 0x3A, 0x2A, 0x2A, 0x2E, 0x2E, 0x00, // Code for char 2
- 0x06, 0x2A, 0x2A, 0x2A, 0x2A, 0x3E, 0x3E, 0x00, // Code for char 3
- 0x06, 0x0E, 0x0E, 0x08, 0x08, 0x3E, 0x3E, 0x00, // Code for char 4
- 0x06, 0x2E, 0x2E, 0x2A, 0x2A, 0x3A, 0x3A, 0x00, // Code for char 5
- 0x06, 0x3E, 0x3E, 0x2A, 0x2A, 0x3A, 0x3A, 0x00, // Code for char 6
- 0x06, 0x02, 0x02, 0x02, 0x02, 0x3E, 0x3E, 0x00, // Code for char 7
- 0x06, 0x3E, 0x3E, 0x2A, 0x2A, 0x3E, 0x3E, 0x00, // Code for char 8
- 0x06, 0x2E, 0x2E, 0x2A, 0x2A, 0x3E, 0x3E, 0x00, // Code for char 9
- 0x02, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x02, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x04, 0x08, 0x1C, 0x36, 0x22, 0x00, 0x00, 0x00, // Code for char <
- 0x05, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, // Code for char =
- 0x04, 0x22, 0x36, 0x1C, 0x08, 0x00, 0x00, 0x00, // Code for char >
- 0x06, 0x02, 0x02, 0x2A, 0x2E, 0x0E, 0x04, 0x00, // Code for char ?
- 0x07, 0x7F, 0x41, 0x5D, 0x55, 0x5D, 0x11, 0x1F, // Code for char @
- 0x05, 0x3E, 0x3E, 0x0A, 0x3E, 0x3E, 0x00, 0x00, // Code for char A
- 0x05, 0x3E, 0x3E, 0x2A, 0x3E, 0x36, 0x00, 0x00, // Code for char B
- 0x05, 0x3E, 0x3E, 0x22, 0x36, 0x36, 0x00, 0x00, // Code for char C
- 0x05, 0x3E, 0x3E, 0x22, 0x3E, 0x3C, 0x00, 0x00, // Code for char D
- 0x05, 0x3E, 0x3E, 0x2A, 0x2A, 0x2A, 0x00, 0x00, // Code for char E
- 0x05, 0x3E, 0x3E, 0x0A, 0x0A, 0x02, 0x00, 0x00, // Code for char F
- 0x06, 0x3E, 0x3E, 0x22, 0x2A, 0x3A, 0x3A, 0x00, // Code for char G
- 0x06, 0x3E, 0x3E, 0x08, 0x08, 0x3E, 0x3E, 0x00, // Code for char H
- 0x02, 0x3E, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x05, 0x30, 0x30, 0x20, 0x3E, 0x3E, 0x00, 0x00, // Code for char J
- 0x06, 0x3E, 0x3E, 0x08, 0x1C, 0x36, 0x22, 0x00, // Code for char K
- 0x05, 0x3E, 0x3E, 0x20, 0x20, 0x20, 0x00, 0x00, // Code for char L
- 0x07, 0x3E, 0x3E, 0x0C, 0x18, 0x0C, 0x3E, 0x3E, // Code for char M
- 0x06, 0x3E, 0x3E, 0x0C, 0x18, 0x3E, 0x3E, 0x00, // Code for char N
- 0x05, 0x3E, 0x3E, 0x22, 0x3E, 0x3E, 0x00, 0x00, // Code for char O
- 0x05, 0x3E, 0x3E, 0x0A, 0x0E, 0x0E, 0x00, 0x00, // Code for char P
- 0x06, 0x3E, 0x3E, 0x22, 0x22, 0x7E, 0x5E, 0x00, // Code for char Q
- 0x05, 0x3E, 0x3E, 0x1A, 0x3E, 0x2E, 0x00, 0x00, // Code for char R
- 0x05, 0x2E, 0x2E, 0x2A, 0x3A, 0x3A, 0x00, 0x00, // Code for char S
- 0x06, 0x02, 0x02, 0x3E, 0x3E, 0x02, 0x02, 0x00, // Code for char T
- 0x06, 0x3E, 0x3E, 0x20, 0x20, 0x3E, 0x3E, 0x00, // Code for char U
- 0x06, 0x1E, 0x3E, 0x30, 0x38, 0x1E, 0x0E, 0x00, // Code for char V
- 0x07, 0x3E, 0x3E, 0x30, 0x3E, 0x30, 0x3E, 0x3E, // Code for char W
- 0x06, 0x22, 0x36, 0x1C, 0x1C, 0x36, 0x22, 0x00, // Code for char X
- 0x06, 0x02, 0x06, 0x3C, 0x3C, 0x06, 0x02, 0x00, // Code for char Y
- 0x06, 0x22, 0x32, 0x3A, 0x2E, 0x26, 0x22, 0x00, // Code for char Z
- 0x02, 0x3E, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x06, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x20, 0x00, // Code for char BackSlash
- 0x02, 0x22, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char ]
- };
-
-
--- a/POKITTO_CORE/FONTS/mini4x6.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : mini4x6
-//GLCD FontSize : 4 x 6
-#include "PokittoFonts.h"
-
-const unsigned char fontMini[] = {
- 4,6,32,1, // width, height, character to start from, only caps ?
- 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0x17, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x03, 0x00, 0x03, 0x00, // Code for char "
- 0x04, 0x14, 0x0E, 0x1C, 0x0A, // Code for char #
- 0x03, 0x14, 0x1E, 0x0A, 0x00, // Code for char $
- 0x04, 0x12, 0x08, 0x04, 0x12, // Code for char %
- 0x04, 0x0C, 0x16, 0x0E, 0x14, // Code for char &
- 0x01, 0x03, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0x0C, 0x12, 0x00, 0x00, // Code for char (
- 0x02, 0x12, 0x0C, 0x00, 0x00, // Code for char )
- 0x03, 0x0A, 0x04, 0x0A, 0x00, // Code for char *
- 0x03, 0x08, 0x1C, 0x08, 0x00, // Code for char +
- 0x01, 0x30, 0x00, 0x00, 0x00, // Code for char ,
- 0x03, 0x08, 0x08, 0x08, 0x00, // Code for char -
- 0x01, 0x10, 0x00, 0x00, 0x00, // Code for char .
- 0x03, 0x10, 0x0C, 0x02, 0x00, // Code for char /
- 0x03, 0x0C, 0x12, 0x0C, 0x00, // Code for char 0
- 0x02, 0x04, 0x1E, 0x00, 0x00, // Code for char 1
- 0x03, 0x1A, 0x16, 0x14, 0x00, // Code for char 2
- 0x03, 0x12, 0x16, 0x1E, 0x00, // Code for char 3
- 0x03, 0x0E, 0x08, 0x1E, 0x00, // Code for char 4
- 0x03, 0x16, 0x16, 0x0A, 0x00, // Code for char 5
- 0x03, 0x0C, 0x1A, 0x08, 0x00, // Code for char 6
- 0x03, 0x12, 0x0A, 0x06, 0x00, // Code for char 7
- 0x03, 0x0A, 0x16, 0x0A, 0x00, // Code for char 8
- 0x03, 0x16, 0x16, 0x0E, 0x00, // Code for char 9
- 0x01, 0x12, 0x00, 0x00, 0x00, // Code for char :
- 0x01, 0x34, 0x00, 0x00, 0x00, // Code for char ;
- 0x02, 0x08, 0x14, 0x00, 0x00, // Code for char <
- 0x02, 0x0A, 0x0A, 0x00, 0x00, // Code for char =
- 0x03, 0x00, 0x0A, 0x04, 0x00, // Code for char >
- 0x03, 0x02, 0x19, 0x06, 0x00, // Code for char ?
- 0x04, 0x0C, 0x12, 0x16, 0x16, // Code for char @
- 0x03, 0x1E, 0x0A, 0x1C, 0x00, // Code for char A
- 0x03, 0x1E, 0x14, 0x18, 0x00, // Code for char B
- 0x03, 0x0C, 0x12, 0x12, 0x00, // Code for char C
- 0x03, 0x1E, 0x12, 0x0C, 0x00, // Code for char D
- 0x03, 0x1E, 0x16, 0x12, 0x00, // Code for char E
- 0x03, 0x1E, 0x0A, 0x02, 0x00, // Code for char F
- 0x03, 0x0C, 0x12, 0x1A, 0x00, // Code for char G
- 0x03, 0x1E, 0x04, 0x18, 0x00, // Code for char H
- 0x01, 0x1E, 0x00, 0x00, 0x00, // Code for char I
- 0x02, 0x12, 0x0E, 0x00, 0x00, // Code for char J
- 0x03, 0x1E, 0x04, 0x1A, 0x00, // Code for char K
- 0x02, 0x1E, 0x10, 0x00, 0x00, // Code for char L
- 0x03, 0x1E, 0x04, 0x1E, 0x00, // Code for char M
- 0x03, 0x1E, 0x02, 0x1C, 0x00, // Code for char N
- 0x03, 0x1C, 0x12, 0x0E, 0x00, // Code for char O
- 0x03, 0x1E, 0x0A, 0x06, 0x00, // Code for char P
- 0x03, 0x0C, 0x0A, 0x1E, 0x00, // Code for char Q
- 0x03, 0x1E, 0x0A, 0x14, 0x00, // Code for char R
- 0x03, 0x14, 0x16, 0x0A, 0x00, // Code for char S
- 0x03, 0x02, 0x1E, 0x02, 0x00, // Code for char T
- 0x03, 0x1E, 0x10, 0x1E, 0x00, // Code for char U
- 0x03, 0x0E, 0x18, 0x0E, 0x00, // Code for char V
- 0x03, 0x1E, 0x08, 0x1E, 0x00, // Code for char W
- 0x03, 0x1A, 0x04, 0x1A, 0x00, // Code for char X
- 0x03, 0x06, 0x18, 0x06, 0x00, // Code for char Y
- 0x03, 0x1A, 0x16, 0x12, 0x00, // Code for char Z
- 0x02, 0x1E, 0x12, 0x00, 0x00, // Code for char [
- 0x03, 0x02, 0x0C, 0x10, 0x00, // Code for char BackSlash
- 0x02, 0x12, 0x1E, 0x00, 0x00 // Code for char ]
- };
-
-
--- a/POKITTO_CORE/FONTS/runes6x8.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : Runes6x8
-//GLCD FontSize : 6 x 10
-
-#include "PokittoFonts.h"
-
-const unsigned char fontRunes[] = {
- 6,10,32,0,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0xBE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char "
- 0x05, 0xE8, 0x00, 0x38, 0x00, 0xEE, 0x00, 0x38, 0x00, 0x2E, 0x00, 0x00, 0x00, // Code for char #
- 0x05, 0x08, 0x00, 0x54, 0x00, 0xFE, 0x00, 0x54, 0x00, 0x20, 0x00, 0x00, 0x00, // Code for char $
- 0x05, 0xC4, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x46, 0x00, 0x00, 0x00, // Code for char %
- 0x05, 0xF4, 0x00, 0x9A, 0x00, 0xD6, 0x00, 0x70, 0x00, 0x90, 0x00, 0x00, 0x00, // Code for char &
- 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0xFC, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
- 0x02, 0x02, 0x01, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
- 0x05, 0x14, 0x00, 0x08, 0x00, 0x3E, 0x00, 0x08, 0x00, 0x14, 0x00, 0x00, 0x00, // Code for char *
- 0x05, 0x20, 0x00, 0x20, 0x00, 0xF8, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, // Code for char +
- 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
- 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char -
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x03, 0xC0, 0x00, 0x38, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
- 0x03, 0xFC, 0x00, 0x82, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
- 0x02, 0x04, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
- 0x03, 0xC4, 0x00, 0xB2, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
- 0x03, 0x4A, 0x00, 0x8E, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
- 0x03, 0x30, 0x00, 0x2C, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4
- 0x03, 0x4E, 0x00, 0x8A, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
- 0x03, 0x7C, 0x00, 0x8A, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
- 0x03, 0xE2, 0x00, 0x1A, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
- 0x03, 0xEC, 0x00, 0x9A, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
- 0x03, 0x1C, 0x00, 0xA2, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9
- 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
- 0x04, 0x20, 0x00, 0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char <
- 0x04, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char =
- 0x04, 0x88, 0x00, 0x50, 0x00, 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char >
- 0x04, 0x04, 0x00, 0xA2, 0x00, 0x12, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ?
- 0x06, 0x78, 0x00, 0x84, 0x00, 0x32, 0x01, 0x4A, 0x01, 0x64, 0x00, 0x38, 0x00, // Code for char @
- 0x05, 0x04, 0x01, 0xFE, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0xFE, 0x00, 0x00, 0x00, // Code for char A
- 0x05, 0x03, 0x01, 0xFE, 0x00, 0x8A, 0x00, 0x8E, 0x00, 0xFA, 0x00, 0x00, 0x00, // Code for char B
- 0x04, 0x7C, 0x00, 0x82, 0x00, 0x02, 0x01, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C
- 0x05, 0x04, 0x01, 0xFE, 0x00, 0x42, 0x00, 0x22, 0x00, 0x1E, 0x00, 0x00, 0x00, // Code for char D
- 0x05, 0x04, 0x00, 0x7E, 0x00, 0x8A, 0x00, 0x0A, 0x01, 0x86, 0x00, 0x00, 0x00, // Code for char E
- 0x05, 0x03, 0x01, 0xFE, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x00, 0x00, // Code for char F
- 0x04, 0x3C, 0x00, 0x42, 0x00, 0x82, 0x00, 0xE6, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char G
- 0x05, 0x03, 0x01, 0xFE, 0x00, 0x10, 0x00, 0x12, 0x00, 0xFE, 0x00, 0x00, 0x00, // Code for char H
- 0x02, 0x04, 0x01, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
- 0x03, 0x04, 0x01, 0x82, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
- 0x05, 0x03, 0x01, 0xFE, 0x00, 0x08, 0x00, 0x14, 0x00, 0xE2, 0x00, 0x00, 0x00, // Code for char K
- 0x05, 0x03, 0x01, 0xFE, 0x01, 0x82, 0x00, 0x80, 0x00, 0xC0, 0x00, 0x00, 0x00, // Code for char L
- 0x06, 0x04, 0x01, 0xFE, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x04, 0x00, 0xFE, 0x00, // Code for char M
- 0x05, 0x04, 0x01, 0xFE, 0x00, 0x04, 0x00, 0x02, 0x00, 0xFE, 0x00, 0x00, 0x00, // Code for char N
- 0x04, 0xFC, 0x00, 0x02, 0x01, 0x82, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O
- 0x05, 0x04, 0x00, 0xFE, 0x00, 0x12, 0x01, 0x0A, 0x00, 0x06, 0x00, 0x00, 0x00, // Code for char P
- 0x04, 0xFC, 0x00, 0x42, 0x01, 0xC2, 0x00, 0x3E, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char Q
- 0x05, 0x04, 0x01, 0xFE, 0x00, 0x0A, 0x00, 0x16, 0x00, 0xE2, 0x00, 0x00, 0x00, // Code for char R
- 0x04, 0x44, 0x00, 0x8A, 0x00, 0x12, 0x01, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
- 0x05, 0x04, 0x00, 0x82, 0x00, 0xFE, 0x00, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, // Code for char T
- 0x05, 0x04, 0x00, 0x7E, 0x00, 0x80, 0x00, 0x80, 0x00, 0xFE, 0x01, 0x00, 0x00, // Code for char U
- 0x05, 0x04, 0x00, 0x7E, 0x00, 0x80, 0x01, 0x60, 0x00, 0x1E, 0x00, 0x00, 0x00, // Code for char V
- 0x06, 0x04, 0x00, 0xFE, 0x01, 0x80, 0x00, 0x78, 0x00, 0xC0, 0x00, 0x3E, 0x00, // Code for char W
- 0x05, 0x04, 0x01, 0xE6, 0x00, 0x18, 0x00, 0x18, 0x00, 0xE6, 0x00, 0x00, 0x00, // Code for char X
- 0x05, 0x04, 0x00, 0xBE, 0x00, 0x90, 0x00, 0x08, 0x01, 0xFE, 0x00, 0x00, 0x00, // Code for char Y
- 0x05, 0x84, 0x00, 0xE2, 0x00, 0x92, 0x00, 0x8E, 0x00, 0x02, 0x01, 0x00, 0x00, // Code for char Z
- 0x02, 0xFE, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
- 0x03, 0x06, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash
- 0x02, 0x02, 0x01, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ]
- 0x05, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, // Code for char ^
- 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // Code for char _
- 0x02, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char `
- 0x03, 0xE8, 0x00, 0x98, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a
- 0x03, 0xFE, 0x00, 0x88, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b
- 0x02, 0x78, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c
- 0x03, 0xF0, 0x00, 0x88, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d
- 0x03, 0x70, 0x00, 0xA8, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e
- 0x02, 0xFC, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f
- 0x03, 0xF0, 0x00, 0x88, 0x02, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g
- 0x03, 0xFE, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h
- 0x01, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
- 0x02, 0x00, 0x02, 0xFA, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j
- 0x03, 0xFE, 0x00, 0x10, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k
- 0x01, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
- 0x05, 0xF8, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x00, 0x00, // Code for char m
- 0x04, 0x10, 0x00, 0xF8, 0x00, 0x08, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n
- 0x03, 0xF0, 0x00, 0x88, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o
- 0x03, 0xF8, 0x03, 0x88, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p
- 0x03, 0xF0, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q
- 0x03, 0xF8, 0x00, 0x10, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r
- 0x02, 0x98, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s
- 0x02, 0x7C, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t
- 0x03, 0x78, 0x00, 0x80, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u
- 0x03, 0xF8, 0x00, 0x40, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v
- 0x05, 0x38, 0x00, 0xC0, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, // Code for char w
- 0x03, 0xC8, 0x00, 0x30, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x
- 0x03, 0xF8, 0x00, 0x40, 0x02, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y
- 0x03, 0xC8, 0x00, 0xA8, 0x00, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z
- 0x03, 0x30, 0x00, 0xFC, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char {
- 0x01, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
- 0x03, 0x02, 0x01, 0xFC, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char }
- 0x05, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, // Code for char ~
- 0x04, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/tight4x7.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : TinyUnicode4x7
-//GLCD FontSize : 4 x 7
-#include "PokittoFonts.h"
-
-const unsigned char fontTight[] = {
- 4,7,32,0,
- 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0x17, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x03, 0x00, 0x03, 0x00, // Code for char "
- 0x04, 0x0A, 0x1F, 0x0A, 0x1F, // Code for char #
- 0x04, 0x24, 0x2A, 0x7F, 0x1A, // Code for char $
- 0x03, 0x19, 0x04, 0x13, 0x00, // Code for char %
- 0x04, 0x0A, 0x15, 0x1D, 0x14, // Code for char &
- 0x01, 0x03, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0x1E, 0x21, 0x00, 0x00, // Code for char (
- 0x02, 0x21, 0x1E, 0x00, 0x00, // Code for char )
- 0x03, 0x05, 0x02, 0x05, 0x00, // Code for char *
- 0x03, 0x04, 0x0E, 0x04, 0x00, // Code for char +
- 0x02, 0x20, 0x10, 0x00, 0x00, // Code for char ,
- 0x03, 0x04, 0x04, 0x04, 0x00, // Code for char -
- 0x01, 0x10, 0x00, 0x00, 0x00, // Code for char .
- 0x03, 0x18, 0x04, 0x03, 0x00, // Code for char /
- 0x03, 0x0E, 0x11, 0x0E, 0x00, // Code for char 0
- 0x02, 0x02, 0x1F, 0x00, 0x00, // Code for char 1
- 0x03, 0x19, 0x15, 0x12, 0x00, // Code for char 2
- 0x03, 0x15, 0x15, 0x0A, 0x00, // Code for char 3
- 0x03, 0x07, 0x04, 0x1F, 0x00, // Code for char 4
- 0x03, 0x17, 0x15, 0x0D, 0x00, // Code for char 5
- 0x03, 0x1E, 0x15, 0x1D, 0x00, // Code for char 6
- 0x03, 0x01, 0x19, 0x07, 0x00, // Code for char 7
- 0x03, 0x1F, 0x15, 0x1F, 0x00, // Code for char 8
- 0x03, 0x17, 0x15, 0x0F, 0x00, // Code for char 9
- 0x01, 0x14, 0x00, 0x00, 0x00, // Code for char :
- 0x02, 0x20, 0x14, 0x00, 0x00, // Code for char ;
- 0x02, 0x04, 0x0A, 0x00, 0x00, // Code for char <
- 0x03, 0x0A, 0x0A, 0x0A, 0x00, // Code for char =
- 0x02, 0x0A, 0x04, 0x00, 0x00, // Code for char >
- 0x03, 0x01, 0x15, 0x02, 0x00, // Code for char ?
- 0x04, 0x1E, 0x21, 0x2D, 0x0E, // Code for char @
- 0x03, 0x1E, 0x05, 0x1E, 0x00, // Code for char A
- 0x03, 0x1F, 0x15, 0x0A, 0x00, // Code for char B
- 0x02, 0x0E, 0x11, 0x00, 0x00, // Code for char C
- 0x03, 0x1F, 0x11, 0x0E, 0x00, // Code for char D
- 0x02, 0x1F, 0x15, 0x00, 0x00, // Code for char E
- 0x02, 0x1F, 0x05, 0x00, 0x00, // Code for char F
- 0x03, 0x0E, 0x11, 0x1D, 0x00, // Code for char G
- 0x03, 0x1F, 0x04, 0x1F, 0x00, // Code for char H
- 0x03, 0x11, 0x1F, 0x11, 0x00, // Code for char I
- 0x03, 0x08, 0x11, 0x0F, 0x00, // Code for char J
- 0x03, 0x1F, 0x04, 0x1B, 0x00, // Code for char K
- 0x02, 0x1F, 0x10, 0x00, 0x00, // Code for char L
- 0x04, 0x1F, 0x06, 0x06, 0x1F, // Code for char M
- 0x04, 0x1F, 0x02, 0x04, 0x1F, // Code for char N
- 0x03, 0x0E, 0x11, 0x0E, 0x00, // Code for char O
- 0x03, 0x1F, 0x05, 0x02, 0x00, // Code for char P
- 0x03, 0x0E, 0x11, 0x2E, 0x00, // Code for char Q
- 0x03, 0x1F, 0x09, 0x16, 0x00, // Code for char R
- 0x03, 0x12, 0x15, 0x09, 0x00, // Code for char S
- 0x03, 0x01, 0x1F, 0x01, 0x00, // Code for char T
- 0x03, 0x1F, 0x10, 0x1F, 0x00, // Code for char U
- 0x03, 0x0F, 0x18, 0x0F, 0x00, // Code for char V
- 0x04, 0x0F, 0x1C, 0x0C, 0x1F, // Code for char W
- 0x03, 0x1B, 0x04, 0x1B, 0x00, // Code for char X
- 0x03, 0x13, 0x14, 0x0F, 0x00, // Code for char Y
- 0x03, 0x19, 0x15, 0x13, 0x00, // Code for char Z
- 0x02, 0x3F, 0x21, 0x00, 0x00, // Code for char [
- 0x03, 0x03, 0x04, 0x18, 0x00, // Code for char BackSlash
- 0x02, 0x21, 0x3F, 0x00, 0x00, // Code for char ]
- 0x03, 0x02, 0x01, 0x02, 0x00, // Code for char ^
- 0x04, 0x20, 0x20, 0x20, 0x20, // Code for char _
- 0x02, 0x01, 0x02, 0x00, 0x00, // Code for char `
- 0x03, 0x0C, 0x12, 0x1E, 0x00, // Code for char a
- 0x03, 0x1F, 0x12, 0x0C, 0x00, // Code for char b
- 0x03, 0x0C, 0x12, 0x12, 0x00, // Code for char c
- 0x03, 0x0C, 0x12, 0x1F, 0x00, // Code for char d
- 0x04, 0x0C, 0x1A, 0x16, 0x04, // Code for char e
- 0x03, 0x04, 0x1F, 0x05, 0x00, // Code for char f
- 0x03, 0x4C, 0x52, 0x3E, 0x00, // Code for char g
- 0x03, 0x1F, 0x02, 0x1C, 0x00, // Code for char h
- 0x01, 0x1D, 0x00, 0x00, 0x00, // Code for char i
- 0x02, 0x40, 0x3D, 0x00, 0x00, // Code for char j
- 0x03, 0x1F, 0x08, 0x16, 0x00, // Code for char k
- 0x01, 0x1F, 0x00, 0x00, 0x00, // Code for char l
- 0x04, 0x1E, 0x0E, 0x0E, 0x1E, // Code for char m
- 0x03, 0x1E, 0x02, 0x1C, 0x00, // Code for char n
- 0x03, 0x0C, 0x12, 0x0C, 0x00, // Code for char o
- 0x03, 0x3E, 0x12, 0x0C, 0x00, // Code for char p
- 0x03, 0x0C, 0x12, 0x3E, 0x00, // Code for char q
- 0x03, 0x1E, 0x04, 0x02, 0x00, // Code for char r
- 0x03, 0x14, 0x1E, 0x0A, 0x00, // Code for char s
- 0x03, 0x02, 0x0F, 0x12, 0x00, // Code for char t
- 0x03, 0x1E, 0x10, 0x1E, 0x00, // Code for char u
- 0x03, 0x0E, 0x18, 0x0E, 0x00, // Code for char v
- 0x04, 0x0E, 0x1C, 0x1C, 0x0E, // Code for char w
- 0x03, 0x12, 0x0C, 0x12, 0x00, // Code for char x
- 0x03, 0x4E, 0x50, 0x3E, 0x00, // Code for char y
- 0x03, 0x12, 0x1A, 0x16, 0x00, // Code for char z
- 0x03, 0x08, 0x77, 0x41, 0x00, // Code for char {
- 0x02, 0x00, 0x1F, 0x00, 0x00, // Code for char |
- 0x03, 0x41, 0x77, 0x08, 0x00, // Code for char }
- 0x04, 0x04, 0x02, 0x04, 0x02, // Code for char ~
- 0x04, 0x7F, 0x7F, 0x7F, 0x7F // Code for char
- };
-
-
--- a/POKITTO_CORE/FONTS/tiny5x7.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-
-//WARNING: This Font Require X-GLCD Lib.
-// You can not use it with MikroE GLCD Lib.
-
-//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
-//MikroElektronika 2011
-//http://www.mikroe.com
-
-//GLCD FontName : TinyUnicode5x8
-//GLCD FontSize : 5 x 8
-#include "PokittoFonts.h"
-
-const unsigned char fontTiny[] = {
- 5,8,32,0,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0x2E, 0x00, 0x00, 0x00, 0x00, // Code for char !
- 0x03, 0x03, 0x00, 0x03, 0x00, 0x00, // Code for char "
- 0x05, 0x14, 0x3E, 0x14, 0x3E, 0x14, // Code for char #
- 0x05, 0x24, 0x2A, 0x7F, 0x2A, 0x12, // Code for char $
- 0x03, 0x32, 0x08, 0x26, 0x00, 0x00, // Code for char %
- 0x04, 0x14, 0x2A, 0x3A, 0x28, 0x00, // Code for char &
- 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, // Code for char '
- 0x02, 0x3E, 0x41, 0x00, 0x00, 0x00, // Code for char (
- 0x02, 0x41, 0x3E, 0x00, 0x00, 0x00, // Code for char )
- 0x03, 0x0A, 0x04, 0x0A, 0x00, 0x00, // Code for char *
- 0x03, 0x08, 0x1C, 0x08, 0x00, 0x00, // Code for char +
- 0x02, 0x40, 0x20, 0x00, 0x00, 0x00, // Code for char ,
- 0x03, 0x08, 0x08, 0x08, 0x00, 0x00, // Code for char -
- 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, // Code for char .
- 0x03, 0x30, 0x08, 0x06, 0x00, 0x00, // Code for char /
- 0x04, 0x1C, 0x22, 0x22, 0x1C, 0x00, // Code for char 0
- 0x02, 0x04, 0x3E, 0x00, 0x00, 0x00, // Code for char 1
- 0x04, 0x24, 0x32, 0x2A, 0x24, 0x00, // Code for char 2
- 0x04, 0x22, 0x2A, 0x2A, 0x14, 0x00, // Code for char 3
- 0x04, 0x18, 0x14, 0x3E, 0x10, 0x00, // Code for char 4
- 0x04, 0x2E, 0x2A, 0x2A, 0x12, 0x00, // Code for char 5
- 0x04, 0x1C, 0x2A, 0x2A, 0x10, 0x00, // Code for char 6
- 0x04, 0x02, 0x32, 0x0A, 0x06, 0x00, // Code for char 7
- 0x04, 0x14, 0x2A, 0x2A, 0x14, 0x00, // Code for char 8
- 0x04, 0x04, 0x2A, 0x2A, 0x1C, 0x00, // Code for char 9
- 0x01, 0x28, 0x00, 0x00, 0x00, 0x00, // Code for char :
- 0x02, 0x40, 0x28, 0x00, 0x00, 0x00, // Code for char ;
- 0x02, 0x08, 0x14, 0x00, 0x00, 0x00, // Code for char <
- 0x03, 0x14, 0x14, 0x14, 0x00, 0x00, // Code for char =
- 0x02, 0x14, 0x08, 0x00, 0x00, 0x00, // Code for char >
- 0x04, 0x02, 0x2A, 0x0A, 0x04, 0x00, // Code for char ?
- 0x04, 0x3C, 0x42, 0x5A, 0x5C, 0x00, // Code for char @
- 0x04, 0x3C, 0x0A, 0x0A, 0x3C, 0x00, // Code for char A
- 0x04, 0x3E, 0x2A, 0x2A, 0x14, 0x00, // Code for char B
- 0x03, 0x1C, 0x22, 0x22, 0x00, 0x00, // Code for char C
- 0x04, 0x3E, 0x22, 0x22, 0x1C, 0x00, // Code for char D
- 0x03, 0x3E, 0x2A, 0x22, 0x00, 0x00, // Code for char E
- 0x03, 0x3E, 0x0A, 0x0A, 0x00, 0x00, // Code for char F
- 0x04, 0x1C, 0x22, 0x2A, 0x3A, 0x00, // Code for char G
- 0x04, 0x3E, 0x08, 0x08, 0x3E, 0x00, // Code for char H
- 0x03, 0x22, 0x3E, 0x22, 0x00, 0x00, // Code for char I
- 0x04, 0x10, 0x22, 0x22, 0x1E, 0x00, // Code for char J
- 0x04, 0x3E, 0x08, 0x14, 0x22, 0x00, // Code for char K
- 0x03, 0x3E, 0x20, 0x20, 0x00, 0x00, // Code for char L
- 0x05, 0x3E, 0x04, 0x08, 0x04, 0x3E, // Code for char M
- 0x04, 0x3E, 0x04, 0x08, 0x3E, 0x00, // Code for char N
- 0x04, 0x1C, 0x22, 0x22, 0x1C, 0x00, // Code for char O
- 0x04, 0x3E, 0x0A, 0x0A, 0x04, 0x00, // Code for char P
- 0x04, 0x1C, 0x22, 0x22, 0x5C, 0x00, // Code for char Q
- 0x04, 0x3E, 0x12, 0x12, 0x2C, 0x00, // Code for char R
- 0x04, 0x24, 0x2A, 0x2A, 0x12, 0x00, // Code for char S
- 0x03, 0x02, 0x3E, 0x02, 0x00, 0x00, // Code for char T
- 0x04, 0x1E, 0x20, 0x20, 0x1E, 0x00, // Code for char U
- 0x04, 0x1E, 0x20, 0x18, 0x06, 0x00, // Code for char V
- 0x05, 0x1E, 0x20, 0x18, 0x20, 0x1E, // Code for char W
- 0x04, 0x36, 0x08, 0x08, 0x36, 0x00, // Code for char X
- 0x04, 0x06, 0x28, 0x28, 0x1E, 0x00, // Code for char Y
- 0x03, 0x32, 0x2A, 0x26, 0x00, 0x00, // Code for char Z
- 0x02, 0x7E, 0x42, 0x00, 0x00, 0x00, // Code for char [
- 0x03, 0x06, 0x08, 0x30, 0x00, 0x00, // Code for char BackSlash
- 0x02, 0x42, 0x7E, 0x00, 0x00, 0x00, // Code for char ]
- 0x03, 0x04, 0x02, 0x04, 0x00, 0x00, // Code for char ^
- 0x05, 0x40, 0x40, 0x40, 0x40, 0x40, // Code for char _
- 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, // Code for char `
- 0x04, 0x18, 0x24, 0x14, 0x3C, 0x00, // Code for char a
- 0x04, 0x3E, 0x24, 0x24, 0x18, 0x00, // Code for char b
- 0x04, 0x18, 0x24, 0x24, 0x24, 0x00, // Code for char c
- 0x04, 0x18, 0x24, 0x24, 0x3E, 0x00, // Code for char d
- 0x04, 0x18, 0x34, 0x2C, 0x08, 0x00, // Code for char e
- 0x03, 0x08, 0x3C, 0x0A, 0x00, 0x00, // Code for char f
- 0x04, 0x18, 0xA4, 0xA4, 0x7C, 0x00, // Code for char g
- 0x04, 0x3E, 0x04, 0x04, 0x38, 0x00, // Code for char h
- 0x01, 0x3A, 0x00, 0x00, 0x00, 0x00, // Code for char i
- 0x02, 0x80, 0x7A, 0x00, 0x00, 0x00, // Code for char j
- 0x04, 0x3E, 0x10, 0x18, 0x24, 0x00, // Code for char k
- 0x01, 0x3E, 0x00, 0x00, 0x00, 0x00, // Code for char l
- 0x05, 0x3C, 0x04, 0x38, 0x04, 0x38, // Code for char m
- 0x04, 0x3C, 0x08, 0x04, 0x38, 0x00, // Code for char n
- 0x04, 0x18, 0x24, 0x24, 0x18, 0x00, // Code for char o
- 0x04, 0x7C, 0x24, 0x24, 0x18, 0x00, // Code for char p
- 0x04, 0x18, 0x24, 0x24, 0x7C, 0x00, // Code for char q
- 0x03, 0x3C, 0x08, 0x04, 0x00, 0x00, // Code for char r
- 0x04, 0x28, 0x2C, 0x34, 0x14, 0x00, // Code for char s
- 0x03, 0x04, 0x1E, 0x24, 0x00, 0x00, // Code for char t
- 0x04, 0x1C, 0x20, 0x20, 0x1C, 0x00, // Code for char u
- 0x04, 0x1C, 0x20, 0x10, 0x0C, 0x00, // Code for char v
- 0x05, 0x1C, 0x20, 0x18, 0x20, 0x1C, // Code for char w
- 0x03, 0x24, 0x18, 0x24, 0x00, 0x00, // Code for char x
- 0x04, 0x1C, 0xA0, 0xA0, 0x7C, 0x00, // Code for char y
- 0x04, 0x24, 0x34, 0x2C, 0x24, 0x00, // Code for char z
- 0x03, 0x08, 0x77, 0x41, 0x00, 0x00, // Code for char {
- 0x02, 0x00, 0x3E, 0x00, 0x00, 0x00, // Code for char |
- 0x03, 0x41, 0x77, 0x08, 0x00, 0x00, // Code for char }
- 0x05, 0x18, 0x04, 0x08, 0x10, 0x0C, // Code for char ~
- 0x04, 0x7F, 0x7F, 0x7F, 0x7F, 0x00 // Code for char
- };
-
-
--- a/POKITTO_CORE/GBcompatibility.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-#ifndef GBCOMPATIBILITY_H
-#define GBCOMPATIBILITY_H
-
-/*
- * (C) Copyright 2014 Aurélien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-
-
-#ifndef SETTINGS_C
-#define SETTINGS_C
-
-#include "binary.h"
-
-#define _BV(bit) (1 << (bit)) //jonne
-
-#define NOROT 0
-#define ROTCCW 1
-#define ROT180 2
-#define ROTCW 3
-
-//colors
-#define WHITE 0
-#define BLACK 1
-#define GRAY 2
-#define INVERT 255
-
-//for extended bitmap function :
-#define NOROT 0
-#define ROTCCW 1
-#define ROT180 2
-#define ROTCW 3
-#define NOFLIP 0
-#define FLIPH 1
-#define FLIPV 2
-#define FLIPVH 3
-
-
-
-
-//SETTINGS YOU CAN EDIT
-
-#define NUM_CHANNELS 1 //number of sound channels, between 0 and 4
-#define DISPLAY_ROT NOROT //set to NOROT, ROTCCW, ROT180 or ROTCW. Can be used to play in portrait mode.
-#define ENABLE_GUI 1 //enable menu, keyboard, pop-up, volume adjust functions
-#define ENABLE_BITMAPS 1 //will replace bitmaps with rectangles if disabled
-#define ENABLE_GRAYSCALE 1 //allows the use of the GRAY color
-#define EXTENDED_NOTE_RANGE 0 //allows the use of notes above A 5... please avoid that they sound really bad
-
-//not really useful
-#define ENABLE_BATTERY 1 //disable battery monitoring
-#define ENABLE_BACKLIGHT 1 //disable automatic back-light
-
-//IT'S STRONGLY ADVISED TO LEAVE THE FOLLOWING SETTINGS ALONE
-
-//defaults values of settings which can be adjusted on each Gamebuino using settings.hex
-#define SCR_CONTRAST 60
-#define START_MENU_TIMER 255 //40 = 40 frames (2sec) before start menu is skipped, 0 = no start menu, 255 = start menu until you press A
-
-//addresses of settings stored in the program memory
-#define SETTINGS_PAGE ((const char *)(0x7800-128))
-#define SETTINGS_TOKEN 0xC001
-#define OFFSET_CURRENTGAME 2
-#define OFFSET_USERNAME 11
-#define USERNAME_LENGTH 10
-#define OFFSET_CONTRAST 22
-#define OFFSET_BACKLIGHT_MIN 23
-#define OFFSET_BACKLIGHT_MAX 24
-#define OFFSET_LIGHT_MIN 25
-#define OFFSET_LIGHT_MAX 27
-#define OFFSET_VOLUME_MAX 29
-#define OFFSET_VOLUME_DEFAULT 30
-#define OFFSET_START_MENU_TIMER 31
-#define OFFSET_BATTERY_CRITIC 32
-#define OFFSET_BATTERY_LOW 34
-#define OFFSET_BATTERY_MED 36
-#define OFFSET_BATTERY_FULL 38
-
-//GUI
-#define KEYBOARD_W 16
-#define KEYBOARD_H 8
-
-//sound
-#define VOLUME_CHANNEL_MAX 255/NUM_CHANNELS/7/9 //7=instrument volume 9=note volume
-
-//battery voltage monitor
-#define BAT_PIN 6 //was A6
-#define NUM_LVL 4
-#define BAT_LVL_CRITIC 3500
-#define BAT_LVL_LOW 3550
-#define BAT_LVL_MED 3700
-#define BAT_LVL_FULL 3900
-
-//SD card
-#define SD_CS 10
-
-//screens back light
-#define BACKLIGHT_PIN 5
-//auto back-light levels
-#define BACKLIGHT_MIN 0
-#define BACKLIGHT_MAX 255
-
-//ambient light sensor
-#define AMBIENTLIGHT_PIN A7
-//auto back-light levels
-#define AMBIENTLIGHT_MIN 800 //800
-#define AMBIENTLIGHT_MAX 980 //1000
-#define AMBIENTLIGHT_SMOOTHING 16
-
-//number of buttons
-#define NUM_BTN 7
-//buttons ID
-#if DISPLAY_ROT == 0
- #define BTN_UP 1
- #define BTN_RIGHT 2
- #define BTN_DOWN 3
- #define BTN_LEFT 0
-#elif DISPLAY_ROT == ROTCCW
- #define BTN_UP 2
- #define BTN_RIGHT 3
- #define BTN_DOWN 0
- #define BTN_LEFT 1
-#elif DISPLAY_ROT == ROT180
- #define BTN_UP 3
- #define BTN_RIGHT 0
- #define BTN_DOWN 1
- #define BTN_LEFT 2
-#elif DISPLAY_ROT == ROTCW
- #define BTN_UP 0
- #define BTN_RIGHT 1
- #define BTN_DOWN 2
- #define BTN_LEFT 3
-#endif
-#define BTN_A 4
-#define BTN_B 5
-#define BTN_C 6
-
-#define BTN_LEFT_PIN 0
-#define BTN_UP_PIN 1
-#define BTN_RIGHT_PIN 2
-#define BTN_DOWN_PIN 3
-#define BTN_A_PIN 4
-#define BTN_B_PIN 5
-#define BTN_C_PIN 6
-
-
-
-#endif /* */
-
-const uint16_t startupSound[] = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};
-
-const uint8_t gamebuinoLogo[] =
-{
- 84,10, //width and height
- B00000011, B11100001, B10000001, B10000110, B01111111, B00111110, B00011000, B01101101, B10000011, B00001111, B00001111,
- B00001110, B00000001, B10000011, B10000110, B01100000, B00110011, B00011000, B01101101, B11000011, B00011001, B10001111,
- B00011000, B00000011, B11000011, B10001110, B01100000, B00110011, B00011000, B01101101, B11100011, B00110000, B11001111,
- B00011000, B00000011, B11000011, B10011110, B01100000, B00110110, B00110000, B11001101, B11100011, B01100000, B11001111,
- B00110000, B00000110, B11000111, B10011110, B01111110, B00111110, B00110000, B11001101, B10110011, B01100000, B11001111,
- B00110000, B00001100, B11000110, B11110110, B01100000, B00110011, B00110000, B11011001, B10110110, B01100000, B11001111,
- B00110011, B11001111, B11001100, B11110110, B01100000, B01100001, B10110000, B11011011, B00011110, B01100000, B11001111,
- B00110000, B11011000, B01101100, B11100110, B11000000, B01100001, B10110000, B11011011, B00011110, B01100001, B10001111,
- B00011001, B10011000, B01101100, B11000110, B11000000, B01100011, B10110001, B10011011, B00001110, B00110011, B00001111,
- B00001111, B10110000, B01111000, B11000110, B11111111, B01111110, B00011111, B00011011, B00000110, B00011110, B00001111,
-};
-
-#endif // GBCOMPATIBILITY_H
-
--- a/POKITTO_CORE/Localization.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/**************************************************************************/ -/*! - @file Localization.h - @author Hannu Viitala - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2017, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#ifndef LOCALIZATION_H -#define LOCALIZATION_H - -//** Localized strings of the Pokitto SW */ - -// Texts -#define STR_OK "OK" -#define STR_CANCEL "CANCEL" - -#endif -
--- a/POKITTO_CORE/Macros_LCD.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/**************************************************************************/
-/*!
- @file Macros_LCD.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2015, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef LCDMACROS_H
-#define LCDMACROS_H
-
-/**************************************************************************/
-/** PINS AND PORTS **/
-/**************************************************************************/
-
-#if POK_BOARDREV == 1
-/** 2-layer board version 1.3 **/
- #define LCD_CD_PORT 0
- #define LCD_CD_PIN 2
- #define LCD_WR_PORT 1
- #define LCD_WR_PIN 23
- #define LCD_RD_PORT 1
- #define LCD_RD_PIN 24
- #define LCD_RES_PORT 1
- #define LCD_RES_PIN 28
-#else
-/** 4-layer board version 2.1 **/
- #define LCD_CD_PORT 0
- #define LCD_CD_PIN 2
- #define LCD_WR_PORT 1
- #define LCD_WR_PIN 12
- #define LCD_RD_PORT 1
- #define LCD_RD_PIN 24
- #define LCD_RES_PORT 1
- #define LCD_RES_PIN 0
-#endif
-
-/**************************************************************************/
-/** LCD CONTROL MACROS **/
-/**************************************************************************/
-
-#define CLR_RESET LPC_GPIO_PORT->CLR[LCD_RES_PORT] = 1 << LCD_RES_PIN; //RST = (0); // Clear pin
-#define SET_RESET LPC_GPIO_PORT->SET[LCD_RES_PORT] = 1 << LCD_RES_PIN; // RST = (1); // Set pin
-
-#define CLR_CD LPC_GPIO_PORT->CLR[LCD_CD_PORT] = 1 << LCD_CD_PIN; // RS = (0); // Clear pin
-#define SET_CD LPC_GPIO_PORT->SET[LCD_CD_PORT] = 1 << LCD_CD_PIN; // RS = (1); // Set pin
-
-#define CLR_WR { LPC_GPIO_PORT->CLR[LCD_WR_PORT] = 1 << LCD_WR_PIN; __asm("nop");}//WR = (0); // Clear pin
-#define SET_WR LPC_GPIO_PORT->SET[LCD_WR_PORT] = 1 << LCD_WR_PIN; //WR = (1); // Set pin
-
-#define CLR_RD LPC_GPIO_PORT->CLR[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (0); // Clear pin
-#define SET_RD LPC_GPIO_PORT->SET[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (1); // Set pin
-
-#define SET_CS //CS tied to ground
-#define CLR_CS
-
-#define CLR_CS_CD_SET_RD_WR {CLR_CD; SET_RD; SET_WR;}
-#define CLR_CS_SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_WR_CS SET_WR;
-
-#define SET_MASK_P2 LPC_GPIO_PORT->MASK[2] = ~(0x7FFF8); //mask P2_3 ...P2_18
-#define CLR_MASK_P2 LPC_GPIO_PORT->MASK[2] = 0; // all on
-
-/**************************************************************************/
-/** OTHER MACROS **/
-/**************************************************************************/
-
-#define write_command w_cmd_16
-#define write_data w_data_16
-
-#define AB_JUMP 1024 // jump one 1-bit Arduboy screen forward to get next color bit
-#define GB_JUMP 504 // jump one 1-bit Gamebuino screen forward to get next color bit
-
-#endif // LCDMACROS_H
-
--- a/POKITTO_CORE/PALETTES/palAction.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#include "PokittoPalettes.h"
-
-// A palette with blue and silver gradients and color highlights for shooter games
-
-const unsigned char paletteAction[48] = {
-0x04,0x07,0x1f,
-0x05,0x05,0x5f,
-0x0e,0x09,0x93,
-0x18,0x22,0xc4,
-0x53,0xa5,0x4a,
-0xef,0xbc,0x2b,
-0xaf,0x50,0x26,
-0x8f,0x11,0x0e,
-0x14,0x20,0x38,
-0x23,0x34,0x4f,
-0x32,0x48,0x66,
-0x47,0x62,0x8c,
-0x66,0x7d,0xc7,
-0x4b,0xa9,0xd1,
-0x15,0xc9,0xda,
-0xb8,0xed,0xfb
-};
-
--- a/POKITTO_CORE/PALETTES/palCGA.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteCGA[48] = {
-0x00,0x00,0x00, //black
-0xFF,0xFF,0xFF, //white
-0xff,0x00,0xff, //magenta
-0x00,0xFF,0xFF, //cyan
-
-0xFF,0xFF,0x00, //yellow
-0x00,0xFF,0x00, //green
-0x00,0x00,0xFF, //blue
-0xFF,0x00,0x00, //red
-
-0x3F,0x3F,0x3F, //dark gray
-0x7F,0x7F,0x7F, //light gray
-0x7F,0x00,0x7F, //violet (dark magenta)
-0x00,0x7F,0x7F, //teal (dark cyan)
-
-0x7F,0x3F,0x00, //brown
-0x00,0x7F,0x00, //dark green
-0x00,0x00,0x7F, //dark blue
-0x7F,0x00,0x00 //dark red
-};
-
--- a/POKITTO_CORE/PALETTES/palDB16.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteDB16[48] = {
-0x14,0x0C,0x1C, //140c1c
-0x44,0x24,0x34, //442434
-0x30,0x34,0x6D, //30346d
-0x4E,0x4A,0x4E, //4e4a4e
-
-0x85,0x4C,0x30, //854c30
-0x34,0x65,0x24, //346524
-0xD0,0x46,0x48, //d04648
-0x75,0x71,0x61, //757161
-
-0x59,0x7D,0xCE, //597dce
-0xD2,0x7D,0x2C, //d27d2c
-0x85,0x95,0xA1, //8595a1
-0x6D,0xAA,0x2C, //6daa2c
-
-0xD2,0xAA,0x99, //d2aa99
-0x6D,0xC2,0xCA, //6dc2ca
-0xDA,0xD4,0x5E, //dad45e
-0xDE,0xEE,0xD6 //deeed6
-};
-
--- a/POKITTO_CORE/PALETTES/palDefault.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteDefault[] = {
- 6,8,32,0, // width, height, start, only caps
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
- 0x01, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
-};
-
-
-
--- a/POKITTO_CORE/PALETTES/palGameboy.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteGameboy[48] = {
-//original grayscale
-0xFF,0xFF,0xFF, //white
-0xAA,0xAA,0xAA, //light gray
-0x55,0x55,0x55, //dark gray
-0x00,0x00,0x00, //black
-//optimum color output
-0xed,0xed,0xff, //white
-0xff,0xcc,0xc1, //light gray
-0xff,0x00,0x00, //dark gray
-0x00,0x89,0x01, //black
-//red-green contrast
-//0xed,0xFf,0xea, //white edffea
-//0xff,0xb1,0xe2, //light gray efa1ce ffb1e2
-//0xb6,0x00,0x92, //dark gray b60092
-//0x5f,0x66,0x00, //black 5f6600
-
-//cyan-pink contrast
-//0xea,0xff,0xfd, //white
-//0xff,0xb1,0xe3, //light gray
-//0xb6,0x00,0x92, //dark gray
-//0x5a,0x1b,0x00, //black
-
-// sunset
-//0xff,0xa5,0x6e, //white
-//0xf5,0xb6,0xbb, //light gray
-//0xdb,0x28,0x5a, //dark gray
-//0x91,0x34,0x00, //black
-//cotton sky
-0x6f,0xe5,0xff, //white
-0xff,0xc8,0xb6, //light gray
-0xff,0x03,0x54, //dark gray
-0x12,0x00,0x38, //black
-// beautiful yellow,pink,red,brown color contrast
-0xFF,0xF2,0x91, //white fff291
-0xf7,0xe0,0xd1, //light gray f7e0d1
-0xff,0x2d,0x61, //dark gray ff2d61
-0x72,0x58,0x0b, //black 72580b
-};
-
--- a/POKITTO_CORE/PALETTES/palMagma.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteMagma[48] = {
-0xfb,0xff,0xb2,
-0xfc,0xda,0x90,
-0xfc,0xad,0x6e,
-0xfa,0x82,0x56,
-0xf2,0x57,0x4a,
-0xe7,0x43,0x4c,
-0xc4,0x2a,0x5c,
-0xa7,0x20,0x66,
-0x89,0x19,0x6c,
-0x6e,0x12,0x6e,
-0x62,0x0d,0x6e,
-0x53,0x06,0x6d,
-0x3f,0x00,0x69,
-0x2a,0x00,0x5b,
-0x18,0x0b,0x3a,
-0x06,0x04,0x11
-};
-
--- a/POKITTO_CORE/PALETTES/palMono.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteMono[48] = {
-0xFF,0xFF,0xFF, //white
-0xAA,0xAA,0xAA, //light gray
-0x55,0x55,0x55, //dark gray
-0x00,0x00,0x00, //black
-
-0xFF,0xea,0xed, //white ffeaed
-0xA1,0xce,0xe8, //light gray a1cee8
-0x00,0x92,0xb6, //dark gray 0092b6
-0x66,0x00,0x5f, //black 66005f
-
-0xed,0xFf,0xea, //white edffea
-0xff,0xb1,0xe2, //light gray efa1ce ffb1e2
-0xb6,0x00,0x92, //dark gray b60092
-0x5f,0x66,0x00, //black 5f6600
-
-0xFF,0xFF,0xFF, //white
-0xAA,0xAA,0xAA, //light gray
-0x55,0x55,0x55, //dark gray
-0x00,0x00,0x00, //black
-};
-
--- a/POKITTO_CORE/PALETTES/palPico.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char palettePico[16*3] = {
- 0,0,0,
- 29,43,83,
- 126,37,83,
- 0,135,81,
-
- 171,82,54,
- 95,87,79,
- 194,195,199,
- 255,241,232,
-
- 255,0,77,
- 255,163,0,
- 255,240,36,
- 0,231,86,
-
- 41,173,255,
- 131,118,156,
- 255,119,168,
- 255,204,170
-};
-
-
-
-
-
--- a/POKITTO_CORE/PALETTES/palRainbow.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteRainbow[48] = {
-0xfb,0x00,0x25,
-0xfb,0x00,0x70,
-0xfb,0x00,0xeb,
-0x8f,0x00,0xff,
-0x3d,0x00,0xff,
-0x00,0x00,0xff,
-0x09,0x54,0xff,
-0x17,0xb5,0xff,
-0x22,0xff,0xc4,
-0x22,0xff,0x52,
-0x24,0xff,0x06,
-0x5d,0xff,0x07,
-0xa3,0xff,0x09,
-0xf6,0xff,0x0a,
-0xfe,0xc2,0x09,
-0xfc,0x62,0x08
-};
-
-
--- a/POKITTO_CORE/PALETTES/palZXSpec.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#include "PokittoPalettes.h"
-
-const unsigned char paletteZXSpec[48] = {
-0x00,0x00,0x00, //black
-0x1C,0x1C,0x1C, // ANOTHER BLACK - POINTLESS. IVE MADE A VERY DARK GREY INSTEAD.
-0x00,0x00,0xC0, //blue d
-0x00,0x00,0xFF, //blue l
-
-0xC0,0x00,0x00, // red d
-0xFF,0x00,0x00, // red l
-0xC0,0x00,0xC0, // magenta d
-0xFF,0x00,0xFF, // magenta l
-
-0x00,0xC0,0x00, // green d
-0x00,0xFF,0x00, // green l
-0x00,0xC0,0xC0, // cyan d
-0x00,0xFF,0xFF, // cyan l
-
-0xC0,0xC0,0x00, // yellow d
-0xFF,0xFF,0x00, // yellow l
-0xC0,0xC0,0xC0, // grey
-0xFF,0xFF,0xFF // white
-};
-
--- a/POKITTO_CORE/PokittoBacklight.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoBacklight.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoBacklight.h"
-
-using namespace Pokitto;
-
-bool Backlight::automatic;
-uint16_t Backlight::ambientLight;
-uint8_t Backlight::backlightValue;
-uint8_t Backlight::backlightMin, Backlight::backlightMax;
-uint16_t Backlight::ambientLightMin, Backlight::ambientLightMax;
-
-void Backlight::begin() {
-
-}
-
-void Backlight::set(uint8_t value) {
-
-}
-
-void Backlight::update() {
-
-}
-
--- a/POKITTO_CORE/PokittoBacklight.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoBacklight.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_BACKLIGHT
-#define POKITTO_BACKLIGHT
-
-#include <stdint.h>
-
-namespace Pokitto {
-class Backlight {
-public:
- static void begin();
- static void set(uint8_t value);
- static void update();
- static bool automatic;
- static uint16_t ambientLight;
- static uint8_t backlightValue;
- static uint8_t backlightMin, backlightMax;
- static uint16_t ambientLightMin, ambientLightMax;
-};
-}
-#endif // POKITTO_BACKLIGHT
-
--- a/POKITTO_CORE/PokittoBattery.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoBattery.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoBattery.h"
-
-using namespace Pokitto;
-
-bool Battery::show;
-uint8_t Battery::level;
-uint16_t Battery::voltage;
-uint16_t Battery::thresholds[NUM_LVL];
-uint8_t Battery::nextUpdate;
-
-void Battery::begin() {
-
-}
-
-void Battery::update() {
- //ToDo - make a real function
- level=0xFF; //full battery all the time
-}
-
--- a/POKITTO_CORE/PokittoBattery.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoBattery.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOBATTERY_H
-#define POKITTOBATTERY_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoGlobs.h"
-
-
-namespace Pokitto {
-
-class Battery {
-public:
- static void begin();
- static void update();
- static bool show;
- static uint8_t level;
- static uint16_t voltage;
- static uint16_t thresholds[NUM_LVL];
- static uint8_t nextUpdate;
-};
-}
-
-#endif //POKITTOBATTERY_H
-
--- a/POKITTO_CORE/PokittoButtons.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoButtons.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-
-using namespace Pokitto;
-
-uint8_t Buttons::pins[NUM_BTN];
-uint8_t Buttons::states[NUM_BTN];
-uint8_t Buttons::buttons_state;
-uint8_t Buttons::buttons_held;
-uint8_t Buttons::buttons_released; // from LSB up,down,left,right,a,b,c
-uint16_t Buttons::cHWLongPress = CHWLONGPRESSTIMEOUT;
-
-
-void Buttons::begin() {
- #ifndef POK_SIM
- Pokitto::initButtons();
- #endif // POK_SIM
-}
-
-void Buttons::update() {
- #if POK_USE_CONSOLE > 1
- if (console.conscounter) return;
- #endif // POK_USE_CONSOLE
- #ifndef POK_SIM
- /** HARDWARE CODE **/
- for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
- if (Pokitto::heldStates[thisButton]) { //if button pressed
- states[thisButton]++; //increase button hold time
- } else {
- if (states[thisButton] == 0)//button idle
- continue;
- if (states[thisButton] == 0xFF)//if previously released
- states[thisButton] = 0; //set to idle
- else
- states[thisButton] = 0xFF; //button just released
- }
- }
- #else
- /** POK_SIM code **/
- simulator.pollButtons();
- for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
- uint8_t temp=0;
- switch (thisButton) {
- case 0:
- temp = simulator.leftHeld(); break;
- case 1:
- temp = simulator.upHeld(); break;
- case 2:
- temp = simulator.rightHeld(); break;
- case 3:
- temp = simulator.downHeld(); break;
- case 4:
- temp = simulator.aHeld(); break;
- case 5:
- temp = simulator.bHeld(); break;
- case 6:
- temp = simulator.cHeld(); break;
- default:
- break;
- }
-
- if (temp == HIGH) { //if button pressed
- states[thisButton]++; //increase button hold time
- } else {
- if (states[thisButton] == 0)//button idle
- continue;
- if (states[thisButton] == 0xFF)//if previously released
- states[thisButton] = 0; //set to idle
- else
- states[thisButton] = 0xFF; //button just released
- }
- }
-
- #endif // POK_SIM
-}
-
-/*
- * Returns true when 'button' is pressed.
- * The button has to be released for it to be triggered again.
- */
-bool Buttons::pressed(uint8_t button) {
- if (states[button] == 1)
- return true;
- else
- return false;
-}
-
-/*
- * return true if 'button' is released
- */
-bool Buttons::released(uint8_t button) {
- if (states[button] == 0xFF)
- return true;
- else
- return false;
-}
-
-/**
- * returns true ONCE when 'button' is held for 'time' frames
- * @param button The button's ID
- * @param time How much frames button must be held, between 1 and 254.
- * @return true when 'button' is held for 'time' frames
- */
-bool Buttons::held(uint8_t button, uint8_t time){
- if(states[button] == (time+1))
- return true;
- else
- return false;
-}
-
-/**
- * returns true every 'period' frames when 'button' is held
- * @param button The button's ID
- * @param period How much frames button must be held, between 1 and 254.
- * @return true if the button is held for the given time
- */
-bool Buttons::repeat(uint8_t button, uint8_t period) {
- if (period <= 1) {
- if ((states[button] != 0xFF) && (states[button]))
- return true;
- } else {
- if ((states[button] != 0xFF) && ((states[button] % period) == 1))
- return true;
- }
- return false;
-}
-
-/**
- *
- * @param button The button's ID
- * @return The number of frames during which the button has been held.
- */
-uint8_t Buttons::timeHeld(uint8_t button){
- if(states[button] != 0xFF)
- return states[button];
- else
- return 0;
-
-}
-
-void Buttons::pollButtons() {
- #ifdef POK_SIM
- simulator.pollButtons();
- #else
- uint8_t buttons_state_old = buttons_state;
- buttons_state = 0; // clear all
- if (upBtn()) buttons_state |= (1<<UPBIT);
- if (downBtn()) buttons_state |= (1<<DOWNBIT);
- if (leftBtn()) buttons_state |= (1<<LEFTBIT);
- if (rightBtn()) buttons_state |= (1<<RIGHTBIT);
- if (aBtn()) buttons_state |= (1<<ABIT);
- if (bBtn()) buttons_state |= (1<<BBIT);
- if (cBtn()) buttons_state |= (1<<CBIT);
- buttons_held = buttons_state & buttons_state_old; // only if both 1, end result is 1
- buttons_released = ~buttons_state & buttons_state_old; // if now zero, then 1 AND previous 1 = 1
- #endif // POK_SIM
-}
-
-uint8_t Buttons::aBtn() {
- #ifdef POK_SIM
- return simulator.aBtn();
- #else
- return Pokitto::heldStates[BTN_A];
- #endif // POK_SIM
-}
-
-
-uint8_t Buttons::bBtn() {
- #ifdef POK_SIM
- return simulator.bBtn();
- #else
- return Pokitto::heldStates[BTN_B];
- #endif // POK_SIM
-}
-
-uint8_t Buttons::cBtn() {
- uint8_t c;
- #ifdef POK_SIM
- c = simulator.cBtn();
- #else
- c = Pokitto::heldStates[BTN_C];
- #endif // POK_SIM
- return c;
-}
-
-uint8_t Buttons::leftBtn() {
- #ifdef POK_SIM
- return simulator.leftBtn();
- #else
- return Pokitto::heldStates[BTN_LEFT];
- #endif // POK_SIM
-}
-
-uint8_t Buttons::rightBtn() {
- #ifdef POK_SIM
- return simulator.rightBtn();
- #else
- return Pokitto::heldStates[BTN_RIGHT];
- #endif // POK_SIM
-}
-
-uint8_t Buttons::upBtn() {
- #ifdef POK_SIM
- return simulator.upBtn();
- #else
- return Pokitto::heldStates[BTN_UP];
- #endif // POK_SIM
-}
-
-uint8_t Buttons::downBtn() {
- #ifdef POK_SIM
- return simulator.downBtn();
- #else
- return Pokitto::heldStates[BTN_DOWN];
- #endif // POK_SIM
-}
-
-
-
-
-
-
-
-
-//** EOF **//
-
--- a/POKITTO_CORE/PokittoButtons.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoButtons.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOBUTTONS_H
-#define POKITTOBUTTONS_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoGlobs.h"
-
-#ifndef POK_SIM
- #include "HWButtons.h"
- #define CHWLONGPRESSTIMEOUT 100
-#else
- #include "PokittoSimulator.h"
- #define CHWLONGPRESSTIMEOUT 1000
-#endif // POK_SIM
-
-
-namespace Pokitto {
-
-class Buttons {
-public:
- // Original functions
- static uint8_t buttons_state, buttons_held, buttons_released;
- static void initButtons();
- static void pollButtons();
- static uint8_t leftBtn();
- static uint8_t rightBtn();
- static uint8_t upBtn();
- static uint8_t downBtn();
- static uint8_t aBtn();
- static uint8_t bBtn();
- static uint8_t cBtn();
- static uint8_t leftHeld();
- static uint8_t rightHeld();
- static uint8_t upHeld();
- static uint8_t downHeld();
- static uint8_t aHeld();
- static uint8_t bHeld();
- static uint8_t cHeld();
-
- static uint8_t leftReleased();
- static uint8_t rightReleased();
- static uint8_t upReleased();
- static uint8_t downReleased();
- static uint8_t aReleased();
- static uint8_t bReleased();
- static uint8_t cReleased();
-
- // GB compatibility functions
- static void begin();
- static void update();
- static bool pressed(uint8_t button);
- static bool released(uint8_t button);
- static bool held(uint8_t button, uint8_t time);
- static bool repeat(uint8_t button, uint8_t period);
- static uint8_t timeHeld(uint8_t button);
- static uint8_t pins[NUM_BTN];
- static uint8_t states[NUM_BTN];
- static uint8_t heldStates[NUM_BTN]; // additional, not GB based
-private:
- static uint16_t cHWLongPress; //forced hardware detection of C long press
-};
-
-}
-
-#endif // POKITTOBUTTONS_H
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoConsole.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoConsole.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoGlobs.h"
-#include "PokittoConsole.h"
-#include "PokittoFonts.h"
-#include "PokittoDisplay.h"
-
-Pokitto::Console pConsole;
-
-using namespace Pokitto;
-
-consmsg Console::msgbuf[CONSOLEBUFSIZE];
-uint8_t Console::conslast;
-uint8_t Console::consfirst;
-uint8_t Console::conspointer;
-uint16_t Console::conscounter;
-uint16_t Console::color;
-Display* Console::_display;
-uint8_t Console::mode;
-uint8_t Console::visible;
-unsigned char* Console::font;
-
-Console::Console() {
- conslast=consfirst=conspointer=conscounter=0;
- color=0xFFFF;
- font=(unsigned char*)fontMini;
- #if POK_CONSOLE_VISIBLE_AT_STARTUP > 0
- mode=CONS_OVERLAY|CONS_VISIBLE;
- #else
- mode=CONS_OVERLAY;//|CONS_VISIBLE;
- #endif
-}
-
-void Console::Toggle() {
- if (!conscounter) // conscounter is a debounce feature for console toggle
- {
- mode ^= CONS_VISIBLE;
- conscounter = CONS_TIMEOUT;
- }
-}
-
-
-void Console::AddMessage(uint8_t source, uint8_t msgtype) {
- AddMessage(source,msgtype, V_NONE,0);
-}
-
-
-void Console::AddMessage(uint8_t type, char* stringptr) {
- AddMessage(MSOURCE_USER,type,V_STRING, (uint32_t) stringptr);
-}
-
-
-void Console::AddMessage(uint8_t msgtype, uint8_t valtype, uint32_t val) {
- AddMessage(MSOURCE_USER,msgtype,valtype,val);
-}
-
-void Console::AddMessage(uint8_t source, uint8_t msgtype, uint8_t valtype, uint32_t val) {
- consmsg c;
- c.msgsource = source;
- c.msgtype = msgtype;
- c.valtype = valtype;
- c.val = val;
- msgbuf[conslast] = c;
- conslast++;
- if (conslast==CONSOLEBUFSIZE) conslast = 0; // wrap around the buffer
- consfirst = conslast + 1;
- if (consfirst == CONSOLEBUFSIZE) consfirst = 0;
-}
-
-void Console::Last() {
- conspointer = conslast;
-}
-
-void Console::RemoveLast() {
- Last();
- Previous();
- msgbuf[conspointer].msgsource = MSOURCE_USER;
- msgbuf[conspointer].msgtype = MSG_OK;
- msgbuf[conspointer].val = 0;
- msgbuf[conspointer].valtype = 0;
- conslast = conspointer;
-}
-
-void Console::First() {
- consmsg c;
- uint16_t outofbounds=0;
- conspointer = consfirst;
- c=GetMessage();
- while (!c.msgsource) {
- Next();
- c=GetMessage();
- outofbounds++;
- if (outofbounds==CONSOLEBUFSIZE) {
- conspointer = consfirst;
- break;
- }
- }
-}
-
-void Console::Previous() {
- if (conspointer==0) conspointer = CONSOLEBUFSIZE-1;
- else conspointer--;
-}
-
-void Console::Next() {
- if (conspointer==CONSOLEBUFSIZE-1) conspointer = 0;
- else conspointer++;
-}
-
-consmsg Console::GetMessage() {
- return msgbuf[conspointer];
-}
-
-void Console::PrintMessage() {
- consmsg c = msgbuf[conspointer];
- switch (c.msgsource) {
- case MSOURCE_APP:
- _display->print("App:");break;
- case MSOURCE_BATT:
- _display->print("Batt:");break;
- case MSOURCE_BTNA:
- _display->print("A:");break;
- case MSOURCE_BTNB:
- _display->print("B:");break;
- case MSOURCE_BTNC:
- _display->print("C:");break;
- case MSOURCE_BTNU:
- _display->print("Up:");break;
- case MSOURCE_BTND:
- _display->print("Down:");break;
- case MSOURCE_BTNL:
- _display->print("Left:");break;
- case MSOURCE_BTNR:
- _display->print("Right:");break;
- case MSOURCE_LCD:
- _display->print("LCD:");break;
- case MSOURCE_SD:
- _display->print("SD:");break;
- case MSOURCE_SOUND:
- _display->print("Sound:");break;
- case MSOURCE_TIMER:
- _display->print("Timer:");break;
- case MSOURCE_USER:
- _display->print("User:");break;
- case MSOURCE_COLLISION:
- _display->print("Hit:");break;
- default:
- return;
- }
-
- switch (c.msgtype) {
- case MSG_OK:
- _display->print("OK ");break;
- case MSG_INIT_OK:
- _display->print("INIT OK ");break;
- case MSG_INIT_FAIL:
- _display->print("INIT FAIL ");break;
- case MSG_WARNING:
- _display->print("WARNING ");break;
- case MSG_FATAL:
- _display->print("FATAL ");break;
- case MSG_GFX_MODE_CHANGE:
- _display->print("MODE ");break;
- case MSG_GFX_MODE_INVALID:
- _display->print("INVALID!");break;
- case MSG_NOT_ENOUGH_MEM:
- _display->print("NOT ENOUGH MEM ");break;
- case MSG_UP:
- _display->print("KEYUP");break;
- case MSG_DOWN:
- _display->print("KEYDOWN");break;
- case MSG_BREAK:
- _display->print("BREAK ");break;
- case MSG_YESNO:
- _display->print("YES(A)/NO(B)");break;
- case MSG_YES:
- _display->print("YES");break;
- case MSG_NO:
- _display->print("NO");break;
- case MSG_OBJECT:
- _display->print("OBJ1: ");break;
- case MSG_OBJECT2:
- _display->print("OBJ2: ");break;
- default:
- _display->print(" ");
- }
-
- switch (c.valtype) {
- case V_NONE:
- _display->println();break;
- case V_UINT8:
- _display->println((uint16_t)c.val);break;
- case V_INT8:
- _display->println((int16_t)c.val);break;
- case V_UINT16:
- _display->println((uint16_t)c.val);break;
- case V_INT16:
- _display->println((int16_t)c.val);break;
- case V_UINT32:
- _display->println((uint32_t)c.val);break;
- case V_INT32:
- _display->println((int32_t)c.val);break;
- case V_FLOAT:
- _display->println((float)c.val);break;
- case V_STRING:
- _display->println((char*)c.val);break;
- default:
- _display->println();
- }
-
- if (c.msgtype == MSG_BREAK || c.msgtype == MSG_YESNO) {
- #ifndef POK_SIM
- __disable_irq(); // Disable Interrupts
- #else
- pauseAudio(1);
- visible = false; // avoid loop in loop inside refreshDisplay
- simulator.wait_ms(300);
- #endif
- int rval=0;
- while(!rval) {
- _buttons->pollButtons();
- #ifdef POK_SIM
- simulator.refreshDisplay();
- #endif // POK_SIM
- if (_buttons->aBtn()) rval = 1;
- if (_buttons->bBtn()) rval = -1;
- }
- /* now remove this message to prevent it from rerunning */
- if (c.msgtype == MSG_YESNO) {
- int8_t* v;
- v = (int8_t*) c.val; //c.val is a pointer to the memory location that receives answer
- *v = rval; // return value through pointer
- msgbuf[conspointer].msgsource = MSOURCE_USER;
- if (rval==1) msgbuf[conspointer].msgtype = MSG_YES;
- else msgbuf[conspointer].msgtype = MSG_NO;
- } else msgbuf[conspointer].msgsource = MSOURCE_NULL;
-
- #ifndef POK_SIM
- __enable_irq(); // Enable Interrupts
- #else
- pauseAudio(0);
- visible = true;
- #endif
- }
-}
-
-void Console::Draw() {
- unsigned char* oldfont;
- int16_t oldx,oldy;
- uint16_t oldcolor;
- uint8_t oldsize;
- oldfont = (unsigned char*) _display->font;
- oldx = _display->cursorX;
- oldy = _display->cursorY;
- oldcolor = _display->directcolor;
- oldsize = _display->fontSize;
- if (!(mode & CONS_OVERLAY)) _display->clearLCD();
- _display->setFont(font5x7);
- _display->fontSize=1;
- _display->setCursor(0,0);
- _display->directcolor=color;
- First();
- while(conspointer!=conslast) {
- PrintMessage();
- Next();
- if (GetMessage().msgsource==MSOURCE_NULL) break;
- }
- _display->font = oldfont;
- _display->fontSize = oldsize;
- _display->cursorX = oldx;
- _display->cursorY = oldy;
- _display->directcolor = oldcolor;
-}
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoConsole.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoConsole.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_CONSOLE_H
-#define POKITTO_CONSOLE_H
-
-#include "Pokitto_settings.h"
-#include "PokittoButtons.h"
-#include <stdint.h>
-
-struct consmsg {
- uint32_t val;
- uint8_t valtype;
- uint8_t msgsource;
- uint8_t msgtype;
-};
-
-/** VAL TYPES **/
-#define V_UINT8 0
-#define V_INT8 1
-#define V_UINT16 2
-#define V_INT16 3
-#define V_UINT32 4
-#define V_INT32 5
-#define V_FLOAT 6
-#define V_STRING 7
-#define V_NONE 8
-
-/** MESSAGE TYPE **/
-#define MSG_NULL 0
-#define MSG_OK 1
-#define MSG_WARNING 2
-#define MSG_FATAL 255
-#define MSG_INIT_OK 3
-#define MSG_INIT_FAIL 4
-#define MSG_NOT_ENOUGH_MEM 5
-#define MSG_GFX_MODE_CHANGE 6
-#define MSG_GFX_MODE_INVALID 7
-#define MSG_UP 8
-#define MSG_DOWN 9
-#define MSG_PRINT 10
-#define MSG_BREAK 11
-#define MSG_YESNO 12
-#define MSG_YES 13
-#define MSG_NO 14
-#define MSG_OBJECT 15
-#define MSG_OBJECT2 16
-
-/** MESSAGE SOURCE **/
-#define MSOURCE_NULL 0
-#define MSOURCE_SD 1
-#define MSOURCE_LCD 2
-#define MSOURCE_SOUND 3
-#define MSOURCE_TIMER 4
-#define MSOURCE_BTNA 5
-#define MSOURCE_BTNB 6
-#define MSOURCE_BTNC 7
-#define MSOURCE_BTNU 8
-#define MSOURCE_BTND 9
-#define MSOURCE_BTNL 10
-#define MSOURCE_BTNR 11
-#define MSOURCE_BATT 12
-#define MSOURCE_APP 13
-#define MSOURCE_USER 14
-#define MSOURCE_COLLISION 15
-
-/** CONSOLE MODES **/
-#define CONS_OVERLAY 0x1
-#define CONS_PAUSE 0x2
-#define CONS_STEP 0x4
-#define CONS_VISIBLE 0x8
-
-
-/** CONSOLE DEBOUNCE **/
-#define CONS_TIMEOUT 20
-extern uint16_t conscounter;
-
-
-
-namespace Pokitto {
-
-class Display;
-
-class Console {
-public:
- /** Console class constructor */
- Console();
-
- static uint8_t mode;
- static uint8_t visible;
- static unsigned char* font;
- static void Toggle();
- static void AddMessage(uint8_t, uint8_t, uint8_t, uint32_t);
- static void AddMessage(uint8_t, uint8_t);
- static void AddMessage(uint8_t, char*);
- static void AddMessage(uint8_t, uint8_t, uint32_t);
- static void Last();
- static void First();
- static void RemoveLast();
- static void Previous();
- static void Next();
- static consmsg GetMessage();
- static void PrintMessage();
- static void Purge();
- static void Draw(); // pokConsole
-
-private:
- /** Message buffer */
- static consmsg msgbuf[CONSOLEBUFSIZE];
- static uint8_t conslast;
- static uint8_t consfirst;
- static uint8_t conspointer;
-public:
- static uint16_t conscounter;
- static uint16_t color;
- static Display* _display;
- static Buttons* _buttons;
-};
-
-
-} // namespace
-
-// this is the console used by the core if POK_USE_CONSOLE is nonzero
-extern Pokitto::Console console;
-
-#endif // POKITTO_CONSOLE_H
-
--- a/POKITTO_CORE/PokittoCore.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1114 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoCore.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-#include "Pokitto_settings.h"
-#include "PokittoConsole.h"
-#include "PokittoFonts.h"
-#include "PokittoTimer.h"
-#include "PokittoLogos.h"
-#include <stdlib.h>
-#ifndef DISABLEAVRMIN
-#define max(a,b) ((a)>(b)?(a):(b))
-#endif // DISABLEAVRMIN
-
-char selectedfile[25];
-
-//#define F
-
-#ifndef POK_SIM
-/** start the user application
-* https://community.nxp.com/thread/417695
-*
-*/
-void start_application(unsigned long app_link_location){
- //asm(" ldr sp, [r0,#0]");
- //asm(" ldr pc, [r0,#4]");
- //This code is not valid for the Cortex-m0+ instruction set.
- // The equivalent for this (as used by the KL26) is
-__disable_irq();// Start by disabling interrupts, before changing interrupt vectors
-
-// delete buttons
-//pokDeleteButtons();
-
-// completely kill button interrupts in preparation for reset
-LPC_PINT->IENR = 0;
-LPC_PINT->IENF = 0;
-
-SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk & ~(SysTick_CTRL_ENABLE_Msk); //disable systick
-LPC_SYSCON->PDRUNCFG |= (1 << 10); /* Power-down USB PHY */
-LPC_SYSCON->PDRUNCFG |= (1 << 8); /* Power-down USB PLL */
-
-// reset clock source to IRC
-LPC_SYSCON->MAINCLKUEN = 0x01; /* Update MCLK Clock Source */
-LPC_SYSCON->MAINCLKUEN = 0x00; /* Toggle Update Register */
-while (LPC_SYSCON->MAINCLKUEN & 0x01); /* Wait Until Updated */
-// switch clock selection to IRC
-LPC_SYSCON->MAINCLKSEL = 0; /* Select Clock Source */
-LPC_SYSCON->MAINCLKUEN = 0x01; /* Update MCLK Clock Source */
-LPC_SYSCON->MAINCLKUEN = 0x00; /* Toggle Update Register */
-while (LPC_SYSCON->MAINCLKUEN & 0x01); /* Wait Until Updated */
-//disable PLL clock output
-LPC_SYSCON->SYSPLLCLKUEN = 0;
-while (LPC_SYSCON->SYSPLLCLKUEN & 0x00);
-LPC_SYSCON->SYSPLLCTRL = 0;
-
-//kill peripherals
-LPC_SYSCON->MAINCLKSEL = 0;
-LPC_SYSCON->PRESETCTRL = 0; //disable all peripherals
-
-//power down PLL
-volatile uint32_t tmp;
-tmp = (LPC_SYSCON->PDRUNCFG & 0x000025FFL);
-tmp |= ((1<<7) & 0x000025FFL);
-LPC_SYSCON->PDRUNCFG = (tmp | 0x0000C800L); /* Power-down SYSPLL */
-
-//Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC); //switch to IRC
-
-// clear all gpio states
-LPC_GPIO_PORT->PIN[0] = 0;
-LPC_GPIO_PORT->PIN[1] = 0;
-LPC_GPIO_PORT->PIN[2] = 0;
-
-SCB->VTOR = app_link_location;//APPL_ADDRESS; /* Change vector table address */
-/*asm(" mov r0, %[address]"::[address] "r" (app_link_location));
-asm(" ldr r1, [r0,#0]"); // get the stack pointer value from the program's reset vector
-asm(" mov sp, r1"); // copy the value to the stack pointer
-asm(" ldr r0, [r0,#4]"); // get the program counter value from the program's reset vector
-asm(" blx r0"); // jump to the' start address*/
-}
-#endif
-
-// returns a random integar between 0 and maxVal
-int random(int maxVal)
-{
- return random( 0, maxVal);
-}
-
-// returns a random integar between minVal and maxVal
-int random(int minVal, int maxVal)
-{
- // int rand(void); included by default from newlib
- return rand() % (maxVal-minVal+1) + minVal;
-}
-
-using namespace Pokitto;
-
-bool Core::run_state; // this definition needed
-
-/** Components */
-Backlight Core::backlight;
-Buttons Core::buttons;
-Battery Core::battery;
-#if POK_ENABLE_SOUND > 0
-Sound Core::sound;
-#endif
-Display Core::display;
-
-//GB Related
-uint8_t Core::startMenuTimer;
-uint8_t Core::timePerFrame;
-uint32_t Core::nextFrameMillis;
-uint32_t Core::frameCount;
-const char* Core::popupText;
-uint8_t Core::popupTimeLeft;
-uint16_t Core::frameDurationMicros;
-uint32_t Core::frameStartMicros, Core::frameEndMicros;
-uint8_t Core::volbar_visible=0;
-
-
-Core::Core() {
-
-}
-
-void Core::showWarning() {
- display.enableDirectPrinting(true);
- display.directbgcolor = COLOR_BLACK;
- display.clearLCD();
- display.directcolor = COLOR_RED;
- display.setFont(fntC64UIGfx);
- display.adjustCharStep = 0;
- display.adjustLineStep = 0;
- display.setCursor(10*8,9);
- display.print("WARNING!");
- display.directcolor = COLOR_WHITE;
- display.setCursor(5*8,4*9);
- display.print("LOUD SOUND THROUGH");
- display.setCursor(2*8,5*9);
- display.print("HEADPHONES COULD DAMAGE");
- display.setCursor(7*8,6*9);
- display.print("YOUR HEARING.");
- display.setCursor(5*8,8*9);
- display.print("USE "); display.directcolor = COLOR_GREEN;
- display.print("0-100% VOLUME");
- display.directcolor = COLOR_WHITE;
- display.setCursor(5*8,9*9);
- display.print("FOR LISTENING WITH");
- display.setCursor(8*8,10*9);
- display.print("HEADPHONES");
- display.setCursor(5*8,12*9);
- display.print("USE "); display.directcolor = COLOR_RED;
- display.print("> 100% VOLUME"); display.directcolor = COLOR_GREEN;
- display.directcolor = COLOR_WHITE;
- display.setCursor(1*8,13*9);
- display.print("ONLY FOR LISTENING VIA THE");
- display.setCursor(5*8,14*9);
- display.print("BUILT-IN SPEAKER");
- display.setCursor(5*8,17*9);
- display.print("PRESS ");display.directcolor = COLOR_GREEN;
- display.print("C ");display.directcolor = COLOR_WHITE;
- display.print("TO ACCEPT");
- while (!buttons.cBtn()) {
- wait(100);
- }
- display.clearLCD();
- display.enableDirectPrinting(false);
-}
-
-void Core::jumpToLoader() {
- display.fontSize=1;
- display.directbgcolor=COLOR_BLACK;
- display.directcolor=COLOR_GREEN;
- display.setCursor(0,0);
- display.enableDirectPrinting(true);
- #ifdef POK_SIM
- display.println("LOADER IS NOT AVAILABLE ON THE SIMULATOR. PRESS A TO RETURN.");
- #else
- uint32_t* bootinfo;
- bootinfo = (uint32_t*)0x3FFF4;
- if (*bootinfo != 0xB007AB1E) display.println("NO LOADER CONNECTED!");
- else start_application(*(bootinfo+2)); //never returns
- #endif // POK_SIM
- while (!buttons.aBtn()) {
- buttons.pollButtons();
- if (buttons.aBtn()) {
- while (buttons.aBtn()) {
- buttons.pollButtons();
- }
- return;
- }
- }
-}
-
-void Core::askLoader() {
- display.enableDirectPrinting(true);
- display.directbgcolor = COLOR_BLACK;
- display.clearLCD();
- display.directcolor = COLOR_RED;
- display.setFont(fntC64UIGfx);
- display.fontSize=1;
- display.adjustCharStep = 0;
- display.adjustLineStep = 0;
- display.directcolor=COLOR_GREEN;
- display.set_cursor(12*8,6*8);
- display.print("ijkl");
- display.set_cursor(12*8,7*8);
- display.print("mnop");
- display.set_cursor(12*8,8*8);
- display.print("qrst");
- display.set_cursor(12*8,9*8);
- display.print("uvwx");
- display.set_cursor(5*8,12*8);
- display.print("PRESS");
- display.directcolor=COLOR_WHITE;
- display.print(" C ");
- display.directcolor=COLOR_GREEN;
- display.print("FOR LOADER");
- display.directcolor=COLOR_WHITE;
- display.fontSize=2;
- int countd=POK_LOADER_COUNTDOWN; uint16_t c2 = getTime();
- while (countd) {
- buttons.pollButtons();
- display.set_cursor(13*8,15*8);
- display.print(countd);
- if (getTime()>c2+1000) {
- c2=getTime();
- countd--;
- }
- if (cBtn()) {while (cBtn()) buttons.pollButtons();jumpToLoader();countd=0;}
- if (aBtn()) {while (aBtn()) buttons.pollButtons();countd=0;}
- if (bBtn()) {while (bBtn()) buttons.pollButtons();countd=0;}
- }
- display.fontSize=1;
- display.clearLCD();
- display.enableDirectPrinting(false);
-}
-
-
-void Core::drawvolbar(int x, int y, int level, bool text) {
- uint16_t oldcol = display.directcolor;
- if (text) display.directRectangle(0,0,50,50,COLOR_BLACK);
- display.directcolor = COLOR_GREEN;
- if (text) {
- bool temp = display.isDirectPrintingEnabled();
- display.enableDirectPrinting(true);
- display.print(x-1,y-20,(int)sound.getVolume());
- display.print(" ");
- display.enableDirectPrinting(temp);
- }
- if (level<12) display.directcolor = COLOR_GRAY_80;
- display.directBitmap(x,y,Pokitto_volumebar,1,1);
- if (level<24) display.directcolor = COLOR_GRAY_80;
- display.directBitmap(x+8,y,Pokitto_volumebar,1,1);
- display.directBitmap(x+8,y-4,Pokitto_volumebar,1,1);
- display.directcolor = COLOR_RED;
- if (level<48) display.directcolor = COLOR_GRAY_80;
- display.directBitmap(x+16,y,Pokitto_volumebar,1,1);
- display.directBitmap(x+16,y-4,Pokitto_volumebar,1,1);
- display.directBitmap(x+16,y-8,Pokitto_volumebar,1,1);
-
- if (level<96) {
- display.directcolor = COLOR_GRAY_80;
- }
- display.directBitmap(x+24,y,Pokitto_volumebar,1,1);
- display.directBitmap(x+24,y-4,Pokitto_volumebar,1,1);
- display.directBitmap(x+24,y-8,Pokitto_volumebar,1,1);
- display.directBitmap(x+24,y-12,Pokitto_volumebar,1,1);
- if (level<160) {
- display.directcolor = COLOR_GRAY_80;
- }
- display.directBitmap(x+32,y,Pokitto_volumebar,1,1);
- display.directBitmap(x+32,y-4,Pokitto_volumebar,1,1);
- display.directBitmap(x+32,y-8,Pokitto_volumebar,1,1);
- display.directBitmap(x+32,y-12,Pokitto_volumebar,1,1);
- display.directBitmap(x+32,y-16,Pokitto_volumebar,1,1);
- display.directcolor = oldcol;
-}
-
-
-#ifdef POK_SIM
-#define VINCMULT 1
-#else
-#define VINCMULT 50
-#endif //POK_SIM
-void Core::setVolLimit() {
- display.enableDirectPrinting(true);
- display.adjustCharStep = 0;
- sound.setMaxVol(VOLUME_HEADPHONE_MAX);
- int dstate=1;
- bool wipe = true;
- float vol = sound.getVolume(); float tvol;
- volbar_visible=0;
- while (core.isRunning() && dstate){
- switch (dstate) {
- case 1:
- //redraw
- if (wipe) {
- display.clearLCD();
- display.directcolor = COLOR_WHITE;
- display.setCursor(4*8,2*8);
- display.print("SELECT VOLUME LIMIT");
- display.setCursor(5*8,17*9);
- display.print("PRESS ");
- display.directcolor = COLOR_GREEN;
- display.print("A");
- display.directcolor = COLOR_WHITE;
- display.print(" TO ACCEPT");
- display.directcolor = COLOR_GREEN;
- // draw frame below first
- display.setCursor(0,11*8);
- display.println(" abbbbbbbbbbbbbbbbbbbbbbbc");
- display.println(" | |");
- display.println(" | |");
- display.println(" | |");
- display.println(" | |");
- display.println(" dbbbbbbbbbbbbbbbbbbbbbbbe");
- } // wipe = true
- display.setCursor(6*8,17*9);
- if (sound.getVolume()-5<=VOLUME_HEADPHONE_MAX) display.directcolor = COLOR_WHITE;
- else display.directcolor = COLOR_RED;
- display.directBitmap(21*8-4,6*8,Pokitto_headphones,1,2);
- display.setCursor(3*8,6*8+6);
- display.print("HEADPHONES");
- display.setCursor(3*8,8*8+2);
- if (sound.getVolume()-8>VOLUME_HEADPHONE_MAX) display.print("TOO LOUD!");
- else display.print("OK ");
- display.directcolor = COLOR_GREEN;
- display.directBitmap(21*8-4,12*8,Pokitto_speaker,1,2);
- display.setCursor(3*8,12*8+6);
- display.print("VOLUME MAX");
- display.setCursor(3*8,14*8+2);
- tvol = (vol/float(VOLUME_HEADPHONE_MAX))*100;
- if (tvol > 100 && tvol < 120) tvol=100;
- if (sound.getVolume()-5>VOLUME_HEADPHONE_MAX) { display.directcolor=COLOR_RED;}
- else display.directcolor=COLOR_GREEN;
- display.print(int(sound.getVolume()));
- //display.print(int(tvol));
- display.print(" ");
- display.directcolor=COLOR_GREEN;
- drawvolbar(14*8,14*8+4+2,sound.getVolume(),false);
- //display.setCursor(1,10);
- //display.print(vol);
- dstate=2; break;
- case 2:
- buttons.pollButtons();
- if (aBtn()) {dstate=0;while(aBtn()){buttons.pollButtons();};break;}
- if (rightBtn()) {
- if (vol >= VOLUME_HEADPHONE_MAX && vol < VOLUME_HEADPHONE_MAX+1 ) vol += 0.00025f*VINCMULT;
- else if (vol >= VOLUME_HEADPHONE_MAX) vol += 0.025f*VINCMULT;
- else vol += 0.05f*VINCMULT;
- if (vol > VOLUME_HEADPHONE_MAX + 20) {
- sound.setMaxVol(VOLUME_SPEAKER_MAX);
- }
- if (vol > VOLUME_SPEAKER_MAX) vol=VOLUME_SPEAKER_MAX;
- sound.setVolume(vol);
- dstate=1; wipe=false;
- break;
- }
- if (leftBtn()) {
- vol -= 0.025f*VINCMULT;
- if (vol <= VOLUME_HEADPHONE_MAX) sound.setMaxVol(VOLUME_HEADPHONE_MAX);
- if (vol < 0) vol=0;
- sound.setVolume(vol);
- dstate=1; wipe=false;
- break;
- }
- break;
- }
- }
-}
-
-void Core::begin() {
-
- init(); // original functions
- timePerFrame = POK_FRAMEDURATION;
- //nextFrameMillis = 0;
- //frameCount = 0;
- frameEndMicros = 1;
- startMenuTimer = 255;
- //read default settings from flash memory (set using settings.hex)
- readSettings();
- //init everything
- backlight.begin();
- backlight.set(BACKLIGHT_MAX);
- buttons.begin();
- buttons.update();
- battery.begin();
- display.begin();
- #if POK_DISPLAYLOGO
- showLogo();
- #endif // POK_DISPLAYLOGO
- display.enableDirectPrinting(true);
- display.directbgcolor = COLOR_BLACK;
- display.clearLCD();
- display.setFont(fntC64UIGfx);
- askLoader();
- #ifndef DISABLE_SOUND_WARNING
- //showWarning();
- setVolLimit();
- //sound.setVolume(sound.getVolume());//make sure we're at set volume before continue
- sound.volumeUp();
- #endif
- display.enableDirectPrinting(false);
- display.adjustCharStep=1;
- display.adjustLineStep=1;
- display.fontSize=1;
- display.textWrap=true;
- #if POK_GAMEBUINO_SUPPORT > 0
- display.setFont(font5x7);
- #else
- display.setFont(fontC64);
- #endif
-
- #if POK_ENABLE_SOUND > 0
- sound.begin();
-
- //mute when B is held during start up or if battery is low
- battery.update();
-
- if(buttons.pressed(BTN_B) || (battery.level == 0)){
- sound.setVolume(0);
- }
- else{ //play the startup sound on each channel for it to be louder
- #if POK_GBSOUND > 0
- #if(NUM_CHANNELS > 0)
- sound.playPattern(startupSound, 0);
- #endif
- #if(NUM_CHANNELS > 1)
- sound.playPattern(startupSound, 1);
- #endif
- #if(NUM_CHANNELS > 2)
- sound.playPattern(startupSound, 2);
- #endif
- #if(NUM_CHANNELS > 3)
- sound.playPattern(startupSound, 3);
- #endif
- #endif // POK_GBSOUND
- }
- #endif // POK ENABLE_SOUND
-}
-
-void Core::init() {
- run_state = true;
- display.enableDirectPrinting(false);
- display.setFont(DEFAULT_FONT);
- initClock();
- initGPIO();
- initButtons();
- initRandom();
- //initAudio();
- //initDisplay();
-}
-
-void Core::init(uint8_t switches) {
- run_state = true;
- display.enableDirectPrinting(false);
- display.setFont(DEFAULT_FONT);
- initClock();
- initGPIO();
- initButtons();
- initRandom();
- //initAudio();
- //initDisplay();
-}
-
-void Core::initButtons() {
- #ifndef POK_SIM
- Pokitto::initButtons();
- #endif
-}
-
-bool Core::isRunning() {
- #ifdef POK_SIM
- run_state = simulator.isRunning();
- #endif // POK_SIM
- return run_state;
-}
-
-void Core::initDisplay() {
- #if POK_DISPLAYLOGO > 0
- showLogo();
- #endif
- #if POK_USE_CONSOLE > 0
- console.AddMessage(MSOURCE_LCD,MSG_INIT_OK);
- #endif
-}
-
-void Core::showLogo() {
- uint32_t now;
- uint8_t state=0; //jump directly to logo, bypass teeth
- uint16_t i=0;
- uint16_t sc;
- while (state < 255/6) {
- now=getTime();
- if (now>refreshtime) {
- refreshtime=now+30;
- switch (state) {
- case 0:
- /** POKITTO CLEAN **/
- display.directbgcolor = COLOR_BLACK;
- display.fillLCD(display.directbgcolor);
- sc = COLOR_BLACK;
- state++;
- break;
- case 1:
- /** POKITTO FADE IN **/
- display.directcolor = display.interpolateColor(sc, COLOR_GREEN, i);
- display.directBitmap(POK_LCD_W/2 - (*Pokitto_logo/2),POK_LCD_H/2-(*(Pokitto_logo+1)/2),Pokitto_logo,1,1);
- i += 28;
- if (i>=0xFF) { state++; i=0;}
- break;
- case 2:
- /** POKITTO WAIT **/
- display.directcolor = COLOR_GREEN;
- display.directBitmap(POK_LCD_W/2 - (*Pokitto_logo/2),POK_LCD_H/2-(*(Pokitto_logo+1)/2),Pokitto_logo,1,1);
- i+= 0x3F;
- if (i>0x3FF) state = 255;
- break;
- }
- if(buttons.aBtn()) state=255;
- }
- }
-}
-
-void Core::readSettings() {
- // ToDo
- /*display.contrast = SCR_CONTRAST;
- backlight.backlightMin = BACKLIGHT_MIN;
- backlight.backlightMax = BACKLIGHT_MAX;
- backlight.ambientLightMin = AMBIENTLIGHT_MIN;
- backlight.ambientLightMax = AMBIENTLIGHT_MAX;
-*/
- sound.setMaxVol(VOLUME_HEADPHONE_MAX);
- sound.globalVolume = VOLUME_STARTUP;
-
- startMenuTimer = START_MENU_TIMER;
-/*
- battery.thresolds[0] = BAT_LVL_CRITIC;
- battery.thresolds[1] = BAT_LVL_LOW;
- battery.thresolds[2] = BAT_LVL_MED;
- battery.thresolds[3] = BAT_LVL_FULL;*/
-}
-
-void Core::titleScreen(const char* name){
- titleScreen(name, 0);
-}
-
-void Core::titleScreen(const uint8_t* logo){
- titleScreen((""), logo);
-}
-
-void Core::titleScreen(){
- titleScreen((""));
-}
-
-void Core::titleScreen(const char* name, const uint8_t *logo){
- display.setFont(font5x7);
- if(startMenuTimer){
- display.fontSize = 1;
- display.textWrap = false;
- display.persistence = false;
- battery.show = false;
- display.setColor(BLACK);
- while(isRunning()){
- if(update()){
- uint8_t logoOffset = name[0]?display.fontHeight:0; //add an offset the logo when there is a name to display
- //draw graphics
- display.setColorDepth(1);
- display.setColor(3);
- //display.drawBitmap(0,0, gamebuinoLogo);
- display.setColor(1);
- if(logo){
- display.drawBitmap(0, 12+logoOffset, logo);
- }
- display.cursorX = 0;
- display.cursorY = 12;
- display.print(name);
-
- //A button
- display.cursorX = LCDWIDTH - display.fontWidth*3 -1;
- display.cursorY = LCDHEIGHT - display.fontHeight*3 - 3;
- if((frameCount/16)%2)
- display.println(("\25 \20"));
- else
- display.println(("\25\20 "));
- //B button
- display.cursorX = LCDWIDTH - display.fontWidth*3 - 1;
- display.cursorY++;
- if(sound.globalVolume)
- display.println(("\26\23\24"));
- else
- display.println(("\26\23x"));
- //C button
- display.cursorX = LCDWIDTH - display.fontWidth*3 - 1;
- display.cursorY++;
- //display.println(F("\27SD"));
-
- //toggle volume when B is pressed
- if(buttons.pressed(BTN_B)){
- sound.setVolume(sound.getVolume() + 1);
- sound.playTick();
- }
- //leave the menu
- if(buttons.pressed(BTN_A) || ((frameCount>=startMenuTimer)&&(startMenuTimer != 255))){
- startMenuTimer = 255; //don't automatically skip the title screen next time it's displayed
- sound.stopPattern(0);
- sound.playOK();
- break;
- }
- //flash the loader
- //if(buttons.pressed(BTN_C))
- // ToDo changeGame();
- }
- }
- battery.show = true;
- }
-}
-
-bool Core::update(bool useDirectMode) {
-#if POK_STREAMING_MUSIC
- sound.updateStream();
- #endif
-
- if ((((nextFrameMillis - getTime())) > timePerFrame) && frameEndMicros) { //if time to render a new frame is reached and the frame end has ran once
- nextFrameMillis = getTime() + timePerFrame;
- frameCount++;
-
- frameEndMicros = 0;
- backlight.update();
- buttons.update();
- battery.update();
-
- return true;
-
- } else {
- if (!frameEndMicros) { //runs once at the end of the frame
- #if POK_ENABLE_SOUND > 0
- sound.updateTrack();
- sound.updatePattern();
- sound.updateNote();
- #endif
- updatePopup();
- displayBattery();
-
- if(!useDirectMode)
- display.update(); //send the buffer to the screen
-
- frameEndMicros = 1; //jonne
-
- }
- return false;
- }
-}
-
-void Core::displayBattery(){
-#if (ENABLE_BATTERY > 0)
- //display.setColor(BLACK, WHITE);
- uint8_t ox,oy;
- ox=display.cursorX;
- oy=display.cursorY;
- display.cursorX = LCDWIDTH-display.fontWidth+1;
- display.cursorY = 0;
- switch(battery.level){
- case 0://battery critic, power down
- sound.stopPattern();
- backlight.set(0);
- display.clear();
- display.fontSize = 1;
- display.print(("LOW BATTERY\n"));
- display.print(battery.voltage);
- display.print(("mV\n\nPLEASE\nTURN OFF"));
- display.update();
- break;
- case 1: //empty battery
- if((frameCount % 16) < 8) display.print('\7'); //blinking battery
- else display.print('x');
- break;
- case 2://low battery
- case 3://full battery
- case 4://full battery
- if(battery.show){
- display.print(char(5+battery.level));
- }
- break;
- default:
- if(battery.show){
- display.print('/');
- }
- break;
- }
-display.cursorX = ox;
-display.cursorY = oy;
-#endif
-}
-
-char* Core::filemenu(char *ext) {
- display.persistence = false;
- uint16_t oldpal0=display.palette[0];
- uint16_t oldpal1=display.palette[1];
- uint16_t oldpal2=display.palette[2];
- display.palette[2]=COLOR_GREEN;
- display.palette[1]=COLOR_WHITE;
- display.palette[0]=COLOR_BLACK;
- uint8_t oldbg=display.bgcolor;
- uint8_t oldfg=display.color;
- display.color=1;
- display.bgcolor=0;
-
- int8_t activeItem = 0;
- int16_t currentY = 100;
- int16_t targetY = 0, rowh = display.fontHeight + 2;
- boolean exit = false;
-
- char* txt;
-
-
- while (isRunning()) {
- if (update()) {
- getFirstFile(ext);
- if (buttons.pressed(BTN_A) || buttons.pressed(BTN_B) || buttons.pressed(BTN_C)) {
- exit = true; //time to exit menu !
- targetY = - display.fontHeight * 10 - 2; //send the menu out of the screen
- if (buttons.pressed(BTN_A)) {
- //answer = activeItem;
- sound.playOK();
- } else {
- sound.playCancel();
- }
- }
- if (exit == false) {
- if (buttons.repeat(BTN_DOWN,4)) {
- activeItem++;
- sound.playTick();
- }
- if (buttons.repeat(BTN_UP,4)) {
- activeItem--;
- sound.playTick();
- }
- //don't go out of the menu
- //if (activeItem == length) activeItem = 0;
- //if (activeItem < 0) activeItem = length - 1;
- if (currentY>targetY) currentY-=16;
- if (currentY<targetY) currentY=targetY;
- //targetY = -rowh * activeItem + (rowh+4); //center the menu on the active item
- } else { //exit :
- if (currentY>targetY) currentY-=16;
- if (currentY<targetY) currentY=targetY;
- if ((currentY - targetY) <= 1)
- {
- display.bgcolor=oldbg;
- display.color=oldfg;
- display.palette[0] = oldpal0;
- display.palette[1] = oldpal1;
- display.palette[2] = oldpal2;
- return selectedfile;
- }
-
- }
- //draw a fancy menu
- //currentY = 0;//(currentY + targetY) / 2 + 5;
- display.cursorX = 0;
- display.cursorY = currentY;
- display.textWrap = false;
- //getFirstFile(ext);
- for (int i = 0; i<20; i++) {
- display.invisiblecolor=255;
- display.cursorY = currentY + rowh * i;
- if (i==3) display.color=1;
- if (i == activeItem){
- display.cursorX = 3;
-
- //display.fillRoundRect(0, currentY + display.fontHeight * activeItem - 2, LCDWIDTH, (display.fontHeight+3), 3);
- display.color=2;
- display.fillRect(0, currentY + rowh * activeItem - 2, LCDWIDTH, (rowh));
- display.setColor(0,2);
- } else display.setColor(1,0);
- //display.println((char*)*(const unsigned int*)(items+i));
- //display.println((int)i);
- txt = getNextFile(ext);
- if (txt) {
- display.println(txt);
- if (i == activeItem) {
- strcpy(selectedfile,txt);
- }
- } else i--;
- display.setColor(1,0);
- } // draw menu loop
- } // update
- }
- return 0;
-}
-
-char* Core::filemenu() {
- return filemenu("");
-}
-
-int8_t Core::menu(const char* const* items, uint8_t length) {
-#if (ENABLE_GUI > 0)
- display.persistence = false;
- int8_t activeItem = 0;
- int16_t currentY = display.height;
- int16_t targetY = 0, rowh = display.fontHeight + 2;
- boolean exit = false;
- int8_t answer = -1;
- while (isRunning()) {
- if (update()) {
- if (buttons.pressed(BTN_A) || buttons.pressed(BTN_B) || buttons.pressed(BTN_C)) {
- exit = true; //time to exit menu !
- targetY = - display.fontHeight * length - 2; //send the menu out of the screen
- if (buttons.pressed(BTN_A)) {
- answer = activeItem;
- sound.playOK();
- } else {
- sound.playCancel();
- }
- }
- if (exit == false) {
- if (buttons.repeat(BTN_DOWN,4)) {
- activeItem++;
- sound.playTick();
- }
- if (buttons.repeat(BTN_UP,4)) {
- activeItem--;
- sound.playTick();
- }
- //don't go out of the menu
- if (activeItem == length) activeItem = 0;
- if (activeItem < 0) activeItem = length - 1;
-
- targetY = -rowh * activeItem + (rowh+4); //center the menu on the active item
- } else { //exit :
- if ((currentY - targetY) <= 1)
- return (answer);
- }
- //draw a fancy menu
- currentY = (currentY + targetY) / 2;
- display.cursorX = 0;
- display.cursorY = currentY;
- display.textWrap = false;
- uint16_t fc,bc;
- fc = display.color;
- bc = display.bgcolor;
- for (byte i = 0; i < length; i++) {
- display.cursorY = currentY + rowh * i;
- if (i == activeItem){
- display.cursorX = 3;
-
- //display.fillRoundRect(0, currentY + display.fontHeight * activeItem - 2, LCDWIDTH, (display.fontHeight+3), 3);
- display.fillRect(0, currentY + rowh * activeItem - 2, LCDWIDTH, (rowh));
- display.setColor(bc,fc);
- } else display.setColor(fc,bc);
-
- display.println((char*)*(const unsigned int*)(items+i));
- display.setColor(fc,bc);
- }
-
- }
- }
-#else
- return 0;
-#endif
- return 0;
-}
-
-void Core::keyboard(char* text, uint8_t length) {
-#if (ENABLE_GUI > 0)
- display.persistence = false;
- //memset(text, 0, length); //clear the text
- text[length-1] = '\0';
- //active character in the typing area
- int8_t activeChar = 0;
- //selected char on the keyboard
- int8_t activeX = 0;
- int8_t activeY = 2;
- //position of the keyboard on the screen
- int8_t currentX = LCDWIDTH;
- int8_t currentY = LCDHEIGHT;
- int8_t targetX = 0;
- int8_t targetY = 0;
-
- while (1) {
- if (update()) {
- //move the character selector
- if (buttons.repeat(BTN_DOWN, 4)) {
- activeY++;
- sound.playTick();
- }
- if (buttons.repeat(BTN_UP, 4)) {
- activeY--;
- sound.playTick();
- }
- if (buttons.repeat(BTN_RIGHT, 4)) {
- activeX++;
- sound.playTick();
- }
- if (buttons.repeat(BTN_LEFT, 4)) {
- activeX--;
- sound.playTick();
- }
- //don't go out of the keyboard
- if (activeX == KEYBOARD_W) activeX = 0;
- if (activeX < 0) activeX = KEYBOARD_W - 1;
- if (activeY == KEYBOARD_H) activeY = 0;
- if (activeY < 0) activeY = KEYBOARD_H - 1;
- //set the keyboard position on screen
- targetX = -(display.fontWidth+1) * activeX + LCDWIDTH / 2 - 3;
- targetY = -(display.fontHeight+1) * activeY + LCDHEIGHT / 2 - 4 - display.fontHeight;
- //smooth the keyboard displacement
- currentX = (targetX + currentX) / 2;
- currentY = (targetY + currentY) / 2;
- //type character
- if (buttons.pressed(BTN_A)) {
- if (activeChar < (length-1)) {
- byte thisChar = activeX + KEYBOARD_W * activeY;
- if((thisChar == 0)||(thisChar == 10)||(thisChar == 13)) //avoid line feed and carriage return
- continue;
- text[activeChar] = thisChar;
- text[activeChar+1] = '\0';
- }
- activeChar++;
- sound.playOK();
- if (activeChar > length)
- activeChar = length;
- }
- //erase character
- if (buttons.pressed(BTN_B)) {
- activeChar--;
- sound.playCancel();
- if (activeChar >= 0)
- text[activeChar] = 0;
- else
- activeChar = 0;
- }
- //leave menu
- if (buttons.pressed(BTN_C)) {
- sound.playOK();
- while (1) {
- if (update()) {
- //display.setCursor(0,0);
- display.println(("You entered\n"));
- display.print(text);
- display.println(("\n\n\n\x15:okay \x16:edit"));
- if(buttons.pressed(BTN_A)){
- sound.playOK();
- return;
- }
- if(buttons.pressed(BTN_B)){
- sound.playCancel();
- break;
- }
- }
- }
- }
- //draw the keyboard
- for (int8_t y = 0; y < KEYBOARD_H; y++) {
- for (int8_t x = 0; x < KEYBOARD_W; x++) {
- display.drawChar(currentX + x * (display.fontWidth+1), currentY + y * (display.fontHeight+1), x + y * KEYBOARD_W, 1);
- }
- }
- //draw instruction
- display.cursorX = currentX-display.fontWidth*6-2;
- display.cursorY = currentY+1*(display.fontHeight+1);
- display.print(("\25type"));
-
- display.cursorX = currentX-display.fontWidth*6-2;
- display.cursorY = currentY+2*(display.fontHeight+1);
- display.print(("\26back"));
-
- display.cursorX = currentX-display.fontWidth*6-2;
- display.cursorY = currentY+3*(display.fontHeight+1);
- display.print(("\27save"));
-
- //erase some pixels around the selected character
- display.setColor(WHITE);
- display.drawFastHLine(currentX + activeX * (display.fontWidth+1) - 1, currentY + activeY * (display.fontHeight+1) - 2, 7);
- //draw the selection rectangle
- display.setColor(BLACK);
- display.drawRoundRect(currentX + activeX * (display.fontWidth+1) - 2, currentY + activeY * (display.fontHeight+1) - 3, (display.fontWidth+2)+(display.fontWidth-1)%2, (display.fontHeight+5), 3);
- //draw keyboard outline
- //display.drawRoundRect(currentX - 6, currentY - 6, KEYBOARD_W * (display.fontWidth+1) + 12, KEYBOARD_H * (display.fontHeight+1) + 12, 8, BLACK);
- //text field
- display.drawFastHLine(0, LCDHEIGHT-display.fontHeight-2, LCDWIDTH);
- display.setColor(WHITE);
- display.fillRect(0, LCDHEIGHT-display.fontHeight-1, LCDWIDTH, display.fontHeight+1);
- //typed text
- display.cursorX = 0;
- display.cursorY = LCDHEIGHT-display.fontHeight;
- display.setColor(BLACK);
- display.print(text);
- //blinking cursor
- if (((frameCount % 8) < 4) && (activeChar < (length-1)))
- display.drawChar(display.fontWidth * activeChar, LCDHEIGHT-display.fontHeight, '_',1);
- }
- }
-#endif
-}
-
-void Core::popup(const char* text, uint8_t duration){
-#if (ENABLE_GUI > 0)
- popupText = text;
- popupTimeLeft = duration+12;
-#endif
-}
-
-void Core::updatePopup(){
-#if (ENABLE_GUI > 0)
- if (popupTimeLeft){
- uint8_t yOffset = 0;
- if(popupTimeLeft<12){
- yOffset = 12-popupTimeLeft;
- }
- display.fontSize = 1;
- display.setColor(WHITE);
- display.fillRoundRect(0,LCDHEIGHT-display.fontHeight+yOffset-3,84,display.fontHeight+3,3);
- display.setColor(BLACK);
- display.drawRoundRect(0,LCDHEIGHT-display.fontHeight+yOffset-3,84,display.fontHeight+3,3);
- display.cursorX = 4;
- display.cursorY = LCDHEIGHT-display.fontHeight+yOffset-1;
- display.print(popupText);
- popupTimeLeft--;
- }
-#endif
-}
-
-void Core::setFrameRate(uint8_t fps) {
- timePerFrame = 1000 / fps;
- sound.prescaler = fps / 20;
- sound.prescaler = __avrmax(1, sound.prescaler);
-}
-
-void Core::pickRandomSeed(){
- initRandom();
-}
-
-bool Core::collidePointRect(int16_t x1, int16_t y1 ,int16_t x2 ,int16_t y2, int16_t w, int16_t h){
- if((x1>=x2)&&(x1<x2+w))
- if((y1>=y2)&&(y1<y2+h))
- return true;
- return false;
-}
-
-bool Core::collideRectRect(int16_t x1, int16_t y1, int16_t w1, int16_t h1 ,int16_t x2 ,int16_t y2, int16_t w2, int16_t h2){
- return !( x2 >= x1+w1 ||
- x2+w2 <= x1 ||
- y2 >= y1+h1 ||
- y2+h2 <= y1 );
-}
-
-bool Core::collideBitmapBitmap(int16_t x1, int16_t y1, const uint8_t* b1, int16_t x2, int16_t y2, const uint8_t* b2){
- int16_t w1 = pgm_read_byte(b1);
- int16_t h1 = pgm_read_byte(b1 + 1);
- int16_t w2 = pgm_read_byte(b2);
- int16_t h2 = pgm_read_byte(b2 + 1);
-
- if(collideRectRect(x1, y1, w1, h1, x2, y2, w2, h2) == false){
- return false;
- }
-
- int16_t xmin = (x1>=x2)? 0 : x2-x1;
- int16_t ymin = (y1>=y2)? 0 : y2-y1;
- int16_t xmax = (x1+w1>=x2+w2)? x2+w2-x1 : w1;
- int16_t ymax = (y1+h1>=y2+h2)? y2+h2-y1 : h1;
- for(uint8_t y = ymin; y < ymax; y++){
- for(uint8_t x = xmin; x < xmax; x++){
- if(display.getBitmapPixel(b1, x, y) && display.getBitmapPixel(b2, x1+x-x2, y1+y-y2)){
- return true;
- }
- }
- }
- return false;
-}
-
-
-//** EOF **//
-
-
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoCore.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoCore.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTOCORE_H
-#define POKITTOCORE_H
-
-#include <stdint.h>
-#include <math.h>
-#ifndef POK_SIM
- #include "pwmout_api.h"
- #include "HWButtons.h"
-#else
- #include "PokittoSimulator.h"
-#endif
-#if POK_USE_CONSOLE > 0
- #include "PokittoConsole.h"
-#endif // POK_USE_CONSOLE
-#if POK_ENABLE_SD > 0
- #include "PokittoDisk.h"
-#endif
-
-#include "PokittoFonts.h"
-#include "PokittoPalettes.h"
-#include "PokittoDisplay.h"
-#include "PokittoButtons.h"
-#include "PokittoBattery.h"
-#include "PokittoBacklight.h"
-#include "PokittoSound.h"
-#include "PokittoFakeavr.h"
-
-#define PALETTE_SIZE 16
-#define PI 3.141592741f
-
-// For GB compatibility
-#if PROJ_GAMEBUINO > 0
-extern void setup();
-extern void loop();
-#endif // PROJ_GAMEBUINO
-
-extern uint32_t* ptimer; // re-directed tick counter
-
-namespace Pokitto {
-
-/** Core class.
- * The Core class is a class consisting of static data and methods.
- * It handles the lowlevel hardware functions of the Pokitto.
- * It is declared as static to prevent several instances running at same time.
- * Example:
- * @code
- * // A simple "Hello World!" program with Pokitto
- *
- * #include "Pokitto.h"
- *
- * Pokitto::Core myApp;
- *
- * int main() {
- * myApp.begin(); // This starts up the console (the display, buttons etc.)
- * while(myApp.isRunning()) {
- * if(myApp.Update()) {
- * myApp.display.print("Hello World!");
- * }
- * }
- * }
- * @endcode
- */
-
-class Core
-{
-public:
- /** Create a Core runtime instance
- */
- Core();
-
- /** Backlight component of the Core runtime */
- static Backlight backlight;
- /** Buttons component of the Core runtime */
- static Buttons buttons;
- /** Battery component of the Core runtime */
- static Battery battery;
- /** Sound component of the Core runtime */
- static Sound sound;
- /** Display component of the Core runtime */
- static Display display;
-
- // EXCECUTION CONTROL
-public:
- /** Initialize runtime (use this one) */
- static void begin();
- /** Initialize runtime (deprecated, avoid) */
- static void init();
- /** Initialize runtime with options (deprecated, avoid) */
- static void init(uint8_t);
- /** Return run state (1 = running, 0 = shutting down) */
- static bool isRunning();
- /** Stop running */
- static void quit();
-private:
- /** run_state is true as long as program is running */
- static bool run_state;
-
-public:
- // INITIALIZATION
- /** Initialize display */
- static void initDisplay();
- /** Initialize random generator */
- static void initRandom();
- /** Initialize GPIO */
- static void initGPIO();
- /** Initialize LCD */
- static void initLCD();
- /** Initialize Audio */
- static void initAudio();
-
-
- // DISPLAY
-public:
- /** Initialize backlight */
- static void initBacklight();
-
-private:
- /** Backlight PWM pointer */
- #ifndef POK_SIM
- static pwmout_t backlightpwm;
- #endif
-
- // TIMEKEEPING
-public:
- /** Initialize runtime clock */
- static void initClock();
- /** Get value of time elapsed during program in milliseconds */
- static uint32_t getTime();
- /** Wait for n milliseconds */
- static void wait(uint16_t);
-private:
- /** Time of next refresh */
- static uint32_t refreshtime;
-
- // DIRECT TO SCREEN
-public:
- /** Display Pokitto logo */
- static void showLogo();
- static void showWarning();
- static void setVolLimit();
-
-// BUTTON INPUT HANDLING
-private:
- static uint8_t heldStates[];
-public:
- static void initButtons();
- static void pollButtons();
- static uint8_t leftBtn();
- static uint8_t rightBtn();
- static uint8_t upBtn();
- static uint8_t downBtn();
- static uint8_t aBtn();
- static uint8_t bBtn();
- static uint8_t cBtn();
- static uint8_t leftHeld();
- static uint8_t rightHeld();
- static uint8_t upHeld();
- static uint8_t downHeld();
- static uint8_t aHeld();
- static uint8_t bHeld();
- static uint8_t cHeld();
-
- static uint8_t leftReleased();
- static uint8_t rightReleased();
- static uint8_t upReleased();
- static uint8_t downReleased();
- static uint8_t aReleased();
- static uint8_t bReleased();
- static uint8_t cReleased();
-
- // AUDIO RELATED
- static uint8_t ampIsOn();
- static void ampEnable(uint8_t);
- static uint8_t soundbyte;
-
- // GB RELATED
-public:
- static void readSettings();
- static void titleScreen(const char* name, const uint8_t *logo);
- static void titleScreen(const char* name);
- static void titleScreen(const uint8_t* logo);
- static void titleScreen();
- static bool update(bool useDirectMode=false);
- static uint32_t frameCount;
- static int8_t menu(const char* const* items, uint8_t length);
- static char* filemenu(char*);
- static char* filemenu();
- static void keyboard(char* text, uint8_t length);
- static void popup(const char* text, uint8_t duration);
- static void setFrameRate(uint8_t fps);
- static void pickRandomSeed();
-
- static uint8_t getCpuLoad();
- static uint16_t getFreeRam();
-
- static bool collidePointRect(int16_t x1, int16_t y1 ,int16_t x2 ,int16_t y2, int16_t w, int16_t h);
- static bool collideRectRect(int16_t x1, int16_t y1, int16_t w1, int16_t h1 ,int16_t x2 ,int16_t y2, int16_t w2, int16_t h2);
- static bool collideBitmapBitmap(int16_t x1, int16_t y1, const uint8_t* b1, int16_t x2, int16_t y2, const uint8_t* b2);
-
-private:
- static uint8_t timePerFrame;
- static uint32_t nextFrameMillis;
- static void updatePopup();
- static const char* popupText;
- static uint8_t popupTimeLeft;
- static void displayBattery();
- static uint16_t frameDurationMicros;
- static uint32_t frameStartMicros, frameEndMicros;
- static uint8_t startMenuTimer;
-public:
- static uint8_t volbar_visible;
- static void drawvolbar(int,int,int, bool);
- static void askLoader();
- static void jumpToLoader();
-};
-
-// this is the instance used by the system
-extern Core core;
-
-
-}
-
-#endif // POKITTOCORE_H
-
-
--- a/POKITTO_CORE/PokittoDisk.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/**************************************************************************/
-/*!
- @file Pokitto_disk.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#include "Pokitto.h"
-
-#define SD_MOSI_PORT 0
-#define SD_MISO_PORT 0
-#define SD_SCK_PORT 0
-#define SD_CS_PORT 0
-#define SD_MOSI_PIN 9
-#define SD_MISO_PIN 8
-#define SD_SCK_PIN 6
-#define SD_CS_PIN 7
-
-#if POK_ENABLE_SD > 0
-BYTE res;
-FATFS fs; /* File system object */
-FATDIR dir; /* Directory object */
-FILINFO fno; /* File information */
-
-//static FATFS *FatFs; /* Pointer to the file system object (logical drive) */
-
-bool diropened=false;
-
-#define SPEAKER 3
-//#define BUFFER_SIZE 256 // was 128
-#define SONGLENGTH 0x1BFBCD // 1072223
-#define FILESIZE 0x1BFBCD
-
-uint8_t filemode = FILE_MODE_UNINITIALIZED;
-char currentfile[15]; // holds current file's name
-
-SPI device(CONNECT_MOSI,CONNECT_MISO,CONNECT_SCK);
-//DigitalOut mmccs(CONNECT_CS);
-
-const char *get_filename_ext(const char *filename) {
- const char *dot = strrchr(filename, '.');
- if(!dot || dot == filename) return "";
- return dot + 1;
-}
-
-__attribute__((section(".SD_Code"))) void initSDGPIO() {
- LPC_GPIO_PORT->DIR[SD_MOSI_PORT] |= (1 << SD_MOSI_PIN );
- LPC_GPIO_PORT->DIR[SD_MISO_PORT] |= (1 << SD_MISO_PIN );
- LPC_GPIO_PORT->DIR[SD_SCK_PORT] |= (1 << SD_SCK_PIN );
- LPC_GPIO_PORT->DIR[SD_CS_PORT] |= (1 << SD_CS_PIN );
-}
-
-__attribute__((section(".SD_Code"))) int pokInitSD() {
- initSDGPIO();
- res = disk_initialize();
- res = (pf_mount(&fs));
- res = pf_opendir(&dir,"");
- if (res) diropened=false;
- else diropened=true;
- return res;
-}
-
-
-/** PUBLIC FUNCTIONS **/
-
-char* getFirstDirEntry() {
- res=0;
- if (!diropened) {
- pokInitSD();
- }
- res = pf_opendir(&dir,"");
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- if (res) return 0;
- while (res==0) { //while res is ok
- if ((fno.fattrib & 0x02)==0) {
- if (fno.fattrib & 0x10) {
- fno.fname[8]='.';
- fno.fname[9]='D';
- fno.fname[10]='I';
- fno.fname[11]='R';
- fno.fname[12]='\0';
- }
- return fno.fname;
- }
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- if (res==0 && dir.index==0) break;
- }
- return 0;
-}
-
-char* getNextDirEntry() {
- if (!diropened) pokInitSD();
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- if (res==0) {
- while (fno.fattrib & 0x02 && !res) res = pf_readdir(&dir,&fno); //system/hidden file
- if (fno.fattrib & 0x10) {
- int a=12;
- while (a) {
- fno.fname[a] = fno.fname[a-1];
- a--;
- }
- if (fno.fname[0]) {
- fno.fname[0]='/';
- a=0;
- while (fno.fname[a]) a++;
- fno.fname[a]='/';
- }
-
- /*fno.fname[a++]='.';
- fno.fname[a++]='D';
- fno.fname[a++]='I';
- fno.fname[a++]='R';
- fno.fname[a]='\0';*/
- }
- return fno.fname;
- }
- return NULL;
-}
-
-char* getNextFile (char* ext){
-
- if (!diropened) pokInitSD();
- int a=1;
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- while (res==0 || a) { //while there are entries and
- if (dir.index==0) return 0; //end of list
- a = strcmp((const char*)get_filename_ext(fno.fname),(const char*)ext); // returns 0 if strings are identical
- if (strcmp(ext,"")==0 && (fno.fattrib & 0x10) == 0) a=0;
- if (a == 0 && (fno.fattrib & 0x10) == 0) return fno.fname;
- if (fno.fattrib&0x10) return NULL; //its a directory
- }
-return 0;
-}
-
-
-char* getNextFile() {
- return getNextFile("");
-}
-
-char* getFirstFile(char* ext) {
- res=0;
- if (!diropened) {
- pokInitSD();
- }
- res = pf_opendir(&dir,"");
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- if (res) return 0;
- while (res==0 || (fno.fattrib & 0x10) == 0) {
- int a=0;
- a = strcmp((const char*)get_filename_ext(fno.fname),(const char*)ext); // returns 0 if strings are identical
- if (!strcmp(ext,"")) a=0;
- if ( a == 0 && (fno.fattrib & 0x10) == 0) return fno.fname;
- res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
- if (res==0 && dir.index==0) break;
- }
- return 0;
-}
-
-char* getFirstFile() {
- return getFirstFile("");
-}
-
-int isThisFileOpen(char* buffer){
- int a=0;
- a = strcmp((const char*)buffer,(const char*)currentfile); // returns 0 if strings are identical
- if ( a == 0 && filemode != FILE_MODE_FAILED) return 1;
- return 0;
-}
-
-int fileOK() {
- if (filemode != FILE_MODE_FAILED) return 1;
- return 0;
-}
-
-uint8_t fileOpen(char* buffer, char fmode) {
- int err;
- if (filemode == FILE_MODE_UNINITIALIZED) {
- int a = pf_mount(&fs);
- if (a) return 1; // 1 means error in this context
- }
-
- filemode = fmode;
- err = pf_open(buffer);
- if (err==0) {
- strcpy(currentfile,(const char*)buffer);
- return 0; // 0 means all clear
- }
- // file open failed
- filemode = FILE_MODE_FAILED;
- return 1; // 1 means failed
-}
-
-void fileClose() {
- filemode = FILE_MODE_UNINITIALIZED;
- for (uint8_t i=0; i<15; i++) currentfile[i]=0;
-}
-
-int fileGetChar() {
- BYTE buff[1];
- WORD br;
- int err = pf_read(buff, 1, &br); /* Read data to the buff[] */
- return buff[0];
-}
-
-void filePutChar(char c) {
- WORD bw;
- pf_write((const void*)&c, 1, &bw);
- pf_write(0, 0, &bw);
-}
-
-void fileWriteBytes(uint8_t * b, uint16_t n) {
- WORD bw;
- pf_write((const void*)&b, n, &bw);
- pf_write(0, 0, &bw);
-}
-
-uint16_t fileReadBytes(uint8_t * b, uint16_t n) {
- WORD br;
- pf_read(b, n, &br); /* Read data to the buff[] */
- return br; /* Return number of bytes read */
-}
-
-void fileSeekAbsolute(long n) {
- res = pf_lseek(n);
-}
-
-void fileSeekRelative(long n) {
- if (n<0) if (fs.fptr < -n) n=-fs.fptr;
- else if (n>0) if (fs.fptr+n > fs.fsize) n=fs.fsize-fs.fptr;
- res = pf_lseek(fs.fptr + n);
-}
-
-void fileRewind() {
- res = pf_lseek(0);
-}
-
-void fileEnd() {
- res = pf_lseek(fs.fsize);
-}
-
-long int fileGetPosition() {
- return fs.fptr;
-}
-
-uint8_t filePeek(long n) {
- pf_lseek(n);
- return fileGetChar();
-}
-
-void filePoke(long n, uint8_t c) {
- pf_lseek(n);
- filePutChar(c);
-}
-
-int dirOpen() {
- return pf_opendir(&dir,"");
-}
-
-int dirUp() {
-
-return 0;
-}
-
-#endif // POK_ENABLE_SD
-
-
--- a/POKITTO_CORE/PokittoDisk.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/**************************************************************************/ -/*! - @file PokittoDisk.h - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - - -#ifndef POKITTO_DISK_H -#define POKITTO_DISK_H - -#ifndef POK_SIM -// real hardware disk driver -#include "diskio.h" -#include "pff.h" -#include "connect.h" -#include "mbed.h" -extern BYTE res; -extern FATFS fs; /* File system object */ -extern FATDIR dir; /* Directory object */ -extern FILINFO fno; /* File information */ -extern SPI device; -extern DigitalOut mmccs; - -/**************************************************************************/ -/** SD CONTROL MACROS **/ -/**************************************************************************/ - -// CS ... #define CONNECT_CS P0_7 //p13 -#define CLR_SD_CS LPC_GPIO_PORT->CLR[0] = (1 << 7) -#define SET_SD_CS LPC_GPIO_PORT->SET[0] = (1 << 7) -#define GET_SD_CS LPC_GPIO_PORT->PIN[0] & (1 << 7) - -#else -// simulated disk driver -#endif - -#include <stdint.h> - - - -extern int pokInitSD(); - -// File IO modes -#define FILE_MODE_APPEND 0x1 -#define FILE_MODE_OVERWRITE 0 -#define FILE_MODE_READONLY 0x2 -#define FILE_MODE_READWRITE 0 -#define FILE_MODE_BINARY 0x4 -#define FILE_MODE_ASCII 0 -#define FILE_MODE_FAILED 0x8 -#define FILE_MODE_UNINITIALIZED 0x10 - -extern uint8_t fileOpen(char*, char); -extern void fileClose(); -extern int fileGetChar(); -extern void filePutChar(char); -extern void fileWriteBytes(uint8_t *, uint16_t); -extern uint16_t fileReadBytes(uint8_t *, uint16_t); -extern void fileSeekAbsolute(long); -extern void fileSeekRelative(long); -extern void fileRewind(); -extern void fileEnd(); -extern long int fileGetPosition(); -#define fileSetPosition(n) (fileSeekAbsolute(n)) -extern uint8_t filePeek(long); -extern void filePoke(long, uint8_t); -extern char* getCurrentFileName (); -extern char* getNextFile (char*); -extern char* getNextFile (); -extern char* getFirstFile(char*); -extern char* getFirstFile(); -extern char* getFirstDirEntry(); -extern char* getNextDirEntry(); -extern int isThisFileOpen(char*); -extern int fileOK(); -extern int dirOpen(); -extern int dirUp(); - -#endif // POKITTO_DISK_H - -
--- a/POKITTO_CORE/PokittoDisplay.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2147 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoDisplay.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-/* THE SEGMENT BELOW PERTAINS TO CIRCLE DRAWING FUNCTIONS ONLY
-*
-This is the core graphics library for all our displays, providing a common
-set of graphics primitives (points, lines, circles, etc.). It needs to be
-paired with a hardware-specific library for each display device we carry
-(to handle the lower-level functions).
-Adafruit invests time and resources providing this open source code, please
-support Adafruit & open-source hardware by purchasing products from Adafruit!
-Copyright (c) 2013 Adafruit Industries. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "PokittoDisplay.h"
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoCore.h"
-#include "PokittoSound.h"
-#include <stdio.h>
-#include <string.h>
-
-#ifndef POK_SIM
-#include "HWLCD.h"
-#else
-#include "SimLCD.h"
-#endif
-
-Pokitto::Core core;
-Pokitto::Sound sound;
-
-using namespace Pokitto;
-
-
-
-uint8_t* Display::m_scrbuf;
-uint8_t* Display::m_tileset;
-uint8_t* Display::m_tilebuf;
-uint8_t* Display::m_tilecolorbuf;
-uint8_t Display::m_mode, Display::m_colordepth;
-uint8_t Display::fontSize=1;
-int16_t Display::cursorX,Display::cursorY;
-uint16_t Display::m_w,Display::m_h;
-uint8_t Display::fontWidth, Display::fontHeight;
-bool Display::textWrap=true;
-
-uint8_t Display::persistence = 0;
-uint16_t Display::color = 1;
-uint16_t Display::bgcolor = 0;
-uint16_t Display::invisiblecolor = 17;
-uint16_t Display::directcolor=0xFFFF;
-uint16_t Display::directbgcolor=0x0;
-
-uint16_t* Display::paletteptr;
-uint16_t Display::palette[PALETTE_SIZE];
-const unsigned char* Display::font;
-int8_t Display::adjustCharStep = 1;
-int8_t Display::adjustLineStep = 1;
-bool Display::fixedWidthFont = false;
-
-/** drawing canvas **/
-//uint8_t* Display::canvas; // points to the active buffer. if null, draw direct to screen
-
-/** screenbuffer **/
-uint8_t Display::bpp = POK_COLORDEPTH;
-#ifndef POK_TILEDMODE
-#if (POK_SCREENMODE == MODE_HI_MONOCHROME)
- uint8_t Display::width = POK_LCD_W;
- uint8_t Display::height = POK_LCD_H;
- uint8_t Display::screenbuffer[((POK_LCD_H+1)*POK_LCD_W)*POK_COLORDEPTH/8]; // maximum resolution
-#elif (POK_SCREENMODE == MODE_HI_4COLOR)
- uint8_t Display::width = POK_LCD_W;
- uint8_t Display::height = POK_LCD_H;
- uint8_t __attribute__((section (".bss"))) Display::screenbuffer[((POK_LCD_H)*POK_LCD_W)/4]; // maximum resolution
-#elif (POK_SCREENMODE == MODE_FAST_16COLOR)
- uint8_t Display::width = POK_LCD_W/2;
- uint8_t Display::height = POK_LCD_H/2;
- uint8_t Display::screenbuffer[(((POK_LCD_H/2)+1)*POK_LCD_W/2)*POK_COLORDEPTH/8]; // half resolution
-#elif (POK_SCREENMODE == MODE_HI_16COLOR)
- uint8_t Display::width = POK_LCD_W;
- uint8_t Display::height = POK_LCD_H;
- uint8_t Display::screenbuffer[POK_LCD_H*POK_LCD_W/2]; // 4 bits per pixel
-#elif (POK_SCREENMODE == MODE_LAMENES)
- uint8_t Display::width = 128;
- uint8_t Display::height = 120;
- uint8_t Display::screenbuffer[((121)*128)*POK_COLORDEPTH/8]; // half resolution
-#elif (POK_SCREENMODE == MODE_GAMEBOY)
- uint8_t Display::width = 160;
- uint8_t Display::height = 144;
- uint8_t Display::screenbuffer[160*144/4];
-#else
- uint8_t Display::width = 84;
- uint8_t Display::height = 48;
- uint8_t Display::screenbuffer[128*64]; // not needed because Gamebuino and Arduboy have their own buffer
-#endif
-#else //Tiledmode
-#if (POK_SCREENMODE == MODE_TILED_1BIT)
- uint8_t Display::width = POK_LCD_W;
- uint8_t Display::height = POK_LCD_H;
- uint8_t Display::screenbuffer[0];
-#else
- uint8_t Display::width = POK_LCD_W;
- uint8_t Display::height = POK_LCD_H;
- uint8_t Display::screenbuffer[0];
-#endif
-#endif //tiledmode
-
-// RLE decoding
-#define RLE_ESC_EOL 0
-#define RLE_ESC_EOB 1
-#define RLE_ESC_OFFSET 2
-
-Display::Display() {
- m_scrbuf = screenbuffer;
- setDefaultPalette();
- m_mode = 1; // direct printing on by default
- m_w = POK_LCD_W;
- m_h = POK_LCD_H;
- setFont(DEFAULT_FONT);
- invisiblecolor=17;
- bgcolor=0;
- if (POK_COLORDEPTH) m_colordepth = POK_COLORDEPTH;
- else m_colordepth = 4;
- #if POK_GAMEBUINO_SUPPORT
- setColorDepth(1);
- #endif // POK_GAMEBUINO_SUPPORT
-}
-
-uint16_t Display::getWidth() {
- return width;
-}
-
-uint8_t Display::getNumberOfColors() {
- return 1<<POK_COLORDEPTH;
-}
-
-uint16_t Display::getHeight() {
- return height;
-}
-
-uint8_t Display::getColorDepth() {
- return m_colordepth;
-}
-
-void Display::setColorDepth(uint8_t v) {
- if (v > POK_COLORDEPTH) v=POK_COLORDEPTH;
- m_colordepth = v;
-}
-
-void Display::clearLCD() {
- lcdFillSurface(0);
- setCursor(0,0); // old basic computer style
-}
-
-void Display::fillLCD(uint16_t c) {
- lcdFillSurface(c);
-}
-
-void Display::directPixel(int16_t x, int16_t y, uint16_t color) {
- lcdPixel(x,y,color);
-}
-
-void Display::directRectangle(int16_t x, int16_t y,int16_t x2, int16_t y2, uint16_t color) {
- lcdRectangle(x,y,x2,y2,color);
-}
-
-void Display::begin() {
- lcdInit();
-}
-
-void Display::setCursor(int16_t x,int16_t y) {
- cursorX = x;
- cursorY = y;
-}
-
-void Display::update() {
-
-#if POK_SCREENMODE == MODE_GAMEBOY
- lcdRefreshModeGBC(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_HI_4COLOR
- lcdRefreshMode1(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_HI_16COLOR
- lcdRefreshMode3(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_FAST_16COLOR
- lcdRefreshMode2(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
- lcdRefreshGB(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_ARDUBOY_16COLOR
- lcdRefreshAB(m_scrbuf, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_TILED_1BIT
- lcdRefreshT1(m_tilebuf, m_tilecolorbuf, m_tileset, paletteptr);
-#endif
-
-if (!persistence) clear();
-
-/** draw volume bar if visible **/
-#if POK_SHOW_VOLUME > 0
-if (core.volbar_visible) {
- core.drawvolbar(4,20,sound.getVolume(),true);
- core.volbar_visible--;
-}
-#endif // POK_SHOW_VOLUME
-
-}
-
-void Display::directBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t depth, uint8_t scale) {
- uint8_t w = *bitmap;
- uint8_t h = *(bitmap + 1);
- bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
- int16_t i, j;
- int8_t byteNum, bitNum, byteWidth = (w + 7) >> 3;
-
- if (depth == 1) {
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- if (*(bitmap + j * byteWidth + byteNum) & (0x80 >> bitNum)) { //0x80 = B10000000
- if (scale==1) directPixel(x + i, y + j,directcolor);
- else {
- directPixel(x + i + i, y + j + j,directcolor);
- directPixel(x + 1 + i + i, y + j + j,directcolor);
- directPixel(x + i + i, y + j + j + 1,directcolor);
- directPixel(x + i + i + 1 , y + j + j + 1,directcolor);
- }
- }
- }
- }
- } else if (depth == 4) {
- for (j = 0; j < h; j+=1) {
- for (i = 0; i < w; i+=2) {
- uint16_t col = paletteptr[*bitmap>>4]; //higher nibble
- if (scale==2) {
- directPixel(x + (i<<1), y + (j<<1),col);
- directPixel(x + (i<<1) + 1, y + (j<<1),col);
- directPixel(x + (i<<1) + 1, y + (j<<1) + 1,col);
- directPixel(x + (i<<1), y + (j<<1) + 1,col);
- } else directPixel(x + i, y + j,col);
- col = paletteptr[*bitmap&0xF]; // lower nibble
- if (scale==2) {
- directPixel(x + (i<<1) + 2, y + (j<<1),col);
- directPixel(x + (i<<1) + 1 + 2, y + (j<<1),col);
- directPixel(x + (i<<1) + 1 + 2, y + (j<<1) + 1,col);
- directPixel(x + (i<<1) + 2 , y + (j<<1) + 1,col);
- } else directPixel(x + i + 1, y + j,col);
- bitmap++;
- }
- }
- }
-
-}
-
-int Display::directChar(int16_t x, int16_t y, uint16_t index){
- const uint8_t* bitmap = font;
- uint8_t w = *bitmap;
- uint8_t h = *(bitmap + 1);
- uint8_t hbytes=0, xtra=1;
- if (h==8 || h==16) xtra=0; //don't add if exactly on byte limit
- hbytes=(h>>3)+xtra; //GLCD fonts are arranged w+1 times h/8 bytes
- //bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
- bitmap = bitmap + 4 + index * (w * hbytes + 1); //add an offset to the pointer (fonts !)
- //int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- int8_t i, j, numBytes;
- numBytes = *bitmap++; //first byte of char is the width in bytes
- // GLCD fonts are arranged LSB = topmost pixel of char, so its easy to just shift through the column
- uint16_t bitcolumn; //16 bits for 2x8 bit high characters
-
- for (i = 0; i < numBytes; i++) {
- bitcolumn = *bitmap++;
- if (hbytes == 2) bitcolumn |= (*bitmap++)<<8; // add second byte for 16 bit high fonts
- for (j = 0; j < h; j++) {
- if (bitcolumn&0x1) {
- if (fontSize==2) {
- directPixel(x + (i<<1) , y + (j<<1),directcolor);
- directPixel(x + (i<<1)+1, y + (j<<1),directcolor);
- directPixel(x + (i<<1) , y + (j<<1)+1,directcolor);
- directPixel(x + (i<<1)+1, y + (j<<1)+1,directcolor);
- } else directPixel(x + i, y + j,directcolor);
- } else if (directbgcolor != invisiblecolor) {
- if (fontSize==2) {
- directPixel(x + (i<<1) , y + (j<<1),directbgcolor);
- directPixel(x + (i<<1)+1, y + (j<<1),directbgcolor);
- directPixel(x + (i<<1) , y + (j<<1)+1,directbgcolor);
- directPixel(x + (i<<1)+1, y + (j<<1)+1,directbgcolor);
- } else directPixel(x + i, y + j,directbgcolor);
- }
- bitcolumn>>=1;
- }
- }
- return (numBytes+adjustCharStep)*fontSize; // for character stepping
-}
-
-int Display::bufferChar(int16_t x, int16_t y, uint16_t index){
- const uint8_t* bitmap = font;
- uint8_t w = *bitmap;
- uint8_t h = *(bitmap + 1);
- uint8_t hbytes=0, xtra=1;
- if (h==8 || h==16) xtra=0; //don't add if exactly on byte limit
- hbytes=(h>>3)+xtra; //GLCD fonts are arranged w+1 times h/8 bytes
- //bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
- bitmap = bitmap + 4 + index * (w * hbytes + 1); //add an offset to the pointer (fonts !)
- //int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- int8_t i, j, numBytes;
- numBytes = *bitmap++; //first byte of char is the width in bytes
- // GLCD fonts are arranged LSB = topmost pixel of char, so its easy to just shift through the column
- uint16_t bitcolumn; //16 bits for 2x8 bit high characters
-
- for (i = 0; i < numBytes; i++) {
- bitcolumn = *bitmap++;
- if (hbytes == 2) bitcolumn |= (*bitmap++)<<8; // add second byte for 16 bit high fonts
- for (j = 0; j <= h; j++) { // was j<=h
- #if PROJ_ARDUBOY > 0
- if (bitcolumn&0x1) {
- drawPixel(x + i, y + 7 - j,color);
- } else drawPixel(x + i, y + 7 - j,bgcolor);
- bitcolumn>>=1;
- #else
- if (bitcolumn&0x1) {
- drawPixel(x + i, y + j,color);
- } else drawPixel(x + i, y + j,bgcolor);
- bitcolumn>>=1;
- #endif // PROJ_ARDUBOY
-
- }
- }
-
- return numBytes+adjustCharStep; // for character stepping
-}
-
-void Display::clear() {
-
- uint8_t c=0;
- c = bgcolor & (PALETTE_SIZE-1) ; //don't let palette go out of bounds
- if (bpp==1 && bgcolor) c=0xFF; // bgcolor !=0, set all pixels
- else if (bpp==2) {
- c = bgcolor & 0x3;
- c = c | (c << 2);
- c = c | (c << 4);
- } else {
- c = (c & 0x0F) | (c << 4);
- }
- uint16_t j = sizeof(screenbuffer);
- memset((void*)m_scrbuf,c,j);
-
- setCursor(0,0);
-
-}
-
-void Display::scroll(int16_t pixelrows) {
- uint16_t index = 0, index2,oc;
- if (pixelrows==0) return;
- if (pixelrows >= height) pixelrows=height-1;
- if (bpp == 4) index2 = pixelrows*width/2;
- else if (bpp == 2) index2 = pixelrows*width/4;
- else return;
- oc = color;
- color = bgcolor;
- if (pixelrows>0) {
- for (uint16_t y=0;y<height-pixelrows;y++) {
- for (uint16_t x=0;x<(width/8)*bpp;x++) screenbuffer[index++]=screenbuffer[index2++];
- }
- fillRect(0,cursorY,width,height);
- } else {
- for (uint16_t y=pixelrows;y<height;y++) {
- for (uint16_t x=0;x<(width*bpp)/8;x++) screenbuffer[index2++]=screenbuffer[index2];
- }
- fillRect(0,0,width,pixelrows);
- }
- color=oc;
-}
-
-void Display::fillScreen(uint16_t c) {
- c = c & (PALETTE_SIZE-1) ; //don't let palette go out of bounds
- if (bpp==1 && c) c=0xFF; // set all pixels
- else if (bpp==2) {
- c = bgcolor & 0x3;
- c = c | (c << 2);
- c = c | (c << 4);
- } else {
- c = (c & 0x0F) | (c << 4);
- }
- memset((void*)m_scrbuf,c,sizeof(screenbuffer));
-}
-
-void Display::setDefaultPalette() {
- #if PICOPALETTE
- loadRGBPalette(palettePico);
- #else
- loadRGBPalette(POK_DEFAULT_PALETTE);
- #endif //PICOPALETTE
-}
-
-void Display::setColor(uint8_t c) {
- color = c & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
-}
-
-void Display::setColor(uint8_t c,uint8_t bgc){
- color = c & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
- bgcolor = bgc & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
-}
-
-void Display::setInvisibleColor(uint16_t c){
- invisiblecolor = c; // invisible color can have values beyond 255 for identification purposes
-}
-
-uint8_t Display::getColor() {
- return color;
-}
-
-uint8_t Display::getBgColor() {
- return bgcolor;
-}
-
-uint16_t Display::getInvisibleColor() {
- return invisiblecolor;
-}
-
-void Display::drawPixel(int16_t x,int16_t y, uint8_t col) {
- if (col==invisiblecolor) return; // do not draw transparent pixels
- if ((uint16_t)x >= width || (uint16_t)y >= height) return;
- col &= (PALETTE_SIZE-1);
- #if POK_GAMEBUINO_SUPPORT >0
-
- uint8_t c = col;
- uint8_t ct = col;
-
- uint16_t bitptr=0;
- for (uint8_t cbit=0;cbit<POK_COLORDEPTH;cbit++) {
- c = ct & 1; // take the lowest bit of the color index number
- if(c == 0){ //white - or actually "Clear bit"
- m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] &= ~_BV(y % 8);
- } else { //black - or actually "Set bit"
- m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] |= _BV(y % 8);
- }
- ct >>=1; // shift to get next bit
- bitptr += POK_BITFRAME; // move one screen worth of buffer forward to get to the next color bit
- } // POK_COLOURDEPTH
-
- #else
- #if POK_COLORDEPTH == 1
- if (col) {m_scrbuf[(y >> 3) * width + x] |= (0x80 >> (y & 7)); return;}
- m_scrbuf[(y >> 3) * width + x] &= ~(0x80 >> (y & 7));
- #elif POK_COLORDEPTH == 2
- if (col) {
- col &= 3;
- }
- uint16_t i = y*(width>>2) + (x>>2);
- uint8_t pixel = m_scrbuf[i];
- uint8_t column = x&0x03;
- if (column==3) pixel = (pixel&0xFC)|(col); // bits 0-1
- else if (column==2) pixel = (pixel&0xF3)|(col<<2); // bits 2-3
- else if (column==1) pixel = (pixel&0xCF)|(col<<4); // bits 4-5
- else pixel = (pixel&0x3F)|(col<<6); // bits 6-7
- m_scrbuf[i] = pixel;
- #elif POK_COLORDEPTH == 3
- #elif POK_COLORDEPTH == 4
- uint16_t i = y*(width>>1) + (x>>1);
- uint8_t pixel = m_scrbuf[i];
- if (x&1) pixel = (pixel&0xF0)|(col);
- else pixel = (pixel&0x0F) | (col<<4);
- m_scrbuf[i] = pixel;
- #endif // POK_COLORDEPTH
- #endif // POK_GAMEBUINO_SUPPORT
-}
-
-void Display::drawPixel(int16_t x,int16_t y) {
- if ((uint16_t)x >= width || (uint16_t)y >= height) return;
-
- #if POK_GAMEBUINO_SUPPORT > 0
-
- uint8_t c = color;
- uint8_t ct = color;
- if(ct == INVERT){
- ct = !getPixel(x, y); //jonne - was c = !getP...
- }
-
- uint16_t bitptr=0;
- for (uint8_t cbit=0;cbit<POK_COLORDEPTH;cbit++) {
- c = ct & 1; // take the lowest bit of the color index number
- if(c == 0){ //white - or actually "Clear bit"
- #if DISPLAY_ROT == NOROT
- m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] &= ~_BV(y % 8);
- #elif DISPLAY_ROT == ROTCCW
- m_scrbuf[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT + bitptr] &= ~_BV(x % 8);
- #elif DISPLAY_ROT == ROT180
- m_scrbuf[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT + bitptr] &= ~_BV((LCDHEIGHT - y - 1) % 8);
- #elif DISPLAY_ROT == ROTCW
- m_scrbuf[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT + bitbtr] &= ~_BV((LCDWIDTH - x - 1) % 8);
- #endif
- //return; //jonne
- } else { //black - or actually "Set bit"
- #if DISPLAY_ROT == NOROT
- m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] |= _BV(y % 8);
- #elif DISPLAY_ROT == ROTCCW
- m_scrbuf[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT + bitptr] |= _BV(x % 8);
- #elif DISPLAY_ROT == ROT180
- m_scrbuf[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT + bitptr] |= _BV((LCDHEIGHT - y - 1) % 8);
- #elif DISPLAY_ROT == ROTCW
- m_scrbuf[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT + bitptr] |= _BV((LCDWIDTH - x -1) % 8);
- #endif
- //return; //jonne
- }
- ct >>=1; // shift to get next bit
- bitptr += POK_BITFRAME; // move one screen worth of buffer forward to get to the next color bit
- } // POK_COLOURDEPTH
-
- #else
-
- /** NOT Gamebuino */
- #if POK_COLORDEPTH == 1
- if (color) {m_scrbuf[(y >> 3) * width + x] |= (0x80 >> (y & 7)); return;}
- m_scrbuf[(y >> 3) * width + x] &= ~(0x80 >> (y & 7));
- #elif POK_COLORDEPTH == 2
- uint16_t i = y*(width>>2) + (x>>2);
- uint8_t pixel = m_scrbuf[i];
- uint8_t column = x&0x03;
- if (column==3) pixel = (pixel&0xFC)|(color); // bits 0-1
- else if (column==2) pixel = (pixel&0xF3)|(color<<2); // bits 2-3
- else if (column==1) pixel = (pixel&0xCF)|(color<<4); // bits 4-5
- else pixel = (pixel&0x3F)|(color<<6); // bits 6-7
- m_scrbuf[i] = pixel;
- #elif POK_COLORDEPTH == 3
- #elif POK_COLORDEPTH == 4
- uint16_t i = y*(width>>1) + (x>>1);
- uint8_t pixel = m_scrbuf[i];
- if (x&1) pixel = (pixel&0xF0)|(color);
- else pixel = (pixel&0x0F) | (color<<4);
- m_scrbuf[i] = pixel;
- #endif // POK_COLORDEPTH
- #endif // POK_GAMEBUINO_SUPPORT
-}
-
-uint8_t Display::getPixel(int16_t x,int16_t y) {
- if ((uint16_t)x >= width || (uint16_t)y >= height) return 0;
- #if POK_GAMEBUINO_SUPPORT
- uint8_t color=0; //jonne
- for (uint8_t cbit=0; cbit<POK_COLORDEPTH;cbit++) {
- color |= (m_scrbuf[x + (y / 8) * LCDWIDTH+POK_BITFRAME*cbit] >> (y % 8)) & 0x1 ; //jonne - added +504*cbit
- }
- return color;
- #else
- /** not gamebuino */
- #if POK_COLORDEPTH == 1
- return (m_scrbuf[(y >> 3) * width + x] & (0x80 >> (y & 7))) ? 1:0;
- #elif POK_COLORDEPTH == 2
- uint16_t i = y*(width>>2) + (x>>2);
- uint8_t pixel = m_scrbuf[i];
- uint8_t column = x&0x03;
- if (column==0) return pixel & 0x03; // bits 0-1
- else if (column==1) return (pixel & 0x0C)>>2; // bits 2-3
- else if (column==2) return (pixel & 0x30)>>4; // bits 4-5
- else return pixel>>6;; // bits 6-7
- #elif POK_COLORDEPTH == 3
- #elif POK_COLORDEPTH == 4
- uint16_t i = y*(width>>1) + (x>>1);
- uint8_t pixel = m_scrbuf[i];
- if (x&1) return pixel & 0x0F;
- else return pixel>>4;
- #endif // POK_COLORDEPTH
- #endif // POK_GAMEBUINO_SUPPORT
-}
-
-void Display::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
- if ((uint16_t)x0 >= width || (uint16_t)y0 >= height || (uint16_t)x1 >= width || (uint16_t)y1 >= height ) {
- if (clipLine (&x0,&y0,&x1,&y1)==0) return; // line out of bounds
- }
- if (x0 == x1)
- drawColumn(x0,y0,y1);
- else if (y0 == y1)
- drawRow(x0,x1,y0);
- else {
- int e;
- signed int dx,dy,j, temp;
- signed char s1,s2, xchange;
- signed int x,y;
-
- x = x0;
- y = y0;
-
- //take absolute value
- if (x1 < x0) {
- dx = x0 - x1;
- s1 = -1;
- }
- else if (x1 == x0) {
- dx = 0;
- s1 = 0;
- }
- else {
- dx = x1 - x0;
- s1 = 1;
- }
-
- if (y1 < y0) {
- dy = y0 - y1;
- s2 = -1;
- }
- else if (y1 == y0) {
- dy = 0;
- s2 = 0;
- }
- else {
- dy = y1 - y0;
- s2 = 1;
- }
-
- xchange = 0;
-
- if (dy>dx) {
- temp = dx;
- dx = dy;
- dy = temp;
- xchange = 1;
- }
-
- e = ((int)dy<<1) - dx;
-
- for (j=0; j<=dx; j++) {
- drawPixel(x,y);
-
- if (e>=0) {
- if (xchange==1) x = x + s1;
- else y = y + s2;
- e = e - ((int)dx<<1);
- }
- if (xchange==1)
- y = y + s2;
- else
- x = x + s1;
- e = e + ((int)dy<<1);
- }
- }
-}
-
-uint8_t Display::clipLine(int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1){
- // Check X bounds
- if (*x1<*x0) {
- //std::swap (*x1,*x0); // swap so that we dont have to check x1 also
- swapWT(int16_t*,x1,x0);
- //std::swap (*y1,*y0); // y needs to be swaaped also
- swapWT(int16_t*,y1,y0);
- }
-
- if (*x0>=width) return 0; // whole line is out of bounds
-
- // Clip against X0 = 0
- if (*x0 < 0) {
- if ( *x1 < 0) return 0; // nothing visible
- int16_t dx = (*x1 - *x0);
- int16_t dy = ((*y1 - *y0) << 8); // 8.8 fixed point calculation trick
- int16_t m = dy/dx;
- *y0 = *y0 + ((m*-*x0)>>8); // get y0 at boundary
- *x0 = 0;
- }
-
- // Clip against x1 = 83
- if (*x1 >= width) {
- int16_t dx = (*x1 - *x0);
- int16_t dy = ((*y1 - *y0) << 8); // 8.8 fixed point calculation trick
- int16_t m = dy/dx;
- //*y1 = *y1 + ((m*(*x1-XMAX))>>8); // get y0 at boundary
- *y1 = *y1 + ((m*(width-1-*x1))>>8); // get y0 at boundary
- *x1 = width-1;
- }
-
- // Check Y bounds
- if (*y1<*y0) {
- //std::swap (*x1,*x0); // swap so that we dont have to check x1 also
- swapWT(int16_t*,x1,x0);
- //std::swap (*y1,*y0); // y needs to be swaaped also
- swapWT(int16_t*,y1,y0);
- }
-
- if (*y0>=height) return 0; // whole line is out of bounds
-
- if (*y0 < 0) {
- if ( *y1 < 0) return 0; // nothing visible
- int16_t dx = (*x1 - *x0) << 8;
- int16_t dy = (*y1 - *y0); // 8.8 fixed point calculation trick
- int16_t m = dx/dy;
- *x0 = *x0 + ((m*-*y0)>>8); // get x0 at boundary
- *y0 = 0;
- }
-
- // Clip against y1 = 47
- if (*y1 >= height) {
- int16_t dx = (*x1 - *x0) << 8;
- int16_t dy = (*y1 - *y0); // 8.8 fixed point calculation trick
- int16_t m = dx/dy;
- *x1 = *x1 + ((m*(height-1-*y1))>>8); // get y0 at boundary
- //*x1 = *x1 + ((m*(*y1-YMAX))>>8); // get y0 at boundary
- *y1 = height-1;
- }
- return 1; // clipped succesfully
-}
-
-void Display::map1BitColumn(int16_t x, int16_t sy, int16_t ey, const uint8_t* bitmap, uint16_t column){
- if ((uint16_t)sy>=height && (uint16_t)ey>=height) return; //completely out of bounds
- if ((uint16_t)x>=width) return; //completely out of bounds
- if (sy>ey) {
- int y=sy;
- sy=ey;
- ey=y; // swap around so that x0 is less than x1
- }
- uint16_t bmw,bmh;
- float texelstep, texelindex;
- bmw = *(bitmap);
- bmh = *(bitmap+1);
- if (column>bmw-1) column=bmw-1;
- bitmap += 2;
- bitmap += column;
- texelstep = (float)bmh/((float)ey-(float)sy);
- texelindex = 0;
- for (int y=sy; y <= ey; y++, texelindex += texelstep) {
- uint8_t texel;
- uint8_t currbyte, bit;
- currbyte = texelindex / 8;
- bit = 7-((uint16_t) texelindex & 0x7);
- texel=*(bitmap+currbyte*bmw);
- if (texel & (1<<bit)) drawPixel(x,y);
- else if (bgcolor != invisiblecolor) drawPixel(x,y,bgcolor);
- }
-};
-
-void Display::drawColumn(int16_t x, int16_t sy, int16_t ey){
- if ((uint16_t)sy>=height && (uint16_t)ey>=height) return; //completely out of bounds
- if ((uint16_t)x>=width) return; //completely out of bounds
- if (sy>ey) {
- int y=sy;
- sy=ey;
- ey=y; // swap around so that x0 is less than x1
- }
- for (int y=sy; y <= ey; y++) {
- drawPixel(x,y);
- }
-}
-
-void Display::drawRow(int16_t x0, int16_t x1, int16_t y){
- if ((uint16_t)x0>=width && (uint16_t)x1>=width) return; //completely out of bounds
- if ((uint16_t)y>=height) return; //completely out of bounds
-
- if (x0>x1) {
- int x=x0;
- x0=x1;
- x1=x; // swap around so that x0 is less than x1
- }
- for (int x=x0; x <= x1; x++) {
- drawPixel(x,y);
- }
-}
-
-void Display::drawFastVLine(int16_t x, int16_t y, int16_t h){
- if (h<0) {y += h; h = -h;}
- drawColumn(x,y,y+h);
-}
-
-void Display::drawFastHLine(int16_t x, int16_t y, int16_t w){
- if (w<0) {x += w; w = -w;}
- drawRow(x,x+w-1,y);
-}
-
-void Display::drawRectangle(int16_t x0, int16_t y0, int16_t w, int16_t h) {
- drawColumn(x0,y0,y0+h);
- drawColumn(x0+w,y0,y0+h);
- drawRow(x0,x0+w,y0);
- drawRow(x0,x0+w,y0+h);
-}
-
-void Display::fillRectangle(int16_t x0,int16_t y0, int16_t w, int16_t h){
- int16_t x,y,x1,y1;
- x1=x0+w;y1=y0+h;
- if ((x0<0 && x1<0) || (x0>=width && x1 >=width)) return; //completely out of bounds
- if ((y0<0 && y1<0) || (y0>=height && y1 >=height)) return; //completely out of bounds
- if (x0>x1) {x=x1;x1=x0;}
- else x=x0;
- if (y0>y1) {y=y1;y1=y0;}
- else y=y0;
- if (x<0) x=0;
- if (y<0) y=0;
- for (;x<x1;x++) drawColumn(x,y,y1);
-}
-
-void Display::fillRect(int16_t x, int16_t y, int16_t w, int16_t h) {
- fillRectangle(x,y,w,h);
-}
-
-void Display::drawRect(int16_t x, int16_t y, int16_t w, int16_t h) {
- drawRectangle(x,y,w,h);
-}
-
-void Display::drawCircle(int16_t x0, int16_t y0, int16_t r) {
- int16_t f = 1 - r;
- int16_t ddF_x = 1;
- int16_t ddF_y = -2 * r;
- int16_t x = 0;
- int16_t y = r;
-
- drawPixel(x0, y0 + r);
- drawPixel(x0, y0 - r);
- drawPixel(x0 + r, y0);
- drawPixel(x0 - r, y0);
-
- while (x < y) {
- if (f >= 0) {
-
- y--;
- ddF_y += 2;
- f += ddF_y;
- }
- x++;
- ddF_x += 2;
- f += ddF_x;
-
- drawPixel(x0 + x, y0 + y);
- drawPixel(x0 - x, y0 + y);
- drawPixel(x0 + x, y0 - y);
- drawPixel(x0 - x, y0 - y);
- drawPixel(x0 + y, y0 + x);
- drawPixel(x0 - y, y0 + x);
- drawPixel(x0 + y, y0 - x);
- drawPixel(x0 - y, y0 - x);
-
- }
-}
-
-void Display::drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername) {
- int16_t f = 1 - r;
- int16_t ddF_x = 1;
- int16_t ddF_y = -2 * r;
- int16_t x = 0;
- int16_t y = r;
-
- while (x < y) {
- if (f >= 0) {
- y--;
- ddF_y += 2;
- f += ddF_y;
- }
- x++;
- ddF_x += 2;
- f += ddF_x;
- if (cornername & 0x4) {
- drawPixel(x0 + x, y0 + y);
- drawPixel(x0 + y, y0 + x);
- }
- if (cornername & 0x2) {
- drawPixel(x0 + x, y0 - y);
- drawPixel(x0 + y, y0 - x);
- }
- if (cornername & 0x8) {
- drawPixel(x0 - y, y0 + x);
- drawPixel(x0 - x, y0 + y);
- }
- if (cornername & 0x1) {
-
- drawPixel(x0 - y, y0 - x);
- drawPixel(x0 - x, y0 - y);
- }
- }
-}
-
-void Display::fillCircle(int16_t x0, int16_t y0, int16_t r) {
- drawFastVLine(x0, y0 - r, 2 * r );
- fillCircleHelper(x0, y0, r, 3, 0);
-}
-
-void Display::fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername, int16_t delta) {
- int16_t f = 1 - r;
- int16_t ddF_x = 1;
- int16_t ddF_y = -2 * r;
- int16_t x = 0;
- int16_t y = r;
-
- while (x < y) {
- if (f >= 0) {
- y--;
- ddF_y += 2;
- f += ddF_y;
- }
- x++;
- ddF_x += 2;
- f += ddF_x;
-
- if (cornername & 0x1) {
- drawFastVLine(x0 + x, y0 - y, 2 * y + 1 + delta-1); //added -1 here, jonne
- drawFastVLine(x0 + y, y0 - x, 2 * x + 1 + delta-1); //added -1 here, jonne
- }
- if (cornername & 0x2) {
-
- drawFastVLine(x0 - x, y0 - y, 2 * y + 1 + delta-1); //added -1 here, jonne
- drawFastVLine(x0 - y, y0 - x, 2 * x + 1 + delta-1); //added -1 here, jonne
- }
- }
-}
-
-void Display::drawRoundRect(int16_t x, int16_t y, int16_t w,int16_t h, int16_t r) {
- if (r<2) {drawRectangle(x,y,w,h);return;}
- // smarter version
- drawFastHLine(x + r, y, w - 2 * r); // Top
- drawFastHLine(x + r, y + h - 1, w - 2 * r); // Bottom
- drawFastVLine(x, y + r, h - 2 * r); // Left
- drawFastVLine(x + w - 1, y + r, h - 2 * r); // Right
- // draw four corners
- drawCircleHelper(x + r, y + r, r, 1);
- drawCircleHelper(x + w - r - 1, y + r, r, 2);
- drawCircleHelper(x + w - r - 1, y + h - r - 1, r, 4);
- drawCircleHelper(x + r, y + h - r - 1, r, 8);
-}
-
-void Display::fillRoundRect(int16_t x, int16_t y, int16_t w,int16_t h, int16_t r) {
- if (r<2) {fillRectangle(x,y,w,h);return;}
- fillRectangle(x + r, y, w - 2 * r, h-1);
- // draw four corners
- fillCircleHelper(x + w - r - 1, y + r, r, 1, h - 2 * r - 1);
- fillCircleHelper(x + r, y + r, r, 2, h - 2 * r - 1);
-}
-
-void Display::drawTriangle(int16_t x0, int16_t y0,
- int16_t x1, int16_t y1,
- int16_t x2, int16_t y2) {
- drawLine(x0, y0, x1, y1);
- drawLine(x1, y1, x2, y2);
- drawLine(x2, y2, x0, y0);
-}
-
-void Display::fillTriangle(int16_t x0, int16_t y0,
- int16_t x1, int16_t y1,
- int16_t x2, int16_t y2) {
- int16_t a, b, y, last;
-
- // Sort coordinates by Y order (y2 >= y1 >= y0)
- if (y0 > y1) {
- swapWT(int16_t,y0, y1);
- swapWT(int16_t,x0, x1);
- }
- if (y1 > y2) {
- swapWT(int16_t,y2, y1);
- swapWT(int16_t,x2, x1);
- }
- if (y0 > y1) {
- swapWT(int16_t,y0, y1);
- swapWT(int16_t,x0, x1);
- }
-
- if (y0 == y2) { // Handle awkward all-on-same-line case as its own thing
- a = b = x0;
- if (x1 < a) a = x1;
- else if (x1 > b) b = x1;
- if (x2 < a) a = x2;
- else if (x2 > b) b = x2;
- drawFastHLine(a, y0, b - a + 1);
- return;
- }
-
- int16_t
- dx01 = x1 - x0,
- dy01 = y1 - y0,
- dx02 = x2 - x0,
- dy02 = y2 - y0,
- dx12 = x2 - x1,
- dy12 = y2 - y1,
- sa = 0,
- sb = 0;
-
- // For upper part of triangle, find scanline crossings for segments
- // 0-1 and 0-2. If y1=y2 (flat-bottomed triangle), the scanline y1
- // is included here (and second loop will be skipped, avoiding a /0
- // error there), otherwise scanline y1 is skipped here and handled
- // in the second loop...which also avoids a /0 error here if y0=y1
- // (flat-topped triangle).
- if (y1 == y2) last = y1; // Include y1 scanline
- else last = y1 - 1; // Skip it
-
- for (y = y0; y <= last; y++) {
- a = x0 + sa / dy01;
- b = x0 + sb / dy02;
- sa += dx01;
- sb += dx02;
- /* longhand:
- a = x0 + (x1 - x0) * (y - y0) / (y1 - y0);
- b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
- */
- if (a > b) swapWT(int16_t,a, b);
- drawFastHLine(a, y, b - a + 1);
- }
-
- // For lower part of triangle, find scanline crossings for segments
- // 0-2 and 1-2. This loop is skipped if y1=y2.
- sa = dx12 * (y - y1);
- sb = dx02 * (y - y0);
- for (; y <= y2; y++) {
- a = x1 + sa / dy12;
- b = x0 + sb / dy02;
- sa += dx12;
- sb += dx02;
-
- if (a > b) swapWT(int16_t,a, b);
- drawFastHLine(a, y, b - a + 1);
- }
-}
-
-void Display::setFont(const unsigned char * f) {
- font = f;
- fontWidth = *(font)+1;
- fontHeight = *(font + 1)+1;
-}
-
-void Display::drawMonoBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t index) {
- uint8_t w = *bitmap;
- uint8_t h = *(bitmap + 1);
- uint8_t xtra=0;
- if (w&0x7) xtra=1;
- bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
- #if POK_GAMEBUINO_SUPPORT > 0
- int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- if (source & (0x80 >> bitNum)) {
- drawPixel(x + i, y + j);
- }
- }
- }
- #else
- /** not gamebuino */
- int8_t scrx,scry;
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
- int8_t bitptr;
- for (scry = y; scry < y+h; scry+=1) {
- if ((x&1)==0) { /** EVEN pixel starting line**/
- for (scrx = x, bitptr=7; scrx < w+x; scrx+=2) {
- uint8_t targetpixel = *scrptr;
- if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF) | color<<4; // upper nibble
- else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF) | bgcolor<<4; // upper nibble
- bitptr--;
- if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF0) | color; // lower nibble
- else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF0) | bgcolor; // lower nibble
- bitptr--;
- if (bitptr<0) { bitptr = 7; bitmap++; }
- *scrptr = targetpixel;
- scrptr++;
- }
- } else { /** ODD pixel starting line **/
- for (scrx = x, bitptr=7; scrx < w+x; scrx+=2) {
- uint8_t targetpixel = *scrptr;
- // store higher nibble of source pixel in lower nibble of target
- if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF0) | color; // lower nibble
- else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF0) | bgcolor; // lower nibble
- *scrptr = targetpixel; // store
- bitptr--;scrptr++;targetpixel = *scrptr;
- // store lower nibble of source pixel in higher nibble of target
- if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF) | color<<4; // higher nibble
- else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF) | bgcolor<<4; // higher nibble
- *scrptr = targetpixel; // store
- bitptr--; // do not increment scrptr here !
- }
- }
- if (bitptr!=7) bitmap++; // force skip to next line
- // increment the y jump in the scrptr
- scrptr = scrptr + ((width - w)>>1);
- }
- #endif // POK_GAMEBUINO_SUPPORT
-}
-
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t frame)
-{
- int16_t w = *bitmap;
- int16_t h = *(bitmap + 1);
- uint8_t framew = *(bitmap+2);
- bitmap = bitmap + 3; //add an offset to the pointer to start after the width and height
- /** visibility check */
- if (y<-h || y>height) return; //invisible
- if (x<-framew || x>width) return; //invisible
- /** 1 bpp mode */
- if (m_colordepth<2) {
- int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- if (source & (0x80 >> bitNum)) {
- drawPixel(x + i, y + j);
- }
- }
- }
-
- return;
- }
- /** 2 bpp mode */
- if (m_colordepth<4) {
- int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
- for (i = 0; i < w; i++) {
- byteNum = i / 4;
- bitNum = (i % 4)<<1;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- uint8_t output = (source & (0xC0 >> bitNum));
- output >>= (6-bitNum);
- if (output != invisiblecolor) {
- setColor(output);
- drawPixel(x + i, y + j);
- }
- }
- }
-
- return;
- }
- /** 4bpp fast version */
- int16_t scrx,scry,xclip,xjump,scrxjump;
- xclip=xjump=scrxjump=0;
- bitmap += (framew*frame)>>1;
- /** y clipping */
- if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
- else if (y+h>height) { h -=(y-height);}
- /** x clipping */
- xjump = (w-framew)>>1;
- if (x<0) { xclip=(x&1)<<1; framew+=x; xjump = ((-x)>>1); bitmap += xjump; x=0;}
- else if (x+framew>width) {
- xclip = (x&1)<<1;
- scrxjump = x&1;
- xjump=((x+framew-width)>>1)+scrxjump;
- framew = width-x;}
-
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
- /** ONLY 4-bit mode for time being **/
- for (scry = y; scry < y+h; scry+=1) {
- if (scry>=height) return;
- if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
- for (scrx = x; scrx < framew+x-xclip; scrx+=2) {
- uint8_t sourcepixel = *bitmap;
- if (xclip) {
- sourcepixel <<=4;
- sourcepixel |= ((*(bitmap+1))>>4);
- }
- uint8_t targetpixel = *scrptr;
- if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0x0F) | (sourcepixel & 0xF0);
- if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F);
- *scrptr = targetpixel;
- bitmap++;
- scrptr++;
- }
- if (xclip){
- if (framew&1) {
- /**last pixel is odd pixel due to clipping & odd width*/
- uint8_t sourcepixel = *bitmap;
- if ((sourcepixel&0x0F) != invisiblecolor) {
- sourcepixel <<=4;
- uint8_t targetpixel = *scrptr;// & 0x0F;
- targetpixel |= sourcepixel;
- *scrptr = targetpixel;
- }
- //scrptr++;
- }
- bitmap++;
- scrptr++;
- }
- bitmap += xjump; // needed if x<0 clipping occurs
- } else { /** ODD pixel starting line **/
- for (scrx = x; scrx < framew+x-xclip; scrx+=2) {
- uint8_t sourcepixel = *bitmap;
- uint8_t targetpixel = *scrptr;
- // store higher nibble of source pixel in lower nibble of target
- if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel >> 4 );
- *scrptr = targetpixel;
- scrptr++;
- targetpixel = *scrptr;
- // store lower nibble of source pixel in higher nibble of target
- if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel << 4);
- *scrptr = targetpixel;
- bitmap++;
- }
- bitmap+=xjump;
- }
- // increment the y jump in the scrptr
- scrptr = scrptr + ((width - framew)>>1)+scrxjump;
- }
-}
-
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap)
-{
- int16_t w = *bitmap;
- int16_t h = *(bitmap + 1);
- bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
- /** visibility check */
- if (y<-h || y>height) return; //invisible
- if (x<-w || x>width) return; //invisible
- /** 1 bpp mode */
- if (m_colordepth<2) {
- int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- if (source & (0x80 >> bitNum)) {
- drawPixel(x + i, y + j);
- }
- }
- }
-
- return;
- }
- /** 2 bpp mode */
- if (m_colordepth<4) {
- int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
- for (i = 0; i < w; i++) {
- byteNum = i / 4;
- bitNum = (i % 4)<<1;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- uint8_t output = (source & (0xC0 >> bitNum));
- output >>= (6-bitNum);
- if (output != invisiblecolor) {
- setColor(output);
- drawPixel(x + i, y + j);
- }
- }
- }
-
- return;
- }
- /** 4bpp fast version */
- int16_t scrx,scry,xclip,xjump,scrxjump;
- xclip=xjump=scrxjump=0;
- /** y clipping */
- if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
- else if (y+h>height) { h -=(y-height);}
- /** x clipping */
- if (x<0) { xclip=(x&1)<<1; w+=x; xjump = ((-x)>>1); bitmap += xjump; x=0;}
- else if (x+w>width) {
- xclip = (x&1)<<1;
- scrxjump = x&1;
- xjump=((x+w-width)>>1)+scrxjump;
- w = width-x;}
-
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
- /** ONLY 4-bit mode for time being **/
- for (scry = y; scry < y+h; scry+=1) {
- if (scry>=height) return;
- if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
- for (scrx = x; scrx < w+x-xclip; scrx+=2) {
- uint8_t sourcepixel = *bitmap;
- if (xclip) {
- sourcepixel <<=4;
- sourcepixel |= ((*(bitmap+1))>>4);
- }
- uint8_t targetpixel = *scrptr;
- if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0x0F) | (sourcepixel & 0xF0);
- if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F);
- *scrptr = targetpixel;
- bitmap++;
- scrptr++;
- }
- if (xclip){
- if (w&1) {
- /**last pixel is odd pixel due to clipping & odd width*/
- uint8_t sourcepixel = *bitmap;
- if ((sourcepixel&0x0F) != invisiblecolor) {
- sourcepixel <<=4;
- uint8_t targetpixel = *scrptr;// & 0x0F;
- targetpixel |= sourcepixel;
- *scrptr = targetpixel;
- }
- //scrptr++;
- }
- bitmap++;
- scrptr++;
- }
- bitmap += xjump; // needed if x<0 clipping occurs
- } else { /** ODD pixel starting line **/
- for (scrx = x; scrx < w+x-xclip; scrx+=2) {
- uint8_t sourcepixel = *bitmap;
- uint8_t targetpixel = *scrptr;
- // store higher nibble of source pixel in lower nibble of target
- if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel >> 4 );
- *scrptr = targetpixel;
- scrptr++;
- targetpixel = *scrptr;
- // store lower nibble of source pixel in higher nibble of target
- if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel << 4);
- *scrptr = targetpixel;
- bitmap++;
- }
- bitmap+=xjump;
- }
- // increment the y jump in the scrptr
- scrptr = scrptr + ((width - w)>>1)+scrxjump;
- }
-}
-
-void Display::drawRleBitmap(int16_t x, int16_t y, const uint8_t* rlebitmap)
-{
- // ONLY can copy 4-bit bitmap to 4-bit screen mode for time being
- #if (POK_SCREENMODE != MODE_FAST_16COLOR)
- return;
- #endif
-
- int16_t w = *rlebitmap;
- int16_t h = *(rlebitmap + 1);
- rlebitmap = rlebitmap + 2; //add an offset to the pointer to start after the width and height
-
- // visibility check
- if (y<-h || y>height) return; //invisible
- if (x<-w || x>width) return; //invisible
-
- // Clipping is not supported
- if ((x < 0) || (x+w > width) || (y < 0) || (y+h > height)) return;
-
- // Currently only support RLE bitmaps in 16 color mode.
- if (m_colordepth != 4) //
- return;
-
- // Go through each line.
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
- bool is_endofbitmap = false;
- for (int16_t scry = y; scry < y+h && !is_endofbitmap;) {
-
- // Process one line. Go through each pixel run and escape command in RLE data.
- for (int16_t scrx = x;;) {
- uint8_t rle_count = *rlebitmap++;
-
- if (rle_count == 0) {
-
- /** Escape or absolute mode */
-
- uint8_t rle_escape_or_runsize = *rlebitmap++;
- if ( rle_escape_or_runsize == RLE_ESC_EOL) {
- // End of line.
- break;
- }
- else if ( rle_escape_or_runsize == RLE_ESC_EOB) {
- // End of bitmap.
- is_endofbitmap = true;
- break;
- }
- else if ( rle_escape_or_runsize == RLE_ESC_OFFSET) {
- // Move position in target.
- // TODO: not tested yet.
- uint8_t xoffset = *rlebitmap++;
- uint8_t yoffset = *rlebitmap++;
- scrptr += (xoffset>1);
- scrx += xoffset;
- scrptr += yoffset*width;
- scry += yoffset;
- }
- else {
-
- /** Absolute mode. Copy pixels from the source bitmap to the target screen. */
-
- int16_t runsize = rle_escape_or_runsize;
- uint8_t targetpixel = *scrptr; // initial value
- uint8_t sourcepixel = *rlebitmap; // initial value
- for( int16_t runx = 0; runx < runsize; ) {
- if (scrx&0x1) { // screen pixel is in the low nibble
- if (runx&0x1) { // bitmap pixel is in the low nibble
- if ((sourcepixel&0x0F) != invisiblecolor)
- targetpixel = (targetpixel&0xF0) | (sourcepixel&0x0F); // Copy low to low nibble.
- rlebitmap++;
- }
- else // bitmap pixel is in the high nibble
- if ((sourcepixel>>4) != invisiblecolor)
- targetpixel = (targetpixel&0xF0) | (sourcepixel>>4); // Copy high to low nibble.
-
- // Copy the byte to the target.
- *scrptr = targetpixel;
- scrptr++;
- }
- else { // screen pixel is in the high nibble
- targetpixel = *scrptr;
- sourcepixel = *rlebitmap;
- if (runx&0x1) { // bitmap pixel is sourcepixel = *rlebitmapin the low nibble
- if ((sourcepixel&0x0F) != invisiblecolor )
- targetpixel = (targetpixel&0x0F) | ((sourcepixel<<4)&0xF0); // Copy low to high nibble.
- rlebitmap++; // read the new source byte
- }
- else // bitmap pixel is in the high nibble
- if ((sourcepixel>>4) != invisiblecolor )
- targetpixel = (targetpixel&0x0F) | (sourcepixel&0xF0); // Copy high to high nibble.
- }
- runx++;
- scrx++;
- } // end for
-
- // If this is odd target index, copy the byte to the target.
- if (scrx&0x1) {
- *scrptr = targetpixel;
- scrptr++;
- }
-
- // In absolute mode the source size is always padded to the word boundary.
- if (runsize%4) {
- int16_t padpixcount = 4 - (runsize%4);
- rlebitmap += padpixcount>>1; // skip n padding bytes
- }
- }
- }
- else {
-
- /** Encoded mode. Duplicate one pixel pair to the all required pixels on the target screen */
-
- int16_t runsize = rle_count;
- uint8_t clonepixelpair = *rlebitmap++;
- uint8_t targetpixel = *scrptr; // initial value
- for( int16_t runx = 0; runx < runsize; ) {
- if (scrx&0x1) { // screen pixel is in the low nibble
- if (runx&0x1) { // bitmap pixel is in the low nibble
- if ((clonepixelpair&0x0F) != invisiblecolor)
- targetpixel = (targetpixel&0xF0) | (clonepixelpair&0x0F); // Copy low to low nibble.
- }
- else // bitmap pixel is in the high nibble
- if ((clonepixelpair>>4) != invisiblecolor)
- targetpixel = (targetpixel&0xF0) | (clonepixelpair>>4); // Copy high to low nibble.
-
- // Copy the byte to the target.
- *scrptr = targetpixel;
- scrptr++;
- }
- else { // screen pixel is in the high nibble
- targetpixel = *scrptr;
- if (runx&0x1) {// bitmap pixel is in the low nibble
- if ((clonepixelpair&0x0F) != invisiblecolor )
- targetpixel = (targetpixel&0x0F) | ((clonepixelpair<<4)&0xF0); // Copy low to high nibble.
- }
- else // bitmap pixel is in the high nibble
- if ((clonepixelpair>>4) != invisiblecolor )
- targetpixel = (targetpixel&0x0F) | (clonepixelpair&0xF0); // Copy high to high nibble.
- }
- runx++;
- scrx++;
-
- } // end for
-
- // If this is odd target index, copy the byte to the target.
- if (scrx&0x1) {
- *scrptr = targetpixel;
- scrptr++;
- }
- } // end if
- } // end while
-
- // Increment the target screen pointer and index.
- scrptr = scrptr + ((width - w)>>1);
- scry++;
- } // end for scry
-}
-
-void Display::drawBitmapXFlipped(int16_t x, int16_t y, const uint8_t* bitmap)
-{
- int16_t w = *bitmap;
- int16_t h = *(bitmap + 1);
- bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
- /** visibility check */
- if (y<-h || y>height) return; //invisible
- if (x<-w || x>width) return; //invisible
- /** 1 bpp mode */
- if (m_colordepth<2) {
- int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- if (source & (0x80 >> bitNum)) {
- drawPixel(x + w - i, y + j);
- }
- }
- }
-
- return;
- }
- /** 2 bpp mode */
- if (m_colordepth<4) {
- int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
- for (i = 0; i < w; i++) {
- byteNum = i / 4;
- bitNum = (i % 4)<<1;
- for (j = 0; j < h; j++) {
- uint8_t source = *(bitmap + j * byteWidth + byteNum);
- uint8_t output = (source & (0xC0 >> bitNum));
- output >>= (6-bitNum);
- if (output != invisiblecolor) {
- setColor(output);
- drawPixel(x + i, y + j);
- }
- }
- }
-
- return;
- }
- /** 4bpp fast version */
- int16_t scrx,scry,xclip,xjump,scrxjump;
- xclip=xjump=scrxjump=0;
- /** y clipping */
- if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
- else if (y+h>height) { h -=(y-height);}
- /** x clipping */
- bitmap += ((w>>1)-1); //inverted!
- if (x<0) {
- xclip=(x&1)<<1;
- w+=x;
- xjump = ((-x)>>1);
- //bitmap += xjump; // do not clip left edge of source, as bitmap is inverted !
- x=0;
- }
- else if (x+w>width) {
- xclip = (x&1)<<1;
- scrxjump = x&1;
- xjump=((x+w-width)>>1)+scrxjump;
- w = width-x;}
-
- //uint8_t* scrptr = m_scrbuf + (y*(width>>1) + ((x+width)>>1));
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
- /** ONLY 4-bit mode for time being **/
- for (scry = y; scry < y+h; scry+=1) {
- // for (scry = y; scry < y+2; scry+=1) {
- if (scry>=height) return;
- if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
- //for (scrx = w+x-xclip-1; scrx >= x; scrx-=2) {
- for (scrx = x; scrx < w+x-xclip; scrx+=2) {
- uint8_t sourcepixel = *(bitmap);
- if (xclip) {
- sourcepixel <<=4;
- sourcepixel |= ((*(bitmap-1))>>4);//inverted!
- }
- uint8_t targetpixel = *scrptr;
- // NIBBLES ARE INVERTED BECAUSE PICTURE IS FLIPPED !!!
- if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0xF0) | (sourcepixel>>4);
- if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel<<4);
- *scrptr = targetpixel;
- bitmap--;
- scrptr++;
- }
- bitmap += w; // w*2 >> 1 because inverted and because 2 pixels per byte!!
- if (xclip){
- if (w&1) {
- /**last pixel is odd pixel due to clipping & odd width*/
- uint8_t sourcepixel = *bitmap;
- if ((sourcepixel&0x0F) != invisiblecolor) {
- sourcepixel <<=4;
- uint8_t targetpixel = *scrptr;// & 0x0F;
- targetpixel |= sourcepixel;
- *scrptr = targetpixel;
- }
- //scrptr++;
- }
- bitmap++;
- scrptr++;
- }
- bitmap += xjump; // needed if x<0 clipping occurs
- } else { /** ODD pixel starting line **/
- for (scrx = x; scrx < w+x-xclip; scrx+=2 ) {
- uint8_t sourcepixel = *bitmap;
- uint8_t targetpixel = *scrptr;
- // inverted !!! store lower nibble of source pixel in lower nibble of target
- if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F );
- *scrptr = targetpixel;
- scrptr++;
- targetpixel = *scrptr;
- // inverted ! store higher nibble of source pixel in higher nibble of target
- if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel & 0xF0);
- *scrptr = targetpixel;
- bitmap--;
- }
- bitmap += w; // w*2 >> 1 because inverted and because 2 pixels per byte!!
- bitmap+=xjump;
- }
- // increment the y jump in the scrptr
- scrptr = scrptr + ((width - w)>>1)+scrxjump;
- }
-}
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip) {
-#if PROJ_GAMEBUINO == 0
- if (!flip) drawBitmap(x,y,bitmap);
- else drawBitmapXFlipped(x,y,bitmap);
-#else
- if((rotation == NOROT) && (flip == NOFLIP)){
- drawBitmap(x,y,bitmap); //use the faster algorithm
- return;
- }
- uint8_t w = bitmap[0];
- uint8_t h = bitmap[1];
- bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
- int8_t i, j, //coordinates in the raw bitmap
- k, l, //coordinates in the rotated/flipped bitmap
- byteNum, bitNum, byteWidth = (w + 7) >> 3;
-
- rotation %= 4;
-
- for (i = 0; i < w; i++) {
- byteNum = i / 8;
- bitNum = i % 8;
- for (j = 0; j < h; j++) {
- if (bitmap[j * byteWidth + byteNum] & (B10000000 >> bitNum)) {
- switch (rotation) {
- case NOROT: //no rotation
- k = i;
- l = j;
- break;
- case ROTCCW: //90� counter-clockwise
- k = j;
- l = w - i - 1;
- break;
- case ROT180: //180�
- k = w - i - 1;
- l = h - j - 1;
- break;
- case ROTCW: //90� clockwise
- k = h - j - 1;
- l = i;
- break;
- }
- if (flip) {
- flip %= 4;
- if (flip & B00000001) { //horizontal flip
- k = w - k;
- }
- if (flip & B00000010) { //vertical flip
- l = h - l;
- }
- }
- k += x; //place the bitmap on the screen
- l += y;
- drawPixel(k, l);
- }
- }
- }
-#endif //PROJ_GAMEBUINO
-
-}
-
-uint8_t* Display::getBuffer() {
- return m_scrbuf;
-}
-
-uint8_t Display::getBitmapPixel(const uint8_t* bitmap, uint16_t x, uint16_t y) {
- uint16_t w = *bitmap;
- uint8_t sourcebyte = bitmap[2+(y * ((w+7)>>3))+ (x>>3)];
- return sourcebyte & (0x80>>(x&7));
-}
-
-int Display::print_char(uint8_t x, uint8_t y, unsigned char c) {
- c -= font[2];
- if (m_mode) return directChar(x,y,c);
- return bufferChar(x,y,c);
-}
-
-void Display::drawChar(int8_t x, int8_t y, unsigned char c, uint8_t size) {
- print_char(x,y,c);
- return;
-}
-
-
-bool Display::isDirectPrintingEnabled() {
- return m_mode;
-}
-
-void Display::enableDirectPrinting(uint8_t m) {
- if (m) {
- m_mode=true;
- m_w = POK_LCD_W;
- m_h = POK_LCD_H;
- } else {
- m_mode=false;
- m_w = getWidth();
- m_h = getHeight();
- }
-}
-
-void Display::write(uint8_t c) {
- int charstep=0;
- if(font[3]) {
- // only caps in this font
- if (c>=97) c-=32;
- }
- switch(c) {
- case '\0': //null
- break;
- case '\n': //line feed
- cursorX = 0;
- inc_txtline();
- break;
- case 8: //backspace
- cursorX -= font[0];
- charstep=print_char(cursorX,cursorY,' ');
- break;
- case 13: //carriage return
- cursorX = 0;
- break;
- case 14: //form feed new page(clear screen)
- //clear_screen();
- break;
- default:
- if (cursorX >= (m_w - font[0])) {
- cursorX = 0;
- if (textWrap) inc_txtline();
- else return; // stop outputting text
- charstep=print_char(cursorX,cursorY,c);
- }
- else
- charstep=print_char(cursorX,cursorY,c);
- if (c==' ' && adjustCharStep) charstep=(charstep>>1)+1;
- cursorX += charstep;
- }
-}
-
-void Display::inc_txtline() {
- if (cursorY > m_h - 2*font[1]) //= (height - (font[1]+1)))
- #if SCROLL_TEXT > 0
- scroll(font[1] + adjustLineStep);
- #else
- cursorY = 0;
- #endif
- else
- cursorY += font[1] + adjustLineStep;
-}
-
-/* default implementation: may be overridden */
-void Display::write(const char *str)
-{
- while (*str)
- write(*str++);
-}
-
-/* default implementation: may be overridden */
-void Display::write(const uint8_t *buffer, uint8_t size)
-{
- while (size--)
- write(*buffer++);
-}
-
-void Display::print(const char str[])
-{
- write(str);
-}
-
-void Display::print(char c, int base)
-{
- print((long) c, base);
-}
-
-void Display::print(unsigned char b, int base)
-{
- print((unsigned long) b, base);
-}
-
-void Display::print(int n, int base)
-{
- print((long) n, base);
-}
-
-void Display::print(unsigned int n, int base)
-{
- print((unsigned long) n, base);
-}
-
-void Display::print(long n, int base)
-{
- if (base == 0) {
- write(n);
- } else if (base == 10) {
- if (n < 0) {
- print('-');
- n = -n;
- }
- printNumber(n, 10);
- } else {
- printNumber(n, base);
- }
-}
-
-void Display::print(unsigned long n, int base)
-{
- if (base == 0) write(n);
- else printNumber(n, base);
-}
-
-void Display::print(double n, int digits)
-{
- printFloat(n, digits);
-}
-
-void Display::println(void)
-{
- print('\r');
- print('\n');
-}
-
-void Display::println(const char c[])
-{
- print(c);
- println();
-}
-
-void Display::println(char c, int base)
-{
- print(c, base);
- println();
-}
-
-void Display::println(unsigned char b, int base)
-{
- print(b, base);
- println();
-}
-
-void Display::println(int n, int base)
-{
- print(n, base);
- println();
-}
-
-void Display::println(unsigned int n, int base)
-{
- print(n, base);
- println();
-}
-
-void Display::println(long n, int base)
-{
- print(n, base);
- println();
-}
-
-void Display::println(unsigned long n, int base)
-{
- print(n, base);
- println();
-}
-
-void Display::println(double n, int digits)
-{
- print(n, digits);
- println();
-}
-
-void Display::set_cursor(uint8_t x, uint8_t y) {
- cursorX = x;
- cursorY = y;
-}
-
-void Display::print(uint8_t x, uint8_t y, const char str[]) {
- cursorX = x;
- cursorY = y;
- write(str);
-
-}
-void Display::print(uint8_t x, uint8_t y, char c, int base) {
- cursorX = x;
- cursorY = y;
- print((long) c, base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned char b, int base) {
- cursorX = x;
- cursorY = y;
- print((unsigned long) b, base);
-}
-void Display::print(uint8_t x, uint8_t y, int n, int base) {
- cursorX = x;
- cursorY = y;
- print((long) n, base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned int n, int base) {
- cursorX = x;
- cursorY = y;
- print((unsigned long) n, base);
-}
-void Display::print(uint8_t x, uint8_t y, long n, int base) {
- cursorX = x;
- cursorY = y;
- print(n,base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned long n, int base) {
- cursorX = x;
- cursorY = y;
- print(n,base);
-}
-void Display::print(uint8_t x, uint8_t y, double n, int digits) {
- cursorX = x;
- cursorY = y;
- print(n,digits);
-}
-
-void Display::println(uint8_t x, uint8_t y, const char c[])
-{
- cursorX = x;
- cursorY = y;
- print(c);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, char c, int base)
-{
- cursorX = x;
- cursorY = y;
- print(c, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned char b, int base)
-{
- cursorX = x;
- cursorY = y;
- print(b, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, int n, int base)
-{
- cursorX = x;
- cursorY = y;
- print(n, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned int n, int base)
-{
- cursorX = x;
- cursorY = y;
- print(n, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, long n, int base)
-{
- cursorX = x;
- cursorY = y;
- print(n, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned long n, int base)
-{
- cursorX = x;
- cursorY = y;
- print(n, base);
- println();
-}
-
-void Display::println(uint8_t x, uint8_t y, double n, int digits)
-{
- cursorX = x;
- cursorY = y;
- print(n, digits);
- println();
-}
-
-void Display::printNumber(unsigned long n, uint8_t base)
-{
- unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars.
- unsigned long i = 0;
-
- if (n == 0) {
- print('0');
- return;
- }
-
- while (n > 0) {
- buf[i++] = n % base;
- n /= base;
- }
-
- for (; i > 0; i--)
- print((char) (buf[i - 1] < 10 ?
- '0' + buf[i - 1] :
- 'A' + buf[i - 1] - 10));
-}
-
-void Display::printFloat(double number, uint8_t digits)
-{
- // Handle negative numbers
- if (number < 0.0)
- {
- print('-');
- number = -number;
- }
-
- // Round correctly so that print(1.999, 2) prints as "2.00"
- double rounding = 0.5;
- for (uint8_t i=0; i<digits; ++i)
- rounding /= 10.0;
-
- number += rounding;
-
- // Extract the integer part of the number and print it
- unsigned long int_part = (unsigned long)number;
- double remainder = number - (double)int_part;
- print(int_part);
-
- // Print the decimal point, but only if there are digits beyond
- if (digits > 0)
- print(".");
-
- // Extract digits from the remainder one at a time
- while (digits-- > 0)
- {
- remainder *= 10.0;
- int toPrint = int(remainder);
- print(toPrint);
- remainder -= toPrint;
- }
-}
-
-void Display::draw4BitColumn(int16_t x, int16_t y, uint8_t h, uint8_t* bitmap)
-{
- int8_t scry;
- uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-
- /** ONLY 4-bit mode for time being **/
-
- if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
- for (scry = y; scry < h+y; scry++) {
- uint8_t sourcepixel = *bitmap;
- uint8_t targetpixel = *scrptr;
- targetpixel = (targetpixel&0x0F) | (sourcepixel << 4);
- *scrptr = targetpixel;
- bitmap++;
- scrptr+=55;
- }
- } else { /** ODD pixel starting line **/
- for (scry = y; scry < h+y; scry++) {
- uint8_t sourcepixel = *bitmap;
- uint8_t targetpixel = *scrptr;
- // store source pixel in lower nibble of target
- targetpixel = (targetpixel & 0xF0) | (sourcepixel);
- *scrptr = targetpixel;
- scrptr+=55;
- bitmap++;
- }
- }
-}
-
-void Display::lcdRefresh(unsigned char* scr) {
-
-#if POK_SCREENMODE == MODE_GAMEBOY
- lcdRefreshModeGBC(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_HI_4COLOR
- lcdRefreshMode1(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_FAST_16COLOR
- lcdRefreshMode2(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
- lcdRefreshGB(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_ARDUBOY_16COLOR
- lcdRefreshAB(scr, paletteptr);
-#endif
-
-}
-
-void Display::setFrameBufferTo(uint8_t* sb) {
- m_scrbuf = sb;
-};
-
-void Display::setTileBufferTo(uint8_t* tb) {
- m_tilebuf = tb;
-};
-
-void Display::loadTileset(const uint8_t* ts) {
- m_tileset = (uint8_t*) ts;
-};
-
-void Display::setTile(uint16_t i, uint8_t t) {
- if (!m_tilebuf) return;
- m_tilebuf[i]=t;
-};
-
-
-/** Eof */
-
-
-
--- a/POKITTO_CORE/PokittoDisplay.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,407 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoDisplay.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-
-/* THE SEGMENT BELOW PERTAINS TO CIRCLE DRAWING FUNCTIONS ONLY
-*
-This is the core graphics library for all our displays, providing a common
-set of graphics primitives (points, lines, circles, etc.). It needs to be
-paired with a hardware-specific library for each display device we carry
-(to handle the lower-level functions).
-Adafruit invests time and resources providing this open source code, please
-support Adafruit & open-source hardware by purchasing products from Adafruit!
-Copyright (c) 2013 Adafruit Industries. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef POKITTODISPLAY_H
-#define POKITTODISPLAY_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "PokittoGlobs.h"
-#include "PokittoFonts.h"
-#include "PokittoPalettes.h"
-
-// Basic Color definitions
-#define COLOR_BLACK (uint16_t)(0x0000)
-#define COLOR_BLUE (uint16_t)(0x001F)
-#define COLOR_RED (uint16_t)(0xF800)
-#define COLOR_GREEN (uint16_t)(0x07E0)
-#define COLOR_CYAN (uint16_t)(0x07FF)
-#define COLOR_MAGENTA (uint16_t)(0xF81F)
-#define COLOR_YELLOW (uint16_t)(0xFFE0)
-#define COLOR_WHITE (uint16_t)(0xFFFF)
-
-// Grayscale Values
-#define COLOR_GRAY_15 (uint16_t)(0x0861) // 15 15 15
-#define COLOR_GRAY_30 (uint16_t)(0x18E3) // 30 30 30
-#define COLOR_GRAY_50 (uint16_t)(0x3186) // 50 50 50
-#define COLOR_GRAY_80 (uint16_t)(0x528A) // 80 80 80
-#define COLOR_GRAY_128 (uint16_t)(0x8410) // 128 128 128
-#define COLOR_GRAY_200 (uint16_t)(0xCE59) // 200 200 200
-#define COLOR_GRAY_225 (uint16_t)(0xE71C) // 225 225 225
-
-/** The tables below are palettes, that resemble the Pico 8 palette*/
-
-enum defcolors {
- C_BLACK,
- C_DARKBLUE,
- C_PURPLE,
- C_DARKGREEN,
-
- C_BROWN,
- C_DARKBROWN,
- C_LIGHTGRAY,
- C_WHITE,
-
- C_RED,
- C_ORANGE,
- C_YELLOW,
- C_GREEN,
-
- C_BLUE,
- C_DARKGRAY,
- C_PINK,
- C_PEACH
-};
-
-const uint16_t def565palette[16] = {
- //kind of like pico8 palette
- 0,0x194a,0x792a,0x42a,
- 0xaa86,0x5aa9,0xc618,0xff9d,
- 0xf809,0xfd00,0xff84,0x72a,
- 0x2d7f,0x83b3,0xfbb5,0xfe75
-};
-
-#define PALETTE_SIZE 16
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-namespace Pokitto {
-
-class Display {
-public:
- Display();
-
- // PROPERTIES
-private:
- static uint8_t* canvas;
- static uint8_t bpp;
- static uint8_t m_colordepth;
-public:
- static uint8_t width;
- static uint8_t height;
- static uint8_t screenbuffer[];
-
- // PROPERTIES
- static void setColorDepth(uint8_t);
- static uint8_t getColorDepth();
- static uint8_t getBitsPerPixel();
- static uint16_t getWidth();
- static uint16_t getHeight();
- static uint8_t getNumberOfColors();
-
- // IMPORTANT PUBLIC STATE MEMBERS
- /** Selected font */
- static const unsigned char * font;
- /** Set if screen is cleared between updates or not*/
- static uint8_t persistence;
- /** Selected drawing color */
- static uint16_t color;
- /** Selected background color */
- static uint16_t bgcolor;
- /** Selected invisible color */
- static uint16_t invisiblecolor;
- /** Direct unbuffered color */
- static uint16_t directcolor;
- /** Direct unbuffered background color */
- static uint16_t directbgcolor;
- /** set color with a command */
- static void setColor(uint8_t);
- /** set color and bgcolor with a command */
- static void setColor(uint8_t,uint8_t);
- /** set invisiblecolor with a command */
- static void setInvisibleColor(uint16_t);
- /** get color */
- static uint8_t getColor();
- /** get background color */
- static uint8_t getBgColor();
- /** get invisible color */
- static uint16_t getInvisibleColor();
-
-
- /** Initialize display */
- static void begin();
- /** Clear display buffer */
- static void clear();
- /** Scroll by x lines */
- static void scroll(int16_t);
- /** Fill display buffer */
- static void fillScreen(uint16_t);
- /** Send display buffer to display hardware */
- static void update();
- /** Forced update of LCD display memory with a given pixel buffer */
- static void lcdRefresh(unsigned char*);
- /** Clear LCD hardware memory */
- static void clearLCD();
- /** Fill LCD hardware memory */
- static void fillLCD(uint16_t);
- /** Show Pokitto logo at startup*/
- static void showLogo();
- /** Point to another screenbuffer instead of the default one */
- static void setFrameBufferTo(uint8_t*);
-
- // COLORS AND PALETTE
-public:
- /** set default palette */
- static void setDefaultPalette();
- /** master palette */
- static uint16_t palette[PALETTE_SIZE];
- /** runtime palette pointer */
- static uint16_t *paletteptr;
- /** convert RGB to 565 color value */
- static uint16_t RGBto565(uint8_t,uint8_t,uint8_t);
- /** linear interpolation between colors */
- static uint16_t interpolateColor(uint16_t, uint16_t, uint8_t);
- /** load an R,G,B triplet palette */
- static void loadRGBPalette(const unsigned char*);
- /** load a ready-made 565 palette */
- static void load565Palette(const uint16_t*);
- /** rotate palette by step */
- static void rotatePalette(int8_t);
- /** tween between two palettes **/
- static void tweenPalette(uint16_t*, const uint16_t*, const uint16_t*, uint8_t);
-
- // DIRECT DRAWING (NO BUFFERING)
- /** Direct pixel (not through display buffer) */
- static void directPixel(int16_t,int16_t,uint16_t);
- /** Direct rectangle (not through display buffer) */
- static void directRectangle(int16_t, int16_t,int16_t, int16_t, uint16_t);
- /** Set the cursor for printing to a certain screen position */
- static void setCursor(int16_t,int16_t);
- /** direct bitmap to screen (no buffering) */
- static void directBitmap(int16_t,int16_t,const uint8_t*, uint8_t,uint8_t);
-
-
- // DRAWING METHODS
- /** Draw pixel at various bit depths */
- static void drawPixel(int16_t,int16_t);
- /** Draw pixel with specific color index at various bit depths */
- static void drawPixel(int16_t x,int16_t y, uint8_t col);
- /** Get pixel at various bit depths */
- static uint8_t getPixel(int16_t,int16_t);
- /** Draw line **/
- static void drawLine(int16_t,int16_t,int16_t,int16_t);
- /** Clip line with screen boundaries, returns 0 if whole line is out of bounds */
- static uint8_t clipLine(int16_t*, int16_t*, int16_t*, int16_t*);
- /** Draw a column real fast */
- static void drawColumn(int16_t, int16_t, int16_t);
- /** Map a 1-bit column real fast */
- static void map1BitColumn(int16_t, int16_t, int16_t, const uint8_t*, uint16_t);
- /** Draw a row real fast */
- static void drawRow(int16_t, int16_t, int16_t);
- /** Legacy drawColumn name, for compatibility - macros are not OK because of scope problems */
- static void drawFastVLine(int16_t, int16_t, int16_t);
- /** Legacy drawRow name, for compatibility - macros are not OK because of scope problems */
- static void drawFastHLine(int16_t, int16_t, int16_t);
- /** Draw rectangle (edges only) */
- static void drawRectangle(int16_t,int16_t,int16_t,int16_t);
- /** Fill rectangle */
- static void fillRectangle(int16_t,int16_t,int16_t,int16_t);
- /** GB compatibility fillRect */
- static void fillRect(int16_t x, int16_t y, int16_t w, int16_t h);
- /** GB compatibility drawRect */
- static void drawRect(int16_t x, int16_t y, int16_t w, int16_t h);
-
- // Functions lifted from Adafruit GFX library (see PokittoDisplay.h for license //
- /** Draw circle */
- static void drawCircle(int16_t x0, int16_t y0, int16_t r);
- /** Draw circle helper */
- static void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername);
- /** Fill circle */
- static void fillCircle(int16_t x0, int16_t y0, int16_t r);
- /** Fill circle helper*/
- static void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername, int16_t delta);
- /** draw triangle */
- static void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2);
- /** Fill triangle*/
- static void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2);
- /** Draw rounded rectangle */
- static void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius);
- /** Fill rounded rectangle */
- static void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius);
-
- // BITMAPS !
- /** Draw monochromatic bitmap. Used in font rendering */
- static void drawMonoBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t index);
- /** Draw bitmap */
- static void drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap);
- /** Draw RLE bitmap */
- static void drawRleBitmap(int16_t x, int16_t y, const uint8_t* bitmap);
- /** Draw animated bitmap frame */
- static void drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t frame);
- /** Draw bitmap flipped on x-axis*/
- static void drawBitmapXFlipped(int16_t x, int16_t y, const uint8_t* bitmap);
- /** Draw bitmap with options */
- static void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip);
- /** Get pointer to the screen buffer - GB compatibility */
- static uint8_t* getBuffer();
- /** Get pixel in a monochromatic bitmap - GB compatibility */
- static uint8_t getBitmapPixel(const uint8_t*, uint16_t, uint16_t);
- /** Optimized functions for drawing bit columns - used in raytracing */
- static void draw4BitColumn(int16_t x, int16_t y, uint8_t h, uint8_t* bitmap);
-
- // PRINTING
- /** direct character to screen (no buffering) */
- static int directChar(int16_t, int16_t, uint16_t);
- /** character to screenbuffer */
- static int bufferChar(int16_t, int16_t, uint16_t);
- /** set the active font */
- static void setFont(const unsigned char * f);
- /** font dimensions */
- static uint8_t fontWidth, fontHeight;
- /** text wrapping */
- static bool textWrap;
- /** GB compatibility drawChar */
- static void drawChar(int8_t x, int8_t y, unsigned char c, uint8_t size);
-
- static void enableDirectPrinting(uint8_t m);
- static bool isDirectPrintingEnabled();
- static int print_char(uint8_t x, uint8_t y, unsigned char c);
- static void set_cursor(uint8_t, uint8_t);
- static void write(uint8_t);
- static void write(const char *str);
- static void write(const uint8_t *buffer, uint8_t size);
- static void print(const char[]);
- static void print(char, int base = 0);
- static void print(unsigned char, int base = 0);
- static void print(int, int base = 10);
- static void print(unsigned int, int base = 10);
- static void print(long, int base = 10);
- static void print(unsigned long, int base = 10);
- static void print(double, int base = 2);
- static void print(uint8_t, uint8_t, const char[]);
- static void print(uint8_t, uint8_t, char, int = 0);
- static void print(uint8_t, uint8_t, unsigned char, int = 0);
- static void print(uint8_t, uint8_t, int, int = 10);
- static void print(uint8_t, uint8_t, unsigned int, int = 10);
- static void print(uint8_t, uint8_t, long, int = 10);
- static void print(uint8_t, uint8_t, unsigned long, int = 10);
- static void print(uint8_t, uint8_t, double, int = 2);
- static void println(uint8_t, uint8_t, const char[]);
- static void println(uint8_t, uint8_t, char, int = 0);
- static void println(uint8_t, uint8_t, unsigned char, int = 0);
- static void println(uint8_t, uint8_t, int, int = 10);
- static void println(uint8_t, uint8_t, unsigned int, int = 10);
- static void println(uint8_t, uint8_t, long, int = 10);
- static void println(uint8_t, uint8_t, unsigned long, int = 10);
- static void println(uint8_t, uint8_t, double, int = 2);
- static void println(uint8_t, uint8_t);
- static void println(const char[]);
- static void println(char, int = 0);
- static void println(unsigned char, int = 0);
- static void println(int, int = 10);
- static void println(unsigned int, int = 10);
- static void println(long, int = 10 );
- static void println(unsigned long, int = 10);
- static void println(double, int = 2);
- static void println(void);
-
- static int16_t cursorX,cursorY;
- static uint8_t fontSize;
- static int8_t adjustCharStep, adjustLineStep;
- static bool fixedWidthFont;
-
- static void inc_txtline();
- static void printNumber(unsigned long, uint8_t);
- static void printFloat(double, uint8_t);
-
- /** Tiled mode functions **/
-
- static void loadTileset(const uint8_t*);
-
- static void setTileBufferTo(uint8_t*);
- static void clearTileBuffer();
- static void shiftTileBuffer(int8_t,int8_t);
-
- static void setTile(uint16_t,uint8_t);
- static uint8_t getTile(uint16_t);
- static uint8_t getTile(uint8_t,uint8_t);
-
-
-
-private:
- static uint8_t m_mode;
- static uint16_t m_w,m_h; // store these for faster access when switching printing modes
- /** Pointer to screen buffer */
- static uint8_t* m_scrbuf;
- /** Pointer to tileset */
- static uint8_t* m_tileset;
- /** Pointer to tilebuffer */
- static uint8_t* m_tilebuf;
- /** Pointer to tilecolorbuffer */
- static uint8_t* m_tilecolorbuf;
-
-};
-
-}
-
-#endif // POKITTODISPLAY_H
-
-
-
-
--- a/POKITTO_CORE/PokittoFakeavr.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoFakeavr.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef _POKITTO_FAKEAVR_H_
-#define _POKITTO_FAKEAVR_H_
-
-#include "PokittoItoa.h"
-#include "binary.h"
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifdef POK_SIM
-#include <stdbool.h>
-#else
-#include <stdbool.h>
-#endif // POK_SIM
-
-#define _BV(bit) (1 << (bit)) //jonne
-
-/** data types */
-#ifndef _RPCNDR_H
-typedef bool boolean;
-#endif
-typedef uint8_t byte;
-
-/** PROGMEM */
-#define PROGMEM
-//#define F
-
-/** AVR program memory string functions **/
-#define sprintf_P sprintf
-#define strstr_P strstr
-#define strcpy_P strcpy
-
-#define utoa pokItoa
-#define ultoa pokItoa
-
-/** PROGMEM hacks **/
-#define PROGMEM
- #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
- #ifndef WIN32
- #define pgm_read_word(addr) (*(addr))
- #else
- #define pgm_read_word(addr) (*(const unsigned int *)(addr))
- #endif // WIN32
-
-/** min max & others **/
-
-
-#ifndef DISABLEAVRMIN
-#define max(a,b) ((a)>(b)?(a):(b))
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif // DISABLEAVRMIN
-#define __avrmax(a,b) ((a)>(b)?(a):(b))
-#define __avrmin(a,b) ((a)<(b)?(a):(b))
-#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
-#define min2(a,b) (((a)<(b))?(a):(b))
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void cli();
-void sei();
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
--- a/POKITTO_CORE/PokittoFonts.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/**************************************************************************/ -/*! - @file PokittoFonts.h - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#ifndef POK_FONTS_H -#define POK_FONTS_H - -#include "Pokitto_settings.h" - -extern const unsigned char fontMini[]; -extern const unsigned char fontDonut[]; -extern const unsigned char fontDragon[]; -extern const unsigned char fontKarateka[]; -extern const unsigned char fontKoubit[]; -extern const unsigned char fontRunes[]; -extern const unsigned char fontTight[]; -extern const unsigned char fontTiny[]; -extern const unsigned char fontAdventurer[]; -extern const unsigned char font5x7[]; -extern const unsigned char font3x5[]; -extern const unsigned char font3x3[]; -extern const unsigned char fontC64[]; -extern const unsigned char fntC64UIGfx[]; -extern const unsigned char fontZXSpec[]; -extern const unsigned char fontTIC806x6[]; - -#if POK_GAMEBUINO_SUPPORT > 0 -#define DEFAULT_FONT font3x5 -#else -#define DEFAULT_FONT font5x7 -#endif // POK_GAMEBUINO_SUPPORT - - -#endif -
--- a/POKITTO_CORE/PokittoGlobs.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoGlobs.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_GLOBS_H
-#define POKITTO_GLOBS_H
-
-#include <stdint.h>
-
-#ifdef POK_SIM
- #include "SimLCD.h"
- #include "SimSound.h"
- #include "PokittoSimulator.h"
-#else
- #include "mbed.h"
- #include "HWLCD.h"
- #include "HWSound.h"
-#endif // POK_SIM
-
-extern int random(int);
-extern int random(int,int);
-
-#define HIGH 1
-#define LOW 0
-
-#define swapWT(type, a, b) \
-{ \
- type _t_; \
- _t_ = a; \
- a = b; \
- b = _t_; \
-}
-
-#define SAMPLE_RATE POK_AUD_FREQ //was 16000, was 57000
-#define NUMFRAMES 570 //1 ms before refresh was 357
-
-
-// TODO: move these into some suitable place
-extern void fakeISR();
-extern void audio_IRQ();
-extern void update_SDAudioStream();
-extern uint16_t soundbyte;
-
-#if POK_STREAMING_MUSIC
- #define SPEAKER 3
- // #define BUFFER_SIZE 512 //5120 // was 256
- extern unsigned char buffers[][BUFFER_SIZE];
- extern volatile int currentBuffer, oldBuffer;
- extern volatile int bufindex, vol;
- extern volatile unsigned char * currentPtr;
- extern volatile unsigned char * endPtr;
- extern int8_t streamvol;
- extern uint32_t streamcounter;
- extern uint8_t streamstep;
-#endif
-
-#endif // POKITTO_GLOBS_H
-
--- a/POKITTO_CORE/PokittoItoa.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoItoa.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoItoa.h"
-#include <string.h>
-#include <stdint.h>
-
-
-void pokItoa(uint16_t value, char *str, int base)
-{
- /** pokItoa: convert value n to characters
- * Needed to emulate AVR LibC non-standard functions, this is a very fast version of itoa
- *
- * @param value unsigned integer to be converted
- * @param *str pointer to string where function stores the result as characters
- * @param base (not implemented in this function, base is always 10)
- */
-
- char *p = str;
- uint8_t v;
- if (value > 499)
- {
- if (value > 799)
- {
- if (value > 999)
- {
- // Treated as a special case as there
- // are only 24 values above 999
- *p++ = '1';
- *p++ = '0';
- uint8_t v = value - 1000;
-
- if (v > 19) { *p++ = '2'; v -= 20; }
- else if (v > 9) { *p++ = '1'; v -= 10; }
- else { *p++ = '0'; }
-
- *p++ = v + '0';
- *p = 0;
- return;
- }
-
- if (value > 899) { *p++ = '9'; v = value - 900; }
- else { *p++ = '8'; v = value - 800; }
- }
- else
- {
- if (value > 699) { *p++ = '7'; v = value - 700; }
- else if (value > 599) { *p++ = '6'; v = value - 600; }
- else { *p++ = '5'; v = value - 500; }
- }
- }
- else
- {
- if (value > 299)
- {
- if (value > 399) { *p++ = '4'; v = value - 400; }
- else { *p++ = '3'; v = value - 300; }
- }
- else
- {
- if (value > 199) { *p++ = '2'; v = value - 200; }
- else if (value > 99) { *p++ = '1'; v = value - 100; }
- else { v = value; }
- }
- }
-
- if (v > 49)
- {
- if (v > 69)
- {
- if (v > 89) { *p++ = '9'; v -= 90; }
- else if (v > 79) { *p++ = '8'; v -= 80; }
- else { *p++ = '7'; v -= 70; }
- }
- else
- {
- if (v > 59) { *p++ = '6'; v -= 60; }
- else { *p++ = '5'; v -= 50; }
- }
- }
- else
- {
- if (v > 19)
- {
- if (v > 39) { *p++ = '4'; v -= 40; }
- else if (v > 29) { *p++ = '3'; v -= 30; }
- else { *p++ = '2'; v -= 20; }
- }
- else
- {
- if (v > 9) { *p++ = '1'; v -= 10; }
- else if (p != str) { *p++ = '0'; }
- }
- }
-
- *p++ = v + '0';
- *p = 0;
-}
-
-void pokUtoa(uint16_t value, char *str, int base) {
- pokItoa(value,str,base);
-}
-
-void pokLtoa(long value, char *str, int base) {
- pokItoa(value,str,base);
-}
-
--- a/POKITTO_CORE/PokittoItoa.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/**************************************************************************/ -/*! - @file PokittoItoa.h - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - - -#ifndef POKITTO_ITOA_H -#define POKITTO_ITOA_H - -#include <stdint.h> - -/** MBED online compiler has no itoa or strrev **/ - -extern void pokItoa(uint16_t, char*,int); -extern void pokUtoa(int16_t, char*,int); -extern void pokLtoa(long, char*,int); - -#endif // POKITTO_ITOA_H -
--- a/POKITTO_CORE/PokittoLogos.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoLogos.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2015, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#include "PokittoLogos.h"
-
-const uint8_t Pokitto_speaker[] = {
-16,16,
-0x00,0x00,0x01,0x00,0x03,0x00,0x05,0x04,0x09,0x12,0x71,0x4A,0x71,0x2A,0x71,0x2A,0x71,0x2A,0x71,0x2A,0x71,0x4A,0x09,0x12,0x05,0x04,0x03,0x00,0x01,0x00,0x00,0x00
-};
-
-const uint8_t Pokitto_headphones[] = {
-16,16,
-0x00,0x00,0x0F,0xF0,0x18,0x18,0x10,0x08,0x20,0x04,0x20,0x04,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x20,0x04,0x00,0x04,0x00,0x08,0x00,0x04,0x00,0x08
-};
-
-const uint8_t Pokitto_volumebar[] = {
-4,4,
-0xE0,0xE0,0xE0,0xE0
-};
-
-const uint8_t Pokitto_logo[] = {
-184,56,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x7F,0xC0,0x0F,0xF8,0x00,0x00,0x01,0x72,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x03,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x00,0x01,0x4A,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x07,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x00,0x01,0x72,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x07,0xFC,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x00,0x01,0x4A,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x0F,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x00,0x01,0x02,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x0F,0xF8,0x01,0xFF,0x00,0x7F,0xC0,0x00,0x00,0x00,0x84,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x1F,0xF0,0x01,0xFF,0x00,0x7F,0xC0,0x00,0x00,0x00,0x78,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x1F,0xF0,0x03,0xFE,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x3F,0xE0,0x03,0xFE,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x80,0x00,0x00,0x00,0x07,0xFC,0x01,0xFF,0x80,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00,0x07,0xFC,0x01,0xFF,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0x00,0x00,0x00,0x00,0x0F,0xFC,0x03,0xFF,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0F,0xFF,0xE0,0x01,0xFF,0xFC,0x03,0xFF,0xFF,0xFC,0xFF,0x9F,0xEF,0xFF,0xFB,0xFF,0xFF,0x0F,0xFF,0xE0,0x00,
-0x00,0x00,0xCF,0xFF,0xF0,0x09,0xFF,0xFE,0x03,0xFF,0xFF,0xFC,0xFF,0x9F,0xEF,0xFF,0xFB,0xFF,0xFE,0x27,0xFF,0xF0,0x00,
-0x00,0x01,0xCF,0xFF,0xF8,0x1D,0xFF,0xFF,0x03,0xFF,0xFF,0xF9,0xFF,0x3F,0xF7,0xFF,0xFD,0xFF,0xFE,0x67,0xFF,0xF8,0x00,
-0x00,0x01,0xEF,0xFF,0xFC,0x1D,0xFF,0xFF,0x03,0xFF,0xFF,0xF9,0xFF,0x3F,0xF7,0xFF,0xFD,0xFF,0xFC,0xF7,0xFF,0xFC,0x00,
-0x00,0x03,0xE7,0xFF,0xFC,0x3C,0xFF,0xFF,0x8B,0xFF,0xFF,0xF3,0xFE,0x3F,0xF3,0xFF,0xFC,0xFF,0xFC,0xF3,0xFF,0xFC,0x00,
-0x00,0x03,0xE7,0xFF,0xFC,0x3E,0xFF,0xFF,0x89,0xFF,0xFF,0xF3,0xFE,0x7F,0xFB,0xFF,0xFE,0xFF,0xF9,0xF3,0xFF,0xFC,0x00,
-0x00,0x07,0xF7,0xFF,0xFC,0x7E,0xFF,0xFF,0x99,0xFF,0xFF,0xF3,0xFE,0x7F,0xF9,0xFF,0xFE,0x7F,0xF9,0xFB,0xFF,0xFC,0x00,
-0x00,0x07,0xF3,0xFF,0xFC,0x7E,0x7F,0xFF,0x9D,0xFF,0xFF,0xE7,0xFC,0x7F,0xFC,0x7F,0xFF,0x1F,0xF3,0xF9,0xFF,0xFC,0x00,
-0x00,0x0F,0xF0,0x07,0xFC,0xFE,0x00,0xFF,0x3D,0xFE,0x00,0x07,0xFC,0x00,0xFF,0x00,0x3F,0xC0,0x03,0xF8,0x03,0xF8,0x00,
-0x00,0x0F,0xF0,0x07,0xF8,0xFE,0x00,0xFF,0x3C,0xFE,0x00,0x0F,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x07,0xF8,0x07,0xF8,0x00,
-0x00,0x0F,0xF0,0x0F,0xF9,0xFE,0x01,0xFE,0x7C,0xFE,0x00,0x0F,0xF8,0x01,0xFF,0x00,0x7F,0xE0,0x07,0xF8,0x07,0xF8,0x00,
-0x00,0x1F,0xE0,0x0F,0xF1,0xFC,0x01,0xFE,0x7E,0xFF,0x00,0x1F,0xF0,0x01,0xFF,0x00,0x7F,0xC0,0x0F,0xF0,0x0F,0xF0,0x00,
-0x00,0x1F,0xE0,0x1F,0xF3,0xFC,0x03,0xFC,0xFE,0x7F,0x00,0x1F,0xF0,0x03,0xFE,0x00,0xFF,0xC0,0x0F,0xF0,0x0F,0xF0,0x00,
-0x00,0x3F,0xC0,0x1F,0xE3,0xF8,0x03,0xFC,0xFE,0x7F,0x80,0x3F,0xE0,0x03,0xFE,0x00,0xFF,0x80,0x1F,0xE0,0x0F,0xE0,0x00,
-0x00,0x3F,0xC0,0x3F,0xE7,0xF8,0x07,0xF8,0xFF,0x3F,0x80,0x3F,0xE0,0x07,0xFE,0x00,0xFF,0x80,0x1F,0xE0,0x1F,0xE0,0x00,
-0x00,0x7F,0x80,0x3F,0xC7,0xF0,0x07,0xF9,0xFF,0x3F,0xC0,0x7F,0xC0,0x07,0xFC,0x01,0xFF,0x00,0x1F,0xC0,0x1F,0xC0,0x00,
-0x00,0x7F,0x80,0x7F,0xC7,0xF0,0x0F,0xF1,0xFF,0x1F,0xE0,0x7F,0xC0,0x0F,0xFC,0x01,0xFF,0x00,0x3F,0xC0,0x3F,0xC0,0x00,
-0x00,0x7F,0x80,0x7F,0x8F,0xF0,0x0F,0xF3,0xFE,0x1F,0xF0,0xFF,0x80,0x0F,0xF8,0x03,0xFE,0x00,0x3F,0x80,0x3F,0x80,0x00,
-0x00,0xFF,0x80,0x7F,0x8F,0xF0,0x0F,0xE3,0xFE,0x0F,0xF8,0xFF,0x80,0x0F,0xF8,0x03,0xFE,0x00,0x3F,0xC0,0x3F,0x80,0x00,
-0x00,0xFF,0xFE,0x7F,0x1F,0xFF,0xEF,0xE7,0xFC,0x0F,0xF9,0xFF,0x00,0x1F,0xF0,0x07,0xFC,0x00,0x7F,0xFF,0x3F,0x80,0x00,
-0x01,0xFF,0xFF,0x7E,0x1F,0xFF,0xE7,0xC7,0xFC,0x07,0xF9,0xFF,0x00,0x1F,0xF0,0x07,0xFC,0x00,0x7F,0xFF,0xBF,0x00,0x00,
-0x01,0xFF,0xFF,0x3E,0x1F,0xFF,0xE7,0xCF,0xF8,0x07,0xF9,0xFF,0x00,0x3F,0xE0,0x0F,0xF8,0x00,0x7F,0xFF,0x9E,0x00,0x00,
-0x01,0xFF,0xFF,0x3C,0x1F,0xFF,0xF7,0x87,0xF8,0x03,0xF3,0xFE,0x00,0x3F,0xE0,0x0F,0xF8,0x00,0x7F,0xFF,0x9E,0x00,0x00,
-0x03,0xFF,0xFF,0xB8,0x0F,0xFF,0xF3,0x07,0xF0,0x01,0xF3,0xFE,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x3F,0xFF,0xDC,0x00,0x00,
-0x03,0xFF,0xFF,0x98,0x0F,0xFF,0xF3,0x03,0xF0,0x00,0xE7,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x3F,0xFF,0xCC,0x00,0x00,
-0x07,0xFF,0xFF,0x90,0x07,0xFF,0xFA,0x03,0xF0,0x00,0xE7,0xFC,0x00,0xFF,0x80,0x3F,0xF0,0x00,0x1F,0xFF,0xC8,0x00,0x00,
-0x07,0xFF,0xFF,0x80,0x03,0xFF,0xF8,0x00,0xE0,0x00,0x47,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x03,0xFF,0xC0,0x00,0x00,
-0x07,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-};
-
--- a/POKITTO_CORE/PokittoLogos.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/**************************************************************************/ -/*! - @file PokittoLogos.h - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2015, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#ifndef POKITTO_LOGOS_H -#define POKITTO_LOGOS_H - -#include <stdint.h> - -extern const uint8_t Pokitto_logo[]; -extern const uint8_t Pokitto_headphones[]; -extern const uint8_t Pokitto_speaker[]; -extern const uint8_t Pokitto_volumebar[]; - -#endif -
--- a/POKITTO_CORE/PokittoPalette.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoPalette.cpp
- @author Jonne Valola
-
- @section LICENSE
-
-Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoDisplay.h"
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include <stdio.h>
-#include <string.h>
-
-#ifndef POK_SIM
-#include "HWLCD.h"
-#else
-#include "SimLCD.h"
-#endif
-
-using namespace Pokitto;
-
-
-void Display::loadRGBPalette(const unsigned char* p) {
- for (int i=0;i<PALETTE_SIZE;i++) palette[i] = RGBto565(p[i*3], p[i*3+1],p[i*3+2]);
- paletteptr = palette;
-}
-
-void Display::load565Palette(const uint16_t* p) {
- for (int i=0;i<PALETTE_SIZE;i++) palette[i] = p[i];
- paletteptr = palette;
-}
-
-void Display::rotatePalette(int8_t step) {
- uint16_t tpal[PALETTE_SIZE];
- if (step == 0) return;
- step = 0-step;
- if (step>0) {
- for (int i=step;i<PALETTE_SIZE;i++) tpal[i]=palette[i-step]; // palette revolves up, new color 1 becomes old color 0
- for (int i=0; i < step; i++) tpal[i]=palette[PALETTE_SIZE-step+i]; // overflow topmost values to bottom of new palette
- } else {
- for (int i=0;i<PALETTE_SIZE+step;i++)
- {
- tpal[i]=palette[i-step];
- }// palette revolves down, new color 0 becomes old color 1
- for (int i=0;i<-step; i++) {
- tpal[PALETTE_SIZE+step+i]=palette[i];
- }
- // overflow bottom values to top of new palette
- }
- for (int i=0; i<PALETTE_SIZE;i++) palette[i] = tpal[i];
-}
-
-uint16_t Display::RGBto565(uint8_t R,uint8_t G,uint8_t B) {
- uint16_t color;
- color = B>>3;
- color |= ((G >> 2) << 5);
- color |= ((R >> 3) << 11);
- return color;
-}
-
-uint16_t Display::interpolateColor(uint16_t c1, uint16_t c2, uint8_t factor) {
- int16_t R,G,B;
- int16_t dR,dG,dB;
- uint16_t color;
-
- B = (c1 & 0x1F);
- dB = (c2 & 0x1F)-B;
- dB = (dB*factor)>>8;
- B += dB;
- if (B<0) B = 0;
-
- G = ((c1>>5) & 0x3F);
- dG = ((c2>>5) & 0x3F)-G;
- dG = (dG*factor)>>8;
- G += dG;
- if (G<0) G=0;
-
- R = (c1>>11);
- dR = (c2>>11)-R;
- dR = (dR*factor)>>8;
- R += dR;
- if (R<0) R=0;
-
- color = B;
- color |= (G << 5);
- color |= (R << 11);
- return color;
-}
-
-void Display::tweenPalette(uint16_t* ram_pal, const uint16_t* pal_1, const uint16_t* pal_2, uint8_t factor) {
- for (uint8_t i = 0; i<16 ; i++) {
- ram_pal[i] = interpolateColor(pal_1[i],pal_2[i],factor);
- }
-}
-
-
-
--- a/POKITTO_CORE/PokittoPalettes.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -#ifndef POK_PALETTES_H -#define POK_PALETTES_H - -#include "Pokitto_settings.h" - -extern const unsigned char paletteDefault[]; -extern const unsigned char paletteCGA[]; -extern const unsigned char paletteNeon[]; -extern const unsigned char palettePico[]; -extern const unsigned char paletteCopper[]; -extern const unsigned char paletteAction[]; -extern const unsigned char paletteMagma[]; -extern const unsigned char paletteRainbow[]; -extern const unsigned char paletteMono[]; -extern const unsigned char paletteGameboy[]; -extern const unsigned char paletteZXSpec[]; -extern const unsigned char paletteDB16[]; - - -#define POK_DEFAULT_PALETTE paletteCGA - -#endif - -
--- a/POKITTO_CORE/PokittoSound.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,913 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoSound.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-/*
- * NOTE:
- * API of the Pokitto Sound library is partially identical to the Gamebuino Sound API.
- * Due to the difference in architecture (ARM Cortex-M0+ in mbed environment vs. 8-bit AVR)
- * large parts are not identical. Most functions were rewritten, with only API remaining.
- * We want to give attribution to the original author's project:
- *
- * License for Gamebuino-identical code:
- *
- * (C) Copyright 2014 Aur�lien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-#include "PokittoSound.h"
-#include "Pokitto_settings.h"
-#include "PokittoCore.h"
-#include "Synth.h"
-
-#ifndef POK_SIM
-#include "HWSound.h"
-#else
-#include "SimSound.h"
-#include "PokittoSimulator.h"
-#endif
-
-typedef uint8_t byte;
-
-using namespace Pokitto;
-
-Pokitto::Core c;
-
-uint8_t Sound::prescaler;
-uint16_t Sound::globalVolume;
-uint16_t Sound::volumeMax = VOLUME_HEADPHONE_MAX;
-
-bool Sound::trackIsPlaying[NUM_CHANNELS];
-bool Sound::patternIsPlaying[NUM_CHANNELS];
-uint8_t Sound::outputPitch[NUM_CHANNELS];
-int8_t Sound::outputVolume[NUM_CHANNELS];
-
-uint16_t *Sound::trackData[NUM_CHANNELS];
-uint8_t Sound::trackCursor[NUM_CHANNELS];
-uint16_t **Sound::patternSet[NUM_CHANNELS];
-int8_t Sound::patternPitch[NUM_CHANNELS];
-
-// pattern data
-uint16_t *Sound::patternData[NUM_CHANNELS];
-uint16_t **Sound::instrumentSet[NUM_CHANNELS];
-bool Sound::patternLooping[NUM_CHANNELS];
-uint16_t Sound::patternCursor[NUM_CHANNELS];
-
-// note data
-uint8_t Sound::notePitch[NUM_CHANNELS];
-uint8_t Sound::noteDuration[NUM_CHANNELS];
-int8_t Sound::noteVolume[NUM_CHANNELS];
-bool Sound::notePlaying[NUM_CHANNELS];
-
-// commands data
-int8_t Sound::commandsCounter[NUM_CHANNELS];
-int8_t Sound::volumeSlideStepDuration[NUM_CHANNELS];
-int8_t Sound::volumeSlideStepSize[NUM_CHANNELS];
-uint8_t Sound::arpeggioStepDuration[NUM_CHANNELS];
-int8_t Sound::arpeggioStepSize[NUM_CHANNELS];
-uint8_t Sound::tremoloStepDuration[NUM_CHANNELS];
-int8_t Sound::tremoloStepSize[NUM_CHANNELS];
-
-// instrument data
-uint16_t *Sound::instrumentData[NUM_CHANNELS];
-uint8_t Sound::instrumentLength[NUM_CHANNELS]; //number of steps in the instrument
-uint8_t Sound::instrumentLooping[NUM_CHANNELS]; //how many steps to loop on when the last step of the instrument is reached
-uint16_t Sound::instrumentCursor[NUM_CHANNELS]; //which step is being played
-uint8_t Sound::instrumentNextChange[NUM_CHANNELS]; //how many frames before the next step
-
-//current step data
-int8_t Sound::stepVolume[NUM_CHANNELS];
-uint8_t Sound::stepPitch[NUM_CHANNELS];
-uint8_t Sound::chanVolumes[NUM_CHANNELS];
-
-#if (POK_ENABLE_SOUND < 1)
- #define NUM_CHANNELS 0
-#endif
-
-#if(NUM_CHANNELS > 0)
- #ifndef POK_SIM
- uint8_t sbyte;
- #else
- uint8_t sbyte;
- float pwm1;
- #endif // POK_SIM
-
-//declare these variables globally for faster access
-uint8_t _rand = 1;
-uint8_t _chanCount[NUM_CHANNELS]; //counts until the next change of the waveform
-bool _chanState[NUM_CHANNELS]; //if the waveform is currently high or low
-uint8_t _chanHalfPeriod[NUM_CHANNELS]; //duration of half the period of the waveform
-uint8_t _chanOutputVolume[NUM_CHANNELS]; //amplitude of the outputted waveform
-uint8_t _chanOutput[NUM_CHANNELS]; //current value of the outputted waveform
-bool _chanNoise[NUM_CHANNELS]; //if a random value should be added to the waveform to generate noise
-
-#if POK_GBSOUND > 0
-const uint16_t squareWaveInstrument[] = {0x0101, 0x03F7};
-const uint16_t noiseInstrument[] = {0x0101, 0x03FF};
-const uint16_t* const defaultInstruments[] = {squareWaveInstrument,noiseInstrument};
-
-const uint16_t playOKPattern[] = {0x0005,0x138,0x168,0x0000};
-const uint16_t playCancelPattern[] = {0x0005,0x168,0x138,0x0000};
-const uint16_t playTickP[] = {0x0045,0x168,0x0000};
-#endif
-#if(EXTENDED_NOTE_RANGE > 0)
-//extended note range
-#define NUM_PITCH 59
-const uint8_t _halfPeriods[NUM_PITCH] = {246,232,219,207,195,184,174,164,155,146,138,130,123,116,110,104,98,92,87,82,78,73,69,65,62,58,55,52,49,46,44,41,39,37,35,33,31,29,28,26,25,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6};
-#else
-//regular note range
-#define NUM_PITCH 36
-const uint8_t _halfPeriods[NUM_PITCH] = {246,232,219,207,195,184,174,164,155,146,138,130,123,116,110,104,98,92,87,82,78,73,69,65,62,58,55,52,49,46,44,41,39,37,35,33};
-#endif
-
-#endif
-
-void Pokitto::audio_IRQ() {
- #if POK_STREAMING_MUSIC > 0
- #if POK_STREAMFREQ_HALVE > 0
- streamstep = 1-streamstep;
- #else
- streamstep=1;
- #endif
-
- streamstep &= streamon; //check if stream is on
-
- if(streamvol && streamstep) {
- uint8_t output = (*currentPtr++);
- sbyte = output;
- } else {
- sbyte = 0; // duty cycle
- }
-
- if (currentPtr >= endPtr)
- {
- currentBuffer++;
- if (currentBuffer==4) currentBuffer=0;
- currentPtr = buffers[currentBuffer];
- endPtr = currentPtr + BUFFER_SIZE;
- }
-
- #endif // POK_STREAMING_MUSIC
- #if (NUM_CHANNELS > 0)
- Sound::generateOutput();
- #endif
-}
-
-void Sound::volumeUp() {
- if (globalVolume>VOLUME_HEADPHONE_MAX) setVolume(getVolume()+VOLUME_STEP*2);
- else setVolume(getVolume()+VOLUME_STEP);
-}
-
-void Sound::volumeDown() {
- if (globalVolume>VOLUME_HEADPHONE_MAX) setVolume(getVolume()-VOLUME_STEP*4);
- else setVolume(getVolume()-VOLUME_STEP);
-}
-
-
-void Sound::setMaxVol(int16_t v) {
- if (v < 0) v = 0; //prevent nasty wraparound
- if (v > VOLUME_SPEAKER_MAX) {
- v = VOLUME_SPEAKER_MAX;
- }
- volumeMax = v;
- setVolume(globalVolume);
-}
-
-uint16_t Sound::getMaxVol() {
- return volumeMax;
-}
-
-void Sound::updateStream() {
- #if POK_STREAMING_MUSIC
- if (oldBuffer != currentBuffer) {
- if (currentBuffer==0) fileReadBytes(&buffers[3][0],BUFFER_SIZE);
- else if (currentBuffer==1) fileReadBytes(&buffers[0][0],BUFFER_SIZE);
- else if (currentBuffer==2) fileReadBytes(&buffers[1][0],BUFFER_SIZE);
- else fileReadBytes(&buffers[2][0],BUFFER_SIZE);
- oldBuffer = currentBuffer;
- streamcounter += BUFFER_SIZE;
- }
-
- #ifndef POK_SIM
- if ( streamcounter > fs.fsize - (BUFFER_SIZE)) {
- #else
- if ( streamcounter > getFileLength() - (BUFFER_SIZE)) {
- #endif
- streamcounter=0;
- #if POK_STREAM_LOOP > 0
- fileRewind();
- #endif
- #ifndef POK_SIM
- streamon=0;
- #endif // POK_SIM
- }
- #endif
-}
-
-void Sound::begin() {
-#if POK_ENABLE_SOUND > 1
-soundInit();
-#endif
-#if (NUM_CHANNELS > 0)
-#if POK_ENABLE_SOUND > 0
-#if POK_GBSOUND > 0
- prescaler = 1;
- for(byte i=0; i<NUM_CHANNELS; i++){
- chanVolumes[i] = VOLUME_CHANNEL_MAX;
- changeInstrumentSet(defaultInstruments, i); //load default instruments. #0:square wave, #1: noise
- command(CMD_INSTRUMENT, 0, 0, i); //set the default instrument to square wave
- }
-#endif // POK_GBSOUND
-#endif //POK_ENABLE_SOUND
-#endif
-}
-
-void Sound::playTrack(const uint16_t* track, uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- stopTrack(channel);
- trackCursor[channel] = 0;
- trackData[channel] = (uint16_t*)track;
- trackIsPlaying[channel] = true;
-#endif
-}
-
-void Sound::stopTrack(uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- trackIsPlaying[channel] = false;
- stopPattern(channel);
-#endif
-}
-
-void Sound::stopTrack(){
-#if(NUM_CHANNELS > 0)
- for(uint8_t i=0; i<NUM_CHANNELS; i++){
- stopTrack(i);
- }
-#endif
-}
-
-void Sound::updateTrack(uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- if(trackIsPlaying[channel] && !patternIsPlaying[channel]){
- uint16_t data = pgm_read_word(trackData[channel] + trackCursor[channel]);
- if(data == 0xFFFF){ //en of the track
- trackIsPlaying[channel] = false;
- return;
- }
- uint8_t patternID = data & 0xFF;
- data >>= 8;
- patternPitch[channel] = data;
- playPattern((const uint16_t*)pgm_read_word(&(patternSet[channel][patternID])), channel);
- trackCursor[channel] ++;
- }
-#endif
-}
-
-void Sound::updateTrack(){
-#if(NUM_CHANNELS > 0)
- for (uint8_t i=0; i<NUM_CHANNELS; i++){
- updateTrack(i);
- }
-#endif
-}
-
-void Sound::changePatternSet(const uint16_t* const* patterns, uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- patternSet[channel] = (uint16_t**)patterns;
-#endif
-}
-
-void Sound::playPattern(const uint16_t* pattern, uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- stopPattern(channel);
- patternData[channel] = (uint16_t*)pattern;
- patternCursor[channel] = 0;
- patternIsPlaying[channel] = true;
- noteVolume[channel] = 9;
- //reinit commands
- volumeSlideStepDuration[channel] = 0;
- arpeggioStepDuration[channel] = 0;
- tremoloStepDuration[channel] = 0;
-#endif
-}
-
-void Sound::updatePattern(){
-#if(NUM_CHANNELS > 0)
- for (uint8_t i=0; i<NUM_CHANNELS; i++){
- updatePattern(i);
- }
-#endif
-}
-
-void Sound::changeInstrumentSet(const uint16_t* const* instruments, uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- instrumentSet[channel] = (uint16_t**)instruments;
-#endif
-}
-
-void Sound::updatePattern(uint8_t i){
-#if(NUM_CHANNELS > 0)
- if(i>=NUM_CHANNELS)
- return;
- if(patternIsPlaying[i]){
- if(noteDuration[i]==0){//if the end of the previous note is reached
-
- uint16_t data = pgm_read_word(patternCursor[i] + patternData[i]);
-
- if(data == 0){ //end of the pattern reached
- if(patternLooping[i] == true){
- patternCursor[i] = 0;
- data = pgm_read_word(patternCursor[i] + patternData[i]);
- }
- else{
- patternIsPlaying[i] = false;
- if(trackIsPlaying[i]){ //if this pattern is part of a track, get the next pattern
- updateTrack(i);
- data = pgm_read_word(patternCursor[i] + patternData[i]);
- } else {
- stopNote(i);
- //Serial.print("pattern end\n");
- return;
- }
- }
- }
-
- while (data & 0x0001){ //read all commands and instrument changes
- data >>= 2;
- //Serial.print("\ncmd\t");
- uint8_t cmd = data & 0x0F;
- data >>= 4;
- uint8_t X = data & 0x1F;
- data >>= 5;
- int8_t Y = data - 16;
- command(cmd,X,Y,i);
- patternCursor[i]++;
- data = pgm_read_word(patternCursor[i] + patternData[i]);
- }
- data >>= 2;
-
- uint8_t pitch = data & 0x003F;
- data >>= 6;
-
- uint8_t duration = data;
- if(pitch != 63){
- }
-
- playNote(pitch, duration, i);
-
- patternCursor[i]++;
- }
- }
-#endif
-}
-
-void Sound::stopPattern(uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- stopNote(channel);
- patternIsPlaying[channel] = false;
-#endif
-}
-
-void Sound::stopPattern(){
-#if(NUM_CHANNELS > 0)
- for(uint8_t i=0; i<NUM_CHANNELS; i++){
- stopPattern(i);
- }
-#endif
-}
-
-void Sound::command(uint8_t cmd, uint8_t X, int8_t Y, uint8_t i){
-#if(NUM_CHANNELS > 0)
- if(i>=NUM_CHANNELS)
- return;
- switch(cmd){
- case CMD_VOLUME: //volume
- X = constrain((int8_t)X, 0, 10);
- noteVolume[i] = X;
- break;
- case CMD_INSTRUMENT: //instrument
- instrumentData[i] = (uint16_t*)pgm_read_word(&(instrumentSet[i][X]));
- instrumentLength[i] = pgm_read_word(&(instrumentData[i][0])) & 0x00FF; //8 LSB
- instrumentLength[i] *= prescaler;
- instrumentLooping[i] = min2((pgm_read_word(&(instrumentData[i][0])) >> 8), instrumentLength[i]); //8 MSB - check that the loop is shorter than the instrument length
- instrumentLooping[i] *= prescaler;
- break;
- case CMD_SLIDE: //volume slide
- volumeSlideStepDuration[i] = X * prescaler;
- volumeSlideStepSize[i] = Y;
- break;
- case CMD_ARPEGGIO:
- arpeggioStepDuration[i] = X * prescaler;
- arpeggioStepSize[i] = Y;
- break;
- case CMD_TREMOLO:
- tremoloStepDuration[i] = X * prescaler;
- tremoloStepSize[i] = Y;
- break;
- default:
- break;
- }
-#endif
-}
-
-void Sound::playNote(uint8_t pitch, uint8_t duration, uint8_t channel){
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- //set note
- notePitch[channel] = pitch;
- noteDuration[channel] = duration * prescaler;
- //reinit vars
- instrumentNextChange[channel] = 0;
- instrumentCursor[channel] = 0;
- notePlaying[channel] = true;
- _chanState[channel] = true;
- commandsCounter[channel] = 0;
-#endif
-}
-
-void Sound::stopNote(uint8_t channel) {
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- notePlaying[channel] = false;
- //counters
- noteDuration[channel] = 0;
- instrumentCursor[channel] = 0;
- commandsCounter[channel] = 0;
- //output
- _chanOutput[channel] = 0;
- _chanOutputVolume[channel] = 0;
- _chanState[channel] = false;
- updateOutput();
-#endif
-}
-
-void Sound::stopNote() {
-#if(NUM_CHANNELS > 0)
- for (uint8_t channel = 0; channel < NUM_CHANNELS; channel++) {
- stopNote(channel);
- }
-#endif
-}
-
-void Sound::updateNote() {
-#if(NUM_CHANNELS > 0)
- for (uint8_t i = 0; i < NUM_CHANNELS; i++) {
- updateNote(i);
- }
-#endif
-}
-
-void Sound::updateNote(uint8_t i) {
-#if(NUM_CHANNELS > 0)
- if(i>=NUM_CHANNELS)
- return;
- if (notePlaying[i]) {
-
- if(noteDuration[i] == 0){
- stopNote(i);
- //Serial.println("note end");
- return;
- } else {
- noteDuration[i]--;
- }
-
- if (instrumentNextChange[i] == 0) {
-
- //read the step data from the progmem and decode it
- uint16_t thisStep = pgm_read_word(&(instrumentData[i][1 + instrumentCursor[i]]));
-
- stepVolume[i] = thisStep & 0x0007;
- thisStep >>= 3;
-
- uint8_t stepNoise = thisStep & 0x0001;
- thisStep >>= 1;
-
- uint8_t stepDuration = thisStep & 0x003F;
- thisStep >>= 6;
-
- stepPitch[i] = thisStep;
-
- //apply the step settings
- instrumentNextChange[i] = stepDuration * prescaler;
-
- _chanNoise[i] = stepNoise;
-
-
- instrumentCursor[i]++;
-
- if (instrumentCursor[i] >= instrumentLength[i]) {
- if (instrumentLooping[i]) {
- instrumentCursor[i] = instrumentLength[i] - instrumentLooping[i];
- } else {
- stopNote(i);
- }
- }
- }
- instrumentNextChange[i]--;
-
- commandsCounter[i]++;
-
- //UPDATE VALUES
- //pitch
- outputPitch[i] = notePitch[i] + stepPitch[i] + patternPitch[i];
- if(arpeggioStepDuration[i]){
- outputPitch[i] += commandsCounter[i] / arpeggioStepDuration[i] * arpeggioStepSize[i];
- }
- outputPitch[i] = (outputPitch[i] + NUM_PITCH) % NUM_PITCH; //wrap
- //volume
- outputVolume[i] = noteVolume[i];
- if(volumeSlideStepDuration[i]){
- outputVolume[i] += commandsCounter[i] / volumeSlideStepDuration[i] * volumeSlideStepSize[i];
- }
- if(tremoloStepDuration[i]){
- outputVolume[i] += ((commandsCounter[i]/tremoloStepDuration[i]) % 2) * tremoloStepSize[i];
- }
- outputVolume[i] = constrain(outputVolume[i], 0, 9);
- if(notePitch[i] == 63){
- outputVolume[i] = 0;
- }
- // jonnehw noInterrupts();
- _chanHalfPeriod[i] = pgm_read_byte(_halfPeriods + outputPitch[i]);
- _chanOutput[i] = _chanOutputVolume[i] = outputVolume[i] * (globalVolume>>GLOBVOL_SHIFT) * chanVolumes[i] * stepVolume[i];
- //Serial.println(outputVolume[i]);
- // jonnehw interrupts();
- }
-#endif
-}
-
-void Sound::setChannelHalfPeriod(uint8_t channel, uint8_t halfPeriod) {
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- _chanHalfPeriod[channel] = halfPeriod;
- _chanState[channel] = false;
- _chanCount[channel] = 0;
- updateOutput();
-#endif
-}
-
-
-void Sound::generateOutput() {
-#if(NUM_CHANNELS > 0)
- bool outputChanged = false;
- //no for loop here, for the performance sake (this function runs 15 000 times per second...)
- //CHANNEL 0
- if (_chanOutputVolume[0]) {
- _chanCount[0]++;
- if (_chanCount[0] >= _chanHalfPeriod[0]) {
- outputChanged = true;
- _chanState[0] = !_chanState[0];
- _chanCount[0] = 0;
- if (_chanNoise[0]) {
- _rand = 67 * _rand + 71;
- _chanOutput[0] = _rand % _chanOutputVolume[0];
- }
- }
- }
-
-
- //CHANNEL 1
- #if (NUM_CHANNELS > 1)
- if (_chanOutputVolume[1]) {
- _chanCount[1]++;
- if (_chanCount[1] >= _chanHalfPeriod[1]) {
- outputChanged = true;
- _chanState[1] = !_chanState[1];
- _chanCount[1] = 0;
- if (_chanNoise[1]) {
- _rand = 67 * _rand + 71;
- _chanOutput[1] = _rand % _chanOutputVolume[1];
- }
- }
- }
- #endif
-
- //CHANNEL 2
- #if (NUM_CHANNELS > 2)
- if (_chanOutputVolume[2]) {
- _chanCount[2]++;
- if (_chanCount[2] >= _chanHalfPeriod[2]) {
- outputChanged = true;
- _chanState[2] = !_chanState[2];
- _chanCount[2] = 0;
- if (_chanNoise[2]) {
- _rand = 67 * _rand + 71;
- _chanOutput[2] = _rand % _chanOutputVolume[2];
- }
- }
- }
- #endif
-
- //CHANNEL 3
- #if (NUM_CHANNELS > 3)
- if (_chanOutputVolume[3]) {
- _chanCount[3]++;
- if (_chanCount[3] >= _chanHalfPeriod[3]) {
- outputChanged = true;
- _chanState[3] = !_chanState[3];
- _chanCount[3] = 0;
- if (_chanNoise[3]) {
- _rand = 67 * _rand + 71;
- _chanOutput[3] = _rand % _chanOutputVolume[3];
- }
- }
- }
- #endif
-
- #if POK_STREAMING_MUSIC
- if (streamstep) {
- outputChanged=true;
- }
- #endif
-
- if (outputChanged) {
- updateOutput();
- }
-#endif
-}
-
-void Sound::updateOutput() {
-#if(NUM_CHANNELS > 0)
- uint8_t output = 0;
-
- //CHANNEL 0
- if (_chanState[0]) {
- output += _chanOutput[0];
- }
-
- //CHANNEL 1
- #if (NUM_CHANNELS > 1)
- if (_chanState[1]) {
- output += _chanOutput[1];
- }
- #endif
-
- //CHANNEL 2
- #if (NUM_CHANNELS > 2)
- if (_chanState[2]) {
- output += _chanOutput[2];
- }
- #endif
-
- //CHANNEL 3
- #if (NUM_CHANNELS > 3)
- if (_chanState[3]) {
- output += _chanOutput[3];
- }
- #endif
-
- #ifndef POK_SIM
- #if POK_ENABLE_SOUND
- /** HARDWARE **/
-
- #if POK_STREAMING_MUSIC
- if (streamstep) {
- pwmout_write(&audiopwm,(float)sbyte/(float)255);
- }
- #endif
- dac_write((uint8_t)output); //direct hardware mixing baby !
- soundbyte = output;
- #endif //POK_ENABLE_SOUND
- #else
- /** SIMULATOR **/
- #if POK_STREAMING_MUSIC
- if (streamstep) {
- uint16_t o = output + sbyte;
- output = o/2;
- }
- #endif
- soundbyte = output;
- #endif // POK_SIM
-#endif
-}
-
-void Sound::setPatternLooping(bool loop, uint8_t channel) {
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- patternLooping[channel] = loop;
-#endif
-}
-
-void Sound::playOK(){
- #if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
- playPattern(playOKPattern,0);
-#endif
-#endif // POK_GBSOUND
-}
-
-void Sound::playCancel(){
-#if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
- playPattern(playCancelPattern,0);
-#endif
-#endif
-}
-
-void Sound::playTick(){
-#if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
- playPattern(playTickP,0);
-#endif
-#endif // POK_GBSOUND
-}
-
-void Sound::setVolume(int16_t volume) {
-//#if NUM_CHANNELS > 0
- if (volume<0) volume = 0;
- if (volume>volumeMax) volume = volumeMax;
- globalVolume = volume; // % (volumeMax+1);
- #ifndef POK_SIM
- volume = (volume / 2)-10;
- if (volume<0) volume = 0;
- #if POK_ENABLE_SOUND > 1
- setHWvolume(volume);
- #endif
- #endif
- #if POK_SHOW_VOLUME > 0
- c.volbar_visible = VOLUMEBAR_TIMEOUT;
- #endif
-//#endif
-}
-
-uint16_t Sound::getVolume() {
-//#if NUM_CHANNELS > 0
- return globalVolume;
-//#else
-// return 0;
-//#endif
-}
-
-void Sound::setVolume(int8_t volume, uint8_t channel) {
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return;
- volume = (volume > VOLUME_CHANNEL_MAX) ? VOLUME_CHANNEL_MAX : volume;
- volume = (volume < 0) ? 0 : volume;
- chanVolumes[channel] = volume;
-#endif
-}
-
-uint8_t Sound::getVolume(uint8_t channel) {
-#if(NUM_CHANNELS > 0)
- if(channel>=NUM_CHANNELS)
- return 255;
- return (chanVolumes[channel]);
-#else
- return 0;
-#endif
-}
-
-void Sound::playTone(uint8_t os, int frq, uint8_t amp, uint8_t wav,uint8_t arpmode)
-{
- if (wav>5) wav=0;
- if (arpmode>MAX_ARPMODE) arpmode=MAX_ARPMODE;
- if (os==1) setOSC(&osc1,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
- else if (os==2) setOSC(&osc2,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
- else if (os==3) setOSC(&osc3,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
-}
-
-void Sound::playTone(uint8_t os, uint16_t frq, uint8_t volume, uint32_t duration)
-{
- if (os==1) setOSC(&osc1,1,WSAW,frq,volume,duration);
- else if (os==2) setOSC(&osc2,1,WTRI,frq,volume,duration);
- else if (os==3) setOSC(&osc3,1,WTRI,frq,volume,duration);
-}
-
-uint8_t Sound::ampIsOn()
-{
- #ifdef POK_SIM
- return core.ampIsOn();
- #else
- #if POK_ENABLE_SOUND > 1
- return Pokitto::ampIsOn();
- #endif
- #endif // POK_SIM
- return 0;
-}
-
-void Sound::ampEnable(uint8_t v) {
- #ifdef POK_SIM
- core.ampEnable(v);
- #else
- #if POK_ENABLE_SOUND > 1
- Pokitto::ampEnable(v);
- #endif
- #endif // POK_SIM
-
-}
-
-int Sound::playMusicStream(char* filename)
-{
- return playMusicStream(filename,0);
-}
-
-int Sound::playMusicStream()
-{
- #if POK_STREAMING_MUSIC >0
- if (currentPtr) {
- pokPlayStream();
- return 1;
- } else return 0; //no stream
- #endif // POK_STREAMING_MUSIC
-}
-
-void Sound::pauseMusicStream() {
- #if POK_ENABLE_SOUND > 1
- pokPauseStream();
- #endif
-}
-
-int Sound::playMusicStream(char* filename, uint8_t options)
-{
- #if POK_STREAMING_MUSIC
- uint8_t result;
- result = pokInitSD();
- if (!isThisFileOpen(filename)) {
- fileClose(); // close any open files
- result = fileOpen(filename,FILE_MODE_OVERWRITE | FILE_MODE_BINARY);
- }
-
- if (result) {
- currentPtr = 0; // mark that no stream is available
- return 0; // opening music file failed
- }
-
- fileReadBytes(&buffers[0][0],BUFFER_SIZE);
- fileReadBytes(&buffers[1][0],BUFFER_SIZE);
- fileReadBytes(&buffers[2][0],BUFFER_SIZE);
- fileReadBytes(&buffers[3][0],BUFFER_SIZE);
- currentBuffer = 0;
- currentPtr = buffers[currentBuffer];
- endPtr = currentPtr + BUFFER_SIZE;
-
- //streaming = STR_PLAYING|options;
-
- if (!options) pokPlayStream(); // activate stream
- #endif //POK_STREAMING_MUSIC
- return 1; // opening music file succeeded
-}
-
--- a/POKITTO_CORE/PokittoSound.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoSound.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOSOUND_H
-#define POKITTOSOUND_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoFakeavr.h"
-#include "PokittoGlobs.h"
-
-extern void pokPauseStream();
-extern void pokPlayStream();
-extern uint8_t pokStreamPaused();
-
-//volume levels
-#define GLOBVOL_SHIFT 5 //shift global volume to allow for finer increments
-#ifndef MAX_VOL_TEST
- #define VOLUME_SPEAKER_MAX 255 //((8<<GLOBVOL_SHIFT)-1)
- #define VOLUME_HEADPHONE_MAX (1<<GLOBVOL_SHIFT)
- #define VOLUME_STARTUP ((1<<GLOBVOL_SHIFT)/2)
-#else
- #define VOLUME_SPEAKER_MAX ((8<<GLOBVOL_SHIFT)-1)
- #define VOLUME_HEADPHONE_MAX VOLUME_SPEAKER_MAX
- #define VOLUME_STARTUP VOLUME_SPEAKER_MAX
-#endif // MAXVOLTEST
-
-#ifdef POK_SIM
-#define VOLUME_STEP 1
-#else
-#define VOLUME_STEP 8
-#endif
-
-
-//commands
-#define CMD_VOLUME 0
-#define CMD_INSTRUMENT 1
-#define CMD_SLIDE 2
-#define CMD_ARPEGGIO 3
-#define CMD_TREMOLO 4
-
-#define STR_PLAYING 0x1
-#define STR_VISUALIZER 0x2
-#define STR_LOOP 0x4
-#define STR_PAUSED 0x8
-
-namespace Pokitto {
-
-/** Sound class.
- * The Sound class is an API-compatible version of the Gamebuino Sound API by Aurelien Rodot.
- * Because it is a class consisting of only static members, there is only 1 instance running,
- * no matter how many Sound classes are declared (see example below). This means sound can
- * be used through a simple Sound class object or as a member of the Core class.
- *
- */
-
-extern void audio_IRQ(); // audio interrupt
-
-class Sound {
-private:
- static uint16_t volumeMax;
-public:
- static void begin();
-
- // Headphonemode
- static void setMaxVol(int16_t);
- static uint16_t getMaxVol();
- static void volumeUp();
- static void volumeDown();
-
- // Original functions
- static void updateStream();
- static void playTone(uint8_t os, int frq, uint8_t amp, uint8_t wav,uint8_t arpmode);
- static void playTone(uint8_t os, uint16_t freq, uint8_t volume, uint32_t duration);
- static uint8_t ampIsOn();
- static void ampEnable(uint8_t);
- static int playMusicStream(char* filename, uint8_t options);
- static int playMusicStream(char* filename);
- static int playMusicStream();
- static void pauseMusicStream();
-
- // GB compatibility functions
- static void playTrack(const uint16_t* track, uint8_t channel);
- static void updateTrack(uint8_t channel);
- static void updateTrack();
- static void stopTrack(uint8_t channel);
- static void stopTrack();
- static void changePatternSet(const uint16_t* const* patterns, uint8_t channel);
- static bool trackIsPlaying[NUM_CHANNELS];
-
- static void playPattern(const uint16_t* pattern, uint8_t channel);
- static void changeInstrumentSet(const uint16_t* const* instruments, uint8_t channel);
- static void updatePattern(uint8_t i);
- static void updatePattern();
- static void setPatternLooping(bool loop, uint8_t channel);
- static void stopPattern(uint8_t channel);
- static void stopPattern();
- static bool patternIsPlaying[NUM_CHANNELS];
-
- static void command(uint8_t cmd, uint8_t X, int8_t Y, uint8_t i);
- static void playNote(uint8_t pitch, uint8_t duration, uint8_t channel);
- static void updateNote();
- static void updateNote(uint8_t i);
- static void stopNote(uint8_t channel);
- static void stopNote();
-
- static uint8_t outputPitch[NUM_CHANNELS];
- static int8_t outputVolume[NUM_CHANNELS];
-
- static void setMasterVolume(uint8_t);
- static uint8_t GetMasterVolume();
- static void setVolume(int16_t volume);
- static uint16_t getVolume();
- static void setVolume(int8_t volume, uint8_t channel);
- static uint8_t getVolume(uint8_t channel);
-
- static void playOK();
- static void playCancel();
- static void playTick();
-
- static uint8_t prescaler;
-
- static void setChannelHalfPeriod(uint8_t channel, uint8_t halfPeriod);
-
- static void generateOutput(); //!\\ DO NOT USE
- static uint16_t globalVolume;
-
-
-#if (NUM_CHANNELS > 0)
- //tracks data
- static uint16_t *trackData[NUM_CHANNELS];
- static uint8_t trackCursor[NUM_CHANNELS];
- static uint16_t **patternSet[NUM_CHANNELS];
- static int8_t patternPitch[NUM_CHANNELS];
-
- // pattern data
- static uint16_t *patternData[NUM_CHANNELS];
- static uint16_t **instrumentSet[NUM_CHANNELS];
- static bool patternLooping[NUM_CHANNELS];
- static uint16_t patternCursor[NUM_CHANNELS];
-
- // note data
- static uint8_t notePitch[NUM_CHANNELS];
- static uint8_t noteDuration[NUM_CHANNELS];
- static int8_t noteVolume[NUM_CHANNELS];
- static bool notePlaying[NUM_CHANNELS];
-
- // commands data
- static int8_t commandsCounter[NUM_CHANNELS];
- static int8_t volumeSlideStepDuration[NUM_CHANNELS];
- static int8_t volumeSlideStepSize[NUM_CHANNELS];
- static uint8_t arpeggioStepDuration[NUM_CHANNELS];
- static int8_t arpeggioStepSize[NUM_CHANNELS];
- static uint8_t tremoloStepDuration[NUM_CHANNELS];
- static int8_t tremoloStepSize[NUM_CHANNELS];
-
-
- // instrument data
- static uint16_t *instrumentData[NUM_CHANNELS];
- static uint8_t instrumentLength[NUM_CHANNELS]; //number of steps in the instrument
- static uint8_t instrumentLooping[NUM_CHANNELS]; //how many steps to loop on when the last step of the instrument is reached
- static uint16_t instrumentCursor[NUM_CHANNELS]; //which step is being played
- static uint8_t instrumentNextChange[NUM_CHANNELS]; //how many frames before the next step
-
- //current step data
- static int8_t stepVolume[NUM_CHANNELS];
- static uint8_t stepPitch[NUM_CHANNELS];
-
- static uint8_t chanVolumes[NUM_CHANNELS];
-#endif
- static void updateOutput();
-};
-
-}
-
-#endif // POKITTOSOUND_H
-
-
-
-
-
--- a/POKITTO_CORE/PokittoTimer.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/**************************************************************************/ -/*! - @file PokittoTimer.h - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#ifndef POKITTO_TIMER_H -#define POKITTO_TIMER_H - -extern void pokInitTimer(void); -extern unsigned int pokGetTime(void); -extern void pokWaitms(uint16_t); - -#endif -
--- a/POKITTO_CORE/binary.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,516 +0,0 @@ -#ifndef Binary_h -#define Binary_h - -//jonne #define B0 0 -#define B00 0 -#define B000 0 -#define B0000 0 -#define B00000 0 -#define B000000 0 -#define B0000000 0 -#define B00000000 0 -//jonne #define B1 1 -#define B01 1 -#define B001 1 -#define B0001 1 -#define B00001 1 -#define B000001 1 -#define B0000001 1 -#define B00000001 1 -#define B10 2 -#define B010 2 -#define B0010 2 -#define B00010 2 -#define B000010 2 -#define B0000010 2 -#define B00000010 2 -#define B11 3 -#define B011 3 -#define B0011 3 -#define B00011 3 -#define B000011 3 -#define B0000011 3 -#define B00000011 3 -#define B100 4 -#define B0100 4 -#define B00100 4 -#define B000100 4 -#define B0000100 4 -#define B00000100 4 -#define B101 5 -#define B0101 5 -#define B00101 5 -#define B000101 5 -#define B0000101 5 -#define B00000101 5 -#define B110 6 -#define B0110 6 -#define B00110 6 -#define B000110 6 -#define B0000110 6 -#define B00000110 6 -#define B111 7 -#define B0111 7 -#define B00111 7 -#define B000111 7 -#define B0000111 7 -#define B00000111 7 -#define B1000 8 -#define B01000 8 -#define B001000 8 -#define B0001000 8 -#define B00001000 8 -#define B1001 9 -#define B01001 9 -#define B001001 9 -#define B0001001 9 -#define B00001001 9 -#define B1010 10 -#define B01010 10 -#define B001010 10 -#define B0001010 10 -#define B00001010 10 -#define B1011 11 -#define B01011 11 -#define B001011 11 -#define B0001011 11 -#define B00001011 11 -#define B1100 12 -#define B01100 12 -#define B001100 12 -#define B0001100 12 -#define B00001100 12 -#define B1101 13 -#define B01101 13 -#define B001101 13 -#define B0001101 13 -#define B00001101 13 -#define B1110 14 -#define B01110 14 -#define B001110 14 -#define B0001110 14 -#define B00001110 14 -#define B1111 15 -#define B01111 15 -#define B001111 15 -#define B0001111 15 -#define B00001111 15 -#define B10000 16 -#define B010000 16 -#define B0010000 16 -#define B00010000 16 -#define B10001 17 -#define B010001 17 -#define B0010001 17 -#define B00010001 17 -#define B10010 18 -#define B010010 18 -#define B0010010 18 -#define B00010010 18 -#define B10011 19 -#define B010011 19 -#define B0010011 19 -#define B00010011 19 -#define B10100 20 -#define B010100 20 -#define B0010100 20 -#define B00010100 20 -#define B10101 21 -#define B010101 21 -#define B0010101 21 -#define B00010101 21 -#define B10110 22 -#define B010110 22 -#define B0010110 22 -#define B00010110 22 -#define B10111 23 -#define B010111 23 -#define B0010111 23 -#define B00010111 23 -#define B11000 24 -#define B011000 24 -#define B0011000 24 -#define B00011000 24 -#define B11001 25 -#define B011001 25 -#define B0011001 25 -#define B00011001 25 -#define B11010 26 -#define B011010 26 -#define B0011010 26 -#define B00011010 26 -#define B11011 27 -#define B011011 27 -#define B0011011 27 -#define B00011011 27 -#define B11100 28 -#define B011100 28 -#define B0011100 28 -#define B00011100 28 -#define B11101 29 -#define B011101 29 -#define B0011101 29 -#define B00011101 29 -#define B11110 30 -#define B011110 30 -#define B0011110 30 -#define B00011110 30 -#define B11111 31 -#define B011111 31 -#define B0011111 31 -#define B00011111 31 -#define B100000 32 -#define B0100000 32 -#define B00100000 32 -#define B100001 33 -#define B0100001 33 -#define B00100001 33 -#define B100010 34 -#define B0100010 34 -#define B00100010 34 -#define B100011 35 -#define B0100011 35 -#define B00100011 35 -#define B100100 36 -#define B0100100 36 -#define B00100100 36 -#define B100101 37 -#define B0100101 37 -#define B00100101 37 -#define B100110 38 -#define B0100110 38 -#define B00100110 38 -#define B100111 39 -#define B0100111 39 -#define B00100111 39 -#define B101000 40 -#define B0101000 40 -#define B00101000 40 -#define B101001 41 -#define B0101001 41 -#define B00101001 41 -#define B101010 42 -#define B0101010 42 -#define B00101010 42 -#define B101011 43 -#define B0101011 43 -#define B00101011 43 -#define B101100 44 -#define B0101100 44 -#define B00101100 44 -#define B101101 45 -#define B0101101 45 -#define B00101101 45 -#define B101110 46 -#define B0101110 46 -#define B00101110 46 -#define B101111 47 -#define B0101111 47 -#define B00101111 47 -#define B110000 48 -#define B0110000 48 -#define B00110000 48 -#define B110001 49 -#define B0110001 49 -#define B00110001 49 -#define B110010 50 -#define B0110010 50 -#define B00110010 50 -#define B110011 51 -#define B0110011 51 -#define B00110011 51 -#define B110100 52 -#define B0110100 52 -#define B00110100 52 -#define B110101 53 -#define B0110101 53 -#define B00110101 53 -#define B110110 54 -#define B0110110 54 -#define B00110110 54 -#define B110111 55 -#define B0110111 55 -#define B00110111 55 -#define B111000 56 -#define B0111000 56 -#define B00111000 56 -#define B111001 57 -#define B0111001 57 -#define B00111001 57 -#define B111010 58 -#define B0111010 58 -#define B00111010 58 -#define B111011 59 -#define B0111011 59 -#define B00111011 59 -#define B111100 60 -#define B0111100 60 -#define B00111100 60 -#define B111101 61 -#define B0111101 61 -#define B00111101 61 -#define B111110 62 -#define B0111110 62 -#define B00111110 62 -#define B111111 63 -#define B0111111 63 -#define B00111111 63 -#define B1000000 64 -#define B01000000 64 -#define B1000001 65 -#define B01000001 65 -#define B1000010 66 -#define B01000010 66 -#define B1000011 67 -#define B01000011 67 -#define B1000100 68 -#define B01000100 68 -#define B1000101 69 -#define B01000101 69 -#define B1000110 70 -#define B01000110 70 -#define B1000111 71 -#define B01000111 71 -#define B1001000 72 -#define B01001000 72 -#define B1001001 73 -#define B01001001 73 -#define B1001010 74 -#define B01001010 74 -#define B1001011 75 -#define B01001011 75 -#define B1001100 76 -#define B01001100 76 -#define B1001101 77 -#define B01001101 77 -#define B1001110 78 -#define B01001110 78 -#define B1001111 79 -#define B01001111 79 -#define B1010000 80 -#define B01010000 80 -#define B1010001 81 -#define B01010001 81 -#define B1010010 82 -#define B01010010 82 -#define B1010011 83 -#define B01010011 83 -#define B1010100 84 -#define B01010100 84 -#define B1010101 85 -#define B01010101 85 -#define B1010110 86 -#define B01010110 86 -#define B1010111 87 -#define B01010111 87 -#define B1011000 88 -#define B01011000 88 -#define B1011001 89 -#define B01011001 89 -#define B1011010 90 -#define B01011010 90 -#define B1011011 91 -#define B01011011 91 -#define B1011100 92 -#define B01011100 92 -#define B1011101 93 -#define B01011101 93 -#define B1011110 94 -#define B01011110 94 -#define B1011111 95 -#define B01011111 95 -#define B1100000 96 -#define B01100000 96 -#define B1100001 97 -#define B01100001 97 -#define B1100010 98 -#define B01100010 98 -#define B1100011 99 -#define B01100011 99 -#define B1100100 100 -#define B01100100 100 -#define B1100101 101 -#define B01100101 101 -#define B1100110 102 -#define B01100110 102 -#define B1100111 103 -#define B01100111 103 -#define B1101000 104 -#define B01101000 104 -#define B1101001 105 -#define B01101001 105 -#define B1101010 106 -#define B01101010 106 -#define B1101011 107 -#define B01101011 107 -#define B1101100 108 -#define B01101100 108 -#define B1101101 109 -#define B01101101 109 -#define B1101110 110 -#define B01101110 110 -#define B1101111 111 -#define B01101111 111 -#define B1110000 112 -#define B01110000 112 -#define B1110001 113 -#define B01110001 113 -#define B1110010 114 -#define B01110010 114 -#define B1110011 115 -#define B01110011 115 -#define B1110100 116 -#define B01110100 116 -#define B1110101 117 -#define B01110101 117 -#define B1110110 118 -#define B01110110 118 -#define B1110111 119 -#define B01110111 119 -#define B1111000 120 -#define B01111000 120 -#define B1111001 121 -#define B01111001 121 -#define B1111010 122 -#define B01111010 122 -#define B1111011 123 -#define B01111011 123 -#define B1111100 124 -#define B01111100 124 -#define B1111101 125 -#define B01111101 125 -#define B1111110 126 -#define B01111110 126 -#define B1111111 127 -#define B01111111 127 -#define B10000000 128 -#define B10000001 129 -#define B10000010 130 -#define B10000011 131 -#define B10000100 132 -#define B10000101 133 -#define B10000110 134 -#define B10000111 135 -#define B10001000 136 -#define B10001001 137 -#define B10001010 138 -#define B10001011 139 -#define B10001100 140 -#define B10001101 141 -#define B10001110 142 -#define B10001111 143 -#define B10010000 144 -#define B10010001 145 -#define B10010010 146 -#define B10010011 147 -#define B10010100 148 -#define B10010101 149 -#define B10010110 150 -#define B10010111 151 -#define B10011000 152 -#define B10011001 153 -#define B10011010 154 -#define B10011011 155 -#define B10011100 156 -#define B10011101 157 -#define B10011110 158 -#define B10011111 159 -#define B10100000 160 -#define B10100001 161 -#define B10100010 162 -#define B10100011 163 -#define B10100100 164 -#define B10100101 165 -#define B10100110 166 -#define B10100111 167 -#define B10101000 168 -#define B10101001 169 -#define B10101010 170 -#define B10101011 171 -#define B10101100 172 -#define B10101101 173 -#define B10101110 174 -#define B10101111 175 -#define B10110000 176 -#define B10110001 177 -#define B10110010 178 -#define B10110011 179 -#define B10110100 180 -#define B10110101 181 -#define B10110110 182 -#define B10110111 183 -#define B10111000 184 -#define B10111001 185 -#define B10111010 186 -#define B10111011 187 -#define B10111100 188 -#define B10111101 189 -#define B10111110 190 -#define B10111111 191 -#define B11000000 192 -#define B11000001 193 -#define B11000010 194 -#define B11000011 195 -#define B11000100 196 -#define B11000101 197 -#define B11000110 198 -#define B11000111 199 -#define B11001000 200 -#define B11001001 201 -#define B11001010 202 -#define B11001011 203 -#define B11001100 204 -#define B11001101 205 -#define B11001110 206 -#define B11001111 207 -#define B11010000 208 -#define B11010001 209 -#define B11010010 210 -#define B11010011 211 -#define B11010100 212 -#define B11010101 213 -#define B11010110 214 -#define B11010111 215 -#define B11011000 216 -#define B11011001 217 -#define B11011010 218 -#define B11011011 219 -#define B11011100 220 -#define B11011101 221 -#define B11011110 222 -#define B11011111 223 -#define B11100000 224 -#define B11100001 225 -#define B11100010 226 -#define B11100011 227 -#define B11100100 228 -#define B11100101 229 -#define B11100110 230 -#define B11100111 231 -#define B11101000 232 -#define B11101001 233 -#define B11101010 234 -#define B11101011 235 -#define B11101100 236 -#define B11101101 237 -#define B11101110 238 -#define B11101111 239 -#define B11110000 240 -#define B11110001 241 -#define B11110010 242 -#define B11110011 243 -#define B11110100 244 -#define B11110101 245 -#define B11110110 246 -#define B11110111 247 -#define B11111000 248 -#define B11111001 249 -#define B11111010 250 -#define B11111011 251 -#define B11111100 252 -#define B11111101 253 -#define B11111110 254 -#define B11111111 255 - -#endif -
--- a/POKITTO_HW/HWButtons.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWButtons.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "HWButtons.h"
-#include "PokittoCore.h"
-#include "PokittoSound.h"
-#include "PokittoDisplay.h"
-
-Pokitto::Sound _s;
-Pokitto::Display _bd;
-
-using namespace mbed;
-
-InterruptIn ABtn(POK_BTN_A_PIN);
-InterruptIn BBtn(POK_BTN_B_PIN);
-InterruptIn CBtn(POK_BTN_C_PIN);
-InterruptIn UBtn(POK_BTN_UP_PIN);
-InterruptIn DBtn(POK_BTN_DOWN_PIN);
-InterruptIn LBtn(POK_BTN_LEFT_PIN);
-InterruptIn RBtn(POK_BTN_RIGHT_PIN);
-
-#define BS_IDLE 0
-#define BS_DOWN 1
-#define BS_UP 2
-
-uint8_t Pokitto::heldStates[NUM_BTN];
-
-void APressed() { Pokitto::heldStates[BTN_A] = 1; }
-void AReleased() { Pokitto::heldStates[BTN_A] = 0; }
-void BPressed() { Pokitto::heldStates[BTN_B] = 1; }
-void BReleased() { Pokitto::heldStates[BTN_B] = 0; }
-void CPressed() {
- _bd.enableDirectPrinting(true);
- _bd.directcolor=COLOR_MAGENTA;
- _bd.setCursor(1,1);
- _bd.print("C pressed");
- Pokitto::heldStates[BTN_C] = 1;
- }
-void CReleased() { Pokitto::heldStates[BTN_C] = 0; }
-void UPressed() { Pokitto::heldStates[BTN_UP] = 1; }
-void UReleased() { Pokitto::heldStates[BTN_UP] = 0; }
-void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; }
-void DReleased() { Pokitto::heldStates[BTN_DOWN] = 0; }
-void RPressed() {
- /* Hardware volume control */
- if (Pokitto::heldStates[BTN_C]) _s.volumeUp();
- else Pokitto::heldStates[BTN_RIGHT] = 1;
- }
-void RReleased() { Pokitto::heldStates[BTN_RIGHT] = 0; }
-void LPressed() {
- /* Hardware volume control */
- if (Pokitto::heldStates[BTN_C]) _s.volumeDown();
- else Pokitto::heldStates[BTN_LEFT] = 1;
- }
-void LReleased() { Pokitto::heldStates[BTN_LEFT] = 0; }
-
-void Pokitto::initButtons() {
- ABtn.fall(&AReleased);
- ABtn.rise(&APressed);
- BBtn.fall(&BReleased);
- BBtn.rise(&BPressed);
- CBtn.fall(&CReleased);
- CBtn.rise(&CPressed);
- UBtn.fall(&UReleased);
- UBtn.rise(&UPressed);
- DBtn.fall(&DReleased);
- DBtn.rise(&DPressed);
- LBtn.fall(&LReleased);
- LBtn.rise(&LPressed);
- RBtn.fall(&RReleased);
- RBtn.rise(&RPressed);
-}
-
-uint8_t Pokitto::Core::aBtn() {
- return Pokitto::heldStates[BTN_A];
-}
-
-uint8_t Pokitto::Core::bBtn() {
- return Pokitto::heldStates[BTN_B];
-}
-
-uint8_t Pokitto::Core::cBtn() {
- return Pokitto::heldStates[BTN_C];
-}
-
-uint8_t Pokitto::Core::upBtn() {
- return Pokitto::heldStates[BTN_UP];
-}
-uint8_t Pokitto::Core::downBtn() {
- return Pokitto::heldStates[BTN_DOWN];
-}
-
-uint8_t Pokitto::Core::leftBtn() {
- return Pokitto::heldStates[BTN_LEFT];
-}
-uint8_t Pokitto::Core::rightBtn() {
- return Pokitto::heldStates[BTN_RIGHT];
-}
-
--- a/POKITTO_HW/HWButtons.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWButtons.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-#ifndef HWBUTTONS_H
-#define HWBUTTONS_H
-
-#include "mbed.h"
-#include "Pokitto_settings.h"
-
-#define BTN_UP 1
-#define BTN_RIGHT 2
-#define BTN_DOWN 3
-#define BTN_LEFT 0
-#define BTN_A 4
-#define BTN_B 5
-#define BTN_C 6
-#define NUM_BTN 7
-
-namespace Pokitto {
-
-extern uint8_t heldStates[];
-extern void initButtons();
-extern void pollButtons();
-
-
-} // namespace Pokitto
-
-#endif //HWBUTTONS
-
--- a/POKITTO_HW/HWLCD.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1137 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWLCD.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "HWLCD.h" //HWLCD.h" #include "HWLCD.h"
-#include "Pokitto_settings.h"
-
-#define AB_JUMP 1024 // jump one 1-bit Arduboy screen forward to get next color bit
-#define GB_JUMP 504 // jump one 1-bit Gamebuino screen forward to get next color bit
-
-using namespace Pokitto;
-
-uint16_t prevdata=0; // if data does not change, do not adjust LCD bus lines
-
-#if POK_BOARDREV == 2
- pwmout_t backlightpwm;
-#endif
-
-
-/**************************************************************************/
-/*!
- @brief set up the 16-bit bus
-*/
-/**************************************************************************/
-
-static inline void setup_data_16(uint16_t data)
-{
- uint32_t p2=0;
-
- if (data != prevdata) {
-
- prevdata=data;
-
- /** D0...D16 = P2_3 ... P2_18 **/
- p2 = data << 3;
-
- //__disable_irq(); // Disable Interrupts
- SET_MASK_P2;
- LPC_GPIO_PORT->MPIN[2] = p2; // write bits to port
- CLR_MASK_P2;
- //__enable_irq(); // Enable Interrupts
- }
-}
-
-
-/**************************************************************************/
-/*!
- @brief Write a command to the lcd, 16-bit bus
-*/
-/**************************************************************************/
-inline void write_command_16(uint16_t data)
-{
- CLR_CS; // select lcd
- CLR_CD; // clear CD = command
- SET_RD; // RD high, do not read
- setup_data_16(data); // function that inputs the data into the relevant bus lines
- CLR_WR; // WR low
- SET_WR; // WR low, then high = write strobe
- SET_CS; // de-select lcd
-}
-
-/**************************************************************************/
-/*!
- @brief Write data to the lcd, 16-bit bus
-*/
-/**************************************************************************/
-inline void write_data_16(uint16_t data)
-{
- CLR_CS;
- SET_CD;
- SET_RD;
- setup_data_16(data);
- CLR_WR;
- SET_WR;
- SET_CS;
-}
-
-/**************************************************************************/
-/*!
- @brief Point to a (x,y) location in the LCD DRAM
-*/
-/**************************************************************************/
-static inline void setDRAMptr(uint8_t xptr, uint8_t yoffset)
-{
- write_command(0x20); // Vertical DRAM Address
- write_data(yoffset);
- write_command(0x21); // Horizontal DRAM Address
- write_data(xptr); //
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;
-}
-
-void Pokitto::initBacklight() {
- #if POK_BOARDREV == 2
- pwmout_init(&backlightpwm,POK_BACKLIGHT_PIN);
- pwmout_period_us(&backlightpwm,5);
- pwmout_write(&backlightpwm,POK_BACKLIGHT_INITIALVALUE);
- #endif
-}
-
-void Pokitto::setBacklight(float value) {
- if (value>0.999f) value = 0.999f;
- pwmout_write(&backlightpwm,value);
-}
-
-void Pokitto::lcdInit() {
- initBacklight();
-
- SET_RESET;
- wait_ms(10);
- CLR_RESET;
- wait_ms(10);
- SET_RESET;
- wait_ms(10);
- //************* Start Initial Sequence **********//
- write_command(0x01); // driver output control, this also affects direction
- write_data(0x11C); // originally: 0x11C 100011100 SS,NL4,NL3,NL2
- // NL4...0 is the number of scan lines to drive the screen !!!
- // so 11100 is 1c = 220 lines, correct
- // test 1: 0x1C 11100 SS=0,NL4,NL3,NL2 -> no effect
- // test 2: 0x31C 1100011100 GS=1,SS=1,NL4,NL3,NL2 -> no effect
- // test 3: 0x51C 10100011100 SM=1,GS=0,SS=1,NL4,NL3,NL2 -> no effect
- // test 4: 0x71C SM=1,GS=1,SS=1,NL4,NL3,NL2
- // test 5: 0x
- // seems to have no effect... is this perhaps only for RGB mode ?
-
- write_command(0x02); // LCD driving control
- write_data(0x0100); // INV = 1
-
- write_command(0x03); // Entry mode... lets try if this affects the direction
- write_data(0x1030); // originally 0x1030 1000000110000 BGR,ID1,ID0
- // test 1: 0x1038 1000000111000 BGR,ID1,ID0,AM=1 ->drawing DRAM horizontally
- // test 4: am=1, id0=0, id1=0, 1000000001000,0x1008 -> same as above, but flipped on long
- // test 2: am=0, id0=0, 1000000100000, 0x1020 -> flipped on long axis
- // test 3: am=0, id1=0, 1000000010000, 0x1010 -> picture flowed over back to screen
-
-
- write_command(0x08); // Display control 2
- write_data(0x0808); // 100000001000 FP2,BP2
-
- write_command(0x0C); // RGB display interface
- write_data(0x0000); // all off
-
- write_command(0x0F); // Frame marker position
- write_data(0x0001); // OSC_EN
-
- write_command(0x20); // Horizontal DRAM Address
- write_data(0x0000); // 0
-
- write_command(0x21); // Vertical DRAM Address
- write_data(0x0000); // 0
-
- //*************Power On sequence ****************//
- write_command(0x10);
- write_data(0x0000);
-
- write_command(0x11);
- write_data(0x1000);
- wait_ms(10);
-//------------------------ Set GRAM area --------------------------------//
- write_command(0x30); // Gate scan position
- write_data(0x0000); // if GS=0, 00h=G1, else 00h=G220
-
- write_command(0x31); // Vertical scroll control
- write_data(0x00DB); // scroll start line 11011011 = 219
-
- write_command(0x32); // Vertical scroll control
- write_data(0x0000); // scroll end line 0
-
- write_command(0x33); // Vertical scroll control
- write_data(0x0000); // 0=vertical scroll disabled
-
- write_command(0x34); // Partial screen driving control
- write_data(0x00DB); // db = full screen (end)
-
- write_command(0x35); // partial screen
- write_data(0x0000); // 0 = start
-
- write_command(0x36); // Horizontal and vertical RAM position
- write_data(0x00AF); //end address 175
-
- write_command(0x37);
- write_data(0x0000); // start address 0
-
- write_command(0x38);
- write_data(0x00DB); //end address 219
-
- write_command(0x39); // start address 0
- write_data(0x0000);
- wait_ms(10);
- write_command(0xff); // start gamma register control
- write_data(0x0003);
-
-// ----------- Adjust the Gamma Curve ----------//
- write_command(0x50);
- write_data(0x0203);
-
- write_command(0x051);
- write_data(0x0A09);
-
- write_command(0x52);
- write_data(0x0005);
-
- write_command(0x53);
- write_data(0x1021);
-
- write_command(0x54);
- write_data(0x0602);
-
- write_command(0x55);
- write_data(0x0003);
-
- write_command(0x56);
- write_data(0x0703);
-
- write_command(0x57);
- write_data(0x0507);
-
- write_command(0x58);
- write_data(0x1021);
-
- write_command(0x59);
- write_data(0x0703);
-
- write_command(0xB0);
- write_data(0x2501);
-
- write_command(0xFF);
- write_data(0x0000);
-
- write_command(0x07);
- write_data(0x1017);
- wait_ms(200);
- write_command(0x22);
-
- lcdClear();
-}
-
-void Pokitto::lcdSleep(void){
- write_command(0xFF);
- write_data(0x0000);
-
- write_command(0x07);
- write_data(0x0000);
- wait_ms(50);
- write_command(0x10);// Enter Standby mode
- write_data(0x0003);
- wait_ms(200);
-
-}
-
-void Pokitto::lcdWakeUp (void){
-
- wait_ms(200);
- write_command(0xFF);
- write_data(0x0000);
-
- write_command(0x10);// Exit Sleep/ Standby mode
- write_data(0x0000);
- wait_ms(50);
- write_command(0x07);
- write_data(0x0117);
- wait_ms(200);
- }
-
-void Pokitto::lcdFillSurface(uint16_t c) {
- uint32_t i;
- write_command(0x20); // Horizontal DRAM Address
- write_data(0x0000); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(0);
- write_command(0x22); // write data to DRAM
- setup_data_16(c);
- CLR_CS_SET_CD_RD_WR;
- for(i=0;i<220*176;i++)
- {
- CLR_WR;
- SET_WR;
- }
-}
-
-void Pokitto::lcdClear() {
- uint32_t i;
- write_command(0x20); // Horizontal DRAM Address
- write_data(0x0000); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(0);
- write_command(0x22); // write data to DRAM
- setup_data_16(0x0000);
- CLR_CS_SET_CD_RD_WR;
- for(i=0;i<220*176;i++)
- {
- CLR_WR;
- SET_WR;
- }
-}
-
-void Pokitto::lcdPixel(int16_t x, int16_t y, uint16_t color) {
- if ((x < 0) || (x >= POK_LCD_W) || (y < 0) || (y >= POK_LCD_H))
- return;
- write_command(0x20); // Horizontal DRAM Address
- write_data(y); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(x);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;
- setup_data_16(color);
- CLR_WR;SET_WR;
-}
-
-void Pokitto::lcdRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) {
- int16_t temp;
- if (x0>x1) {temp=x0;x0=x1;x1=temp;}
- if (y0>y1) {temp=y0;y0=y1;y1=temp;}
- if (x0 > POK_LCD_W) return;
- if (y0 > POK_LCD_H) return;
- if (x1 > POK_LCD_W) x1=POK_LCD_W;
- if (y1 > POK_LCD_H) y1=POK_LCD_W;
- if (x0 < 0) x0=0;
- if (y0 < 0) y0=0;
-
- int16_t x,y;
- for (x=x0; x<=x1;x++) {
- write_command(0x20); // Horizontal DRAM Address (=y on pokitto screen)
- write_data(y0);
- write_command(0x21); // Vertical DRAM Address (=x on pokitto screen)
- write_data(x);
- write_command(0x22); // write data to DRAM
-
- CLR_CS_SET_CD_RD_WR; // go to vram write mode
-
-
- for (y=y0; y<y1;y++) {
- setup_data_16(color); // setup the data (flat color = no change between pixels)
- CLR_WR;SET_WR; //CLR_WR;SET_WR;//toggle writeline, pokitto screen writes a column up to down
- }
- }
-}
-
-void Pokitto::lcdRefreshMode1(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y,xptr;
-uint16_t scanline[4][176]; // read 4 half-nibbles = 4 pixels at a time
-uint8_t *d, yoffset=0;
-
-xptr = 0;
-setDRAMptr(xptr,yoffset);
-
-
-for(x=0;x<220;x+=4)
- {
- d = scrbuf+(x>>2);// point to beginning of line in data
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<176;y++)
- {
- uint8_t tdata = *d;
- uint8_t t4 = tdata & 0x03; tdata >>= 2;// lowest half-nibble
- uint8_t t3 = tdata & 0x03; tdata >>= 2;// second lowest half-nibble
- uint8_t t2 = tdata & 0x03; tdata >>= 2;// second highest half-nibble
- uint8_t t = tdata & 0x03;// highest half-nibble
-
- /** put nibble values in the scanlines **/
- scanline[0][s] = paletteptr[t];
- scanline[1][s] = paletteptr[t2];
- scanline[2][s] = paletteptr[t3];
- scanline[3][s++] = paletteptr[t4];
-
- d+=220/4; // jump to read byte directly below in screenbuffer
- }
- s=0;
- /** draw scanlines **/
- for (s=0;s<176;) {
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- }
- for (s=0;s<176;) {
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- }
- for (s=0;s<176;) {
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- }
- for (s=0;s<176;) {
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- }
- }
-}
-
-void Pokitto::lcdRefreshMode2(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[2][88]; // read two nibbles = pixels at a time
-uint8_t *d;
-
-write_command(0x20); // Horizontal DRAM Address
-write_data(0); // 0
-write_command(0x21); // Vertical DRAM Address
-write_data(0);
-write_command(0x22); // write data to DRAM
-CLR_CS_SET_CD_RD_WR;
-
-for(x=0;x<110;x+=2)
- {
- d = scrbuf+(x>>1);// point to beginning of line in data
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<88;y++)
- {
- uint8_t t = *d >> 4; // higher nibble
- uint8_t t2 = *d & 0xF; // lower nibble
- /** higher nibble = left pixel in pixel pair **/
- scanline[0][s] = paletteptr[t];
- scanline[1][s++] = paletteptr[t2];
- /** testing only **/
- //scanline[0][s] = 0xFFFF*(s&1);
- //scanline[1][s] = 0xFFFF*(!(s&1));
- //s++;
- /** until here **/
- d+=110/2; // jump to read byte directly below in screenbuffer
- }
- s=0;
- /** draw scanlines **/
- /** leftmost scanline twice**/
-
- for (s=0;s<88;) {
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
-
- for (s=0;s<88;) {
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
- /** rightmost scanline twice**/
- //setDRAMptr(xptr++,yoffset);
- for (s=0;s<88;) {
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
-
- for (s=0;s<88;) {
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
- }
-}
-
-void Pokitto::lcdRefreshMode3(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[2][176]; // read two nibbles = pixels at a time
-uint8_t *d;
-
-write_command(0x20); // Horizontal DRAM Address
-write_data(0); // 0
-write_command(0x21); // Vertical DRAM Address
-write_data(0);
-write_command(0x22); // write data to DRAM
-CLR_CS_SET_CD_RD_WR;
-
-for(x=0;x<220;x+=2)
- {
- d = scrbuf+(x>>1);// point to beginning of line in data
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<176;y++)
- {
- uint8_t t = *d >> 4; // higher nibble
- uint8_t t2 = *d & 0xF; // lower nibble
- /** higher nibble = left pixel in pixel pair **/
- scanline[0][s] = paletteptr[t];
- scanline[1][s++] = paletteptr[t2];
- /** testing only **/
- //scanline[0][s] = 0xFFFF*(s&1);
- //scanline[1][s] = 0xFFFF*(!(s&1));
- //s++;
- /** until here **/
- d+=220/2; // jump to read byte directly below in screenbuffer
- }
- s=0;
- /** draw scanlines **/
- /** leftmost scanline**/
-
- for (s=0;s<176;) {
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- }
-
- /** rightmost scanline**/
- //setDRAMptr(xptr++,yoffset);
- for (s=0;s<176;) {
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- }
- }
-}
-
-void Pokitto::lcdRefreshGB(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[48];
-uint8_t * d;
-
-#if POK_STRETCH
-//uint16_t xptr = 8;
-#else
-//xptr = 26;
-#endif
-
-write_command(0x20); // Horizontal DRAM Address
-write_data(0); // 0
-write_command(0x21); // Vertical DRAM Address
-write_data(0);
-write_command(0x22); // write data to DRAM
-CLR_CS_SET_CD_RD_WR;
-
-/** draw border **/
- for (int s=0;s<5*176;) {
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;s++;
- }
-
-for(x=0;x<84;x++)
- {
-
- d = scrbuf + x;// point to beginning of line in data
-
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<6;y++)
- {
- uint8_t t = *d;
- #if POK_COLORDEPTH > 1
- uint8_t t2 = *(d+504);
- #endif
- #if POK_COLORDEPTH > 2
- uint8_t t3 = *(d+504+504);
- #endif
- #if POK_COLORDEPTH > 3
- uint8_t t4 = *(d+504+504+504);
- #endif
- uint8_t paletteindex = 0;
-
- /** bit 1 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x1);
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x1)) | ((t2 & 0x01)<<1);
- #elif POK_COLORDEPTH == 3
- paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2);
- #elif POK_COLORDEPTH == 4
- paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2) | ((t4 & 0x1)<<3);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 2 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x2)>>1;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x02));
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1) | ((t4 & 0x2)<<2);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 3 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x4)>>2;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 4)>>2) | ((t2 & 0x04)>>1);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4) | ((t4 & 0x4)<<1);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 4 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x8)>>3;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x08)>>2);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1) | (t4 & 0x8);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 5 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x10)>>4;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2) | ((t4 & 0x10)>>1);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 6 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x20)>>5;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3) | ((t4 & 0x20)>>2);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 7 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x40)>>6;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) ;
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) | ((t4 & 0x40)>>3);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 8 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x80)>>7;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5) | ((t4 & 0x80)>>4);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- d+=84; // jump to byte directly below
- }
-
-
- /*write_command(0x20); // Horizontal DRAM Address
- write_data(0x10); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(xptr++);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;*/
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
- s=0;
-
- /** draw scanlines **/
- for (s=0;s<48;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
- /*write_command(0x20); // Horizontal DRAM Address
- write_data(0x10); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(xptr++);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;*/
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
- for (s=0;s<48;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
-
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
- #if POK_STRETCH
- //if (x>16 && x<68)
- if (x&2)// && x&2)
- {
- /*write_command(0x20); // Horizontal DRAM Address
- write_data(0x10); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(xptr++);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;*/
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
- for (s=0;s<48;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
-
- /** draw border **/
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR; CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
- }
- #endif
- }
- /** draw border **/
- for (int s=0;s<5*176;) {
- setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;s++;
- }
-}
-
-
-void Pokitto::lcdRefreshAB(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[64];
-uint8_t *d;
-//lcdClear();
-#if POK_STRETCH
-uint16_t xptr = 14;
-uint8_t yoffset = 24;
-#else
-xptr = 0; //was 26
-#endif
-
-for(x=0;x<128;x++)
- {
- write_command(0x20); // Horizontal DRAM Address
- write_data(yoffset); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(xptr++);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;
- //setDRAMptr(xptr++,yoffset);
-
- d = scrbuf + x;// point to beginning of line in data
-
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<8;y++)
- {
- uint8_t t = *d;
- #if POK_COLORDEPTH > 1
- uint8_t t2 = *(d+AB_JUMP);
- #endif // POK_COLORDEPTH
- #if POK_COLORDEPTH > 2
- uint8_t t3 = *(d+AB_JUMP+AB_JUMP);
- #endif // POK_COLORDEPTH
- #if POK_COLORDEPTH > 3
- uint8_t t4 = *(d+AB_JUMP+AB_JUMP+AB_JUMP);
- #endif // POK_COLORDEPTH
- uint8_t paletteindex = 0;
-
- /** bit 1 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x1);
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x1)) | ((t2 & 0x01)<<1);
- #elif POK_COLORDEPTH == 3
- paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2);
- #elif POK_COLORDEPTH == 4
- paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2) | ((t4 & 0x1)<<3);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 2 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x2)>>1;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x02));
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1) | ((t4 & 0x2)<<2);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 3 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x4)>>2;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 4)>>2) | ((t2 & 0x04)>>1);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4) | ((t4 & 0x4)<<1);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 4 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x8)>>3;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x08)>>2);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1) | (t4 & 0x8);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 5 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x10)>>4;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2) | ((t4 & 0x10)>>1);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 6 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x20)>>5;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3) | ((t4 & 0x20)>>2);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 7 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x40)>>6;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) ;
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) | ((t4 & 0x40)>>3);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- /** bit 8 **/
- #if POK_COLORDEPTH == 1
- paletteindex = (t & 0x80)>>7;
- #elif POK_COLORDEPTH == 2
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6);
- #elif POK_COLORDEPTH == 3
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5);
- #elif POK_COLORDEPTH == 4
- paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5) | ((t4 & 0x80)>>4);
- #endif
- scanline[s++] = paletteptr[paletteindex];
-
- d+=128; // jump to byte directly below
- }
-
- s=0;
-
- /** draw scanlines **/
- for (s=0;s<64;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
-
- #if POK_STRETCH
- if (x&1) {
- write_command(0x20); // Horizontal DRAM Address
- write_data(yoffset); // 0
- write_command(0x21); // Vertical DRAM Address
- write_data(xptr++);
- write_command(0x22); // write data to DRAM
- CLR_CS_SET_CD_RD_WR;
- //setDRAMptr(xptr++,yoffset);
-
- for (s=0;s<64;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
- }
- }
- #endif
- }
-}
-
-void Pokitto::lcdRefreshModeGBC(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y,xptr;
-uint16_t scanline[4][144]; // read 4 half-nibbles = 4 pixels at a time
-uint8_t *d, yoffset=0;
-
-xptr = 0;
-setDRAMptr(xptr,yoffset);
-
-
-for(x=0;x<160;x+=4)
- {
- d = scrbuf+(x>>2);// point to beginning of line in data
- /** find colours in one scanline **/
- uint8_t s=0;
- for(y=0;y<144;y++)
- {
- uint8_t tdata = *d;
- uint8_t t4 = tdata & 0x03; tdata >>= 2;// lowest half-nibble
- uint8_t t3 = tdata & 0x03; tdata >>= 2;// second lowest half-nibble
- uint8_t t2 = tdata & 0x03; tdata >>= 2;// second highest half-nibble
- uint8_t t = tdata & 0x03;// highest half-nibble
-
- /** put nibble values in the scanlines **/
-
- scanline[0][s] = paletteptr[t];
- scanline[1][s] = paletteptr[t2];
- scanline[2][s] = paletteptr[t3];
- scanline[3][s++] = paletteptr[t4];
-
- d+=160/4; // jump to read byte directly below in screenbuffer
- }
-
- s=0;
- /** draw scanlines **/
- for (s=0;s<144;) {
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
- }
- setDRAMptr(++xptr,yoffset);
- for (s=0;s<144;) {
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
- }
- setDRAMptr(++xptr,yoffset);
- for (s=0;s<144;) {
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
- }
- setDRAMptr(++xptr,yoffset);
- for (s=0;s<144;) {
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
- }
- setDRAMptr(++xptr,yoffset);
- }
-}
-
-
-void Pokitto::lcdRefreshT1(uint8_t* tilebuf, uint8_t* tilecolorbuf, uint8_t* tileset, uint16_t* paletteptr) {
-#ifdef POK_TILEMODE
-uint16_t x,y,data,xptr;
-uint16_t scanline[176];
-uint8_t yoffset=0, tilebyte, tileindex, tilex=0, tiley=0,xcount;
-
-
-if (!tileset) return;
-
-#if LCDWIDTH < POK_LCD_W
-xptr = (POK_LCD_W-LCDWIDTH)/2;
-#else
-xptr = 0;
-#endif
-#if LCDHEIGHT < POK_LCD_H
-yoffset = (POK_LCD_H-LCDHEIGHT)/2;
-#else
-yoffset = 0;
-#endif
-
-for(x=0, xcount=0 ;x<LCDWIDTH;x++,xcount++) // loop through vertical columns
- {
- setDRAMptr(xptr++,yoffset); //point to VRAM
-
- /** find colours in one scanline **/
- uint8_t s=0, tiley=0;
- //tileindex = tilebuf[tilex*POK_TILES_Y];
- if (xcount==POK_TILE_W) {
- tilex++;
- xcount=0;
- }
-
- for(y=0;y<LCDHEIGHT;)
- {
- uint8_t tileval = tilebuf[tilex+tiley*POK_TILES_X]; //get tile number
- uint16_t index = tileval*POK_TILE_W+xcount;
- uint8_t tilebyte = tileset[index]; //get bitmap data
- for (uint8_t ycount=0, bitcount=0; ycount<POK_TILE_H; ycount++, y++, bitcount++) {
- if (bitcount==8) {
- bitcount=0;
- index += 176; //jump to byte below in the tileset bitmap
- tilebyte = tileset[index]; //get bitmap data
- }
- //tilebyte = tile[(tileindex>>4)+*POK_TILE_W]; //tilemaps are 16x16
- //uint8_t paletteindex = ((tilebyte>>(bitcount&0x7)) & 0x1);
- if (!tileval) scanline[s++] = COLOR_MAGENTA*((tilebyte>>bitcount)&0x1);//paletteptr[paletteindex];
- else scanline[s++] = paletteptr[((tilebyte>>bitcount)&0x1)*tileval];//paletteptr[paletteindex];
- }
- tiley++; //move to next tile
- }
- s=0;
-
- /** draw scanlines **/
- for (s=0;s<LCDHEIGHT;) {
- setup_data_16(scanline[s++]);CLR_WR;SET_WR;
- }
- }
- #endif
-}
-
-void Pokitto::blitWord(uint16_t c) {
- setup_data_16(c);CLR_WR;SET_WR;
-}
-
--- a/POKITTO_HW/HWLCD.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWLCD.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef __HWLCD_H__
-#define __HWLCD_H__
-
-#include "mbed.h"
-#include "gpio_api.h"
-#include "pinmap.h"
-
-#define write_command write_command_16
-#define write_data write_data_16
-
-namespace Pokitto {
-
-
-extern void initBacklight();
-extern void setBacklight(float);
-extern void lcdFillSurface(uint16_t);
-extern void lcdPixel(int16_t x, int16_t y, uint16_t c);
-extern void lcdRectangle(int16_t x, int16_t y,int16_t x2, int16_t y2, uint16_t color);
-extern void lcdInit();
-extern void lcdSleep();
-extern void lcdWakeUp();
-extern void lcdRefresh(uint8_t *, uint16_t*);
-extern void lcdRefreshAB(uint8_t *, uint16_t*);
-extern void lcdRefreshGB(uint8_t *, uint16_t*);
-extern void lcdRefreshMode1(uint8_t *, uint16_t*);
-extern void lcdRefreshMode2(uint8_t *, uint16_t*);
-extern void lcdRefreshMode3(uint8_t *, uint16_t*);
-extern void lcdRefreshModeGBC(uint8_t *, uint16_t*);
-/** Update LCD from 1-bit tile mode */
-extern void lcdRefreshT1(uint8_t*, uint8_t*, uint8_t*, uint16_t*);
-extern void lcdClear();
-extern void lcdFill(uint16_t);
-/** Blit one word of data*/
-extern void blitWord(uint16_t);
-
-/**************************************************************************/
-/** PINS AND PORTS **/
-/**************************************************************************/
-
-#if POK_BOARDREV == 1
-/** 2-layer board version 1.3 **/
- #define LCD_CD_PORT 0
- #define LCD_CD_PIN 2
- #define LCD_WR_PORT 1
- #define LCD_WR_PIN 23
- #define LCD_RD_PORT 1
- #define LCD_RD_PIN 24
- #define LCD_RES_PORT 1
- #define LCD_RES_PIN 28
-#else
-/** 4-layer board version 2.1 **/
- #define LCD_CD_PORT 0
- #define LCD_CD_PIN 2
- #define LCD_WR_PORT 1
- #define LCD_WR_PIN 12
- #define LCD_RD_PORT 1
- #define LCD_RD_PIN 24
- #define LCD_RES_PORT 1
- #define LCD_RES_PIN 0
-#endif
-
-/**************************************************************************/
-/** LCD CONTROL MACROS **/
-/**************************************************************************/
-
-#define CLR_RESET LPC_GPIO_PORT->CLR[LCD_RES_PORT] = 1 << LCD_RES_PIN; //RST = (0); // Clear pin
-#define SET_RESET LPC_GPIO_PORT->SET[LCD_RES_PORT] = 1 << LCD_RES_PIN; // RST = (1); // Set pin
-
-#define CLR_CD { LPC_GPIO_PORT->CLR[LCD_CD_PORT] = 1 << LCD_CD_PIN; } // RS = (0); // Clear pin
-#define SET_CD { LPC_GPIO_PORT->SET[LCD_CD_PORT] = 1 << LCD_CD_PIN; }// RS = (1); // Set pin
-
-#define CLR_WR { LPC_GPIO_PORT->CLR[LCD_WR_PORT] = 1 << LCD_WR_PIN; __asm("nop");__asm("nop");}//WR = (0); // Clear pin
-#define SET_WR LPC_GPIO_PORT->SET[LCD_WR_PORT] = 1 << LCD_WR_PIN; //WR = (1); // Set pin
-
-#define CLR_RD LPC_GPIO_PORT->CLR[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (0); // Clear pin
-#define SET_RD LPC_GPIO_PORT->SET[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (1); // Set pin
-
-#define SET_CS //CS tied to ground
-#define CLR_CS
-
-#define CLR_CS_CD_SET_RD_WR {CLR_CD; SET_RD; SET_WR;}
-#define CLR_CS_SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_WR_CS SET_WR;
-
-#define SET_MASK_P2 LPC_GPIO_PORT->MASK[2] = ~(0x7FFF8); //mask P2_3 ...P2_18
-#define CLR_MASK_P2 LPC_GPIO_PORT->MASK[2] = 0; // all on
-
-
-
-/**************************************************************************/
-/** SETUP GPIO & DATA **/
-/**************************************************************************/
-
-static void setup_gpio()
-{
- /** control lines **/
- LPC_GPIO_PORT->DIR[LCD_CD_PORT] |= (1 << LCD_CD_PIN );
- LPC_GPIO_PORT->DIR[LCD_WR_PORT] |= (1 << LCD_WR_PIN );
- LPC_GPIO_PORT->DIR[LCD_RD_PORT] |= (1 << LCD_RD_PIN );
- LPC_GPIO_PORT->DIR[LCD_RES_PORT] |= (1 << LCD_RES_PIN );
- /** data lines **/
- LPC_GPIO_PORT->DIR[2] |= (0xFFFF << 3); // P2_3...P2_18 as output
-
- pin_mode(P2_3,PullNone); // turn off pull-up
- pin_mode(P2_4,PullNone); // turn off pull-up
- pin_mode(P2_5,PullNone); // turn off pull-up
- pin_mode(P2_6,PullNone); // turn off pull-up
-
- pin_mode(P2_7,PullNone); // turn off pull-up
- pin_mode(P2_8,PullNone); // turn off pull-up
- pin_mode(P2_9,PullNone); // turn off pull-up
- pin_mode(P2_10,PullNone); // turn off pull-up
-
- pin_mode(P2_11,PullNone); // turn off pull-up
- pin_mode(P2_12,PullNone); // turn off pull-up
- pin_mode(P2_13,PullNone); // turn off pull-up
- pin_mode(P2_14,PullNone); // turn off pull-up
-
- pin_mode(P2_15,PullNone); // turn off pull-up
- pin_mode(P2_16,PullNone); // turn off pull-up
- pin_mode(P2_17,PullNone); // turn off pull-up
- pin_mode(P2_18,PullNone); // turn off pull-up
-}
-
-
-
-
-#define HI_BYTE(d) (LPC_GPIO->MPIN[1]= (d<<13)) //((d>>8)<<21))
-#define LO_BYTE(d) (LPC_GPIO->MPIN[1]= (d<<21)) //because of mask makes no difference
-
-// Macros to set data bus direction to input/output
-#define LCD_GPIO2DATA_SETINPUT GPIO_GPIO2DIR &= ~LCD_DATA_MASK
-#define LCD_GPIO2DATA_SETOUTPUT GPIO_GPIO2DIR |= LCD_DATA_MASK
-
-
-// Basic Color definitions
-#define COLOR_BLACK (uint16_t)(0x0000)
-#define COLOR_BLUE (uint16_t)(0x001F)
-#define COLOR_RED (uint16_t)(0xF800)
-#define COLOR_GREEN (uint16_t)(0x07E0)
-#define COLOR_CYAN (uint16_t)(0x07FF)
-#define COLOR_MAGENTA (uint16_t)(0xF81F)
-#define COLOR_YELLOW (uint16_t)(0xFFE0)
-#define COLOR_WHITE (uint16_t)(0xFFFF)
-
-// Grayscale Values
-#define COLOR_GRAY_15 (uint16_t)(0x0861) // 15 15 15
-#define COLOR_GRAY_30 (uint16_t)(0x18E3) // 30 30 30
-#define COLOR_GRAY_50 (uint16_t)(0x3186) // 50 50 50
-#define COLOR_GRAY_80 (uint16_t)(0x528A) // 80 80 80
-#define COLOR_GRAY_128 (uint16_t)(0x8410) // 128 128 128
-#define COLOR_GRAY_200 (uint16_t)(0xCE59) // 200 200 200
-#define COLOR_GRAY_225 (uint16_t)(0xE71C) // 225 225 225
-
-
-} // namespace pokitto
-#endif // __HWLCD_H_
-
--- a/POKITTO_HW/HWSound.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,372 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWSound.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "mbed.h"
-#include "HWSound.h"
-//#include "MCP4018.h"
-#include "SoftwareI2C.h"
-#include "Pokitto_settings.h"
-#include "PokittoDisk.h"
-#include "PokittoGlobs.h"
-#include "Synth.h"
-
-
-
-using namespace Pokitto;
-
-/** Sound Variables **/
-#if (POK_STREAMING_MUSIC > 0)
- unsigned char buffers[4][BUFFER_SIZE];
- volatile int currentBuffer = 0, oldBuffer = 0;
- volatile int bufindex = 0, vol=1;
- volatile unsigned char * currentPtr;
- volatile unsigned char * endPtr;
- int8_t streamvol=3;
- uint32_t streamcounter=0;
- uint8_t streamstep=0;
-#endif
-
-#if POK_ENABLE_SOUND > 0
- pwmout_t Pokitto::audiopwm; // this way (instead of PwmOut class) pwm doesn't start screaming until it is initialized !
- Ticker Pokitto::audio;
-
-using namespace Pokitto;
-
-/** stream output and status */
-uint8_t Pokitto::streambyte,Pokitto::streamon;
-
-uint8_t soundbuf[256], soundbufindex=0, Pokitto::HWvolume=0;
-bool volpotError=false; //test for broken MCP4018
-
-uint16_t soundbyte;
-
-
-#if POK_USE_DAC > 0
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- DigitalOut dac0(P1_6);
- DigitalOut dac1(P1_0);
- DigitalOut dac2(P1_16);
- DigitalOut dac3(P0_19);
- DigitalOut dac4(P0_17);
- DigitalOut dac5(P1_12);
- DigitalOut dac6(P1_15);
- DigitalOut dac7(P1_8);
-#else
- /** 4-layer board rev 2.1 **/
- DigitalOut dac0(P1_28);
- DigitalOut dac1(P1_29);
- DigitalOut dac2(P1_30);
- DigitalOut dac3(P1_31);
- /* has daniel made a mistake ?*/
- DigitalOut dac4(P2_20);
- DigitalOut dac5(P2_21);
- DigitalOut dac6(P2_22);
- DigitalOut dac7(P2_23);
-
- DigitalOut amp(P1_17);
-
-#endif // POK_BOARDREV
-#endif // POK_USE_DAC
-
-#if POK_BOARDREV == 2
-//MCP4018 volpot(P0_5,P0_4);
-
-void initHWvolumecontrol() {
- HWvolume=0;
- volpotError=true;
- //if (volpot.put(HWvolume)) volpotError=true; //try if MCP4018 answers
- setHWvolume(VOLUME_STARTUP);
-}
-
-int Pokitto::setHWvolume(uint8_t v) {
- HWvolume = 0x7F&v;
- //if (!volpotError) return volpot.put(HWvolume); //use normal I2C
- /* fallback method for broken MCP4018 */
- SoftwareI2C swvolpot(P0_4, P0_5); //swapped SDA,SCL
- swvolpot.write(0x5e,HWvolume);
- return HWvolume;
-}
-
-uint8_t Pokitto::getHWvolume() {
- return HWvolume;
-}
-
-void Pokitto::changeHWvolume(int8_t v) {
- int temp = HWvolume + v;
- if (temp < 0) temp = 0; //prevent volume "looparound" than can make a massive crack
- if (temp > 127) temp = 127;
- setHWvolume(temp);
-}
-
- uint8_t Pokitto::ampIsOn() {
- return amp;
- }
-
- void Pokitto::ampEnable(uint8_t v) {
- if (v>1) v=1; // limit against funny values
- amp=v;
- }
-#endif // POK_BOARDREV == 2
-
-void Pokitto::dac_write(uint8_t value) {
- #if POK_USE_DAC > 0
- #if POK_BOARDREV == 1 // was 1
- if (value & 1) SET_DAC0 else CLR_DAC0;
- value >>= 1;
- if (value & 1) SET_DAC1 else CLR_DAC1;
- value >>= 1;
- if (value & 1) SET_DAC2 else CLR_DAC2;
- value >>= 1;
- if (value & 1) SET_DAC3 else CLR_DAC3;
- value >>= 1;
- if (value & 1) SET_DAC4 else CLR_DAC4;
- value >>= 1;
- if (value & 1) SET_DAC5 else CLR_DAC5;
- value >>= 1;
- if (value & 1) SET_DAC6 else CLR_DAC6;
- value >>= 1;
- if (value & 1) SET_DAC7 else CLR_DAC7;
- #else
- //uint32_t val;
- //val = value<<28; //lower 4 bits go higher - because port mask is used, no AND is needed to clear bits
- //val += value<<(15-4); //higher 4 bits go lower. No need to shift by 15 because bits are in the higher nibble
- /* daniel has made a mistake with ports */
- //val = ((value&0x70)<<(28-4)); //higher 4 bits go higher - because port mask is used, no AND is needed to clear bits
- //val += value<<(15); //lower 4 bits go lower. No need to shift by 15 because bits are in the higher nibble
- //SET_MASK_DAC;
- //LPC_GPIO_PORT->MPIN[1] = val; // write bits to port
- //CLR_MASK_DAC;
- /* fixed here */
- /*val=value;
- SET_MASK_DAC_LO;
- LPC_GPIO_PORT->MPIN[1] = val<<28; // write lower 4 bits to port
- CLR_MASK_DAC_LO;
- SET_MASK_DAC_HI;
- LPC_GPIO_PORT->MPIN[2] = val<<(20-4); // write bits to port
- CLR_MASK_DAC_HI; */
- if (value & 1) SET_DAC0 else CLR_DAC0;
- value >>= 1;
- if (value & 1) SET_DAC1 else CLR_DAC1;
- value >>= 1;
- if (value & 1) SET_DAC2 else CLR_DAC2;
- value >>= 1;
- if (value & 1) SET_DAC3 else CLR_DAC3;
- value >>= 1;
- if (value & 1) SET_DAC4 else CLR_DAC4;
- value >>= 1;
- if (value & 1) SET_DAC5 else CLR_DAC5;
- value >>= 1;
- if (value & 1) SET_DAC6 else CLR_DAC6;
- value >>= 1;
- if (value & 1) SET_DAC7 else CLR_DAC7;
- //CLR_MASK_DAC;
- #endif // BOARDREV
- #endif
-}
-
-/** SOUND INIT **/
-void Pokitto::soundInit() {
-
- pwmout_init(&audiopwm,POK_AUD_PIN);
- pwmout_period_us(&audiopwm,POK_AUD_PWM_US); //was 31us
- pwmout_write(&audiopwm,0.1f);
-
- #if POK_GBSOUND > 0
- /** GAMEBUINO SOUND **/
- audio.attach_us(&audio_IRQ, 1000000/(POK_AUD_FREQ>>0));
- #else
- /** NOT GAMEBUINO SOUND **/
- audio.attach_us(&pokSoundIRQ, 1000000/(POK_AUD_FREQ>>0));
- #endif // POK_GAMEBUINO_SUPPORT
-
- //emptySong();
- //emptyOscillators();
- //emptyBlocks();
- //emptyPatches();
- #ifdef TEST_SOUND
- testOsc();
- #endif // TEST_SOUND
- #if POK_BOARDREV == 2
- initHWvolumecontrol();
- #endif
-
-}
-
-
-uint8_t Pokitto::streamPaused() {
- return !streamon;
-}
-
-void Pokitto::pauseStream() {
- streamon=0;
-}
-
-void Pokitto::playStream() {
- streamon=1;
-}
-
-
-void pokPauseStream() {
- streamon=0;
-}
-
-void pokPlayStream() {
- streamon=1;
-}
-
-void pokSoundIRQ() {
- uint8_t output=0;
- #ifndef POK_SIM
- //pwmout_t* obj = &audiopwm;
- #endif
- #if POK_STREAMING_MUSIC > 0
- #if POK_STREAMFREQ_HALVE
- streamstep = 1-streamstep;
- #else
- streamstep = 1;
- #endif // POK_STREAMFREQ_HALVE
- streamstep &= streamon; // streamon is used to toggle SD music streaming on and off
- if (streamstep) {
- output = (*currentPtr++);
- if(streamvol && streamon) {
- output >>= 3-streamvol;
- streambyte = output;
- } else {
- streambyte = 0; // duty cycle
- output = 0;
- }
- if (currentPtr >= endPtr)
- {
- currentBuffer++;
- if (currentBuffer==4) currentBuffer=0;
- currentPtr = buffers[currentBuffer];
- endPtr = currentPtr + BUFFER_SIZE;
- }
- }
- #endif // POK_STREAMING_MUSIC
-
- /** DO ADDITIONAL SOUND PROCESSING (NOT STREAM) OF SOUND HERE **/
-
- #if POK_ENABLE_SYNTH
- /** if song is being played from sd **/
- if (playing) {
- notetick++;
- updatePlaybackSD(playerpos&7);
- }
- /** oscillators update **/
- osc1.count += osc1.cinc + (osc1.pitchbend >> 4); // counts to 65535 and overflows to zero WAS 8 !
- osc2.count += osc2.cinc + (osc2.pitchbend >> 4); // counts to 65535 and overflows to zero
- osc3.count += osc3.cinc + (osc3.pitchbend >> 4); // counts to 65535 and overflows to zero
- Marr[tick](); // call mixing function
- --tick;
-
- /** mixing oscillator output **/
-
- uint16_t op = (uint16_t) ((osc1.output)*(osc1.vol>>8))>>9;// >> 2 osc1.vol Marr;
- op += (uint16_t) ((osc2.output)*(osc2.vol>>8))>>9;// >> 2 osc1.vol Marr;
- op += (uint16_t) ((osc3.output)*(osc3.vol>>8))>>9;// >> 2 osc1.vol Marr;
- output = (uint8_t) op;
-
- #endif // POK_ENABLE_SYNTH
-
- #ifndef POK_SIM
- /** HARDWARE **/
- #if POK_ENABLE_SOUND > 0
- #if POK_STREAMING_MUSIC > 0
- /** sound is enabled, streaming is enabled */
- #if POK_STREAM_TO_DAC > 0
- /** stream goes to DAC */
- #if POK_USE_DAC > 0
- if (streamstep) dac_write((uint8_t)streambyte); // duty cycle
- #endif // POK_USE_DAC
- #else
- /** stream goes to PWM */
- if (streamstep) {
- pwmout_write(&audiopwm,(float)streambyte/(float)255);
- //uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*streambyte)>>8); //cut out float
- //obj->pwm->MATCHREL1 = t_on;
- //dac_write((uint8_t)streambyte); // duty cycle
- }
- #endif // POK_STREAM_TO_DAC
- #endif // POK_STREAMING_MUSIC
- #if POK_STREAM_TO_DAC > 0
- /** synth goes to PWM */
- pwmout_write(&audiopwm,(float)output/(float)255);
- //uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*output)>>8); //cut out float
- //obj->pwm->MATCHREL1 = t_on;
- #else
- dac_write((uint8_t)output);
- #endif // decide where synth is output
- soundbyte = (output+streambyte)>>1;
- soundbuf[soundbufindex++]=soundbyte;
- #endif //POK_ENABLE_SOUND
- #endif // HARDWARE
-}
-
-
-void Pokitto::updateSDAudioStream() {
- if (streamPaused()) return;
-
- #if POK_STREAMING_MUSIC > 0
- if (oldBuffer != currentBuffer) {
- if (currentBuffer==0) fileReadBytes(&buffers[3][0],BUFFER_SIZE);
- else if (currentBuffer==1) fileReadBytes(&buffers[0][0],BUFFER_SIZE);
- else if (currentBuffer==2) fileReadBytes(&buffers[1][0],BUFFER_SIZE);
- else fileReadBytes(&buffers[2][0],BUFFER_SIZE);
- oldBuffer = currentBuffer;
- streamcounter += BUFFER_SIZE;
- } else return;
-
- #ifndef POK_SIM
- if ( streamcounter > fs.fsize - (BUFFER_SIZE*6)) {
- #else
- if ( streamcounter > getFileLength() - (BUFFER_SIZE*6)) {
- #endif
- streamcounter=0;
- #if POK_STREAM_LOOP
- fileRewind();
- #else
- pokPauseStream();
- #endif
- }
- #endif
-}
-
-
-#endif // POK_ENABLE_SOUND
-
-
--- a/POKITTO_HW/HWSound.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/**************************************************************************/
-/*!
- @file HWSOUND.h
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-#ifndef HWSOUND_H
-#define HWSOUND_H
-
-#include "mbed.h"
-#include "Pokitto_settings.h"
-
-#define SPEAKER 3
-#define BUFFER_SIZE 512*4 //*8 //*8 // 512 // was 512 (works really well with crabator) was 256
-
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- #define DAC0_PORT 1
- #define DAC0_PIN 6
- #define DAC1_PORT 1
- #define DAC1_PIN 0
- #define DAC2_PORT 1
- #define DAC2_PIN 16
- #define DAC3_PORT 0
- #define DAC3_PIN 19
- #define DAC4_PORT 0
- #define DAC4_PIN 17
- #define DAC5_PORT 1
- #define DAC5_PIN 12
- #define DAC6_PORT 1
- #define DAC6_PIN 15
- #define DAC7_PORT 1
- #define DAC7_PIN 8
-#else
- /** 4-layer board rev 2.1 **/
- #define DAC0_PORT 1
- #define DAC0_PIN 28
- #define DAC1_PORT 1
- #define DAC1_PIN 29
- #define DAC2_PORT 1
- #define DAC2_PIN 30
- #define DAC3_PORT 1
- #define DAC3_PIN 31
-/** has daniel made a mistake with dac ? **/
- #define DAC4_PORT 2
- #define DAC4_PIN 20
- #define DAC5_PORT 2
- #define DAC5_PIN 21
- #define DAC6_PORT 2
- #define DAC6_PIN 22
- #define DAC7_PORT 2
- #define DAC7_PIN 23
-
- /** MASK FOR FASTER DAC **/
- #define SET_MASK_DAC LPC_GPIO_PORT->MASK[1] = ~(0xF0078000); //mask P1_15...P1_18 and P1_28...P1_31
- #define CLR_MASK_DAC LPC_GPIO_PORT->MASK[1] = 0; // all on
-
- /* fixing wrong pins from daniel*/
- #define SET_MASK_DAC_LO LPC_GPIO_PORT->MASK[1] = ~(0xF0000000); //mask P1_28...P1_31
- #define CLR_MASK_DAC_LO LPC_GPIO_PORT->MASK[1] = 0; // all on
- #define SET_MASK_DAC_HI LPC_GPIO_PORT->MASK[2] = ~(0xF00000); //mask P2_20...P2_23
- #define CLR_MASK_DAC_HI LPC_GPIO_PORT->MASK[2] = 0; // all on
-
-#endif
-
-#define CLR_DAC0 LPC_GPIO_PORT->CLR[DAC0_PORT] = 1UL << DAC0_PIN;
-#define SET_DAC0 LPC_GPIO_PORT->SET[DAC0_PORT] = 1UL << DAC0_PIN;
-#define CLR_DAC1 LPC_GPIO_PORT->CLR[DAC1_PORT] = 1UL << DAC1_PIN;
-#define SET_DAC1 LPC_GPIO_PORT->SET[DAC1_PORT] = 1UL << DAC1_PIN;
-#define CLR_DAC2 LPC_GPIO_PORT->CLR[DAC2_PORT] = 1UL << DAC2_PIN;
-#define SET_DAC2 LPC_GPIO_PORT->SET[DAC2_PORT] = 1UL << DAC2_PIN;
-#define CLR_DAC3 LPC_GPIO_PORT->CLR[DAC3_PORT] = 1UL << DAC3_PIN;
-#define SET_DAC3 LPC_GPIO_PORT->SET[DAC3_PORT] = 1UL << DAC3_PIN;
-#define CLR_DAC4 LPC_GPIO_PORT->CLR[DAC4_PORT] = 1UL << DAC4_PIN;
-#define SET_DAC4 LPC_GPIO_PORT->SET[DAC4_PORT] = 1UL << DAC4_PIN;
-#define CLR_DAC5 LPC_GPIO_PORT->CLR[DAC5_PORT] = 1UL << DAC5_PIN;
-#define SET_DAC5 LPC_GPIO_PORT->SET[DAC5_PORT] = 1UL << DAC5_PIN;
-#define CLR_DAC6 LPC_GPIO_PORT->CLR[DAC6_PORT] = 1UL << DAC6_PIN;
-#define SET_DAC6 LPC_GPIO_PORT->SET[DAC6_PORT] = 1UL << DAC6_PIN;
-#define CLR_DAC7 LPC_GPIO_PORT->CLR[DAC7_PORT] = 1UL << DAC7_PIN;
-#define SET_DAC7 LPC_GPIO_PORT->SET[DAC7_PORT] = 1UL << DAC7_PIN;
-
-/** the output holder **/
-extern uint16_t soundbyte;
-
-namespace Pokitto {
-
-
-/** stream output and status */
-extern uint8_t streambyte, streamon, HWvolume;
-
-extern float pwm2; //virtual pwm output
-
-extern void soundInit();
-extern void dac_write(uint8_t value);
-extern uint8_t ampIsOn();
-extern void ampEnable(uint8_t v);
-extern void audio_IRQ();
-extern void updateSDAudioStream();
-extern uint8_t streamPaused();
-extern void pauseStream();
-extern void playStream();
-extern int setHWvolume(uint8_t);
-extern uint8_t getHWvolume();
-extern void changeHWvolume(int8_t);
-
-extern pwmout_t audiopwm;
-extern uint8_t pokAmpIsOn();
-extern void pokAmpEnable(uint8_t);
-
-extern Ticker audio;
-
-extern void update_SDAudioStream();
-}
-
-
-extern void pokSoundIRQ();
-
-#if POK_STREAMING_MUSIC > 0
- extern unsigned char buffers[][BUFFER_SIZE];
- extern volatile int currentBuffer, oldBuffer;
- extern volatile int bufindex, vol;
- extern volatile unsigned char * currentPtr;
- extern volatile unsigned char * endPtr;
- extern int8_t streamvol;
- extern uint32_t streamcounter;
- extern uint8_t streamstep;
-#endif
-
-#endif //HWSOUND_H
-
-
--- a/POKITTO_HW/PokittoClock.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoClock.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2015, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-#include "pinmap.h"
-#include "HWLCD.h"
-#include "Pokitto_settings.h"
-#include "wait_api.h"
-
-uint32_t pt_count=0;
-uint32_t* ptimer;
-
-extern "C" {
-void SysTick_Handler(void) {
- //interrupt happens when systick has counted down to zero
- #if PROJ_GAMEBOY > 0
- uint32_t a;
- a = *ptimer;
- *ptimer = a + 1;
- #endif
- pt_count+=10; // increment counter
-}}
-
-using namespace Pokitto;
-
-uint32_t Core::refreshtime;
-
-void Core::initClock() {
- // to get 1000 interrupts per second the reload value should be 48000
- #if PROJ_GAMEBOY > 0
- ptimer = &pt_count;
- SysTick->LOAD = 480000-1;
- #else
- SysTick->LOAD = 480000-1;
- #endif
- SysTick->VAL = 0;
- SysTick->CTRL = 4 | 2 | 1; //CLKSOURCE=CPU clock | TICKINT | ENABLE
- pt_count = 0;
-}
-
-uint32_t Core::getTime() {
- return pt_count;
-}
-
-void Core::wait(uint16_t ms) {
- wait_ms(ms);
-}
-
--- a/POKITTO_HW/PokittoEEPROM.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- EEPROM.h - EEPROM library
- Original Copyright (c) 2006 David A. Mellis. All right reserved.
- New version by Christopher Andrews 2015.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef EEPROM_h
-#define EEPROM_h
-
-#include <stdint.h>
-#include "iap.h"
-
-/***
- EERef class.
-
- This object references an EEPROM cell.
- Its purpose is to mimic a typical byte of RAM, however its storage is the EEPROM.
- This class has an overhead of two bytes, similar to storing a pointer to an EEPROM cell.
-***/
-
-struct EERef{
-
- EERef( const int index )
- : index( index ) {}
-
- //Access/read members.
- uint8_t operator*() const { return eeprom_read_byte( (uint8_t*) index ); }
- operator uint8_t() const { return **this; }
-
- //Assignment/write members.
- EERef &operator=( const EERef &ref ) { return *this = *ref; }
- EERef &operator=( uint8_t in ) { return eeprom_write_byte( (uint8_t*) index, in ), *this; }
- EERef &operator +=( uint8_t in ) { return *this = **this + in; }
- EERef &operator -=( uint8_t in ) { return *this = **this - in; }
- EERef &operator *=( uint8_t in ) { return *this = **this * in; }
- EERef &operator /=( uint8_t in ) { return *this = **this / in; }
- EERef &operator ^=( uint8_t in ) { return *this = **this ^ in; }
- EERef &operator %=( uint8_t in ) { return *this = **this % in; }
- EERef &operator &=( uint8_t in ) { return *this = **this & in; }
- EERef &operator |=( uint8_t in ) { return *this = **this | in; }
- EERef &operator <<=( uint8_t in ) { return *this = **this << in; }
- EERef &operator >>=( uint8_t in ) { return *this = **this >> in; }
-
- EERef &update( uint8_t in ) { return in != *this ? *this = in : *this; }
-
- /** Prefix increment/decrement **/
- EERef& operator++() { return *this += 1; }
- EERef& operator--() { return *this -= 1; }
-
- /** Postfix increment/decrement **/
- uint8_t operator++ (int){
- uint8_t ret = **this;
- return ++(*this), ret;
- }
-
- uint8_t operator-- (int){
- uint8_t ret = **this;
- return --(*this), ret;
- }
-
- int index; //Index of current EEPROM cell.
-};
-
-/***
- EEPtr class.
-
- This object is a bidirectional pointer to EEPROM cells represented by EERef objects.
- Just like a normal pointer type, this can be dereferenced and repositioned using
- increment/decrement operators.
-***/
-
-struct EEPtr{
-
- EEPtr( const int index )
- : index( index ) {}
-
- operator int() const { return index; }
- EEPtr &operator=( int in ) { return index = in, *this; }
-
- //Iterator functionality.
- bool operator!=( const EEPtr &ptr ) { return index != ptr.index; }
- EERef operator*() { return index; }
-
- /** Prefix & Postfix increment/decrement **/
- EEPtr& operator++() { return ++index, *this; }
- EEPtr& operator--() { return --index, *this; }
- EEPtr operator++ (int) { return index++; }
- EEPtr operator-- (int) { return index--; }
-
- int index; //Index of current EEPROM cell.
-};
-
-/***
- EEPROMClass class.
-
- This object represents the entire EEPROM space.
- It wraps the functionality of EEPtr and EERef into a basic interface.
- This class is also 100% backwards compatible with earlier Arduino core releases.
-***/
-
-struct EEPROMClass{
-
- //Basic user access methods.
- EERef operator[]( const int idx ) { return idx; }
- uint8_t read( int idx ) { return EERef( idx ); }
- void write( int idx, uint8_t val ) { (EERef( idx )) = val; }
- void update( int idx, uint8_t val ) { EERef( idx ).update( val ); }
-
- //STL and C++11 iteration capability.
- EEPtr begin() { return 0x00; }
- EEPtr end() { return length(); } //Standards requires this to be the item after the last valid entry. The returned pointer is invalid.
- uint16_t length() { return 0x1000; } // length for pokitto is 4kB
-
- //Functionality to 'get' and 'put' objects to and from EEPROM.
- template< typename T > T &get( int idx, T &t ){
- EEPtr e = idx;
- uint8_t *ptr = (uint8_t*) &t;
- for( int count = sizeof(T) ; count ; --count, ++e ) *ptr++ = *e;
- return t;
- }
-
- template< typename T > const T &put( int idx, const T &t ){
- EEPtr e = idx;
- const uint8_t *ptr = (const uint8_t*) &t;
- for( int count = sizeof(T) ; count ; --count, ++e ) (*e).update( *ptr++ );
- return t;
- }
-};
-
-static EEPROMClass EEPROM;
-#endif
-
--- a/POKITTO_HW/PokittoHW.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/**************************************************************************/
-/*!
- @file PokittoHW.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2015, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-#include "pinmap.h"
-#include "HWLCD.h"
-
-
-using namespace Pokitto;
-
-
-void Core::quit() {
- run_state = false;
-}
-
-void Core::initRandom() {
- //TODO: hook random seed to battery level
-}
-
-void Core::initGPIO() {
- /** control lines **/
- LPC_GPIO_PORT->DIR[LCD_CD_PORT] |= (1 << LCD_CD_PIN );
- LPC_GPIO_PORT->DIR[LCD_WR_PORT] |= (1 << LCD_WR_PIN );
- LPC_GPIO_PORT->DIR[LCD_RD_PORT] |= (1 << LCD_RD_PIN );
- LPC_GPIO_PORT->DIR[LCD_RES_PORT] |= (1 << LCD_RES_PIN );
- /** data lines **/
- LPC_GPIO_PORT->DIR[2] |= (0xFFFF << 3); // P2_3...P2_18 as output
-
- pin_mode(P2_3,PullNone); // turn off pull-up
- pin_mode(P2_4,PullNone); // turn off pull-up
- pin_mode(P2_5,PullNone); // turn off pull-up
- pin_mode(P2_6,PullNone); // turn off pull-up
-
- pin_mode(P2_7,PullNone); // turn off pull-up
- pin_mode(P2_8,PullNone); // turn off pull-up
- pin_mode(P2_9,PullNone); // turn off pull-up
- pin_mode(P2_10,PullNone); // turn off pull-up
-
- pin_mode(P2_11,PullNone); // turn off pull-up
- pin_mode(P2_12,PullNone); // turn off pull-up
- pin_mode(P2_13,PullNone); // turn off pull-up
- pin_mode(P2_14,PullNone); // turn off pull-up
-
- pin_mode(P2_15,PullNone); // turn off pull-up
- pin_mode(P2_16,PullNone); // turn off pull-up
- pin_mode(P2_17,PullNone); // turn off pull-up
- pin_mode(P2_18,PullNone); // turn off pull-up
-}
-
-
-
-
-
--- a/POKITTO_HW/Pokitto_extport.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/**************************************************************************/
-/*!
- @file Pokitto_extport.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#include "Pokitto.h"
-
-using namespace mbed; //needed for interruptin
-
-#if POK_USE_EXT > 0
-//#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
-//#else
- /** 4-layer board rev 2.1 **/
- //InterruptIn ext0(P1_19);
- AnalogIn ext0(P1_19);
- DigitalIn ext1(P0_11, PullUp);
- //DigitalOut ext0(P1_19);
- //DigitalOut ext1(P0_11);
- DigitalOut ext2(P0_12);
- DigitalOut ext3(P0_13);
- DigitalOut ext4(P0_14);
- DigitalOut ext5(P0_17);
- DigitalOut ext6(P0_18);
- DigitalOut ext7(P0_19);
- DigitalOut ext8(P1_20);
- DigitalOut ext9(P1_21);
- DigitalOut ext10(P1_22);
- DigitalOut ext11(P1_23);
- DigitalOut ext12(P1_5);
- DigitalOut ext13(P1_6);
- DigitalOut ext14(P1_8);
- DigitalOut ext15(P1_26);
- DigitalOut ext16(P1_27);
- DigitalOut ext17(P0_16);
-//#endif // POK_BOARDREV
-#endif // POK_USE_EXT
-
-
-
-void ext_write(uint32_t value) {
- #if POK_USE_EXT > 0
- if (value & 1) SET_EXT0 else CLR_EXT0;
- value >>= 1;
- if (value & 1) SET_EXT1 else CLR_EXT1;
- value >>= 1;
- if (value & 1) SET_EXT2 else CLR_EXT2;
- value >>= 1;
- if (value & 1) SET_EXT3 else CLR_EXT3;
- value >>= 1;
- if (value & 1) SET_EXT4 else CLR_EXT4;
- value >>= 1;
- if (value & 1) SET_EXT5 else CLR_EXT5;
- value >>= 1;
- if (value & 1) SET_EXT6 else CLR_EXT6;
- value >>= 1;
- if (value & 1) SET_EXT7 else CLR_EXT7;
- value >>= 1;
- if (value & 1) SET_EXT8 else CLR_EXT8;
- value >>= 1;
- if (value & 1) SET_EXT9 else CLR_EXT9;
- value >>= 1;
- if (value & 1) SET_EXT10 else CLR_EXT10;
- value >>= 1;
- if (value & 1) SET_EXT11 else CLR_EXT11;
- value >>= 1;
- if (value & 1) SET_EXT12 else CLR_EXT12;
- value >>= 1;
- if (value & 1) SET_EXT13 else CLR_EXT13;
- value >>= 1;
- if (value & 1) SET_EXT14 else CLR_EXT14;
- value >>= 1;
- if (value & 1) SET_EXT15 else CLR_EXT15;
- value >>= 1;
- if (value & 1) SET_EXT16 else CLR_EXT16;
- value >>= 1;
- if (value & 1) SET_EXT17 else CLR_EXT17;
- #endif
-}
-
--- a/POKITTO_HW/Pokitto_extport.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/**************************************************************************/
-/*!
- @file Pokitto_extport.h
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_EXTPORT_H
-#define POKITTO_EXTPORT_H
-
-#include "mbed.h"
-
-using namespace mbed; //interruptin
-
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- #define EXT0_PORT 1
- #define EXT0_PIN 19
- #define EXT1_PORT 0
- #define EXT1_PIN 11
- #define EXT2_PORT 0
- #define EXT2_PIN 12
- #define EXT3_PORT 0
- #define EXT3_PIN 13
- #define EXT4_PORT 0
- #define EXT4_PIN 14
- #define EXT5_PORT 0
- #define EXT5_PIN 17
- #define EXT6_PORT 0
- #define EXT6_PIN 18
- #define EXT7_PORT 0
- #define EXT7_PIN 19
- #define EXT8_PORT 1
- #define EXT8_PIN 20
- #define EXT9_PORT 1
- #define EXT9_PIN 21
- #define EXT10_PORT 1
- #define EXT10_PIN 22
- #define EXT11_PORT 1
- #define EXT11_PIN 23
- #define EXT12_PORT 1
- #define EXT12_PIN 5
- #define EXT13_PORT 1
- #define EXT13_PIN 6
- #define EXT14_PORT 1
- #define EXT14_PIN 8
- #define EXT15_PORT 0
- #define EXT15_PIN 19
- #define EXT16_PORT 0
- #define EXT16_PIN 13
- #define EXT17_PORT 0
- #define EXT17_PIN 16
-#else
- /** 4-layer board rev 2.1 **/
- #define EXT0_PORT 1
- #define EXT0_PIN 19
- #define EXT1_PORT 0
- #define EXT1_PIN 11
- #define EXT2_PORT 0
- #define EXT2_PIN 12
- #define EXT3_PORT 0
- #define EXT3_PIN 13
- #define EXT4_PORT 0
- #define EXT4_PIN 14
- #define EXT5_PORT 0
- #define EXT5_PIN 17
- #define EXT6_PORT 0
- #define EXT6_PIN 18
- #define EXT7_PORT 0
- #define EXT7_PIN 19
- #define EXT8_PORT 1
- #define EXT8_PIN 20
- #define EXT9_PORT 1
- #define EXT9_PIN 21
- #define EXT10_PORT 1
- #define EXT10_PIN 22
- #define EXT11_PORT 1
- #define EXT11_PIN 23
- #define EXT12_PORT 1
- #define EXT12_PIN 5
- #define EXT13_PORT 1
- #define EXT13_PIN 6
- #define EXT14_PORT 1
- #define EXT14_PIN 8
- #define EXT15_PORT 0
- #define EXT15_PIN 19
- #define EXT16_PORT 0
- #define EXT16_PIN 13
- #define EXT17_PORT 0
- #define EXT17_PIN 16
-
- #define EXT0 P1_19
- #define EXT1 P0_11
- #define EXT2 P0_12
- #define EXT3 P0_13
- #define EXT4 P0_14
- #define EXT5 P0_17
- #define EXT6 P0_18
- #define EXT7 P0_19
- #define EXT8 P1_20
- #define EXT9 P1_21
- #define EXT10 P1_22
- #define EXT11 P1_23
- #define EXT12 P1_5
- #define EXT13 P1_6
- #define EXT14 P1_8
- #define EXT15 P1_26
- #define EXT16 P1_27
- #define EXT17 P0_16
-
-#endif // POK_BOARDREV
-
-#define CLR_EXT0 LPC_GPIO_PORT->CLR[EXT0_PORT] = 1 << EXT0_PIN;
-#define SET_EXT0 LPC_GPIO_PORT->SET[EXT0_PORT] = 1 << EXT0_PIN;
-#define CLR_EXT1 LPC_GPIO_PORT->CLR[EXT1_PORT] = 1 << EXT1_PIN;
-#define SET_EXT1 LPC_GPIO_PORT->SET[EXT1_PORT] = 1 << EXT1_PIN;
-#define CLR_EXT2 LPC_GPIO_PORT->CLR[EXT2_PORT] = 1 << EXT2_PIN;
-#define SET_EXT2 LPC_GPIO_PORT->SET[EXT2_PORT] = 1 << EXT2_PIN;
-#define CLR_EXT3 LPC_GPIO_PORT->CLR[EXT3_PORT] = 1 << EXT3_PIN;
-#define SET_EXT3 LPC_GPIO_PORT->SET[EXT3_PORT] = 1 << EXT3_PIN;
-#define CLR_EXT4 LPC_GPIO_PORT->CLR[EXT4_PORT] = 1 << EXT4_PIN;
-#define SET_EXT4 LPC_GPIO_PORT->SET[EXT4_PORT] = 1 << EXT4_PIN;
-#define CLR_EXT5 LPC_GPIO_PORT->CLR[EXT5_PORT] = 1 << EXT5_PIN;
-#define SET_EXT5 LPC_GPIO_PORT->SET[EXT5_PORT] = 1 << EXT5_PIN;
-#define CLR_EXT6 LPC_GPIO_PORT->CLR[EXT6_PORT] = 1 << EXT6_PIN;
-#define SET_EXT6 LPC_GPIO_PORT->SET[EXT6_PORT] = 1 << EXT6_PIN;
-#define CLR_EXT7 LPC_GPIO_PORT->CLR[EXT7_PORT] = 1 << EXT7_PIN;
-#define SET_EXT7 LPC_GPIO_PORT->SET[EXT7_PORT] = 1 << EXT7_PIN;
-#define CLR_EXT8 LPC_GPIO_PORT->CLR[EXT8_PORT] = 1 << EXT8_PIN;
-#define SET_EXT8 LPC_GPIO_PORT->SET[EXT8_PORT] = 1 << EXT8_PIN;
-#define CLR_EXT9 LPC_GPIO_PORT->CLR[EXT9_PORT] = 1 << EXT9_PIN;
-#define SET_EXT9 LPC_GPIO_PORT->SET[EXT9_PORT] = 1 << EXT9_PIN;
-#define CLR_EXT10 LPC_GPIO_PORT->CLR[EXT10_PORT] = 1 << EXT10_PIN;
-#define SET_EXT10 LPC_GPIO_PORT->SET[EXT10_PORT] = 1 << EXT10_PIN;
-#define CLR_EXT11 LPC_GPIO_PORT->CLR[EXT11_PORT] = 1 << EXT11_PIN;
-#define SET_EXT11 LPC_GPIO_PORT->SET[EXT11_PORT] = 1 << EXT11_PIN;
-#define CLR_EXT12 LPC_GPIO_PORT->CLR[EXT12_PORT] = 1 << EXT12_PIN;
-#define SET_EXT12 LPC_GPIO_PORT->SET[EXT12_PORT] = 1 << EXT12_PIN;
-#define CLR_EXT13 LPC_GPIO_PORT->CLR[EXT13_PORT] = 1 << EXT13_PIN;
-#define SET_EXT13 LPC_GPIO_PORT->SET[EXT13_PORT] = 1 << EXT13_PIN;
-#define CLR_EXT14 LPC_GPIO_PORT->CLR[EXT14_PORT] = 1 << EXT14_PIN;
-#define SET_EXT14 LPC_GPIO_PORT->SET[EXT14_PORT] = 1 << EXT14_PIN;
-#define CLR_EXT15 LPC_GPIO_PORT->CLR[EXT15_PORT] = 1 << EXT15_PIN;
-#define SET_EXT15 LPC_GPIO_PORT->SET[EXT15_PORT] = 1 << EXT15_PIN;
-#define CLR_EXT16 LPC_GPIO_PORT->CLR[EXT16_PORT] = 1 << EXT16_PIN;
-#define SET_EXT16 LPC_GPIO_PORT->SET[EXT16_PORT] = 1 << EXT16_PIN;
-#define CLR_EXT17 LPC_GPIO_PORT->CLR[EXT17_PORT] = 1 << EXT17_PIN;
-#define SET_EXT17 LPC_GPIO_PORT->SET[EXT17_PORT] = 1 << EXT17_PIN;
-
-#if POK_USE_EXT > 0
-//#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
-//#else
- /** 4-layer board rev 2.1 **/
- //extern InterruptIn ext0;
- extern AnalogIn ext0;
- extern DigitalIn ext1;
- //DigitalOut ext0;
- //DigitalOut ext1;
- extern DigitalOut ext2;
- extern DigitalOut ext3;
- extern DigitalOut ext4;
- extern DigitalOut ext5;
- extern DigitalOut ext6;
- extern DigitalOut ext7;
- extern DigitalOut ext8;
- extern DigitalOut ext9;
- extern DigitalOut ext10;
- extern DigitalOut ext11;
- extern DigitalOut ext12;
- extern DigitalOut ext13;
- extern DigitalOut ext14;
- extern DigitalOut ext15;
- extern DigitalOut ext16;
- extern DigitalOut ext17;
-//#endif // POK_BOARDREV
-#endif // POK_USE_EXT
-
-extern int turn;
-#endif // POKITTO_EXTPORT_H
-
--- a/POKITTO_HW/SoftwareI2C.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/*
- * mbed Library to use a software master i2c interface on any GPIO pins
- * Copyright (c) 2012 Christopher Pepper
- * Released under the MIT License: http://mbed.org/license/mit
- */
-
-#include "SoftwareI2C.h"
-
-/**
- * @brief Initializes interface
- * @param sda GPIO pin to use as I2C SDA
- * @param scl GPIO pin to use as I2C SCL
- */
-
-SoftwareI2C::SoftwareI2C(PinName sda, PinName scl) : _sda(sda) , _scl(scl) {
- _scl.output();
- _scl.mode(OpenDrain);
- _sda.output();
- _sda.mode(OpenDrain);
-
- _device_address = 0;
- _frequency_delay = 1;
-
- initialise();
-}
-
-SoftwareI2C::~SoftwareI2C() {
-
-}
-
-/**
- * @brief Read 1 or more bytes from the I2C slave
- * @param device_address The address of the device to read from
- * @param data An allocated array to read the data into
- * @param data_bytes Number of bytes to read (must be equal to or less then the allocated memory in data)
- */
-void SoftwareI2C::read(uint8_t device_address, uint8_t* data, uint8_t data_bytes) {
- if (data == 0 || data_bytes == 0) return;
-
- device_address = device_address | 0x01;
- start();
- putByte(device_address);
- getAck();
- for (int x = 0; x < data_bytes; ++x) {
- data[x] = getByte();
- if ( x < (data_bytes -1)) { //ack all but the final byte
- giveAck();
- }
- }
- stop();
-}
-
-/**
- * @brief Write 1 or more bytes to the I2C slave
- * @param device_address The address of the device to write to
- * @param data An array to write the data from
- * @param data_bytes Number of bytes to write from array
- */
-void SoftwareI2C::write(uint8_t device_address, uint8_t* data, uint8_t data_bytes) {
- if (data == 0 || data_bytes == 0) return;
-
- device_address = device_address & 0xFE;
- start();
- putByte(device_address);
- getAck();
- for ( int x = 0; x < data_bytes; ++x ) {
- putByte(data[x]);
- getAck();
- }
- stop();
-}
-
-/**
- * @brief Write 1 byte to the I2C slave
- * @param device_address The address of the device to write to
- * @param byte The data to write
- */
-void SoftwareI2C::write(uint8_t device_address, uint8_t byte) {
- device_address = device_address & 0xFE;
- start();
- putByte(device_address);
- getAck();
- putByte(byte);
- getAck();
- stop();
-}
-
-/**
- * @brief Read 1 or more bytes from the I2C slave at the specified memory address
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @param data The allocated array to read into
- * @param data_bytes The number of bytes to read
- */
-void SoftwareI2C::randomRead(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes) {
- if (data == 0 || data_bytes == 0) return;
-
- device_address = device_address & 0xFE;
- start();
- putByte(device_address);
- if (!getAck()) {
- return;
- }
- putByte(start_address);
- if (!getAck()) {
- return;
- }
-
- device_address=device_address | 0x01;
- start();
- putByte(device_address);
- if (!getAck()) {
- return;
- }
- for ( int x = 0; x < data_bytes; ++x) {
- data[x] = getByte();
- if (x != (data_bytes - 1)) giveAck();
- }
- stop();
-}
-
-/**
- * @brief Write 1 byte to the I2C slave at the specified memory address
- * @param device_address The address of the device to write to
- * @param start_address The memory address to write to
- * @param byte The data to write
- */
-void SoftwareI2C::randomWrite(uint8_t device_address, uint8_t start_address, uint8_t byte) {
- device_address = device_address & 0xFE;
- start();
- putByte(device_address);
- getAck();
- putByte(start_address);
- getAck();
- putByte(byte);
- getAck();
- stop();
-}
-
-/**
- * @brief Write 1 or more bytes to the I2C slave at the specified memory address
- * @param device_address The address of the device to write to
- * @param start_address The memory address to write to
- * @param data The data to write
- * @param data_bytes The number of bytes to write
- */
-void SoftwareI2C::randomWrite(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes) {
- if (data == 0 || data_bytes == 0) return;
-
- device_address = device_address & 0xFE;
- start();
- putByte(device_address);
- getAck();
- putByte(start_address);
- getAck();
- for ( int x = 0; x <= data_bytes; ++x ) {
- putByte(data[x]);
- getAck();
- }
- stop();
-}
-
-/**
- * @brief Read 2 bytes from the I2C slave at the specified memory address and return them as an 16bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 16bit unsigned integer
- */
-uint16_t SoftwareI2C::read16(uint8_t device_address, uint8_t start_address) {
- uint8_t short_array[2] = {0, 0};
- randomRead(device_address, start_address, short_array, 2 );
- uint16_t value = 0;
- value = short_array[0] << 8;
- value |= short_array[1];
-
- return value;
-}
-
-/**
- * @brief Read 3 bytes from the I2C slave at the specified memory address and return them as an 32bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 32bit unsigned integer
- */
-uint32_t SoftwareI2C::read24(uint8_t device_address, uint8_t start_address) {
- uint8_t value_array[4] = {0, 0, 0};
- randomRead(device_address, start_address, value_array, 3 );
- uint32_t value = 0;
- value = value_array[0] << 16;
- value |= value_array[1] << 8;
- value |= value_array[2];
-
- return value;
-}
-
-/**
- * @brief Read 4 bytes from the I2C slave at the specified memory address and return them as an 32bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 32bit unsigned integer
- */
-uint32_t SoftwareI2C::read32(uint8_t device_address, uint8_t start_address) {
- uint8_t value_array[4] = {0, 0, 0, 0};
- randomRead(device_address, start_address, value_array, 4 );
- uint32_t value = 0;
- value = value_array[0] << 24;
- value |= value_array[1] << 16;
- value |= value_array[2] << 8;
- value |= value_array[3];
-
- return value;
-}
-
--- a/POKITTO_HW/SoftwareI2C.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * mbed Library to use a software master i2c interface on any GPIO pins
- * Copyright (c) 2012 Christopher Pepper
- * Released under the MIT License: http://mbed.org/license/mit
- */
-
-#ifndef _SOFTWARE_I2C_H_
-#define _SOFTWARE_I2C_H_
-
-#include "mbed.h"
-
-/**
- * @brief SoftwareI2C class
- */
-
-class SoftwareI2C {
-public:
- SoftwareI2C(PinName sda, PinName scl);
- ~SoftwareI2C();
-
- void read(uint8_t device_address, uint8_t* data, uint8_t data_bytes);
- void write(uint8_t device_address, uint8_t* data, uint8_t data_bytes);
- void write(uint8_t device_address, uint8_t byte);
- void randomRead(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes);
- void randomWrite(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes);
- void randomWrite(uint8_t device_address, uint8_t start_address, uint8_t byte);
-
- uint8_t read8(uint8_t device_address, uint8_t start_address);
- uint16_t read16(uint8_t device_address, uint8_t start_address);
- uint32_t read24(uint8_t device_address, uint8_t start_address);
- uint32_t read32(uint8_t device_address, uint8_t start_address);
-
- void setDeviceAddress(uint8_t address){
- _device_address = address;
- }
-
- void setFrequency(uint32_t frequency){
- _frequency_delay = 1000000 / frequency;
- }
-
- inline void initialise() {
- _scl.output();
- _sda.output();
-
- _sda = 1;
- _scl = 0;
- wait_us(_frequency_delay);
-
- for ( int n = 0; n <= 3; ++n ) {
- stop();
- }
- }
-
-private:
- inline void start() {
- _sda.output();
- wait_us(_frequency_delay);
- _scl = 1;
- _sda = 1;
- wait_us(_frequency_delay);
- _sda = 0;
- wait_us(_frequency_delay);
- _scl = 0;
- wait_us(_frequency_delay);
- }
-
- inline void stop() {
- _sda.output();
- wait_us(_frequency_delay);
- _sda = 0;
- wait_us(_frequency_delay);
- _scl = 1;
- wait_us(_frequency_delay);
- _sda = 1;
- }
-
- inline void putByte(uint8_t byte) {
- _sda.output();
- for ( int n = 8; n > 0; --n) {
- wait_us(_frequency_delay);
- _sda = byte & (1 << (n-1));
- _scl = 1;
- wait_us(_frequency_delay);
- _scl = 0;
- }
- _sda = 1;
- }
-
- inline uint8_t getByte() {
- uint8_t byte = 0;
-
- _sda.input(); //release the data line
- _sda.mode(OpenDrain);
-
- wait_us(_frequency_delay);
-
- for ( int n = 8; n > 0; --n ) {
- _scl=1; //set clock high
- wait_us(_frequency_delay);
- byte |= _sda << (n-1); //read the bit
- wait_us(_frequency_delay);
- _scl=0; //set clock low
- wait_us(_frequency_delay);
- }
-
- _sda.output(); //take data line back
-
- return byte;
- }
-
- inline void giveAck() {
- _sda.output();
- wait_us(_frequency_delay);
- _sda = 0;
- _scl = 1;
- wait_us(_frequency_delay);
- _scl = 0;
- _sda = 1;
-
- }
-
- inline bool getAck() {
- _sda.output();
- _sda = 1;
- _scl = 1;
- _sda.input();
- _sda.mode(OpenDrain);
- wait_us(_frequency_delay);
- _scl = 0;
-
- if(_sda != 0){return false;}
-
- wait_us(_frequency_delay);
- return true;
- }
-
- DigitalInOut _sda;
- DigitalInOut _scl;
-
- uint8_t _device_address;
- uint32_t _frequency_delay;
-};
-
-#endif
-
--- a/POKITTO_HW/iap.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,704 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <iap.h>
-#include "LPC11U6x.h"
-#include "PokittoDisk.h"
-
-#define TICKRATE_HZ (10) /* 10 ticks per second */
-/* SystemTick Counter */
-static volatile uint32_t sysTick;
-
-/* LPC1347 IAP entry address */
-#define IAP_LOCATION 0x1fff1ff1
-
-#define last_sector_flash 0x00038000 //0x0000F000
-#define IAP_LAST_SECTOR 28 /* Page number 896 - 1023, 0x00038000 - 0x0003FFFF */
-#define IAP_NUM_BYTES_TO_WRITE 256
-#define WRITECOUNT (IAP_NUM_BYTES_TO_WRITE / 4) /* when data array is in uint32_t */
-
-#define IAP_PREWRRITE_CMD 50 /* Prepare sector for write operation command */
-#define IAP_WRISECTOR_CMD 51
-#define IAP_ERSSECTOR_CMD 52
-#define IAP_REPID_CMD 54
-
-/* IAP command variables */
-static unsigned int command[5], result[4];
-
-/* IAP entry function */
-typedef int (*IAP)(unsigned int[], unsigned int[]);
-IAP iap_entry = (IAP) IAP_LOCATION;
-
-int CopyPageToFlash (uint32_t address, uint8_t* data) {
- IAP iap_call = (IAP) IAP_LOCATION;
- __disable_irq();
-
- unsigned int sector;
- bool firstpage=false;
-
- /* Calculate sector based on address */
- if (address < 0x18000) sector = address/0x1000; // sectors go in 4 k's
- else if (address >= 0x38000) sector = 28;
- else if (address >= 0x30000) sector = 27;
- else if (address >= 0x28000) sector = 26;
- else if (address >= 0x20000) sector = 25;
- else sector = 24;
-
- /* Check is it the first page in the sector */
- if (sector<24) {
- if (address == sector * 0x1000) firstpage = true;
- } else {
- if (address == (sector-24)*0x4000 + 0x18000) firstpage = true;
- }
-
- /* Prepare the sector for writing */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = sector; /* Start Sector Number */
- command[2] = sector; /* End Sector Number */
- iap_call(command, result);
- if (result[0]) return 1;
-
- /* do sector erase only when writing first page of given sector */
- if (firstpage) {
- /* Erase the last sector */
- command[0] = IAP_ERSSECTOR_CMD; /* Erase command code*/
- command[1] = sector; /* Start Sector Number */
- command[2] = sector; /* End Sector Number */
- command[3] = SystemCoreClock / 1000UL; /* Core clock frequency in kHz */
- iap_call(command, result);
- if (result[0]) return 1;
- /* Prepare to write/erase the last sector, needs to be done again because succesful erase re-locks sectors */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = sector; /* Start Sector Number */
- command[2] = sector; /* Start Sector Number */
- iap_call(command, result);
- if (result[0]) return 1;
- }
-
- /* Write data to the sectors */
- command[0] = IAP_WRISECTOR_CMD; /* Write command code */
- command[1] = (uint32_t) (uint32_t*) address; /* Destination Flash Address */
- command[2] = (uint32_t) data; /* Source RAM Address */
- command[3] = 0x100; /* Number of Bytes to be written */
- command[4] = SystemCoreClock / 1000; /* System clock frequency */
- iap_call(command, result);
- if (result[0]) return 1;
-
- /* Re-enable interrupt mode */
- __enable_irq();
-
- return 0; /*succesful write*/
-
-}
-
-__attribute__((section(".IAP_Code"))) int HelloFromIAP() {
- static uint32_t array_data[WRITECOUNT];
- int i;
- /* Initialize the array data to be written to FLASH */
- for (i = 0; i < WRITECOUNT; i++) {
- array_data[i] = 0xB007AB1E;
- }
-
- IAP iap_call = (IAP) IAP_LOCATION;
- uint8_t teahupoo;
- //readEEPROM(0,&teahupoo,1);
- teahupoo++;
- //writeEEPROM(0,&teahupoo,1);
-
- /** open file **/
- pokInitSD();
- char fn[20];
- char* now;
- now = (char*)last_sector_flash;
- switch (now[0]) {
-case 0xAA:
- fn[0]='B';fn[1]='B';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';break;
-case 0xBB:
- fn[0]='C';fn[1]='C';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';break;
-default:
- fn[0]='A';fn[1]='A';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';
- }
- if(fileOpen(fn,FILE_MODE_BINARY)) {
- return 1;
- } else {
- for (i = 0; i < WRITECOUNT; i++) {
- fileReadBytes((uint8_t*)&array_data[i],4);
- }
- }
-
-
- /** write sector in flash **/
- /* Read Part Identification Number*/
- command[0] = IAP_REPID_CMD; /* Read ID command code */
- iap_call(command, result);
-
- __disable_irq();
-
- /* Prepare to write/erase the last sector */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* End Sector Number */
- iap_call(command, result);
- /* Erase the last sector */
- command[0] = IAP_ERSSECTOR_CMD; /* Erase command code*/
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[3] = SystemCoreClock / 1000UL; /* Core clock frequency in kHz */
- iap_call(command, result);
- /* Prepare to write/erase the last sector */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* Start Sector Number */
- iap_call(command, result);
- /* Write to the last sector */
- command[0] = IAP_WRISECTOR_CMD; /* Write command code */
- command[1] = (uint32_t) last_sector_flash; /* Destination Flash Address */
- command[2] = (uint32_t) &array_data; /* Source RAM Address */
- command[3] = IAP_NUM_BYTES_TO_WRITE; /* Number of Bytes to be written */
- command[4] = SystemCoreClock / 1000; /* System clock frequency */
- iap_call(command, result);
-
- /* Re-enable interrupt mode */
- __enable_irq();
-
-
- SCB->AIRCR = 0x05FA0004; //issue system reset
- //while(1); //should never come here
- return 0;
-}
-
-
-
-
-void IAPstacksave()
-{
- /*need to save 32 top bytes of RAM to RAM1*/
- #define RAM1_0 (*((volatile unsigned long *) 0x20000000))
- #define RAM1_1 (*((volatile unsigned long *) 0x20000004))
- #define RAM1_2 (*((volatile unsigned long *) 0x20000008))
- #define RAM1_3 (*((volatile unsigned long *) 0x2000000C))
- #define RAM1_4 (*((volatile unsigned long *) 0x20000010))
- #define RAM1_5 (*((volatile unsigned long *) 0x20000014))
- #define RAM1_6 (*((volatile unsigned long *) 0x20000018))
- #define RAM1_7 (*((volatile unsigned long *) 0x2000001C))
-
- uint32_t *saveloc = (uint32_t*)(0x10002000-0x20); // RAM top - 32 bytes
- RAM1_0 = *saveloc++;
- RAM1_1 = *saveloc++;
- RAM1_2 = *saveloc++;
- RAM1_3 = *saveloc++;
- RAM1_4 = *saveloc++;
- RAM1_5 = *saveloc++;
- RAM1_6 = *saveloc++;
- RAM1_7 = *saveloc;
-}
-
-
-char iaptest() {
- static uint32_t array_data[WRITECOUNT];
- int i;
- /* Initialize the array data to be written to FLASH */
- for (i = 0; i < WRITECOUNT; i++) {
- array_data[i] = 0x11223340 + i;
- }
-
- /* Read Part Identification Number*/
- command[0] = IAP_REPID_CMD; /* Read ID command code */
- iap_entry(command, result);
-
- /* Reinvoke ISP mode so that reprogamming of Flash possible */
- __disable_irq();
-
- command[0] = IAP_REPID_CMD;
- iap_entry(command, result);
-
- /* Prepare to write/erase the last sector */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* End Sector Number */
- iap_entry(command, result);
-
- /* Erase the last sector */
- command[0] = IAP_ERSSECTOR_CMD; /* Erase command code*/
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* Start Sector Number */
- iap_entry(command, result);
-
- /* Prepare to write/erase the last sector */
- command[0] = IAP_PREWRRITE_CMD; /* Prepare to write/erase command code */
- command[1] = IAP_LAST_SECTOR; /* Start Sector Number */
- command[2] = IAP_LAST_SECTOR; /* Start Sector Number */
- iap_entry(command, result);
-
- /* Write to the last sector */
- command[0] = IAP_WRISECTOR_CMD; /* Write command code */
- command[1] = (uint32_t) last_sector_flash; /* Destination Flash Address */
- command[2] = (uint32_t) &array_data; /* Source RAM Address */
- command[3] = IAP_NUM_BYTES_TO_WRITE; /* Number of Bytes to be written */
- command[4] = SystemCoreClock / 1000; /* System clock frequency */
- iap_entry(command, result);
-
- /* Re-enable interrupt mode */
- __enable_irq();
-
- //while (1) {
- // __WFI();
- //}
-
- return 0;
-
-}
-
-
-//1) EEprom Write
-//
-//Command code: 61
-//Param0: eeprom address (byte, half-word or word aligned)
-//Param1: RAM address (byte, half-word or word aligned)
-//Param2: Number of bytes to be written ( Byte, Half-words write are ok)
-//Param3: System Clock Frequency (CCLK) in kHz
-//
-//Return Code CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
-__attribute__((section(".IAP_Code"))) void writeEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
- unsigned int command[5], result[4];
-
- command[0] = 61;
- command[1] = (uint32_t) eeAddress;
- command[2] = (uint32_t) buffAddress;
- command[3] = byteCount;
- command[4] = SystemCoreClock/1000;
-
- /* Invoke IAP call...*/
-#if (EEPROM_PROFILE!=0)
- LPC_CT32B0->TCR = 1;
- __disable_irq();
- iap_entry(command, result);
- __enable_irq();
- LPC_CT32B0->TCR = 0;
-#else
- __disable_irq();
- iap_entry(command, result);
- __enable_irq();
-#endif
- if (0 != result[0])
- {
- //Trap error
- while(1);
- }
- return;
-}
-
-//2) EEprom Read
-//Command code: 62
-//Param0: eeprom address (byte, half-word or word aligned)
-//Param1: RAM address (byte, half-word or word aligned)
-//Param2: Number of bytes to be read ( Byte, Half-words read are ok)
-//Param3: System Clock Frequency (CCLK) in kHz
-//
-//Return Code CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
-__attribute__((section(".IAP_Code"))) void readEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
- unsigned int command[5], result[4];
-
- command[0] = 62;
- command[1] = (uint32_t) eeAddress;
- command[2] = (uint32_t) buffAddress;
- command[3] = byteCount;
- command[4] = SystemCoreClock/1000;
-
- /* Invoke IAP call...*/
- __disable_irq();
- iap_entry( command, result);
- __enable_irq();
- if (0 != result[0])
- {
- //Trap error
- while(1);
- }
- return;
-}
-
-__attribute__((section(".IAP_Code"))) void IAPreadPartId( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
- unsigned int command[5], result[4];
-
- command[0] = 62;
- command[1] = (uint32_t) eeAddress;
- command[2] = (uint32_t) buffAddress;
- command[3] = byteCount;
- command[4] = SystemCoreClock/1000;
-
- /* Invoke IAP call...*/
- __disable_irq();
- iap_entry( command, result);
- __enable_irq();
- if (0 != result[0])
- {
- //Trap error
- while(1);
- }
- return;
-}
-
-uint8_t eeprom_read_byte(uint8_t* index) {
- uint8_t val;
- readEEPROM(index,&val,1);
- return val;
-}
-
-void eeprom_write_byte(uint8_t*index , uint8_t val) {
- writeEEPROM(index,&val,1);
-}
-
-/*****************************************************************************
- * $Id$
- *
- * Project: NXP LPC11U6x In Application Programming
- *
- * Description: Provides access to In-Application Programming (IAP) routines
- * contained within the bootROM sector of LPC11U6x devices.
- *
- * Copyright(C) 2010, NXP Semiconductor
- * All rights reserved.
- *
- *****************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * NXP Semiconductors assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. NXP Semiconductors
- * reserves the right to make changes in the software without
- * notification. NXP Semiconductors also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-
-/* IAP Command Definitions */
-#define IAP_CMD_PREPARE_SECTORS 50
-#define IAP_CMD_COPY_RAM_TO_FLASH 51
-#define IAP_CMD_ERASE_SECTORS 52
-#define IAP_CMD_BLANK_CHECK_SECTORS 53
-#define IAP_CMD_READ_PART_ID 54
-#define IAP_CMD_READ_BOOT_ROM_VERSION 55
-#define IAP_CMD_COMPARE 56
-#define IAP_CMD_REINVOKE_ISP 57
-#define IAP_CMD_READ_UID 58
-
-#define IAP_CMD_ERASE_PAGE 59 //new
-
-/* IAP boot ROM location and access function */
-#define IAP_ROM_LOCATION 0x1FFF1FF1UL
-//#define IAP_EXECUTE_CMD(a, b) ((void (*)())(IAP_ROM_LOCATION))(a, b)
-
-__attribute__((section(".IAP_Code"))) void IAP_EXECUTE_CMD(uint32_t* a, uint32_t* b) {
- void (*user_code_entry)(uint32_t*,uint32_t*);
- uint32_t *p;
- p = (uint32_t *)IAP_ROM_LOCATION;
- user_code_entry = (void (*)(uint32_t*,uint32_t*))(*p);
- user_code_entry(a, b);
-}
-
-
-/*****************************************************************************
-** Function name: u32IAP_PrepareSectors
-**
-** Description: Prepares sector(s) for erasing or write operations. This
-** command must be executed before executing the "Copy RAM to
-** Flash" or "Erase Sector(s)" commands.
-**
-** Parameters: u32StartSector - Number of first sector to prepare.
-** u32EndSector - Number of last sector to prepare.
-**
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector)
-{
- uint32_t u32Status;
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- if (u32EndSector < u32StartSector)
- {
- u32Status = IAP_STA_INVALD_PARAM;
- }
- else
- {
- au32Command[0] = IAP_CMD_PREPARE_SECTORS;
- au32Command[1] = u32StartSector;
- au32Command[2] = u32EndSector;
- __disable_irq();
- IAP_EXECUTE_CMD(au32Command, au32Result);
- __enable_irq();
- u32Status = au32Result[0];
- }
- return u32Status;
-}
-
-/*****************************************************************************
-** Function name: u32IAP_CopyRAMToFlash
-**
-** Description: Program the flash memory with data stored in RAM.
-**
-** Parameters: u32DstAddr - Destination Flash address, should be a 256
-** byte boundary.
-** u32SrcAddr - Source RAM address, should be a word boundary
-** u32Len - Number of 8-bit bytes to write, must be a
-** multiple of 256.
-*
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len)
-{
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_COPY_RAM_TO_FLASH;
- au32Command[1] = u32DstAddr;
- au32Command[2] = u32SrcAddr;
- au32Command[3] = u32Len;
- au32Command[4] = SystemCoreClock / 1000UL; /* Core clock frequency in kHz */
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
- return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name: u32IAP_EraseSectors
-**
-** Description: Erase a sector or multiple sectors of on-chip Flash memory.
-**
-** Parameters: u32StartSector - Number of first sector to erase.
-** u32EndSector - Number of last sector to erase.
-*
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector)
-{
- uint32_t u32Status;
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- if (u32EndSector < u32StartSector)
- {
- u32Status = IAP_STA_INVALD_PARAM;
- }
- else
- {
- au32Command[0] = IAP_CMD_ERASE_SECTORS;
- au32Command[1] = u32StartSector;
- au32Command[2] = u32EndSector;
- au32Command[3] = SystemCoreClock / 1000UL; /* Core clock frequency in kHz */
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
- u32Status = au32Result[0];
- }
- return u32Status;
-}
-
-/*****************************************************************************
-** Function name: u32IAP_BlankCheckSectors
-**
-** Description: Blank check a sector or multiple sectors of on-chip flash
-** memory.
-**
-** Parameters: u32StartSector - Number of first sector to check.
-** u32EndSector - Number of last sector to check.
-** pu32Result[0] - Offset of the first non blank word location
-** if the Status Code is IAP_STA_SECTOR_NOT_BLANK.
-** pu32Result[1] - Contents of non blank word location.
-**
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result)
-{
- uint32_t u32Status;
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- if (u32EndSector < u32StartSector)
- {
- u32Status = IAP_STA_INVALD_PARAM;
- }
- else
- {
- au32Command[0] = IAP_CMD_BLANK_CHECK_SECTORS;
- au32Command[1] = u32StartSector;
- au32Command[2] = u32EndSector;
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
- if (au32Result[0] == IAP_STA_SECTOR_NOT_BLANK)
- {
- *pu32Result = au32Result[0];
- *(pu32Result + 1) = au32Result[1];
- }
- u32Status = au32Result[0];
- }
- return u32Status;
-}
-
-/*****************************************************************************
-** Function name: u32IAP_ReadPartID
-**
-** Description: Read the part identification number.
-**
-** Parameters: pu32PartID - Pointer to storage for part ID number.
-*
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID)
-{
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_READ_PART_ID;
- __disable_irq();
- IAP_EXECUTE_CMD(au32Command, au32Result);
- __enable_irq();
- *pu32PartID = au32Result[1];
-
- return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name: u32IAP_ReadBootVersion
-**
-** Description: Read the boot code version number.
-**
-** Parameters: pu32Major - Major version number in ASCII format.
-** pu32Minor - Minor version number in ASCII format.
-**
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor)
-//uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major)
-{
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_READ_BOOT_ROM_VERSION;
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
-
- *pu32Major = (au32Result[1] & 0x0000FF00UL) >> 8;
- *pu32Minor = au32Result[1] & 0x000000FFUL;
-
- return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name: u32IAP_Compare
-**
-** Description: Compares the memory contents at two locations.
-**
-** Parameters: u32Len - Number of bytes to compare, must be a multiple of 4.
-** pu32Offset - Offset of the first mismatch if the Status Code is COMPARE_ERROR
-**
-** Returned value: Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset)
-{
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_COMPARE;
- au32Command[1] = u32DstAddr;
- au32Command[2] = u32SrcAddr;
- au32Command[3] = u32Len;
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
- if (au32Result[0] == IAP_STA_COMPARE_ERROR)
- {
- if (pu32Offset != 0)
- {
- *pu32Offset = au32Result[1];
- }
- }
- return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name: vIAP_ReinvokeISP
-**
-** Description: Invoke the bootloader in ISP mode.
-**
-** Parameters: None.
-*
-** Returned value: None.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) void vIAP_ReinvokeISP(void)
-{
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_REINVOKE_ISP;
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-}
-
-// read UID
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadUID(uint32_t * pu32UID)
-{
- uint32_t au32Result[5];
- uint32_t au32Command[5];
-
- au32Command[0] = IAP_CMD_READ_UID;
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-// *pu32UID++ = au32Result[1];
-// *pu32UID++ = au32Result[2];
-// *pu32UID++ = au32Result[3];
-// *pu32UID = au32Result[4];
-
- *pu32UID = au32Result[1];
- *pu32UID++ = au32Result[2];
- *pu32UID++ = au32Result[3];
- *pu32UID++ = au32Result[4];
-
- return au32Result[0];
-
-}
-
-//IAP erase Page 256B 64K have 0-255 pages, page0-15 in sector 0, 32K have 0-127 pages, 128k have 0-511 pages,
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage)
-{
- uint32_t u32Status;
- uint32_t au32Result[3];
- uint32_t au32Command[5];
-
- if (u32EndPage < u32StartPage)
- {
- u32Status = IAP_STA_INVALD_PARAM;
- }
- else
- {
- au32Command[0] = IAP_CMD_ERASE_PAGE;
- au32Command[1] = u32StartPage;
- au32Command[2] = u32EndPage;
- au32Command[3] = SystemCoreClock / 1000UL; /* Core clock frequency in kHz */
-
- IAP_EXECUTE_CMD(au32Command, au32Result);
-
- u32Status = au32Result[0];
- }
- return u32Status;
-}
-
-
-/*****************************************************************************
- ** End Of File
- *****************************************************************************/
-
--- a/POKITTO_HW/iap.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -#ifndef IAP_H_INCLUDED -#define IAP_H_INCLUDED - -extern int HelloFromIAP(); -extern int CopyPageToFlash(uint32_t,uint8_t*); -extern char iaptest(); -extern void IAPstacksave(); -#define EEPROM_PROFILE 1 -extern void writeEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount ); -extern void readEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount ); -extern uint8_t eeprom_read_byte(uint8_t*); -extern void eeprom_write_byte(uint8_t*,uint8_t); - -/***************************************************************************** - * $Id$ - * - * Project: NXP LPC1100 Secondary Bootloader Example - * - * Description: Provides access to In-Application Programming (IAP) routines - * contained within the bootROM sector of LPC1100 devices. - * - * Copyright(C) 2010, NXP Semiconductor - * All rights reserved. - * - ***************************************************************************** - * Software that is described herein is for illustrative purposes only - * which provides customers with programming information regarding the - * products. This software is supplied "AS IS" without any warranties. - * NXP Semiconductors assumes no responsibility or liability for the - * use of the software, conveys no license or title under any patent, - * copyright, or mask work right to the product. NXP Semiconductors - * reserves the right to make changes in the software without - * notification. NXP Semiconductors also make no representation or - * warranty that such application will be suitable for the specified - * use without further testing or modification. - *****************************************************************************/ - -#include <stdint.h> - -/* IAP Command Status Codes */ -#define IAP_STA_CMD_SUCCESS 0 -#define IAP_STA_INVALID_COMMAND 1 -#define IAP_STA_SRC_ADDR_ERROR 2 -#define IAP_STA_DST_ADDR_ERROR 3 -#define IAP_STA_SRC_ADDR_NOT_MAPPED 4 -#define IAP_STA_DST_ADDR_NOT_MAPPED 5 -#define IAP_STA_COUNT_ERROR 6 -#define IAP_STA_INVALID_SECTOR 7 -#define IAP_STA_SECTOR_NOT_BLANK 8 -#define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9 -#define IAP_STA_COMPARE_ERROR 10 -#define IAP_STA_BUSY 11 -#define IAP_STA_INVALD_PARAM 12 - -/* Define the flash page size, this is the minimum amount of data can be written in one operation */ -#define IAP_FLASH_PAGE_SIZE_BYTES 256 -#define IAP_FLASH_PAGE_SIZE_WORDS (IAP_FLASH_PAGE_SIZE_BYTES >> 2) - -void vIAP_ReinvokeISP(void); -uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID); -uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor); -//uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major); -uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector); -uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector); -uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len); -uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result); -uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset); -uint32_t u32IAP_ReadUID(uint32_t * pu32UID); -uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage); - -/***************************************************************************** -** End Of File -******************************************************************************/ - - - -#endif /* IAP_H_INCLUDED */ -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_HW/loader.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,2342 @@
+#ifndef MINIHI_BIN_H
+#define MINIHI_BIN_H
+
+
+static const unsigned char loaderh[] __attribute__((at(0x39000))) = {
+ 0xe0, 0x7f, 0x00, 0x10, 0xfd, 0x90, 0x03, 0x00, 0x4d, 0x9f, 0x03, 0x00,
+ 0x51, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x85, 0xb0, 0xf4, 0xef, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x9f, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x9f, 0x03, 0x00,
+ 0x5d, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00,
+ 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0xeb, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0x7c, 0x00, 0x00, 0x00,
+ 0x84, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0xeb, 0x03, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+ 0x7c, 0x01, 0x00, 0x10, 0x5c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+ 0x70, 0xb5, 0x1b, 0x4c, 0x1b, 0x4d, 0xac, 0x42, 0x0e, 0xd2, 0x20, 0x68,
+ 0x61, 0x68, 0x0c, 0x34, 0x23, 0x1f, 0x1a, 0x68, 0x00, 0x23, 0x00, 0x2a,
+ 0xf5, 0xd0, 0x1e, 0x58, 0x5e, 0x50, 0x04, 0x33, 0x9a, 0x42, 0xfa, 0xd8,
+ 0xac, 0x42, 0xf0, 0xd3, 0x13, 0x4a, 0x94, 0x42, 0x13, 0xd2, 0x23, 0x1c,
+ 0x08, 0x33, 0xd5, 0x1d, 0xed, 0x1a, 0xed, 0x08, 0xed, 0x00, 0x5d, 0x19,
+ 0x00, 0x21, 0x62, 0x68, 0x20, 0x68, 0x00, 0x23, 0x00, 0x2a, 0x03, 0xd0,
+ 0x19, 0x50, 0x04, 0x33, 0x9a, 0x42, 0xfb, 0xd8, 0x08, 0x34, 0xac, 0x42,
+ 0xf3, 0xd1, 0x00, 0xf0, 0x69, 0xfe, 0x08, 0x4b, 0x00, 0x2b, 0x02, 0xd0,
+ 0x00, 0xe0, 0x00, 0xbf, 0xfe, 0xe7, 0x02, 0xf0, 0xf7, 0xff, 0x00, 0xf0,
+ 0x87, 0xfd, 0xf9, 0xe7, 0xc0, 0x90, 0x03, 0x00, 0xe4, 0x90, 0x03, 0x00,
+ 0xfc, 0x90, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xb5, 0x06, 0x4c,
+ 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, 0x00, 0x2b, 0x02, 0xd0,
+ 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, 0x23, 0x70, 0x10, 0xbd,
+ 0x7c, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x84, 0xeb, 0x03, 0x00,
+ 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, 0x07, 0x48, 0x08, 0x49,
+ 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, 0x00, 0x2b, 0x03, 0xd0,
+ 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46,
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0xeb, 0x03, 0x00, 0x80, 0x01, 0x00, 0x10,
+ 0x7c, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c,
+ 0x01, 0x48, 0x00, 0xf0, 0xbd, 0xfd, 0x08, 0xbd, 0x24, 0x02, 0x00, 0x10,
+ 0x08, 0xb5, 0x03, 0x48, 0xff, 0x21, 0x00, 0xf0, 0xb5, 0xfd, 0xc0, 0xb2,
+ 0x08, 0xbd, 0xc0, 0x46, 0x24, 0x02, 0x00, 0x10, 0xf8, 0xb5, 0x43, 0xb2,
+ 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x07, 0xda, 0x77, 0x20, 0x00, 0x21,
+ 0xff, 0xf7, 0xf6, 0xff, 0x01, 0x28, 0x32, 0xd8, 0x7f, 0x23, 0x1c, 0x40,
+ 0xa0, 0x26, 0x88, 0x23, 0x9b, 0x01, 0x36, 0x06, 0x80, 0x27, 0xf7, 0x50,
+ 0xff, 0xf7, 0xe0, 0xff, 0x8a, 0x23, 0x9b, 0x01, 0xf7, 0x50, 0xff, 0xf7,
+ 0xdb, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0xd0, 0xff, 0x28, 0x0e, 0xff, 0xf7,
+ 0xcd, 0xff, 0x28, 0x0c, 0xc0, 0xb2, 0xff, 0xf7, 0xc9, 0xff, 0x28, 0x0a,
+ 0xc0, 0xb2, 0xff, 0xf7, 0xc5, 0xff, 0xe8, 0xb2, 0xff, 0xf7, 0xc2, 0xff,
+ 0x40, 0x2c, 0x04, 0xd0, 0x87, 0x20, 0x48, 0x2c, 0x02, 0xd0, 0x01, 0x20,
+ 0x00, 0xe0, 0x95, 0x20, 0xff, 0xf7, 0xb8, 0xff, 0x0a, 0x24, 0xff, 0xf7,
+ 0xbd, 0xff, 0x03, 0x06, 0x03, 0xd5, 0x01, 0x3c, 0xe4, 0xb2, 0x00, 0x2c,
+ 0xf7, 0xd1, 0xf8, 0xbd, 0x73, 0xb5, 0x88, 0x23, 0x40, 0x4d, 0xa0, 0x24,
+ 0x9b, 0x01, 0x80, 0x22, 0x24, 0x06, 0xe2, 0x50, 0x28, 0x1c, 0x3e, 0x49,
+ 0x00, 0xf0, 0x5a, 0xfd, 0x28, 0x1c, 0x08, 0x21, 0x00, 0x22, 0x00, 0xf0,
+ 0x49, 0xfd, 0x84, 0x23, 0x9b, 0x01, 0xe3, 0x58, 0x64, 0x25, 0x01, 0x3d,
+ 0xed, 0xb2, 0xff, 0xf7, 0x9d, 0xff, 0x00, 0x2d, 0xf9, 0xd1, 0x40, 0x20,
+ 0x29, 0x1c, 0xff, 0xf7, 0xa1, 0xff, 0x04, 0x1e, 0x01, 0x2c, 0x35, 0xd1,
+ 0xd5, 0x21, 0x48, 0x20, 0x49, 0x00, 0xff, 0xf7, 0x99, 0xff, 0x01, 0x28,
+ 0x15, 0xd1, 0xff, 0xf7, 0x8b, 0xff, 0x01, 0xae, 0xa8, 0x55, 0x01, 0x35,
+ 0x04, 0x2d, 0xf8, 0xd1, 0xb3, 0x78, 0x01, 0x2b, 0x24, 0xd1, 0xf3, 0x78,
+ 0xaa, 0x2b, 0x21, 0xd1, 0x28, 0x4c, 0x80, 0x21, 0xc9, 0x05, 0xe9, 0x20,
+ 0xff, 0xf7, 0x84, 0xff, 0x01, 0x1e, 0x3b, 0xd1, 0x1a, 0xe0, 0xe9, 0x20,
+ 0x29, 0x1c, 0xff, 0xf7, 0x7d, 0xff, 0x41, 0x26, 0x01, 0x28, 0x01, 0xd8,
+ 0x02, 0x24, 0xe9, 0x26, 0x20, 0x4d, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7,
+ 0x73, 0xff, 0x00, 0x28, 0x2f, 0xd1, 0x00, 0x2d, 0x06, 0xd0, 0x80, 0x21,
+ 0x50, 0x20, 0x89, 0x00, 0xff, 0xf7, 0x6a, 0xff, 0x00, 0x28, 0x13, 0xd0,
+ 0x00, 0x24, 0x11, 0xe0, 0x00, 0x2c, 0xfb, 0xd0, 0x7a, 0x20, 0xff, 0xf7,
+ 0x61, 0xff, 0x00, 0x28, 0xf6, 0xd1, 0x04, 0x1c, 0xff, 0xf7, 0x52, 0xff,
+ 0x30, 0x55, 0x01, 0x34, 0x04, 0x2c, 0xf9, 0xd1, 0x33, 0x78, 0x5a, 0x06,
+ 0x00, 0xd5, 0x0c, 0x24, 0x0f, 0x4b, 0xa0, 0x22, 0x1c, 0x70, 0x88, 0x23,
+ 0x80, 0x21, 0x9b, 0x01, 0x12, 0x06, 0xd1, 0x50, 0xff, 0xf7, 0x40, 0xff,
+ 0x60, 0x42, 0x60, 0x41, 0xc0, 0xb2, 0x76, 0xbd, 0x01, 0x3c, 0xa4, 0xb2,
+ 0x00, 0x2c, 0xd9, 0xd0, 0xb7, 0xe7, 0x01, 0x3d, 0xad, 0xb2, 0x00, 0x2d,
+ 0xd4, 0xd0, 0xc4, 0xe7, 0x24, 0x02, 0x00, 0x10, 0x80, 0x1a, 0x06, 0x00,
+ 0xe0, 0x2e, 0x00, 0x00, 0xa8, 0x61, 0x00, 0x00, 0x98, 0x01, 0x00, 0x10,
+ 0xf8, 0xb5, 0x1d, 0x1c, 0x23, 0x4b, 0x07, 0x1c, 0x1b, 0x78, 0x14, 0x1c,
+ 0x1a, 0x07, 0x00, 0xd4, 0x49, 0x02, 0x51, 0x20, 0xff, 0xf7, 0x26, 0xff,
+ 0x00, 0x28, 0x01, 0xd0, 0x01, 0x26, 0x2f, 0xe0, 0x1d, 0x4e, 0xff, 0xf7,
+ 0x15, 0xff, 0xff, 0x28, 0x04, 0xd1, 0x01, 0x3e, 0xb6, 0xb2, 0x00, 0x2e,
+ 0xf4, 0xd0, 0xf6, 0xe7, 0xfe, 0x28, 0xf1, 0xd1, 0x18, 0x4e, 0x76, 0x1b,
+ 0x36, 0x1b, 0xb6, 0xb2, 0x00, 0x2c, 0x02, 0xd1, 0x3c, 0x1e, 0x05, 0xd1,
+ 0x0e, 0xe0, 0x01, 0x3c, 0xff, 0xf7, 0x00, 0xff, 0xa4, 0xb2, 0xf5, 0xe7,
+ 0xff, 0xf7, 0xfc, 0xfe, 0x7a, 0x19, 0x20, 0x70, 0x01, 0x34, 0x92, 0xb2,
+ 0xa3, 0xb2, 0x9a, 0x42, 0xf6, 0xd1, 0x05, 0xe0, 0x01, 0x3d, 0xad, 0xb2,
+ 0xff, 0xf7, 0xf0, 0xfe, 0x00, 0x2d, 0xf9, 0xd1, 0x01, 0x3e, 0xb6, 0xb2,
+ 0xff, 0xf7, 0xea, 0xfe, 0x00, 0x2e, 0xf9, 0xd1, 0x88, 0x23, 0xa0, 0x22,
+ 0x80, 0x21, 0x9b, 0x01, 0x12, 0x06, 0xd1, 0x50, 0xff, 0xf7, 0xe0, 0xfe,
+ 0x30, 0x1c, 0xf8, 0xbd, 0x98, 0x01, 0x00, 0x10, 0x30, 0x75, 0x00, 0x00,
+ 0x02, 0x02, 0x00, 0x00, 0x06, 0x4b, 0x82, 0x1e, 0x1b, 0x68, 0x00, 0x20,
+ 0xd9, 0x68, 0x02, 0x39, 0x8a, 0x42, 0x03, 0xd2, 0x58, 0x78, 0x9b, 0x69,
+ 0x50, 0x43, 0xc0, 0x18, 0x70, 0x47, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10,
+ 0x0f, 0x4b, 0x10, 0xb5, 0x1a, 0x68, 0x00, 0x23, 0x03, 0x80, 0x83, 0x68,
+ 0x04, 0x1c, 0x01, 0x2b, 0x14, 0xd0, 0xd1, 0x68, 0x01, 0x20, 0x8b, 0x42,
+ 0x11, 0xd2, 0x00, 0x2b, 0x03, 0xd1, 0x11, 0x78, 0x03, 0x29, 0x00, 0xd1,
+ 0x53, 0x69, 0xe3, 0x60, 0x00, 0x2b, 0x03, 0xd0, 0x18, 0x1c, 0xff, 0xf7,
+ 0xd7, 0xff, 0x00, 0xe0, 0x50, 0x69, 0x20, 0x61, 0x00, 0x20, 0x00, 0xe0,
+ 0x18, 0x1c, 0x10, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x36, 0x4b,
+ 0x85, 0xb0, 0x04, 0x1c, 0x1d, 0x68, 0x01, 0x28, 0x63, 0xd9, 0xea, 0x68,
+ 0x90, 0x42, 0x60, 0xd2, 0x2e, 0x78, 0x02, 0x2e, 0x32, 0xd0, 0x03, 0x2e,
+ 0x41, 0xd0, 0x01, 0x2e, 0x59, 0xd1, 0x83, 0xb2, 0x5a, 0x08, 0xd3, 0x18,
+ 0x9b, 0xb2, 0xda, 0x05, 0x5b, 0x0a, 0x01, 0x93, 0x2b, 0x4b, 0xd2, 0x0d,
+ 0x03, 0xaf, 0x29, 0x69, 0x9a, 0x42, 0x04, 0xd0, 0x01, 0x9b, 0x38, 0x1c,
+ 0x59, 0x18, 0x02, 0x23, 0x0e, 0xe0, 0x01, 0x9b, 0x38, 0x1c, 0x59, 0x18,
+ 0x33, 0x1c, 0xff, 0xf7, 0x55, 0xff, 0x02, 0x1e, 0x3f, 0xd1, 0x29, 0x69,
+ 0x01, 0x9b, 0x01, 0x31, 0x68, 0x46, 0xc9, 0x18, 0x0d, 0x30, 0x33, 0x1c,
+ 0xff, 0xf7, 0x4a, 0xff, 0x00, 0x28, 0x34, 0xd1, 0x7b, 0x78, 0x38, 0x78,
+ 0x1b, 0x02, 0x03, 0x43, 0x18, 0x11, 0xe2, 0x07, 0x2e, 0xd4, 0x18, 0x05,
+ 0x00, 0x0d, 0x2b, 0xe0, 0x2b, 0x69, 0x01, 0x0a, 0xc4, 0xb2, 0x03, 0xaf,
+ 0xc9, 0x18, 0x62, 0x00, 0x38, 0x1c, 0x33, 0x1c, 0xff, 0xf7, 0x34, 0xff,
+ 0x00, 0x28, 0x1e, 0xd1, 0x78, 0x78, 0x3b, 0x78, 0x00, 0x02, 0x18, 0x43,
+ 0x1a, 0xe0, 0x2b, 0x69, 0x7f, 0x22, 0xc1, 0x09, 0x03, 0xae, 0x14, 0x40,
+ 0xc9, 0x18, 0xa2, 0x00, 0x30, 0x1c, 0x04, 0x23, 0xff, 0xf7, 0x22, 0xff,
+ 0x00, 0x28, 0x0c, 0xd1, 0xf0, 0x78, 0xb3, 0x78, 0x00, 0x06, 0x1b, 0x04,
+ 0x18, 0x43, 0x33, 0x78, 0x18, 0x43, 0x73, 0x78, 0x1b, 0x02, 0x18, 0x43,
+ 0x00, 0x01, 0x00, 0x09, 0x00, 0xe0, 0x01, 0x20, 0x05, 0xb0, 0xf0, 0xbd,
+ 0x9c, 0x01, 0x00, 0x10, 0xff, 0x01, 0x00, 0x00, 0x70, 0xb5, 0x05, 0x88,
+ 0x15, 0x4b, 0x01, 0x35, 0xad, 0xb2, 0x04, 0x1c, 0x1e, 0x68, 0x00, 0x2d,
+ 0x01, 0xd1, 0x03, 0x20, 0x21, 0xe0, 0x03, 0x69, 0x00, 0x2b, 0xfa, 0xd0,
+ 0x2a, 0x07, 0x18, 0xd1, 0x01, 0x33, 0x03, 0x61, 0xc0, 0x68, 0x00, 0x28,
+ 0x03, 0xd1, 0xb3, 0x88, 0xab, 0x42, 0xf0, 0xd9, 0x0f, 0xe0, 0x72, 0x78,
+ 0x2b, 0x09, 0x01, 0x3a, 0x1a, 0x42, 0x0a, 0xd1, 0xff, 0xf7, 0x6e, 0xff,
+ 0x01, 0x28, 0x09, 0xd9, 0xf3, 0x68, 0x98, 0x42, 0xe3, 0xd2, 0xe0, 0x60,
+ 0xff, 0xf7, 0x34, 0xff, 0x20, 0x61, 0x25, 0x80, 0x00, 0x20, 0x00, 0xe0,
+ 0x01, 0x20, 0x70, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0xf8, 0xb5, 0x04, 0x1c,
+ 0x0d, 0x1c, 0x2b, 0x78, 0x20, 0x2b, 0x01, 0xd1, 0x01, 0x35, 0xfa, 0xe7,
+ 0x2f, 0x3b, 0x5a, 0x42, 0x53, 0x41, 0x00, 0x26, 0xed, 0x18, 0xa6, 0x60,
+ 0x2b, 0x78, 0x20, 0x2b, 0x2b, 0xd8, 0x20, 0x1c, 0xff, 0xf7, 0x28, 0xff,
+ 0x3e, 0x4b, 0x1b, 0x68, 0x9b, 0x68, 0x1e, 0x70, 0x76, 0xe0, 0x33, 0x78,
+ 0x00, 0x2b, 0x65, 0xd0, 0xf2, 0x7a, 0x08, 0x23, 0x13, 0x40, 0x5a, 0xd1,
+ 0x62, 0x68, 0xf1, 0x5c, 0x01, 0x33, 0xd0, 0x18, 0x01, 0x38, 0x00, 0x78,
+ 0x88, 0x42, 0x52, 0xd1, 0x0b, 0x2b, 0xf6, 0xd1, 0xd3, 0x7a, 0x00, 0x2b,
+ 0x61, 0xd1, 0x3b, 0x68, 0x9b, 0x68, 0xda, 0x7a, 0xd1, 0x06, 0x5a, 0xd5,
+ 0x5a, 0x7d, 0x19, 0x7d, 0x12, 0x02, 0x0a, 0x43, 0xd9, 0x7e, 0x9b, 0x7e,
+ 0x09, 0x02, 0x12, 0x04, 0x0b, 0x43, 0x13, 0x43, 0xa3, 0x60, 0x60, 0x68,
+ 0x02, 0x1c, 0x03, 0x1c, 0x0b, 0x32, 0x93, 0x42, 0x03, 0xd0, 0x20, 0x21,
+ 0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x00, 0x22, 0x13, 0x1c, 0x08, 0x21,
+ 0x5e, 0x1c, 0xeb, 0x5c, 0xf6, 0xb2, 0x20, 0x2b, 0x10, 0xd9, 0x2f, 0x2b,
+ 0x0e, 0xd0, 0x2e, 0x2b, 0x34, 0xd0, 0x8a, 0x42, 0x0a, 0xd2, 0x1f, 0x1c,
+ 0x61, 0x3f, 0x19, 0x2f, 0x01, 0xd8, 0x20, 0x3b, 0xdb, 0xb2, 0x57, 0x1c,
+ 0x83, 0x54, 0xfa, 0xb2, 0x33, 0x1c, 0xe9, 0xe7, 0x00, 0x22, 0x20, 0x21,
+ 0x99, 0x42, 0x52, 0x41, 0xc2, 0x72, 0x20, 0x1c, 0xad, 0x19, 0xff, 0xf7,
+ 0xd3, 0xfe, 0x00, 0x28, 0x14, 0xd1, 0x13, 0x4f, 0x3b, 0x68, 0x9e, 0x68,
+ 0x22, 0x88, 0x0f, 0x23, 0x1a, 0x40, 0x52, 0x01, 0x30, 0x1c, 0x21, 0x69,
+ 0x20, 0x23, 0xff, 0xf7, 0x65, 0xfe, 0x00, 0x28, 0x9f, 0xd0, 0x01, 0x20,
+ 0x14, 0xe0, 0x20, 0x1c, 0xff, 0xf7, 0x52, 0xff, 0x00, 0x28, 0xed, 0xd0,
+ 0x03, 0x28, 0x0d, 0xd1, 0x63, 0x68, 0xd8, 0x7a, 0x43, 0x42, 0x58, 0x41,
+ 0x03, 0x30, 0x07, 0xe0, 0x08, 0x29, 0xd5, 0xd1, 0x0a, 0x1c, 0x0b, 0x21,
+ 0xd0, 0xe7, 0x04, 0x20, 0x00, 0xe0, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46,
+ 0x9c, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x1b, 0x4b, 0x01, 0x1c, 0x1d, 0x68,
+ 0x91, 0xb0, 0x06, 0x20, 0x00, 0x2d, 0x2c, 0xd0, 0x00, 0x23, 0x08, 0xac,
+ 0xab, 0x70, 0xac, 0x60, 0x00, 0xab, 0x03, 0xa8, 0x04, 0x93, 0xff, 0xf7,
+ 0x5b, 0xff, 0x00, 0x28, 0x21, 0xd1, 0x23, 0x78, 0x03, 0x20, 0x00, 0x2b,
+ 0x1d, 0xd0, 0xe2, 0x7a, 0x10, 0x23, 0x13, 0x40, 0x19, 0xd1, 0x61, 0x7d,
+ 0x22, 0x7d, 0x09, 0x02, 0x11, 0x43, 0xe2, 0x7e, 0xa0, 0x7e, 0x12, 0x02,
+ 0x09, 0x04, 0x02, 0x43, 0x0a, 0x43, 0x6a, 0x62, 0xe1, 0x7f, 0xa2, 0x7f,
+ 0x09, 0x06, 0x12, 0x04, 0x0a, 0x43, 0x21, 0x7f, 0x18, 0x1c, 0x0a, 0x43,
+ 0x61, 0x7f, 0xeb, 0x61, 0x09, 0x02, 0x0a, 0x43, 0x2a, 0x62, 0x01, 0x22,
+ 0xaa, 0x70, 0x11, 0xb0, 0x30, 0xbd, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10,
+ 0xf7, 0xb5, 0x31, 0x4b, 0x01, 0x90, 0x1c, 0x68, 0x00, 0x23, 0x0d, 0x1c,
+ 0x17, 0x1c, 0x13, 0x80, 0x9c, 0x42, 0x57, 0xd0, 0xa3, 0x78, 0x05, 0x20,
+ 0xd9, 0x07, 0x54, 0xd5, 0x22, 0x6a, 0xe1, 0x69, 0x53, 0x1a, 0x9d, 0x42,
+ 0x00, 0xd9, 0x9d, 0xb2, 0x01, 0x9a, 0x00, 0x92, 0x00, 0x2d, 0x43, 0xd0,
+ 0xe6, 0x69, 0xf3, 0x05, 0x1b, 0xd1, 0x70, 0x0a, 0x61, 0x78, 0x02, 0xf0,
+ 0x99, 0xfd, 0x00, 0x29, 0x0b, 0xd1, 0x00, 0x2e, 0x01, 0xd1, 0x60, 0x6a,
+ 0x02, 0xe0, 0xa0, 0x6a, 0xff, 0xf7, 0x68, 0xfe, 0x01, 0x28, 0x33, 0xd9,
+ 0x00, 0x23, 0xa0, 0x62, 0xe3, 0x70, 0xa0, 0x6a, 0xff, 0xf7, 0x2e, 0xfe,
+ 0x00, 0x28, 0x2b, 0xd0, 0xe3, 0x78, 0x5a, 0x1c, 0xc3, 0x18, 0xe2, 0x70,
+ 0xe3, 0x62, 0xe3, 0x69, 0x2e, 0x1c, 0xda, 0x05, 0x80, 0x23, 0xd1, 0x0d,
+ 0x9b, 0x00, 0x5b, 0x1a, 0x9b, 0xb2, 0x9d, 0x42, 0x00, 0xd9, 0x1e, 0x1c,
+ 0x01, 0x98, 0x00, 0x99, 0x43, 0x1e, 0x98, 0x41, 0xb6, 0xb2, 0x40, 0x42,
+ 0x08, 0x40, 0xd2, 0x0d, 0xe1, 0x6a, 0x33, 0x1c, 0xff, 0xf7, 0xc0, 0xfd,
+ 0x00, 0x28, 0x0d, 0xd1, 0xe2, 0x69, 0xad, 0x1b, 0x93, 0x19, 0xe3, 0x61,
+ 0x00, 0x9b, 0xad, 0xb2, 0x9b, 0x19, 0x00, 0x93, 0x3b, 0x88, 0xf6, 0x18,
+ 0x3e, 0x80, 0xb9, 0xe7, 0x28, 0x1c, 0x04, 0xe0, 0x00, 0x23, 0xa3, 0x70,
+ 0x01, 0x20, 0x00, 0xe0, 0x06, 0x20, 0xfe, 0xbd, 0x9c, 0x01, 0x00, 0x10,
+ 0x2a, 0x4b, 0xf7, 0xb5, 0x1c, 0x68, 0x00, 0x2c, 0x4c, 0xd0, 0xa2, 0x78,
+ 0x05, 0x23, 0xd1, 0x07, 0x49, 0xd5, 0x23, 0x6a, 0x05, 0x1e, 0x9d, 0x42,
+ 0x00, 0xd9, 0x1d, 0x1c, 0x00, 0x22, 0xe3, 0x69, 0xe2, 0x61, 0x95, 0x42,
+ 0x38, 0xd0, 0x66, 0x78, 0x76, 0x02, 0x00, 0x2b, 0x12, 0xd0, 0x31, 0x1c,
+ 0x68, 0x1e, 0x5f, 0x1e, 0x02, 0xf0, 0xf2, 0xfc, 0x31, 0x1c, 0x01, 0x90,
+ 0x38, 0x1c, 0x02, 0xf0, 0xed, 0xfc, 0x01, 0x9a, 0x82, 0x42, 0x05, 0xd3,
+ 0x73, 0x42, 0x3b, 0x40, 0xe3, 0x61, 0xed, 0x1a, 0xa0, 0x6a, 0x0e, 0xe0,
+ 0x60, 0x6a, 0xa0, 0x62, 0x0b, 0xe0, 0xff, 0xf7, 0xfb, 0xfd, 0x01, 0x28,
+ 0x1c, 0xd9, 0xe3, 0x68, 0x98, 0x42, 0x19, 0xd2, 0xe1, 0x69, 0xa0, 0x62,
+ 0x8b, 0x19, 0xe3, 0x61, 0xad, 0x1b, 0xb5, 0x42, 0xf1, 0xd8, 0xe2, 0x69,
+ 0x53, 0x19, 0xe3, 0x61, 0xff, 0xf7, 0xb8, 0xfd, 0x00, 0x28, 0x0b, 0xd0,
+ 0x6b, 0x0a, 0xda, 0xb2, 0xed, 0x05, 0x01, 0xd1, 0xe2, 0x70, 0x03, 0xe0,
+ 0x01, 0x32, 0x18, 0x18, 0xe2, 0x70, 0xe0, 0x62, 0x00, 0x23, 0x04, 0xe0,
+ 0x00, 0x23, 0xa3, 0x70, 0x01, 0x23, 0x00, 0xe0, 0x06, 0x23, 0x18, 0x1c,
+ 0xfe, 0xbd, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x15, 0x4b,
+ 0x05, 0x1c, 0x1b, 0x68, 0x8d, 0xb0, 0x06, 0x20, 0x00, 0x2b, 0x20, 0xd0,
+ 0x04, 0xac, 0x9c, 0x60, 0x01, 0xab, 0x6b, 0x60, 0x28, 0x1c, 0xff, 0xf7,
+ 0x65, 0xfe, 0x00, 0x28, 0x14, 0xd1, 0x23, 0x78, 0x00, 0x2b, 0x0e, 0xd0,
+ 0xe3, 0x7a, 0x04, 0x20, 0xda, 0x06, 0x10, 0xd5, 0x62, 0x7d, 0x23, 0x7d,
+ 0x12, 0x02, 0x1a, 0x43, 0xe3, 0x7e, 0xa1, 0x7e, 0x1b, 0x02, 0x12, 0x04,
+ 0x0b, 0x43, 0x13, 0x43, 0xab, 0x60, 0x28, 0x1c, 0xff, 0xf7, 0x8a, 0xfd,
+ 0x03, 0x28, 0x00, 0xd1, 0x04, 0x20, 0x0d, 0xb0, 0x30, 0xbd, 0xc0, 0x46,
+ 0x9c, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x44, 0x4f, 0x8d, 0xb0, 0x3b, 0x68,
+ 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x74, 0xd0, 0x04, 0xae, 0x9e, 0x60,
+ 0x01, 0xab, 0x43, 0x60, 0x03, 0x20, 0x00, 0x29, 0x1a, 0xd1, 0x20, 0x1c,
+ 0xff, 0xf7, 0x70, 0xfd, 0x74, 0xe0, 0x22, 0x88, 0x0f, 0x23, 0x1a, 0x40,
+ 0x52, 0x01, 0x30, 0x1c, 0x20, 0x23, 0xff, 0xf7, 0x07, 0xfd, 0x00, 0x28,
+ 0x68, 0xd1, 0x33, 0x78, 0x00, 0x2b, 0x63, 0xd0, 0x6a, 0x46, 0x1b, 0x32,
+ 0x12, 0x78, 0xe5, 0x2b, 0x59, 0xd1, 0x20, 0x1c, 0xff, 0xf7, 0xee, 0xfd,
+ 0x00, 0x28, 0x04, 0xd1, 0x21, 0x69, 0x00, 0x29, 0xe5, 0xd1, 0x00, 0x28,
+ 0x05, 0xd0, 0x00, 0x23, 0x23, 0x61, 0x03, 0x28, 0x01, 0xd0, 0x00, 0x28,
+ 0x52, 0xd1, 0x23, 0x69, 0x28, 0x1c, 0x09, 0x30, 0x00, 0x2b, 0x38, 0xd0,
+ 0x3b, 0x68, 0x02, 0x1c, 0x9b, 0x68, 0x00, 0x21, 0x5e, 0x5c, 0x20, 0x2e,
+ 0x07, 0xd0, 0x05, 0x2e, 0x00, 0xd1, 0xe5, 0x26, 0x46, 0x54, 0x01, 0x31,
+ 0x01, 0x32, 0x08, 0x29, 0xf4, 0xd1, 0x19, 0x7a, 0x20, 0x29, 0x0e, 0xd0,
+ 0x2e, 0x21, 0x11, 0x70, 0x19, 0x1c, 0x16, 0x1d, 0x08, 0x31, 0x01, 0x32,
+ 0x08, 0x78, 0x20, 0x28, 0x05, 0xd0, 0x01, 0x32, 0x57, 0x1e, 0x38, 0x70,
+ 0x01, 0x31, 0xb2, 0x42, 0xf6, 0xd1, 0xd9, 0x7a, 0x29, 0x72, 0xd8, 0x7f,
+ 0x99, 0x7f, 0x00, 0x06, 0x09, 0x04, 0x01, 0x43, 0x18, 0x7f, 0x01, 0x43,
+ 0x58, 0x7f, 0x00, 0x02, 0x01, 0x43, 0x29, 0x60, 0x59, 0x7e, 0x18, 0x7e,
+ 0x09, 0x02, 0x01, 0x43, 0xa9, 0x80, 0xd9, 0x7d, 0x9b, 0x7d, 0x09, 0x02,
+ 0x0b, 0x43, 0xeb, 0x80, 0x10, 0x1c, 0x00, 0x25, 0x05, 0x70, 0x20, 0x1c,
+ 0xff, 0xf7, 0x9e, 0xfd, 0x03, 0x28, 0x0d, 0xd1, 0x25, 0x61, 0x28, 0x1c,
+ 0x0a, 0xe0, 0x06, 0x20, 0x08, 0xe0, 0x2e, 0x2b, 0xa3, 0xd0, 0x13, 0x07,
+ 0xa1, 0xd4, 0xb0, 0xe7, 0x03, 0x20, 0xa8, 0xe7, 0x01, 0x20, 0xa6, 0xe7,
+ 0x0d, 0xb0, 0xf0, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0x38, 0xb5, 0x05, 0x1c,
+ 0x0c, 0x1c, 0x13, 0x1c, 0x29, 0x1c, 0x02, 0x48, 0x22, 0x1c, 0x00, 0xf0,
+ 0x0c, 0xf8, 0x38, 0xbd, 0xb8, 0xdb, 0x03, 0x00, 0x08, 0xb5, 0x72, 0xb6,
+ 0x96, 0x20, 0x00, 0xf0, 0xa8, 0xf9, 0x96, 0x20, 0x00, 0xf0, 0xa5, 0xf9,
+ 0xf8, 0xe7, 0x0f, 0xb4, 0x01, 0x20, 0x08, 0xb5, 0x02, 0xf0, 0x42, 0xfb,
+ 0x70, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0x16, 0x1c, 0x00, 0xf0, 0xa8, 0xfa,
+ 0x01, 0x35, 0x07, 0xd0, 0x20, 0x1c, 0x00, 0x21, 0x00, 0xf0, 0xca, 0xfa,
+ 0x20, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xc0, 0xfa, 0x70, 0xbd, 0x08, 0xb5,
+ 0x01, 0x22, 0xff, 0xf7, 0xeb, 0xff, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x4b,
+ 0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x1c, 0x30, 0x00, 0xf0, 0x90, 0xfb,
+ 0x20, 0x1c, 0x10, 0xbd, 0xf0, 0xdb, 0x03, 0x00, 0x10, 0xb5, 0x06, 0x4b,
+ 0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x1c, 0x30, 0x00, 0xf0, 0x84, 0xfb,
+ 0x20, 0x1c, 0x00, 0xf0, 0x35, 0xfa, 0x20, 0x1c, 0x10, 0xbd, 0xc0, 0x46,
+ 0xf0, 0xdb, 0x03, 0x00, 0x08, 0xb5, 0x01, 0x29, 0x0c, 0xd0, 0x02, 0x29,
+ 0x09, 0xd1, 0xc3, 0x6c, 0x00, 0x2b, 0x12, 0xd0, 0x82, 0x6b, 0x00, 0x2a,
+ 0x03, 0xd0, 0x01, 0x1c, 0x3c, 0x31, 0x10, 0x1c, 0x98, 0x47, 0x08, 0xbd,
+ 0x43, 0x6b, 0x00, 0x2b, 0x0c, 0xd0, 0x02, 0x6a, 0x00, 0x2a, 0xf8, 0xd0,
+ 0x01, 0x1c, 0x24, 0x31, 0x10, 0x1c, 0x98, 0x47, 0xf3, 0xe7, 0x83, 0x6b,
+ 0x00, 0x2b, 0xf0, 0xd0, 0x98, 0x47, 0xee, 0xe7, 0x03, 0x6a, 0x00, 0x2b,
+ 0xeb, 0xd0, 0x98, 0x47, 0xe9, 0xe7, 0xc0, 0x46, 0x38, 0xb5, 0x0e, 0x4b,
+ 0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x00, 0x23, 0x0d, 0x1c, 0x43, 0x60,
+ 0x83, 0x60, 0xc3, 0x60, 0x03, 0x61, 0x43, 0x61, 0x83, 0x61, 0xc3, 0x61,
+ 0x03, 0x62, 0x43, 0x63, 0x83, 0x63, 0xc3, 0x64, 0x06, 0x4a, 0x23, 0x1c,
+ 0x1c, 0x30, 0x00, 0xf0, 0xdd, 0xfa, 0x20, 0x1d, 0x29, 0x1c, 0xff, 0xf7,
+ 0x9e, 0xff, 0x20, 0x1c, 0x38, 0xbd, 0xc0, 0x46, 0xf0, 0xdb, 0x03, 0x00,
+ 0x09, 0x9b, 0x03, 0x00, 0x08, 0xb5, 0x00, 0x29, 0x08, 0xd0, 0x00, 0x23,
+ 0x01, 0x62, 0x43, 0x63, 0x01, 0x21, 0x1c, 0x30, 0x01, 0x22, 0x00, 0xf0,
+ 0x3d, 0xfb, 0x08, 0xbd, 0x1c, 0x30, 0x01, 0x21, 0x00, 0x22, 0x00, 0xf0,
+ 0x37, 0xfb, 0xf8, 0xe7, 0x08, 0xb5, 0x00, 0x29, 0x08, 0xd0, 0x00, 0x23,
+ 0x81, 0x63, 0xc3, 0x64, 0x02, 0x21, 0x1c, 0x30, 0x01, 0x22, 0x00, 0xf0,
+ 0x2b, 0xfb, 0x08, 0xbd, 0x1c, 0x30, 0x02, 0x21, 0x00, 0x22, 0x00, 0xf0,
+ 0x25, 0xfb, 0xf8, 0xe7, 0x10, 0xb5, 0x04, 0x1c, 0x42, 0x1c, 0x12, 0xd0,
+ 0x0b, 0x68, 0x5a, 0x1c, 0x0c, 0xd0, 0xa3, 0x42, 0x08, 0xd1, 0x20, 0x1c,
+ 0x89, 0x68, 0x00, 0xf0, 0x3d, 0xfb, 0x20, 0x1c, 0x00, 0x21, 0x00, 0xf0,
+ 0x55, 0xfb, 0x04, 0xe0, 0x0c, 0x31, 0xef, 0xe7, 0x01, 0x48, 0xff, 0xf7,
+ 0x46, 0xff, 0x10, 0xbd, 0x00, 0xdc, 0x03, 0x00, 0x08, 0xb5, 0x88, 0x42,
+ 0x0a, 0xd0, 0x43, 0x1c, 0x07, 0xd0, 0x01, 0x31, 0x06, 0xd0, 0x04, 0x48,
+ 0xff, 0xf7, 0x39, 0xff, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, 0x08, 0x1c,
+ 0x08, 0xbd, 0xc0, 0x46, 0x11, 0xdc, 0x03, 0x00, 0x0b, 0x68, 0x5a, 0x1c,
+ 0x05, 0xd0, 0x83, 0x42, 0x01, 0xd1, 0x48, 0x68, 0x02, 0xe0, 0x0c, 0x31,
+ 0xf6, 0xe7, 0x18, 0x1c, 0x70, 0x47, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c,
+ 0x43, 0x1c, 0x07, 0xd0, 0xff, 0xf7, 0xee, 0xff, 0x04, 0x1c, 0x43, 0x1c,
+ 0x02, 0xd1, 0x02, 0x48, 0xff, 0xf7, 0x19, 0xff, 0x20, 0x1c, 0x10, 0xbd,
+ 0x22, 0xdc, 0x03, 0x00, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46,
+ 0x08, 0xb5, 0xff, 0xf7, 0xfb, 0xff, 0xff, 0xf7, 0xf7, 0xff, 0x02, 0xf0,
+ 0xa9, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x28, 0x00, 0xd1, 0xfe, 0xe7,
+ 0xff, 0xf7, 0xfa, 0xfe, 0xfb, 0xe7, 0xc0, 0x46, 0x01, 0x4b, 0x08, 0x33,
+ 0x03, 0x60, 0x70, 0x47, 0x60, 0xdc, 0x03, 0x00, 0x10, 0xb5, 0x04, 0x4b,
+ 0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x00, 0xf0, 0x5b, 0xf9, 0x20, 0x1c,
+ 0x10, 0xbd, 0xc0, 0x46, 0x60, 0xdc, 0x03, 0x00, 0x30, 0xb5, 0x04, 0x1c,
+ 0x0f, 0x48, 0x83, 0xb0, 0x08, 0x30, 0x20, 0x60, 0x00, 0x20, 0x60, 0x60,
+ 0x20, 0x72, 0x20, 0x61, 0x0c, 0x48, 0x08, 0x25, 0x60, 0x61, 0x06, 0x98,
+ 0xe5, 0x60, 0x25, 0x1d, 0x00, 0x90, 0x28, 0x1c, 0x00, 0xf0, 0x22, 0xfc,
+ 0x28, 0x1c, 0xe1, 0x68, 0x22, 0x69, 0x00, 0x23, 0x00, 0xf0, 0x9c, 0xfc,
+ 0x28, 0x1c, 0x61, 0x69, 0x00, 0xf0, 0xce, 0xfc, 0x20, 0x1c, 0x03, 0xb0,
+ 0x30, 0xbd, 0xc0, 0x46, 0x60, 0xdc, 0x03, 0x00, 0x40, 0x42, 0x0f, 0x00,
+ 0x70, 0xb5, 0x09, 0x4d, 0x04, 0x1c, 0x2b, 0x68, 0x83, 0x42, 0x0b, 0xd0,
+ 0x06, 0x1d, 0x30, 0x1c, 0xe1, 0x68, 0x22, 0x69, 0x00, 0x23, 0x00, 0xf0,
+ 0x83, 0xfc, 0x30, 0x1c, 0x61, 0x69, 0x00, 0xf0, 0xb5, 0xfc, 0x2c, 0x60,
+ 0x70, 0xbd, 0xc0, 0x46, 0xa0, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x04, 0x4b,
+ 0x02, 0x61, 0xc1, 0x60, 0x00, 0x22, 0x1a, 0x60, 0xff, 0xf7, 0xe2, 0xff,
+ 0x08, 0xbd, 0xc0, 0x46, 0xa0, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x03, 0x4b,
+ 0x00, 0x22, 0x41, 0x61, 0x1a, 0x60, 0xff, 0xf7, 0xd7, 0xff, 0x08, 0xbd,
+ 0xa0, 0x01, 0x00, 0x10, 0x38, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0xff, 0xf7,
+ 0xcf, 0xff, 0x29, 0x1c, 0x20, 0x1d, 0x00, 0xf0, 0xd7, 0xfc, 0x38, 0xbd,
+ 0x38, 0xb5, 0x03, 0x68, 0x04, 0x1c, 0xdb, 0x68, 0x98, 0x47, 0x63, 0x68,
+ 0x5a, 0x68, 0x23, 0x68, 0x00, 0x2a, 0x02, 0xd1, 0x9b, 0x68, 0x98, 0x47,
+ 0x14, 0xe0, 0x5b, 0x68, 0x15, 0x68, 0x98, 0x47, 0x63, 0x68, 0x2d, 0x1a,
+ 0x00, 0x2d, 0x08, 0xdc, 0x5a, 0x68, 0x91, 0x68, 0x59, 0x60, 0x1b, 0x68,
+ 0x00, 0x2b, 0xea, 0xd0, 0x50, 0x68, 0x98, 0x47, 0xe7, 0xe7, 0x5b, 0x68,
+ 0x22, 0x68, 0x18, 0x68, 0x13, 0x69, 0x98, 0x47, 0x38, 0xbd, 0x00, 0x00,
+ 0x08, 0xb5, 0x02, 0x48, 0xff, 0xf7, 0xd8, 0xff, 0x08, 0xbd, 0xc0, 0x46,
+ 0x8c, 0xdc, 0x03, 0x00, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0xf0, 0xe2, 0xfc,
+ 0x05, 0x1c, 0x00, 0xf0, 0xdf, 0xfc, 0x40, 0x1b, 0xa0, 0x42, 0xfa, 0xd3,
+ 0x38, 0xbd, 0x08, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x58, 0x43, 0xff, 0xf7,
+ 0xef, 0xff, 0x08, 0xbd, 0x0c, 0x4b, 0xf0, 0xb5, 0x9d, 0x68, 0x9f, 0x68,
+ 0x80, 0x24, 0x2a, 0x1c, 0x1e, 0x1c, 0x64, 0x05, 0xa7, 0x42, 0x0b, 0xd0,
+ 0x00, 0x23, 0x80, 0x27, 0x7f, 0x05, 0xda, 0x19, 0x5f, 0x59, 0x04, 0x33,
+ 0x17, 0x60, 0xc0, 0x2b, 0xf7, 0xd1, 0x80, 0x22, 0xb4, 0x60, 0x52, 0x05,
+ 0x10, 0x30, 0x80, 0x00, 0x81, 0x50, 0xf0, 0xbd, 0x00, 0xed, 0x00, 0xe0,
+ 0x7f, 0xb5, 0x3e, 0x4a, 0x80, 0x21, 0xd0, 0x6f, 0x49, 0x02, 0x3d, 0x4b,
+ 0x01, 0x43, 0xd1, 0x67, 0x23, 0x22, 0x3c, 0x49, 0x9a, 0x60, 0x01, 0x22,
+ 0x0a, 0x60, 0x3b, 0x49, 0x3b, 0x4d, 0x0a, 0x60, 0x00, 0x22, 0x8e, 0x21,
+ 0x1a, 0x62, 0x89, 0x00, 0x58, 0x58, 0x20, 0x24, 0x28, 0x40, 0x01, 0x90,
+ 0x01, 0x98, 0xa0, 0x43, 0x01, 0x90, 0x01, 0x9c, 0xc8, 0x20, 0x00, 0x02,
+ 0x20, 0x43, 0x58, 0x50, 0x00, 0x92, 0x00, 0x99, 0x32, 0x4a, 0x91, 0x42,
+ 0x03, 0xd8, 0xc0, 0x46, 0x00, 0x9a, 0x01, 0x32, 0xf6, 0xe7, 0x01, 0x22,
+ 0x00, 0x21, 0x1a, 0x64, 0x5a, 0x64, 0x59, 0x64, 0x5a, 0x64, 0x59, 0x6c,
+ 0x27, 0x4a, 0xc8, 0x07, 0xfb, 0xd5, 0x8e, 0x21, 0x89, 0x00, 0x50, 0x58,
+ 0x80, 0x24, 0x28, 0x40, 0x02, 0x90, 0x02, 0x98, 0x20, 0x43, 0x02, 0x90,
+ 0x02, 0x9e, 0xc8, 0x20, 0x00, 0x02, 0x06, 0x43, 0x56, 0x50, 0x23, 0x26,
+ 0x96, 0x60, 0x56, 0x58, 0x35, 0x40, 0x03, 0x95, 0x03, 0x9d, 0xa5, 0x43,
+ 0x03, 0x95, 0x03, 0x9c, 0x20, 0x43, 0x50, 0x50, 0xd8, 0x68, 0x01, 0x21,
+ 0x18, 0x4a, 0x08, 0x42, 0xfa, 0xd0, 0x03, 0x20, 0x10, 0x67, 0x00, 0x20,
+ 0x51, 0x67, 0x50, 0x67, 0x51, 0x67, 0x58, 0x6f, 0x01, 0x21, 0x13, 0x4a,
+ 0x08, 0x42, 0xfa, 0xd0, 0x8e, 0x20, 0x91, 0x67, 0x80, 0x00, 0x15, 0x58,
+ 0x14, 0x4c, 0x2c, 0x40, 0x14, 0x50, 0x15, 0x58, 0x13, 0x4c, 0x2c, 0x40,
+ 0x14, 0x50, 0x00, 0x20, 0x91, 0x64, 0xd1, 0x64, 0xd0, 0x64, 0xd1, 0x64,
+ 0xda, 0x6c, 0xd1, 0x07, 0xfc, 0xd5, 0x08, 0x4a, 0x23, 0x21, 0x11, 0x61,
+ 0x59, 0x69, 0x01, 0x22, 0x11, 0x42, 0xfb, 0xd0, 0x0b, 0x4b, 0x00, 0x21,
+ 0x19, 0x60, 0x19, 0x60, 0x0a, 0x4b, 0x1a, 0x60, 0x7f, 0xbd, 0xc0, 0x46,
+ 0x04, 0x80, 0x04, 0x40, 0x00, 0x80, 0x04, 0x40, 0xf0, 0x40, 0x04, 0x40,
+ 0xf4, 0x40, 0x04, 0x40, 0xff, 0x25, 0x00, 0x00, 0xc3, 0x09, 0x00, 0x00,
+ 0xff, 0xfb, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xc0, 0x80, 0x04, 0x40,
+ 0xc8, 0x80, 0x04, 0x40, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46,
+ 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46,
+ 0x70, 0x47, 0xc0, 0x46, 0x00, 0x20, 0x70, 0x47, 0x08, 0xb5, 0x02, 0xf0,
+ 0x19, 0xf9, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x1c, 0x42, 0x1c, 0x04, 0xd1,
+ 0x16, 0x48, 0x17, 0x49, 0x1e, 0x22, 0xff, 0xf7, 0x77, 0xfd, 0x16, 0x4b,
+ 0x1a, 0x68, 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x60, 0x14, 0x4b,
+ 0x14, 0x49, 0xda, 0x6f, 0x0a, 0x43, 0xda, 0x67, 0x01, 0x21, 0x00, 0x2c,
+ 0x12, 0xd0, 0x12, 0x4b, 0x9c, 0x42, 0x0f, 0xd0, 0x11, 0x4b, 0x9c, 0x42,
+ 0x0c, 0xd0, 0x11, 0x4b, 0x9c, 0x42, 0x09, 0xd0, 0x10, 0x4b, 0x9c, 0x42,
+ 0x06, 0xd0, 0x10, 0x4b, 0x9c, 0x42, 0x03, 0xd0, 0x0f, 0x4b, 0xe1, 0x18,
+ 0x4b, 0x42, 0x59, 0x41, 0x20, 0x1c, 0xa4, 0x04, 0x00, 0xf0, 0x54, 0xf9,
+ 0xe4, 0x0e, 0x01, 0x20, 0xa0, 0x40, 0x10, 0xbd, 0xd4, 0xdc, 0x03, 0x00,
+ 0x94, 0xdc, 0x03, 0x00, 0xac, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40,
+ 0x40, 0x00, 0x01, 0x00, 0x28, 0x14, 0x00, 0x00, 0x2c, 0x16, 0x00, 0x00,
+ 0x30, 0x18, 0x00, 0x00, 0x34, 0x1a, 0x00, 0x00, 0x38, 0x1c, 0x00, 0x00,
+ 0xc4, 0xe1, 0xff, 0xff, 0x38, 0xb5, 0x04, 0x1c, 0x0d, 0x1c, 0x21, 0x60,
+ 0x4a, 0x1c, 0x11, 0xd0, 0x08, 0x1c, 0xff, 0xf7, 0xaf, 0xff, 0x2d, 0x14,
+ 0x07, 0x4a, 0xad, 0x00, 0xab, 0x18, 0x07, 0x4a, 0xe3, 0x60, 0xab, 0x18,
+ 0x06, 0x4a, 0x23, 0x61, 0xab, 0x18, 0x63, 0x61, 0x05, 0x4b, 0x60, 0x60,
+ 0xed, 0x18, 0xa5, 0x60, 0x38, 0xbd, 0xc0, 0x46, 0x00, 0x22, 0x00, 0xa0,
+ 0x80, 0x22, 0x00, 0xa0, 0x00, 0x21, 0x00, 0xa0, 0x00, 0x20, 0x00, 0xa0,
+ 0x08, 0xb5, 0x00, 0x68, 0x00, 0xf0, 0x30, 0xf9, 0x08, 0xbd, 0x00, 0x00,
+ 0x38, 0xb5, 0x03, 0x68, 0x04, 0x1c, 0x0d, 0x1c, 0x01, 0x33, 0x04, 0xd1,
+ 0x09, 0x48, 0x0a, 0x49, 0x43, 0x22, 0xff, 0xf7, 0x05, 0xfd, 0x00, 0x2d,
+ 0x06, 0xd0, 0x01, 0x2d, 0x09, 0xd1, 0xa3, 0x68, 0x62, 0x68, 0x19, 0x68,
+ 0x0a, 0x43, 0x03, 0xe0, 0xa3, 0x68, 0x61, 0x68, 0x1a, 0x68, 0x8a, 0x43,
+ 0x1a, 0x60, 0x38, 0xbd, 0xcf, 0xdc, 0x03, 0x00, 0x94, 0xdc, 0x03, 0x00,
+ 0xf8, 0xb5, 0x14, 0x4d, 0x01, 0x21, 0x0c, 0x1c, 0x6b, 0x6a, 0x84, 0x40,
+ 0x23, 0x42, 0x20, 0xd0, 0x11, 0x4b, 0x87, 0x00, 0xf8, 0x58, 0x00, 0x28,
+ 0x1b, 0xd0, 0x2b, 0x68, 0x23, 0x42, 0x18, 0xd1, 0x6b, 0x68, 0x23, 0x42,
+ 0x06, 0xd0, 0xeb, 0x69, 0x23, 0x42, 0x03, 0xd0, 0x0b, 0x4b, 0x1b, 0x68,
+ 0x98, 0x47, 0xec, 0x61, 0x2b, 0x69, 0x07, 0x4e, 0x23, 0x42, 0x09, 0xd0,
+ 0x33, 0x6a, 0x23, 0x42, 0x06, 0xd0, 0x05, 0x4b, 0x02, 0x21, 0xd8, 0x59,
+ 0x04, 0x4b, 0x1b, 0x68, 0x98, 0x47, 0x34, 0x62, 0x6c, 0x62, 0xf8, 0xbd,
+ 0x00, 0x40, 0x00, 0xa0, 0xb4, 0x01, 0x00, 0x10, 0xb0, 0x01, 0x00, 0x10,
+ 0x08, 0xb5, 0x00, 0x20, 0xff, 0xf7, 0xcc, 0xff, 0x08, 0xbd, 0x08, 0xb5,
+ 0x01, 0x20, 0xff, 0xf7, 0xc7, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x02, 0x20,
+ 0xff, 0xf7, 0xc2, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x03, 0x20, 0xff, 0xf7,
+ 0xbd, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x04, 0x20, 0xff, 0xf7, 0xb8, 0xff,
+ 0x08, 0xbd, 0x08, 0xb5, 0x05, 0x20, 0xff, 0xf7, 0xb3, 0xff, 0x08, 0xbd,
+ 0x08, 0xb5, 0x06, 0x20, 0xff, 0xf7, 0xae, 0xff, 0x08, 0xbd, 0x08, 0xb5,
+ 0x07, 0x20, 0xff, 0xf7, 0xa9, 0xff, 0x08, 0xbd, 0xf0, 0xb5, 0x06, 0x1c,
+ 0x27, 0x48, 0x85, 0xb0, 0x81, 0x42, 0x02, 0xdd, 0x01, 0x20, 0x40, 0x42,
+ 0x46, 0xe0, 0x25, 0x48, 0x02, 0x60, 0x00, 0x22, 0x24, 0x48, 0x95, 0x00,
+ 0x2c, 0x58, 0x02, 0x94, 0x00, 0x2c, 0x39, 0xd1, 0x2b, 0x50, 0x22, 0x48,
+ 0x32, 0x60, 0xc4, 0x6f, 0x21, 0x4f, 0x22, 0x4b, 0x3c, 0x43, 0xc4, 0x67,
+ 0x88, 0x03, 0x80, 0x0f, 0x18, 0x24, 0x44, 0x43, 0x49, 0x12, 0x1f, 0x27,
+ 0x0f, 0x40, 0x11, 0x1c, 0xbc, 0x46, 0x5e, 0x31, 0x64, 0x44, 0x89, 0x00,
+ 0x00, 0x90, 0xcc, 0x50, 0x81, 0x21, 0x89, 0x00, 0x01, 0x24, 0x58, 0x58,
+ 0x27, 0x1c, 0x97, 0x40, 0x38, 0x43, 0x58, 0x50, 0x00, 0x99, 0xa0, 0x23,
+ 0x88, 0x00, 0x1b, 0x06, 0xc0, 0x18, 0x80, 0x23, 0x9b, 0x01, 0xc7, 0x58,
+ 0x61, 0x46, 0x03, 0x97, 0x27, 0x1c, 0x8f, 0x40, 0x03, 0x99, 0xb9, 0x43,
+ 0xc1, 0x50, 0x0f, 0x4b, 0x50, 0xb2, 0xe9, 0x58, 0xff, 0xf7, 0x16, 0xfe,
+ 0x33, 0x68, 0x1f, 0x22, 0x13, 0x40, 0x9c, 0x40, 0x0b, 0x4b, 0x02, 0x98,
+ 0x1c, 0x60, 0x03, 0xe0, 0x01, 0x32, 0x08, 0x2a, 0xbc, 0xd1, 0xb5, 0xe7,
+ 0x05, 0xb0, 0xf0, 0xbd, 0x13, 0x11, 0x02, 0x00, 0xb0, 0x01, 0x00, 0x10,
+ 0xb4, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40, 0x80, 0x00, 0x09, 0x00,
+ 0x00, 0x80, 0x04, 0x40, 0xe8, 0xdc, 0x03, 0x00, 0x00, 0xe1, 0x00, 0xe0,
+ 0x03, 0x68, 0x00, 0x21, 0x9a, 0x00, 0x06, 0x4b, 0x10, 0xb5, 0xd1, 0x50,
+ 0x05, 0x4a, 0x81, 0x23, 0x9b, 0x00, 0x00, 0x68, 0xd1, 0x58, 0x01, 0x24,
+ 0x84, 0x40, 0xa1, 0x43, 0xd1, 0x50, 0x10, 0xbd, 0xb4, 0x01, 0x00, 0x10,
+ 0x00, 0x80, 0x04, 0x40, 0x03, 0x68, 0x70, 0xb5, 0x10, 0x4d, 0x01, 0x20,
+ 0x98, 0x40, 0x2b, 0x68, 0x03, 0x42, 0x00, 0xd1, 0x68, 0x62, 0x2e, 0x68,
+ 0xc4, 0x43, 0x26, 0x40, 0x0b, 0x4b, 0x2e, 0x60, 0x01, 0x29, 0x09, 0xd1,
+ 0x00, 0x2a, 0x03, 0xd0, 0x5a, 0x68, 0x10, 0x43, 0x58, 0x60, 0x0c, 0xe0,
+ 0x5a, 0x68, 0x14, 0x40, 0x5c, 0x60, 0x08, 0xe0, 0x00, 0x2a, 0x03, 0xd0,
+ 0x1a, 0x69, 0x10, 0x43, 0x18, 0x61, 0x02, 0xe0, 0x1a, 0x69, 0x14, 0x40,
+ 0x1c, 0x61, 0x70, 0xbd, 0x00, 0x40, 0x00, 0xa0, 0x38, 0xb5, 0x04, 0x1c,
+ 0x0d, 0x1c, 0x43, 0x1c, 0x04, 0xd1, 0x08, 0x48, 0x08, 0x49, 0x15, 0x22,
+ 0xff, 0xf7, 0xf4, 0xfb, 0x07, 0x4b, 0xe4, 0x05, 0xe4, 0x0d, 0xe4, 0x18,
+ 0x22, 0x68, 0x07, 0x23, 0x9a, 0x43, 0x1d, 0x40, 0x13, 0x1c, 0x2b, 0x43,
+ 0x23, 0x60, 0x38, 0xbd, 0xd4, 0xdc, 0x03, 0x00, 0x08, 0xdd, 0x03, 0x00,
+ 0x00, 0x40, 0x04, 0x40, 0x38, 0xb5, 0x04, 0x1c, 0x0d, 0x1c, 0x43, 0x1c,
+ 0x05, 0xd1, 0x11, 0x48, 0x11, 0x49, 0x1d, 0x22, 0xff, 0xf7, 0xd8, 0xfb,
+ 0x06, 0xe0, 0x81, 0x23, 0x1b, 0x01, 0x98, 0x42, 0x16, 0xd0, 0x0e, 0x4b,
+ 0x98, 0x42, 0x13, 0xd0, 0xe4, 0x05, 0x0d, 0x4b, 0xe4, 0x0d, 0xe4, 0x18,
+ 0x22, 0x68, 0x04, 0x2d, 0x04, 0xd1, 0x80, 0x23, 0xdb, 0x00, 0x13, 0x43,
+ 0x23, 0x60, 0x07, 0xe0, 0x18, 0x23, 0x9a, 0x43, 0x03, 0x23, 0x1d, 0x40,
+ 0xeb, 0x00, 0x15, 0x1c, 0x1d, 0x43, 0x25, 0x60, 0x38, 0xbd, 0xc0, 0x46,
+ 0xd4, 0xdc, 0x03, 0x00, 0x08, 0xdd, 0x03, 0x00, 0x14, 0x0a, 0x00, 0x00,
+ 0x00, 0x40, 0x04, 0x40, 0x38, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x08, 0x1c,
+ 0x00, 0x21, 0x02, 0xf0, 0x47, 0xf8, 0x00, 0x28, 0x09, 0xd1, 0xfe, 0x21,
+ 0x20, 0x1c, 0x89, 0x05, 0x02, 0xf0, 0x54, 0xf8, 0x00, 0x28, 0x03, 0xd0,
+ 0xfe, 0x24, 0xa4, 0x05, 0x00, 0xe0, 0x00, 0x24, 0x2d, 0x68, 0x80, 0x23,
+ 0x9b, 0x00, 0xe8, 0x58, 0x02, 0xf0, 0xe0, 0xfe, 0x21, 0x1c, 0x02, 0xf0,
+ 0xc1, 0xfb, 0x02, 0xf0, 0x57, 0xf8, 0x81, 0x23, 0x9b, 0x00, 0xe8, 0x50,
+ 0x38, 0xbd, 0xf7, 0xb5, 0x80, 0x23, 0x81, 0x22, 0x04, 0x68, 0x95, 0x00,
+ 0x9b, 0x00, 0xe7, 0x58, 0x08, 0x1c, 0x66, 0x59, 0xe1, 0x50, 0x02, 0xf0,
+ 0x6f, 0xfe, 0x01, 0x90, 0x30, 0x1c, 0x02, 0xf0, 0xc7, 0xfe, 0x06, 0x1c,
+ 0x38, 0x1c, 0x02, 0xf0, 0xc3, 0xfe, 0x01, 0x1c, 0x30, 0x1c, 0x02, 0xf0,
+ 0xbf, 0xf9, 0x01, 0x1c, 0x01, 0x98, 0x02, 0xf0, 0x9f, 0xfb, 0x02, 0xf0,
+ 0x35, 0xf8, 0x60, 0x51, 0xf7, 0xbd, 0x00, 0x00, 0xf7, 0xb5, 0x04, 0x1c,
+ 0x0f, 0x1c, 0x08, 0x1c, 0x51, 0x49, 0xff, 0xf7, 0x57, 0xfc, 0xc3, 0xb2,
+ 0x06, 0x1c, 0xff, 0x2b, 0x02, 0xd1, 0x4f, 0x48, 0xff, 0xf7, 0x75, 0xfb,
+ 0x4e, 0x48, 0x01, 0x23, 0x01, 0x78, 0x05, 0x1c, 0x0a, 0x1c, 0x1a, 0x40,
+ 0x00, 0xd1, 0x8e, 0xe0, 0x19, 0x41, 0x19, 0x42, 0x00, 0xd0, 0x84, 0xe0,
+ 0x2a, 0x78, 0x01, 0x21, 0x99, 0x40, 0x0a, 0x43, 0x2a, 0x70, 0x47, 0x4a,
+ 0x99, 0x00, 0x89, 0x58, 0x63, 0x60, 0x21, 0x60, 0x45, 0x49, 0x80, 0x25,
+ 0xc8, 0x6f, 0x45, 0x4a, 0x01, 0x90, 0x28, 0x06, 0x01, 0x9d, 0x09, 0x33,
+ 0x05, 0x43, 0xcd, 0x67, 0x01, 0x20, 0x51, 0x68, 0x98, 0x40, 0x03, 0x1c,
+ 0x0b, 0x43, 0x53, 0x60, 0x38, 0x1c, 0x39, 0x49, 0xff, 0xf7, 0xee, 0xfb,
+ 0x27, 0x68, 0x3d, 0x4a, 0x3b, 0x68, 0x3d, 0x49, 0x13, 0x43, 0x3b, 0x60,
+ 0x7b, 0x68, 0x0c, 0x22, 0x13, 0x43, 0x7b, 0x60, 0x7a, 0x68, 0x3a, 0x4b,
+ 0x13, 0x40, 0x7b, 0x60, 0x39, 0x4b, 0x7d, 0x68, 0x18, 0x68, 0x01, 0xf0,
+ 0x1f, 0xff, 0x7f, 0x23, 0x01, 0x38, 0x18, 0x40, 0x40, 0x01, 0x28, 0x43,
+ 0x78, 0x60, 0xf0, 0xb2, 0x01, 0x25, 0x07, 0x28, 0x1d, 0xd8, 0x01, 0xf0,
+ 0x09, 0xff, 0x04, 0x0a, 0x10, 0x16, 0x04, 0x0a, 0x10, 0x16, 0xa0, 0x23,
+ 0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2e, 0x4b, 0x10, 0xe0, 0xa1, 0x23,
+ 0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2c, 0x4b, 0x0a, 0xe0, 0xa2, 0x23,
+ 0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2a, 0x4b, 0x04, 0xe0, 0xa3, 0x23,
+ 0xdb, 0x00, 0xfd, 0x50, 0x28, 0x4b, 0x02, 0x22, 0xfa, 0x50, 0x80, 0x22,
+ 0xc1, 0x23, 0x52, 0x01, 0x9b, 0x00, 0xfa, 0x50, 0x01, 0x23, 0xc0, 0x22,
+ 0x5b, 0x42, 0x92, 0x00, 0xbb, 0x50, 0x23, 0x49, 0xc3, 0x22, 0x92, 0x00,
+ 0xb9, 0x50, 0x80, 0x25, 0x21, 0x49, 0xc2, 0x22, 0xad, 0x00, 0x92, 0x00,
+ 0xbb, 0x50, 0x79, 0x51, 0x7b, 0x59, 0x81, 0x26, 0xb6, 0x00, 0x9b, 0x08,
+ 0xbb, 0x51, 0x7b, 0x68, 0x04, 0x22, 0x93, 0x43, 0x7b, 0x60, 0x20, 0x1c,
+ 0xff, 0xf7, 0x4b, 0xff, 0x24, 0x68, 0x60, 0x59, 0x02, 0xf0, 0x1e, 0xfe,
+ 0x00, 0x21, 0x02, 0xf0, 0xff, 0xfa, 0x01, 0xf0, 0x95, 0xff, 0xa0, 0x51,
+ 0xf7, 0xbd, 0x14, 0x48, 0xff, 0xf7, 0xe1, 0xfa, 0x01, 0x23, 0x5b, 0x42,
+ 0x74, 0xe7, 0x13, 0x1c, 0x72, 0xe7, 0xc0, 0x46, 0x44, 0xdd, 0x03, 0x00,
+ 0xb0, 0xdd, 0x03, 0x00, 0xd4, 0x01, 0x00, 0x10, 0xdc, 0xdd, 0x03, 0x00,
+ 0x04, 0x80, 0x04, 0x40, 0x00, 0x80, 0x04, 0x40, 0x01, 0x00, 0x06, 0x00,
+ 0x40, 0x42, 0x0f, 0x00, 0x1f, 0xf0, 0xff, 0xff, 0x04, 0x01, 0x00, 0x10,
+ 0x04, 0x05, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x14, 0x05, 0x00, 0x00,
+ 0x1c, 0x05, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x20, 0x4e, 0x00, 0x00,
+ 0xca, 0xdd, 0x03, 0x00, 0xf0, 0xb5, 0x87, 0xb0, 0x04, 0x1c, 0x00, 0x91,
+ 0x08, 0x1c, 0x31, 0x49, 0x01, 0x92, 0x02, 0x93, 0xff, 0xf7, 0x8a, 0xfb,
+ 0x2f, 0x49, 0x07, 0x1c, 0x01, 0x98, 0xff, 0xf7, 0x85, 0xfb, 0x2e, 0x4d,
+ 0x03, 0x90, 0x29, 0x1c, 0x02, 0x98, 0xff, 0xf7, 0x7f, 0xfb, 0x2c, 0x4e,
+ 0x04, 0x90, 0x31, 0x1c, 0x0c, 0x98, 0xff, 0xf7, 0x79, 0xfb, 0x03, 0x99,
+ 0x05, 0x90, 0x38, 0x1c, 0xff, 0xf7, 0x56, 0xfb, 0x05, 0x99, 0x07, 0x1c,
+ 0x04, 0x98, 0xff, 0xf7, 0x51, 0xfb, 0x01, 0x1c, 0x38, 0x1c, 0xff, 0xf7,
+ 0x4d, 0xfb, 0x20, 0x4f, 0x20, 0x60, 0x01, 0x30, 0x04, 0xd1, 0x21, 0x48,
+ 0x21, 0x49, 0x48, 0x22, 0xff, 0xf7, 0x72, 0xfa, 0x23, 0x68, 0x20, 0x4a,
+ 0x93, 0x42, 0x0f, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x19, 0xd1, 0x1f, 0x4a,
+ 0x80, 0x21, 0xd0, 0x6f, 0xc9, 0x02, 0x01, 0x43, 0xd1, 0x67, 0x1d, 0x4a,
+ 0x01, 0x21, 0x1d, 0x4b, 0x11, 0x60, 0x5a, 0x68, 0x04, 0x21, 0x0a, 0xe0,
+ 0x18, 0x4a, 0x80, 0x21, 0xd0, 0x6f, 0x09, 0x01, 0x01, 0x43, 0xd1, 0x67,
+ 0x18, 0x49, 0x17, 0x4b, 0x01, 0x22, 0x0a, 0x60, 0x59, 0x68, 0x0a, 0x43,
+ 0x5a, 0x60, 0x00, 0x98, 0x09, 0x49, 0xff, 0xf7, 0x05, 0xfb, 0x01, 0x98,
+ 0x39, 0x1c, 0xff, 0xf7, 0x01, 0xfb, 0x02, 0x98, 0x29, 0x1c, 0xff, 0xf7,
+ 0xfd, 0xfa, 0x0c, 0x9b, 0x01, 0x33, 0x03, 0xd0, 0x0c, 0x98, 0x31, 0x1c,
+ 0xff, 0xf7, 0xf6, 0xfa, 0x07, 0xb0, 0xf0, 0xbd, 0x1c, 0xdf, 0x03, 0x00,
+ 0xe4, 0xdd, 0x03, 0x00, 0x20, 0xde, 0x03, 0x00, 0x58, 0xdf, 0x03, 0x00,
+ 0x68, 0xde, 0x03, 0x00, 0x7c, 0xde, 0x03, 0x00, 0x00, 0x00, 0x04, 0x40,
+ 0x00, 0x80, 0x05, 0x40, 0x04, 0x80, 0x04, 0x40, 0x9c, 0x80, 0x04, 0x40,
+ 0x00, 0x80, 0x04, 0x40, 0x94, 0x80, 0x04, 0x40, 0xf8, 0xb5, 0x1f, 0x1c,
+ 0x03, 0x68, 0x15, 0x1c, 0x5a, 0x68, 0x0e, 0x1c, 0x02, 0x21, 0x8a, 0x43,
+ 0x5a, 0x60, 0x33, 0x1f, 0x04, 0x1c, 0x0c, 0x2b, 0x06, 0xd9, 0x03, 0x2d,
+ 0x04, 0xd9, 0x11, 0x48, 0x11, 0x49, 0x65, 0x22, 0xff, 0xf7, 0x10, 0xfa,
+ 0x23, 0x68, 0x01, 0x22, 0x28, 0x1c, 0x19, 0x68, 0xd5, 0x40, 0x10, 0x40,
+ 0xc0, 0x01, 0x2a, 0x40, 0x01, 0x3e, 0x06, 0x43, 0x92, 0x01, 0x09, 0x0c,
+ 0x09, 0x04, 0x16, 0x43, 0x0e, 0x43, 0x1e, 0x60, 0x5a, 0x68, 0x0d, 0x21,
+ 0x8a, 0x43, 0x79, 0x1e, 0x8f, 0x41, 0xbf, 0x00, 0x17, 0x43, 0x5f, 0x60,
+ 0x23, 0x68, 0x02, 0x21, 0x5a, 0x68, 0x0a, 0x43, 0x5a, 0x60, 0xf8, 0xbd,
+ 0xb6, 0xde, 0x03, 0x00, 0x7c, 0xde, 0x03, 0x00, 0xf7, 0xb5, 0x03, 0x68,
+ 0x02, 0x24, 0x5a, 0x68, 0x05, 0x1c, 0xa2, 0x43, 0x5a, 0x60, 0x1c, 0x4b,
+ 0x0e, 0x1c, 0x1b, 0x68, 0x01, 0x93, 0x21, 0x1c, 0x01, 0x98, 0x01, 0xf0,
+ 0xdb, 0xfd, 0x02, 0xf0, 0xc9, 0xfc, 0x07, 0x1c, 0x30, 0x1c, 0x02, 0xf0,
+ 0xc5, 0xfc, 0x01, 0x1c, 0x38, 0x1c, 0x02, 0xf0, 0x1d, 0xf8, 0xfc, 0x21,
+ 0x89, 0x05, 0x01, 0xf0, 0xad, 0xfe, 0x03, 0xf0, 0x03, 0xfa, 0x01, 0xf0,
+ 0x71, 0xfc, 0x03, 0xf0, 0xcb, 0xf9, 0xff, 0x28, 0x10, 0xdc, 0x2b, 0x68,
+ 0x0d, 0x4a, 0x1c, 0x61, 0x19, 0x68, 0x01, 0x38, 0x0a, 0x40, 0x1a, 0x60,
+ 0x1a, 0x68, 0x00, 0x02, 0x10, 0x43, 0x18, 0x60, 0x2b, 0x68, 0x02, 0x21,
+ 0x5a, 0x68, 0x0a, 0x43, 0x5a, 0x60, 0x07, 0xe0, 0x80, 0x23, 0x02, 0x34,
+ 0x5b, 0x00, 0x9c, 0x42, 0xcf, 0xd1, 0x04, 0x48, 0xff, 0xf7, 0xc5, 0xf9,
+ 0xf7, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10, 0xff, 0x00, 0x00, 0xff,
+ 0xf4, 0xde, 0x03, 0x00, 0x10, 0xb5, 0x03, 0x68, 0xda, 0x68, 0x94, 0x07,
+ 0xfc, 0xd5, 0x99, 0x60, 0x03, 0x68, 0xda, 0x68, 0x51, 0x07, 0xfc, 0xd5,
+ 0x98, 0x68, 0x10, 0xbd, 0x38, 0xb5, 0x10, 0x4b, 0x1a, 0x68, 0x00, 0x2a,
+ 0x1a, 0xd1, 0x01, 0x25, 0x1d, 0x60, 0x0e, 0x4b, 0x80, 0x22, 0xd9, 0x6f,
+ 0xd2, 0x00, 0x0a, 0x43, 0xda, 0x67, 0x0c, 0x4b, 0x0c, 0x4c, 0x18, 0x68,
+ 0x02, 0x23, 0x63, 0x60, 0x0b, 0x49, 0x01, 0xf0, 0x83, 0xfd, 0x01, 0x38,
+ 0xe0, 0x60, 0x0a, 0x49, 0x65, 0x60, 0x13, 0x20, 0xff, 0xf7, 0x40, 0xfb,
+ 0x80, 0x22, 0x08, 0x4b, 0x12, 0x03, 0x1a, 0x60, 0x38, 0xbd, 0xc0, 0x46,
+ 0xd8, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40, 0x04, 0x01, 0x00, 0x10,
+ 0x00, 0x80, 0x01, 0x40, 0x40, 0x42, 0x0f, 0x00, 0xbd, 0x9d, 0x03, 0x00,
+ 0x00, 0xe1, 0x00, 0xe0, 0x08, 0xb5, 0x04, 0x4b, 0x1b, 0x68, 0x00, 0x2b,
+ 0x01, 0xd1, 0xff, 0xf7, 0xc9, 0xff, 0x02, 0x4b, 0x98, 0x68, 0x08, 0xbd,
+ 0xd8, 0x01, 0x00, 0x10, 0x00, 0x80, 0x01, 0x40, 0x03, 0x4b, 0x01, 0x21,
+ 0x98, 0x61, 0x5a, 0x69, 0x0a, 0x43, 0x5a, 0x61, 0x70, 0x47, 0xc0, 0x46,
+ 0x00, 0x80, 0x01, 0x40, 0x02, 0x4b, 0x01, 0x21, 0x5a, 0x69, 0x8a, 0x43,
+ 0x5a, 0x61, 0x70, 0x47, 0x00, 0x80, 0x01, 0x40, 0x01, 0x4b, 0x01, 0x22,
+ 0x1a, 0x60, 0x70, 0x47, 0x00, 0x80, 0x01, 0x40, 0x70, 0xb5, 0x1d, 0x4d,
+ 0x00, 0x23, 0x2b, 0x70, 0x1c, 0x4b, 0x1b, 0x78, 0x00, 0x2b, 0x01, 0xd1,
+ 0x03, 0xf0, 0xdd, 0xff, 0x1a, 0x4e, 0x1b, 0x49, 0x30, 0x1c, 0xff, 0xf7,
+ 0x7d, 0xf8, 0x1a, 0x4c, 0x28, 0x70, 0x21, 0x1c, 0x30, 0x1c, 0xff, 0xf7,
+ 0xa5, 0xf8, 0x28, 0x70, 0x00, 0x28, 0x0c, 0xd0, 0x00, 0x20, 0x20, 0xe0,
+ 0x22, 0x7a, 0x02, 0x23, 0x13, 0x40, 0x0a, 0xd0, 0x30, 0x1c, 0x21, 0x1c,
+ 0xff, 0xf7, 0x98, 0xf8, 0x28, 0x70, 0x00, 0x28, 0x11, 0xd0, 0x2b, 0x78,
+ 0x00, 0x2b, 0xf1, 0xd0, 0xee, 0xe7, 0x20, 0x1c, 0x09, 0x30, 0xd1, 0x06,
+ 0x0d, 0xd5, 0x2e, 0x22, 0x62, 0x74, 0x44, 0x22, 0xa2, 0x74, 0x49, 0x22,
+ 0xe2, 0x74, 0x52, 0x22, 0x22, 0x75, 0x63, 0x75, 0x03, 0xe0, 0x33, 0x88,
+ 0x00, 0x2b, 0xea, 0xd1, 0xdc, 0xe7, 0x70, 0xbd, 0x4b, 0x02, 0x00, 0x10,
+ 0x60, 0x02, 0x00, 0x10, 0x4c, 0x02, 0x00, 0x10, 0x18, 0xe3, 0x03, 0x00,
+ 0x0c, 0x02, 0x00, 0x10, 0x1d, 0x4b, 0x70, 0xb5, 0x1b, 0x78, 0x00, 0x2b,
+ 0x01, 0xd1, 0x03, 0xf0, 0x9a, 0xff, 0x1b, 0x4e, 0x1b, 0x4c, 0x30, 0x1c,
+ 0x21, 0x1c, 0xff, 0xf7, 0x67, 0xf8, 0x1a, 0x4d, 0x28, 0x70, 0x00, 0x28,
+ 0x28, 0xd1, 0x23, 0x7a, 0x9a, 0x07, 0x06, 0xd4, 0xda, 0x06, 0x20, 0xd5,
+ 0x23, 0x1c, 0x22, 0x1c, 0x14, 0x33, 0x08, 0x32, 0x08, 0xe0, 0x2a, 0x78,
+ 0x00, 0x2a, 0xf5, 0xd1, 0x30, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x52, 0xf8,
+ 0x28, 0x70, 0xec, 0xe7, 0x19, 0x78, 0x01, 0x3b, 0x99, 0x70, 0x93, 0x42,
+ 0xfa, 0xd1, 0x63, 0x7a, 0x00, 0x2b, 0x0a, 0xd0, 0x2f, 0x23, 0x63, 0x72,
+ 0x00, 0x23, 0xe2, 0x18, 0x51, 0x7a, 0x00, 0x29, 0x01, 0xd0, 0x01, 0x33,
+ 0xf9, 0xe7, 0x2f, 0x23, 0x53, 0x72, 0x20, 0x1c, 0x09, 0x30, 0x00, 0xe0,
+ 0x00, 0x20, 0x70, 0xbd, 0x60, 0x02, 0x00, 0x10, 0x4c, 0x02, 0x00, 0x10,
+ 0x0c, 0x02, 0x00, 0x10, 0x4b, 0x02, 0x00, 0x10, 0x70, 0xb5, 0x0f, 0x4c,
+ 0x06, 0x1c, 0x23, 0x78, 0x0d, 0x1c, 0x10, 0x2b, 0x0b, 0xd0, 0x30, 0x1c,
+ 0x25, 0x70, 0xfe, 0xf7, 0xff, 0xfe, 0x05, 0x1e, 0x0c, 0xd1, 0x0a, 0x48,
+ 0x31, 0x1c, 0x01, 0xf0, 0x95, 0xfc, 0x2b, 0x1c, 0x09, 0xe0, 0x08, 0x48,
+ 0x03, 0xf0, 0x84, 0xfe, 0x01, 0x23, 0x00, 0x28, 0xed, 0xd0, 0x02, 0xe0,
+ 0x08, 0x23, 0x23, 0x70, 0x01, 0x23, 0x18, 0x1c, 0x70, 0xbd, 0xc0, 0x46,
+ 0x08, 0x01, 0x00, 0x10, 0x3c, 0x02, 0x00, 0x10, 0xdc, 0x01, 0x00, 0x10,
+ 0x13, 0xb5, 0x6c, 0x46, 0x06, 0x34, 0x22, 0x1c, 0xfe, 0xf7, 0x18, 0xff,
+ 0x20, 0x88, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x20, 0xfe, 0xf7, 0x78, 0xff,
+ 0x01, 0x4b, 0x18, 0x70, 0x08, 0xbd, 0xc0, 0x46, 0x4b, 0x02, 0x00, 0x10,
+ 0x08, 0xb5, 0x03, 0x4b, 0x18, 0x6a, 0xfe, 0xf7, 0x6d, 0xff, 0x02, 0x4b,
+ 0x18, 0x70, 0x08, 0xbd, 0xdc, 0x01, 0x00, 0x10, 0x4b, 0x02, 0x00, 0x10,
+ 0x01, 0x4b, 0xd8, 0x69, 0x70, 0x47, 0xc0, 0x46, 0xdc, 0x01, 0x00, 0x10,
+ 0x13, 0xb5, 0x01, 0x23, 0x07, 0x4c, 0x5b, 0x42, 0x81, 0x22, 0x00, 0x93,
+ 0x20, 0x1c, 0x06, 0x4b, 0x06, 0x49, 0x52, 0x01, 0xff, 0xf7, 0x8c, 0xf9,
+ 0x20, 0x1c, 0x05, 0x49, 0x05, 0x4a, 0xff, 0xf7, 0xdb, 0xfa, 0x13, 0xbd,
+ 0x24, 0x02, 0x00, 0x10, 0x18, 0x0c, 0x00, 0x00, 0x24, 0x12, 0x00, 0x00,
+ 0x99, 0x9c, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0xf7, 0xb5, 0x07, 0x1c,
+ 0x01, 0x91, 0x72, 0xb6, 0x34, 0x4b, 0x98, 0x42, 0x02, 0xd8, 0x05, 0x0b,
+ 0x2b, 0x03, 0x14, 0xe0, 0x32, 0x4b, 0x1c, 0x25, 0x98, 0x42, 0x0d, 0xd8,
+ 0x31, 0x4b, 0x1b, 0x25, 0x98, 0x42, 0x09, 0xd8, 0x30, 0x4b, 0x1a, 0x25,
+ 0x98, 0x42, 0x05, 0xd8, 0x2f, 0x4b, 0x00, 0x25, 0x83, 0x42, 0x6d, 0x41,
+ 0x19, 0x23, 0x5d, 0x1b, 0x2d, 0x4a, 0xab, 0x18, 0x9b, 0x03, 0xfb, 0x1a,
+ 0x2c, 0x4c, 0x2d, 0x4e, 0x5a, 0x42, 0x53, 0x41, 0xdb, 0xb2, 0x32, 0x22,
+ 0x00, 0x93, 0x22, 0x60, 0x2a, 0x4b, 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c,
+ 0x31, 0x1c, 0x98, 0x47, 0x33, 0x68, 0x00, 0x2b, 0x01, 0xd0, 0x01, 0x20,
+ 0x38, 0xe0, 0x00, 0x9a, 0x00, 0x2a, 0x17, 0xd1, 0x33, 0x23, 0x23, 0x60,
+ 0x01, 0x9b, 0xfa, 0x21, 0xa3, 0x60, 0x80, 0x23, 0x5b, 0x00, 0xe3, 0x60,
+ 0x20, 0x4b, 0x89, 0x00, 0x18, 0x68, 0x67, 0x60, 0x01, 0xf0, 0x0e, 0xfc,
+ 0x31, 0x1c, 0x20, 0x61, 0x1b, 0x4a, 0x20, 0x1c, 0x90, 0x47, 0x30, 0x68,
+ 0x00, 0x28, 0xe4, 0xd1, 0x62, 0xb6, 0x1d, 0xe0, 0x34, 0x23, 0x23, 0x60,
+ 0x17, 0x4b, 0xfa, 0x21, 0x18, 0x68, 0x89, 0x00, 0x65, 0x60, 0xa5, 0x60,
+ 0x01, 0xf0, 0xfa, 0xfb, 0x31, 0x1c, 0xe0, 0x60, 0x11, 0x4b, 0x20, 0x1c,
+ 0x98, 0x47, 0x32, 0x68, 0x00, 0x2a, 0xd0, 0xd1, 0x32, 0x23, 0x23, 0x60,
+ 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x31, 0x1c, 0x0b, 0x4a, 0x90, 0x47,
+ 0x33, 0x68, 0x00, 0x2b, 0xca, 0xd0, 0xc4, 0xe7, 0xfe, 0xbd, 0xc0, 0x46,
+ 0xff, 0x7f, 0x01, 0x00, 0xff, 0x7f, 0x03, 0x00, 0xff, 0xff, 0x02, 0x00,
+ 0xff, 0x7f, 0x02, 0x00, 0xff, 0xff, 0x01, 0x00, 0xee, 0xff, 0x03, 0x00,
+ 0x64, 0x03, 0x00, 0x10, 0x78, 0x03, 0x00, 0x10, 0xf1, 0x1f, 0xff, 0x1f,
+ 0x04, 0x01, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x1a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x1a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x5a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x5a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x9a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x9a, 0x71, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x5a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x5a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0xda, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0xda, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x9a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x9a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x1a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0x70, 0x47,
+ 0x28, 0x04, 0x00, 0x10, 0x38, 0xb5, 0x2a, 0x4b, 0x00, 0x24, 0x2a, 0x4d,
+ 0x1c, 0x70, 0x2a, 0x4b, 0x28, 0x1c, 0x2a, 0x49, 0x1c, 0x70, 0xff, 0xf7,
+ 0x1b, 0xf8, 0x28, 0x1c, 0x28, 0x49, 0xff, 0xf7, 0x05, 0xf8, 0x28, 0x4d,
+ 0x28, 0x49, 0x28, 0x1c, 0xff, 0xf7, 0x12, 0xf8, 0x28, 0x1c, 0x27, 0x49,
+ 0xfe, 0xf7, 0xfc, 0xff, 0x26, 0x4d, 0x27, 0x49, 0x28, 0x1c, 0xff, 0xf7,
+ 0x09, 0xf8, 0x28, 0x1c, 0x25, 0x49, 0xfe, 0xf7, 0xf3, 0xff, 0x25, 0x4d,
+ 0x25, 0x49, 0x28, 0x1c, 0xff, 0xf7, 0x00, 0xf8, 0x28, 0x1c, 0x24, 0x49,
+ 0xfe, 0xf7, 0xea, 0xff, 0x23, 0x4d, 0x24, 0x49, 0x28, 0x1c, 0xfe, 0xf7,
+ 0xf7, 0xff, 0x28, 0x1c, 0x22, 0x49, 0xfe, 0xf7, 0xe1, 0xff, 0x22, 0x4d,
+ 0x22, 0x49, 0x28, 0x1c, 0xfe, 0xf7, 0xee, 0xff, 0x28, 0x1c, 0x21, 0x49,
+ 0xfe, 0xf7, 0xd8, 0xff, 0x20, 0x4d, 0x21, 0x49, 0x28, 0x1c, 0xfe, 0xf7,
+ 0xe5, 0xff, 0x28, 0x1c, 0x1f, 0x49, 0xfe, 0xf7, 0xcf, 0xff, 0x1f, 0x4b,
+ 0x1c, 0x70, 0x5c, 0x70, 0x9c, 0x70, 0xdc, 0x70, 0x1c, 0x71, 0x5c, 0x71,
+ 0x9c, 0x71, 0x1c, 0x4b, 0x1c, 0x70, 0x5c, 0x70, 0x9c, 0x70, 0xdc, 0x70,
+ 0x1c, 0x71, 0x5c, 0x71, 0x9c, 0x71, 0x38, 0xbd, 0x24, 0x05, 0x00, 0x10,
+ 0x30, 0x05, 0x00, 0x10, 0x80, 0x04, 0x00, 0x10, 0xd5, 0xaa, 0x03, 0x00,
+ 0xc9, 0xaa, 0x03, 0x00, 0x80, 0x05, 0x00, 0x10, 0xed, 0xaa, 0x03, 0x00,
+ 0xe1, 0xaa, 0x03, 0x00, 0x88, 0x03, 0x00, 0x10, 0x05, 0xab, 0x03, 0x00,
+ 0xf9, 0xaa, 0x03, 0x00, 0xd4, 0x04, 0x00, 0x10, 0x1d, 0xab, 0x03, 0x00,
+ 0x11, 0xab, 0x03, 0x00, 0xd8, 0x03, 0x00, 0x10, 0x35, 0xab, 0x03, 0x00,
+ 0x29, 0xab, 0x03, 0x00, 0x30, 0x04, 0x00, 0x10, 0x65, 0xab, 0x03, 0x00,
+ 0x59, 0xab, 0x03, 0x00, 0x84, 0x04, 0x00, 0x10, 0x4d, 0xab, 0x03, 0x00,
+ 0x41, 0xab, 0x03, 0x00, 0x28, 0x04, 0x00, 0x10, 0x25, 0x05, 0x00, 0x10,
+ 0x02, 0x4b, 0x18, 0x78, 0x01, 0x23, 0x18, 0x40, 0x70, 0x47, 0xc0, 0x46,
+ 0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78, 0x80, 0x07, 0xc0, 0x0f,
+ 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78,
+ 0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10,
+ 0x02, 0x4b, 0x18, 0x78, 0x00, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0xc0, 0x46,
+ 0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78, 0xc0, 0x06, 0xc0, 0x0f,
+ 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10, 0x03, 0x4b, 0x18, 0x78,
+ 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46,
+ 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x98, 0x78, 0x01, 0x38, 0x43, 0x42,
+ 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10,
+ 0x03, 0x4b, 0x58, 0x78, 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2,
+ 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0xd8, 0x78,
+ 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46,
+ 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x18, 0x79, 0x01, 0x38, 0x43, 0x42,
+ 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10,
+ 0x03, 0x4b, 0x58, 0x79, 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2,
+ 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x98, 0x79,
+ 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46,
+ 0x28, 0x04, 0x00, 0x10, 0x38, 0xb5, 0x21, 0x4c, 0x00, 0x23, 0x25, 0x78,
+ 0x23, 0x70, 0xff, 0xf7, 0xc7, 0xff, 0x00, 0x28, 0x01, 0xd0, 0x01, 0x23,
+ 0x23, 0x70, 0xff, 0xf7, 0xcb, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78,
+ 0x02, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 0xa5, 0xff, 0x00, 0x28,
+ 0x03, 0xd0, 0x23, 0x78, 0x04, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7,
+ 0xa7, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 0x08, 0x22, 0x13, 0x43,
+ 0x23, 0x70, 0xff, 0xf7, 0xbd, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78,
+ 0x10, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 0xbf, 0xff, 0x00, 0x28,
+ 0x03, 0xd0, 0x23, 0x78, 0x20, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7,
+ 0xc1, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 0x40, 0x22, 0x13, 0x43,
+ 0x23, 0x70, 0x23, 0x78, 0x29, 0x1c, 0x19, 0x40, 0x9d, 0x43, 0x03, 0x4a,
+ 0x03, 0x4b, 0x11, 0x70, 0x1d, 0x70, 0x38, 0xbd, 0x80, 0x04, 0x00, 0x10,
+ 0x24, 0x05, 0x00, 0x10, 0x2c, 0x05, 0x00, 0x10, 0x70, 0xb5, 0x24, 0x4e,
+ 0x24, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0xac, 0xfe, 0x23, 0x4d, 0x24, 0x4c,
+ 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xad, 0xf8, 0x22, 0x4e,
+ 0x22, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0xa0, 0xfe, 0x29, 0x1c, 0x22, 0x1c,
+ 0x30, 0x1c, 0xff, 0xf7, 0xa3, 0xf8, 0x1f, 0x4e, 0x1f, 0x49, 0x30, 0x1c,
+ 0xfe, 0xf7, 0x96, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7,
+ 0x99, 0xf8, 0x1c, 0x4e, 0x1c, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x8c, 0xfe,
+ 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0x8f, 0xf8, 0x19, 0x4e,
+ 0x19, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x82, 0xfe, 0x29, 0x1c, 0x22, 0x1c,
+ 0x30, 0x1c, 0xff, 0xf7, 0x85, 0xf8, 0x16, 0x4e, 0x16, 0x49, 0x30, 0x1c,
+ 0xfe, 0xf7, 0x78, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7,
+ 0x7b, 0xf8, 0x13, 0x4e, 0x13, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x6e, 0xfe,
+ 0x30, 0x1c, 0x29, 0x1c, 0x22, 0x1c, 0xff, 0xf7, 0x71, 0xf8, 0x70, 0xbd,
+ 0x30, 0x05, 0x00, 0x10, 0x84, 0x12, 0x01, 0x00, 0xd1, 0x9a, 0x03, 0x00,
+ 0x00, 0x01, 0x00, 0x10, 0x80, 0x05, 0x00, 0x10, 0x70, 0x08, 0x01, 0x00,
+ 0x88, 0x03, 0x00, 0x10, 0x88, 0x14, 0x01, 0x00, 0xd4, 0x04, 0x00, 0x10,
+ 0x94, 0x1a, 0x01, 0x00, 0xd8, 0x03, 0x00, 0x10, 0x6c, 0x06, 0x01, 0x00,
+ 0x30, 0x04, 0x00, 0x10, 0xc4, 0x32, 0x01, 0x00, 0x84, 0x04, 0x00, 0x10,
+ 0x7c, 0x0e, 0x01, 0x00, 0xf0, 0xb5, 0x89, 0xb0, 0x07, 0x91, 0x51, 0x78,
+ 0x15, 0x78, 0x01, 0x91, 0x59, 0x43, 0x07, 0x23, 0x2b, 0x40, 0x06, 0x90,
+ 0x5c, 0x1e, 0xa3, 0x41, 0xe8, 0x10, 0xc3, 0x18, 0x4b, 0x43, 0x03, 0x33,
+ 0xd3, 0x18, 0x02, 0x93, 0xeb, 0x1d, 0xdb, 0x10, 0x03, 0x93, 0x00, 0x26,
+ 0x74, 0xb2, 0xac, 0x42, 0x2f, 0xda, 0xe3, 0x17, 0x5b, 0x0f, 0x1b, 0x19,
+ 0xdb, 0x10, 0xdb, 0xb2, 0x04, 0x93, 0x16, 0x4b, 0x23, 0x40, 0x04, 0xd5,
+ 0x08, 0x22, 0x01, 0x3b, 0x52, 0x42, 0x13, 0x43, 0x01, 0x33, 0x5b, 0xb2,
+ 0x80, 0x22, 0x1a, 0x41, 0x05, 0x92, 0x00, 0x27, 0x01, 0x99, 0x78, 0xb2,
+ 0x88, 0x42, 0x15, 0xda, 0x04, 0x9a, 0x02, 0x99, 0x53, 0xb2, 0x03, 0x9a,
+ 0x42, 0x43, 0x8a, 0x18, 0xd3, 0x5c, 0x05, 0x9a, 0x1a, 0x42, 0x08, 0xd0,
+ 0x06, 0x9b, 0x07, 0x99, 0x18, 0x18, 0x08, 0x4b, 0x08, 0x31, 0x09, 0x1b,
+ 0x1a, 0x68, 0x00, 0xf0, 0x29, 0xfa, 0x01, 0x37, 0xff, 0xb2, 0xe5, 0xe7,
+ 0x01, 0x36, 0xf6, 0xb2, 0xcc, 0xe7, 0x09, 0xb0, 0xf0, 0xbd, 0xc0, 0x46,
+ 0x07, 0x00, 0x00, 0x80, 0x10, 0x01, 0x00, 0x10, 0x07, 0x4b, 0x1a, 0x68,
+ 0x90, 0x42, 0x0a, 0xd0, 0x18, 0x60, 0x06, 0x4a, 0x06, 0x49, 0xa0, 0x23,
+ 0x1b, 0x06, 0x99, 0x50, 0x05, 0x49, 0xc0, 0x00, 0x58, 0x50, 0x00, 0x21,
+ 0x99, 0x50, 0x70, 0x47, 0xd0, 0x05, 0x00, 0x10, 0x88, 0x20, 0x00, 0x00,
+ 0x07, 0x00, 0xf8, 0xff, 0x88, 0x21, 0x00, 0x00, 0x10, 0xb5, 0x07, 0x4c,
+ 0x07, 0x49, 0x20, 0x1c, 0xff, 0xf7, 0xfa, 0xf9, 0x20, 0x1c, 0x05, 0x21,
+ 0xff, 0xf7, 0xd5, 0xf9, 0x20, 0x1c, 0x04, 0x49, 0xff, 0xf7, 0xae, 0xf9,
+ 0x10, 0xbd, 0xc0, 0x46, 0xd4, 0x05, 0x00, 0x10, 0xfc, 0x04, 0x02, 0x00,
+ 0x9a, 0x99, 0x99, 0x3e, 0x38, 0xb5, 0xa0, 0x24, 0x8a, 0x23, 0x24, 0x06,
+ 0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x06, 0x4d, 0x80, 0x23, 0x5b, 0x04,
+ 0x63, 0x51, 0xff, 0xf7, 0xc5, 0xff, 0x04, 0x4a, 0x80, 0x23, 0x5b, 0x01,
+ 0xa3, 0x50, 0xc0, 0x46, 0x63, 0x51, 0x38, 0xbd, 0x04, 0x22, 0x00, 0x00,
+ 0x84, 0x22, 0x00, 0x00, 0x38, 0xb5, 0xa0, 0x24, 0x88, 0x23, 0x24, 0x06,
+ 0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x06, 0x4d, 0x80, 0x23, 0x5b, 0x04,
+ 0x63, 0x51, 0xff, 0xf7, 0xad, 0xff, 0x04, 0x4a, 0x80, 0x23, 0x5b, 0x01,
+ 0xa3, 0x50, 0xc0, 0x46, 0x63, 0x51, 0x38, 0xbd, 0x04, 0x22, 0x00, 0x00,
+ 0x84, 0x22, 0x00, 0x00, 0x10, 0xb5, 0x20, 0x20, 0xff, 0xf7, 0xcc, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0xe1, 0xff, 0x21, 0x20, 0xff, 0xf7, 0xc6, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0xdb, 0xff, 0x22, 0x20, 0xff, 0xf7, 0xc0, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0x8f, 0xff, 0xa0, 0x23, 0x88, 0x22, 0x1b, 0x06,
+ 0x04, 0x21, 0x92, 0x01, 0x99, 0x50, 0x0a, 0x4a, 0x80, 0x21, 0x49, 0x04,
+ 0x99, 0x50, 0x80, 0x21, 0x49, 0x01, 0x99, 0x50, 0x07, 0x4b, 0x08, 0x4c,
+ 0xa0, 0x21, 0x80, 0x20, 0x09, 0x06, 0x40, 0x01, 0x08, 0x51, 0xc0, 0x46,
+ 0x01, 0x3b, 0x88, 0x50, 0x00, 0x2b, 0xf4, 0xd1, 0x10, 0xbd, 0xc0, 0x46,
+ 0x04, 0x22, 0x00, 0x00, 0x40, 0x97, 0x00, 0x00, 0x84, 0x22, 0x00, 0x00,
+ 0xf8, 0xb5, 0xa0, 0x24, 0x80, 0x23, 0x24, 0x06, 0x9b, 0x01, 0xe2, 0x58,
+ 0x04, 0x21, 0x0a, 0x43, 0xe2, 0x50, 0xa1, 0x4b, 0x80, 0x26, 0xe2, 0x58,
+ 0x76, 0x01, 0x32, 0x43, 0xe2, 0x50, 0xe1, 0x58, 0x80, 0x22, 0x52, 0x04,
+ 0x0a, 0x43, 0xe2, 0x50, 0xe2, 0x58, 0x01, 0x25, 0x2a, 0x43, 0xe2, 0x50,
+ 0x9a, 0x4b, 0x9b, 0x49, 0xe2, 0x58, 0x9b, 0x48, 0x0a, 0x43, 0xe2, 0x50,
+ 0x00, 0x21, 0xff, 0xf7, 0xf1, 0xf8, 0x99, 0x48, 0x00, 0x21, 0xff, 0xf7,
+ 0xed, 0xf8, 0x98, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xe9, 0xf8, 0x97, 0x48,
+ 0x00, 0x21, 0xff, 0xf7, 0xe5, 0xf8, 0x96, 0x48, 0x00, 0x21, 0xff, 0xf7,
+ 0xe1, 0xf8, 0x95, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xdd, 0xf8, 0x94, 0x48,
+ 0x00, 0x21, 0xff, 0xf7, 0xd9, 0xf8, 0x93, 0x48, 0x00, 0x21, 0xff, 0xf7,
+ 0xd5, 0xf8, 0x92, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xd1, 0xf8, 0x91, 0x48,
+ 0x00, 0x21, 0xff, 0xf7, 0xcd, 0xf8, 0x90, 0x48, 0x00, 0x21, 0xff, 0xf7,
+ 0xc9, 0xf8, 0x8f, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xc5, 0xf8, 0x8e, 0x48,
+ 0x00, 0x21, 0xff, 0xf7, 0xc1, 0xf8, 0x8d, 0x48, 0x00, 0x21, 0xff, 0xf7,
+ 0xbd, 0xf8, 0x8c, 0x4f, 0x8c, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xb8, 0xf8,
+ 0x00, 0x21, 0x8b, 0x48, 0xff, 0xf7, 0xb4, 0xf8, 0xff, 0xf7, 0x26, 0xff,
+ 0xe5, 0x51, 0x0a, 0x20, 0xfe, 0xf7, 0x49, 0xfe, 0x87, 0x4b, 0x0a, 0x20,
+ 0xe5, 0x50, 0xfe, 0xf7, 0x44, 0xfe, 0xe5, 0x51, 0x0a, 0x20, 0xfe, 0xf7,
+ 0x40, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0x2c, 0xff, 0x8e, 0x20, 0xa8, 0x40,
+ 0xff, 0xf7, 0x40, 0xff, 0x02, 0x20, 0xff, 0xf7, 0x25, 0xff, 0x80, 0x20,
+ 0xa8, 0x40, 0xff, 0xf7, 0x39, 0xff, 0x03, 0x20, 0xff, 0xf7, 0x1e, 0xff,
+ 0x7b, 0x48, 0xff, 0xf7, 0x33, 0xff, 0x08, 0x20, 0xff, 0xf7, 0x18, 0xff,
+ 0x79, 0x48, 0xff, 0xf7, 0x2d, 0xff, 0x0c, 0x20, 0xff, 0xf7, 0x12, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0x27, 0xff, 0x0f, 0x20, 0xff, 0xf7, 0x0c, 0xff,
+ 0x28, 0x1c, 0xff, 0xf7, 0x21, 0xff, 0x20, 0x20, 0xff, 0xf7, 0x06, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0x1b, 0xff, 0x21, 0x20, 0xff, 0xf7, 0x00, 0xff,
+ 0x00, 0x20, 0xff, 0xf7, 0x15, 0xff, 0x10, 0x20, 0xff, 0xf7, 0xfa, 0xfe,
+ 0x00, 0x20, 0xff, 0xf7, 0x0f, 0xff, 0x11, 0x20, 0xff, 0xf7, 0xf4, 0xfe,
+ 0x30, 0x1c, 0xff, 0xf7, 0x09, 0xff, 0x0a, 0x20, 0xfe, 0xf7, 0xff, 0xfd,
+ 0x30, 0x20, 0xff, 0xf7, 0xeb, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0x00, 0xff,
+ 0x31, 0x20, 0xff, 0xf7, 0xe5, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xfa, 0xfe,
+ 0x32, 0x20, 0xff, 0xf7, 0xdf, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xf4, 0xfe,
+ 0x33, 0x20, 0xff, 0xf7, 0xd9, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xee, 0xfe,
+ 0x34, 0x20, 0xff, 0xf7, 0xd3, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xe8, 0xfe,
+ 0x35, 0x20, 0xff, 0xf7, 0xcd, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xe2, 0xfe,
+ 0x36, 0x20, 0xff, 0xf7, 0xc7, 0xfe, 0xaf, 0x20, 0xff, 0xf7, 0xdc, 0xfe,
+ 0x37, 0x20, 0xff, 0xf7, 0xc1, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xd6, 0xfe,
+ 0x38, 0x20, 0xff, 0xf7, 0xbb, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xd0, 0xfe,
+ 0x39, 0x20, 0xff, 0xf7, 0xb5, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xca, 0xfe,
+ 0x0a, 0x20, 0xfe, 0xf7, 0xc0, 0xfd, 0xff, 0x20, 0xff, 0xf7, 0xac, 0xfe,
+ 0x03, 0x20, 0xff, 0xf7, 0xc1, 0xfe, 0x50, 0x20, 0xff, 0xf7, 0xa6, 0xfe,
+ 0x41, 0x48, 0xff, 0xf7, 0xbb, 0xfe, 0x51, 0x20, 0xff, 0xf7, 0xa0, 0xfe,
+ 0x3f, 0x48, 0xff, 0xf7, 0xb5, 0xfe, 0x52, 0x20, 0xff, 0xf7, 0x9a, 0xfe,
+ 0x3d, 0x4d, 0x05, 0x20, 0xff, 0xf7, 0xae, 0xfe, 0x53, 0x20, 0xff, 0xf7,
+ 0x93, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0xa8, 0xfe, 0x54, 0x20, 0xff, 0xf7,
+ 0x8d, 0xfe, 0x38, 0x48, 0xff, 0xf7, 0xa2, 0xfe, 0x55, 0x20, 0xff, 0xf7,
+ 0x87, 0xfe, 0x36, 0x4c, 0x03, 0x20, 0xff, 0xf7, 0x9b, 0xfe, 0x56, 0x20,
+ 0xff, 0xf7, 0x80, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0x95, 0xfe, 0x57, 0x20,
+ 0xff, 0xf7, 0x7a, 0xfe, 0x30, 0x48, 0xff, 0xf7, 0x8f, 0xfe, 0x58, 0x20,
+ 0xff, 0xf7, 0x74, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0x89, 0xfe, 0x59, 0x20,
+ 0xff, 0xf7, 0x6e, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0x83, 0xfe, 0xb0, 0x20,
+ 0xff, 0xf7, 0x68, 0xfe, 0x28, 0x48, 0xff, 0xf7, 0x7d, 0xfe, 0xff, 0x20,
+ 0xff, 0xf7, 0x62, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0x77, 0xfe, 0x07, 0x20,
+ 0xff, 0xf7, 0x5c, 0xfe, 0x23, 0x48, 0xff, 0xf7, 0x71, 0xfe, 0xc8, 0x20,
+ 0xfe, 0xf7, 0x67, 0xfd, 0x22, 0x20, 0xff, 0xf7, 0x53, 0xfe, 0xff, 0xf7,
+ 0x81, 0xfe, 0xf8, 0xbd, 0x04, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00,
+ 0xf8, 0xff, 0x07, 0x00, 0x00, 0x07, 0x02, 0x00, 0x04, 0x09, 0x02, 0x00,
+ 0x08, 0x0b, 0x02, 0x00, 0x0c, 0x0d, 0x02, 0x00, 0x10, 0x0f, 0x02, 0x00,
+ 0x14, 0x11, 0x02, 0x00, 0x18, 0x13, 0x02, 0x00, 0x1c, 0x15, 0x02, 0x00,
+ 0x20, 0x17, 0x02, 0x00, 0x24, 0x19, 0x02, 0x00, 0x28, 0x1b, 0x02, 0x00,
+ 0x2c, 0x1d, 0x02, 0x00, 0x30, 0x1f, 0x02, 0x00, 0x34, 0x21, 0x02, 0x00,
+ 0x04, 0x22, 0x00, 0x00, 0x38, 0x23, 0x02, 0x00, 0x3c, 0x25, 0x02, 0x00,
+ 0x84, 0x22, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00,
+ 0x03, 0x02, 0x00, 0x00, 0x09, 0x0a, 0x00, 0x00, 0x21, 0x10, 0x00, 0x00,
+ 0x02, 0x06, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00,
+ 0x01, 0x25, 0x00, 0x00, 0x17, 0x10, 0x00, 0x00, 0xf8, 0xb5, 0x04, 0x1c,
+ 0x0d, 0x1c, 0x17, 0x1c, 0xdb, 0x28, 0x24, 0xd8, 0xaf, 0x29, 0x22, 0xd8,
+ 0x20, 0x20, 0xff, 0xf7, 0x07, 0xfe, 0xa8, 0xb2, 0xff, 0xf7, 0x1c, 0xfe,
+ 0x21, 0x20, 0xff, 0xf7, 0x01, 0xfe, 0xa0, 0xb2, 0xff, 0xf7, 0x16, 0xfe,
+ 0x22, 0x20, 0xff, 0xf7, 0xfb, 0xfd, 0xa0, 0x24, 0x88, 0x23, 0x24, 0x06,
+ 0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x07, 0x4d, 0x80, 0x23, 0x80, 0x26,
+ 0x5b, 0x04, 0x76, 0x01, 0x63, 0x51, 0xb8, 0xb2, 0x66, 0x51, 0xff, 0xf7,
+ 0xbd, 0xfd, 0x03, 0x4b, 0xe6, 0x50, 0xc0, 0x46, 0x66, 0x51, 0xf8, 0xbd,
+ 0x04, 0x22, 0x00, 0x00, 0x84, 0x22, 0x00, 0x00, 0x0c, 0x4b, 0x00, 0x20,
+ 0x10, 0xb5, 0x18, 0x60, 0x0b, 0x4b, 0x00, 0x21, 0x0b, 0x4c, 0x00, 0x22,
+ 0x24, 0x18, 0x62, 0x54, 0x01, 0x31, 0x0a, 0x29, 0xf8, 0xd1, 0x1a, 0x70,
+ 0x5a, 0x70, 0x9a, 0x70, 0xda, 0x70, 0x1a, 0x71, 0x0a, 0x30, 0xfa, 0x22,
+ 0x05, 0x33, 0x92, 0x00, 0x90, 0x42, 0xec, 0xd1, 0x10, 0xbd, 0xc0, 0x46,
+ 0xbc, 0x0b, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10, 0xd0, 0x07, 0x00, 0x10,
+ 0x03, 0x78, 0x30, 0xb5, 0x2e, 0x2b, 0x09, 0xd1, 0x43, 0x78, 0x00, 0x2b,
+ 0x01, 0xd0, 0x2e, 0x2b, 0x04, 0xd1, 0x2e, 0x23, 0x0b, 0x70, 0x43, 0x78,
+ 0x4b, 0x70, 0x11, 0xe0, 0x00, 0x23, 0x1d, 0x1c, 0xc4, 0x5c, 0x2e, 0x2c,
+ 0x06, 0xd0, 0x00, 0x2c, 0x0a, 0xd0, 0x00, 0x2d, 0x02, 0xd1, 0x0c, 0x70,
+ 0x01, 0x31, 0x02, 0xe0, 0x14, 0x70, 0x01, 0x25, 0x01, 0x32, 0x01, 0x33,
+ 0x0f, 0x2b, 0xef, 0xd1, 0x30, 0xbd, 0x00, 0x00, 0x38, 0xb5, 0x04, 0x1c,
+ 0xff, 0xf7, 0xba, 0xff, 0xff, 0xf7, 0xac, 0xf9, 0x00, 0x28, 0x04, 0xd1,
+ 0x11, 0x49, 0x12, 0x48, 0x00, 0xf0, 0xd6, 0xfe, 0x19, 0xe0, 0x00, 0x2c,
+ 0x15, 0xd1, 0x0f, 0x49, 0x0f, 0x4a, 0xff, 0xf7, 0xcb, 0xff, 0x01, 0x24,
+ 0x0f, 0xe0, 0xff, 0xf7, 0xe1, 0xf9, 0x03, 0x78, 0x00, 0x2b, 0x0e, 0xd0,
+ 0x0a, 0x21, 0x61, 0x43, 0x05, 0x22, 0x08, 0x4b, 0x62, 0x43, 0x59, 0x18,
+ 0x07, 0x4b, 0x01, 0x34, 0x9a, 0x18, 0xff, 0xf7, 0xb9, 0xff, 0x63, 0x2c,
+ 0xed, 0xdd, 0x00, 0x20, 0x00, 0xe0, 0x20, 0x1c, 0x38, 0xbd, 0xc0, 0x46,
+ 0x97, 0xe2, 0x03, 0x00, 0xd0, 0x07, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10,
+ 0xf0, 0xb5, 0x87, 0xb0, 0x05, 0x93, 0x27, 0x4b, 0x0a, 0x25, 0x1c, 0x68,
+ 0x26, 0x4b, 0x65, 0x43, 0x5d, 0x19, 0x05, 0x23, 0x63, 0x43, 0x04, 0x92,
+ 0x24, 0x4a, 0x03, 0x90, 0xd3, 0x18, 0x0e, 0x1c, 0x00, 0x93, 0x2b, 0x78,
+ 0x00, 0x2b, 0x3a, 0xd0, 0x03, 0x9a, 0xf3, 0xb2, 0xd2, 0xb2, 0x10, 0x1c,
+ 0x19, 0x1c, 0x01, 0x92, 0x02, 0x93, 0x00, 0xf0, 0x33, 0xfd, 0x1d, 0x4b,
+ 0x1a, 0x68, 0x19, 0x4b, 0x1b, 0x68, 0xd2, 0x18, 0x1b, 0x4b, 0x94, 0x42,
+ 0x01, 0xd1, 0x05, 0x9a, 0x00, 0xe0, 0x04, 0x9a, 0x28, 0x1c, 0x1a, 0x60,
+ 0x00, 0xf0, 0x20, 0xfd, 0x17, 0x4f, 0x0a, 0x25, 0x3b, 0x68, 0x01, 0x9a,
+ 0x18, 0x78, 0x01, 0x34, 0x68, 0x43, 0x10, 0x18, 0xc0, 0xb2, 0x02, 0x99,
+ 0x65, 0x43, 0x00, 0xf0, 0x17, 0xfd, 0x00, 0x98, 0x00, 0xf0, 0x26, 0xfd,
+ 0x0b, 0x4b, 0x0c, 0x4a, 0x5d, 0x19, 0x05, 0x23, 0x63, 0x43, 0xd2, 0x18,
+ 0x3b, 0x68, 0x00, 0x92, 0x5b, 0x78, 0xf6, 0x18, 0x05, 0x4b, 0x1b, 0x68,
+ 0x0d, 0x33, 0x9c, 0x42, 0x03, 0xd0, 0x09, 0x4b, 0x1b, 0x68, 0x9c, 0x42,
+ 0xc1, 0xd1, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xc0, 0x0c, 0x00, 0x10,
+ 0xd0, 0x07, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10, 0xc4, 0x0c, 0x00, 0x10,
+ 0x10, 0x01, 0x00, 0x10, 0xcc, 0x0c, 0x00, 0x10, 0xbc, 0x0b, 0x00, 0x10,
+ 0x70, 0xb5, 0x06, 0x1c, 0x0d, 0x1c, 0x00, 0x24, 0x09, 0x4b, 0xf0, 0xb2,
+ 0x1b, 0x68, 0x59, 0x78, 0x61, 0x43, 0x49, 0x19, 0xc9, 0xb2, 0x00, 0xf0,
+ 0xe3, 0xfc, 0x06, 0x4b, 0x00, 0x22, 0x06, 0x48, 0x01, 0x34, 0x1a, 0x60,
+ 0x00, 0xf0, 0xee, 0xfc, 0x0d, 0x2c, 0xed, 0xd1, 0x70, 0xbd, 0xc0, 0x46,
+ 0xcc, 0x0c, 0x00, 0x10, 0x10, 0x01, 0x00, 0x10, 0x52, 0xe3, 0x03, 0x00,
+ 0xf8, 0xb5, 0x10, 0x4c, 0x07, 0x1c, 0x20, 0x60, 0x00, 0x20, 0x0e, 0x1c,
+ 0x01, 0x1c, 0x15, 0x1c, 0x00, 0xf0, 0xc8, 0xfc, 0x0c, 0x48, 0x00, 0xf0,
+ 0xc1, 0xfc, 0x0c, 0x48, 0x26, 0x60, 0x00, 0xf0, 0xbd, 0xfc, 0x0b, 0x48,
+ 0x25, 0x60, 0x00, 0xf0, 0xcf, 0xfc, 0x0a, 0x48, 0x27, 0x60, 0x00, 0xf0,
+ 0xb5, 0xfc, 0x09, 0x48, 0x26, 0x60, 0x00, 0xf0, 0xb1, 0xfc, 0x08, 0x48,
+ 0x25, 0x60, 0x00, 0xf0, 0xc3, 0xfc, 0xf8, 0xbd, 0x10, 0x01, 0x00, 0x10,
+ 0xa0, 0xe2, 0x03, 0x00, 0xa7, 0xe2, 0x03, 0x00, 0xb6, 0xe2, 0x03, 0x00,
+ 0xbe, 0xe2, 0x03, 0x00, 0xc5, 0xe2, 0x03, 0x00, 0xd4, 0xe2, 0x03, 0x00,
+ 0x38, 0xb5, 0x13, 0x4b, 0x18, 0x21, 0x18, 0x60, 0x00, 0x20, 0x00, 0xf0,
+ 0x9b, 0xfc, 0x05, 0x24, 0x10, 0x4d, 0x01, 0x3c, 0x28, 0x1c, 0x00, 0xf0,
+ 0xa7, 0xfc, 0x00, 0x2c, 0xf8, 0xd1, 0x0e, 0x4c, 0x20, 0x1c, 0x00, 0xf0,
+ 0xa1, 0xfc, 0x0d, 0x48, 0x00, 0xf0, 0x88, 0xfc, 0x20, 0x1c, 0x00, 0xf0,
+ 0x9b, 0xfc, 0x20, 0x1c, 0x00, 0xf0, 0x98, 0xfc, 0x05, 0x24, 0x28, 0x1c,
+ 0x01, 0x3c, 0x00, 0xf0, 0x93, 0xfc, 0x00, 0x2c, 0xf9, 0xd1, 0x06, 0x48,
+ 0x00, 0xf0, 0x8e, 0xfc, 0x38, 0xbd, 0xc0, 0x46, 0x10, 0x01, 0x00, 0x10,
+ 0xdc, 0xe2, 0x03, 0x00, 0xf8, 0xe2, 0x03, 0x00, 0x14, 0xe3, 0x03, 0x00,
+ 0x19, 0xe3, 0x03, 0x00, 0x19, 0x4b, 0x00, 0x22, 0x70, 0xb5, 0x05, 0x1c,
+ 0x1a, 0x60, 0x16, 0x24, 0x1e, 0x1c, 0x17, 0x48, 0x01, 0x3c, 0x00, 0xf0,
+ 0x77, 0xfc, 0x00, 0x2c, 0xf9, 0xd1, 0x20, 0x24, 0xe1, 0xb2, 0x28, 0x20,
+ 0x00, 0xf0, 0x5e, 0xfc, 0x08, 0x34, 0x12, 0x48, 0x00, 0xf0, 0x6c, 0xfc,
+ 0x98, 0x2c, 0xf5, 0xd1, 0x28, 0x20, 0x20, 0x21, 0x35, 0x60, 0x00, 0xf0,
+ 0x53, 0xfc, 0x0e, 0x48, 0x00, 0xf0, 0x62, 0xfc, 0x28, 0x24, 0xe1, 0xb2,
+ 0x28, 0x20, 0x00, 0xf0, 0x4b, 0xfc, 0x08, 0x34, 0x0a, 0x48, 0x00, 0xf0,
+ 0x59, 0xfc, 0x90, 0x2c, 0xf5, 0xd1, 0x21, 0x1c, 0x28, 0x20, 0x00, 0xf0,
+ 0x41, 0xfc, 0x07, 0x48, 0x00, 0xf0, 0x50, 0xfc, 0x70, 0xbd, 0xc0, 0x46,
+ 0x10, 0x01, 0x00, 0x10, 0x35, 0xe3, 0x03, 0x00, 0x51, 0xe3, 0x03, 0x00,
+ 0x64, 0xe3, 0x03, 0x00, 0x77, 0xe3, 0x03, 0x00, 0x8a, 0xe3, 0x03, 0x00,
+ 0x38, 0xb5, 0xf8, 0x24, 0x24, 0x02, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7,
+ 0xb9, 0xff, 0x21, 0x4b, 0x30, 0x21, 0x60, 0x20, 0x1c, 0x60, 0x00, 0xf0,
+ 0x23, 0xfc, 0x1f, 0x48, 0x00, 0xf0, 0x1c, 0xfc, 0x38, 0x21, 0x60, 0x20,
+ 0x00, 0xf0, 0x1c, 0xfc, 0x1c, 0x48, 0x00, 0xf0, 0x15, 0xfc, 0x40, 0x21,
+ 0x60, 0x20, 0x00, 0xf0, 0x15, 0xfc, 0x1a, 0x48, 0x00, 0xf0, 0x0e, 0xfc,
+ 0x48, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x0e, 0xfc, 0x17, 0x48, 0x00, 0xf0,
+ 0x07, 0xfc, 0x60, 0x21, 0x38, 0x20, 0x00, 0xf0, 0x07, 0xfc, 0x28, 0x1c,
+ 0x00, 0xf0, 0x00, 0xfc, 0xff, 0xf7, 0x3e, 0xfe, 0x12, 0x49, 0x13, 0x48,
+ 0x00, 0xf0, 0x5e, 0xfd, 0x12, 0x4b, 0x13, 0x49, 0x00, 0x22, 0x1d, 0x68,
+ 0x0a, 0x60, 0x1a, 0x60, 0x1c, 0x1c, 0xff, 0xf7, 0xe1, 0xfa, 0x50, 0x20,
+ 0x78, 0x21, 0x0f, 0x4a, 0x0f, 0x4b, 0xff, 0xf7, 0x9f, 0xfe, 0xff, 0xf7,
+ 0x8b, 0xfa, 0x00, 0x28, 0xf3, 0xd0, 0x0d, 0x4b, 0x00, 0x22, 0x25, 0x60,
+ 0x1a, 0x60, 0x38, 0xbd, 0x10, 0x01, 0x00, 0x10, 0x9d, 0xe3, 0x03, 0x00,
+ 0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00, 0xac, 0xe3, 0x03, 0x00,
+ 0xb1, 0xe3, 0x03, 0x00, 0xd0, 0x07, 0x00, 0x10, 0xc4, 0x0c, 0x00, 0x10,
+ 0xc0, 0x0c, 0x00, 0x10, 0xef, 0x7b, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
+ 0xb8, 0x0b, 0x00, 0x10, 0x38, 0xb5, 0xff, 0xf7, 0xb7, 0xfa, 0x1d, 0x4c,
+ 0x20, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0x2d, 0xfd, 0x03, 0x22,
+ 0x16, 0x2f, 0x31, 0x00, 0x19, 0x4d, 0xff, 0xf7, 0x0d, 0xfc, 0x80, 0x20,
+ 0x29, 0x1c, 0x18, 0x4a, 0xc0, 0x00, 0xff, 0xf7, 0xe7, 0xfe, 0x17, 0x4b,
+ 0x17, 0x48, 0x1d, 0x60, 0x00, 0xf0, 0xc6, 0xfb, 0x28, 0x1c, 0xff, 0xf7,
+ 0x0f, 0xff, 0x02, 0x23, 0x16, 0xe0, 0x18, 0x20, 0x30, 0x21, 0x00, 0xf0,
+ 0xab, 0xfb, 0x10, 0x4b, 0x11, 0x4a, 0x12, 0x48, 0x1a, 0x60, 0x00, 0xf0,
+ 0xb7, 0xfb, 0x01, 0x23, 0x0a, 0xe0, 0xff, 0xf7, 0x2f, 0xfa, 0x00, 0x28,
+ 0x01, 0xd0, 0x03, 0x23, 0x23, 0x60, 0xff, 0xf7, 0x31, 0xfa, 0x00, 0x28,
+ 0xcb, 0xd0, 0x04, 0x23, 0x23, 0x60, 0xc8, 0xe7, 0x01, 0x22, 0x00, 0xe0,
+ 0x03, 0x22, 0x08, 0x4b, 0x1a, 0x60, 0x38, 0xbd, 0xb8, 0x0b, 0x00, 0x10,
+ 0xff, 0x07, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10,
+ 0xbb, 0xe3, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xd7, 0xe3, 0x03, 0x00,
+ 0x14, 0x01, 0x00, 0x10, 0x38, 0xb5, 0xff, 0xf7, 0x69, 0xfa, 0x1e, 0x4c,
+ 0x20, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0xdf, 0xfc, 0x03, 0x23,
+ 0x17, 0x30, 0x32, 0x00, 0x1a, 0x4d, 0xff, 0xf7, 0xbf, 0xfb, 0x80, 0x20,
+ 0x82, 0x21, 0xc9, 0x00, 0x2a, 0x1c, 0xc0, 0x00, 0xff, 0xf7, 0x98, 0xfe,
+ 0x16, 0x4b, 0x17, 0x48, 0x1d, 0x60, 0x00, 0xf0, 0x77, 0xfb, 0x28, 0x1c,
+ 0xff, 0xf7, 0xc0, 0xfe, 0x02, 0x23, 0x16, 0xe0, 0x18, 0x20, 0x30, 0x21,
+ 0x00, 0xf0, 0x5c, 0xfb, 0x0f, 0x4b, 0x11, 0x4a, 0x11, 0x48, 0x1a, 0x60,
+ 0x00, 0xf0, 0x68, 0xfb, 0x01, 0x23, 0x0a, 0xe0, 0xff, 0xf7, 0xe0, 0xf9,
+ 0x00, 0x28, 0x01, 0xd0, 0x03, 0x23, 0x23, 0x60, 0xff, 0xf7, 0xe2, 0xf9,
+ 0x00, 0x28, 0xca, 0xd0, 0x04, 0x23, 0x23, 0x60, 0xc7, 0xe7, 0x02, 0x22,
+ 0x00, 0xe0, 0x01, 0x22, 0x07, 0x4b, 0x1a, 0x60, 0x38, 0xbd, 0xc0, 0x46,
+ 0xb8, 0x0b, 0x00, 0x10, 0x1f, 0xf8, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10,
+ 0xe0, 0xe3, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xfc, 0xe3, 0x03, 0x00,
+ 0x14, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x89, 0xb0, 0x6e, 0x46, 0x01, 0x23,
+ 0x0b, 0x36, 0x33, 0x70, 0x00, 0x23, 0x03, 0xad, 0x00, 0x24, 0x5c, 0x55,
+ 0x01, 0x33, 0x14, 0x2b, 0xf9, 0xd1, 0x27, 0x1c, 0x20, 0x1c, 0x31, 0x1c,
+ 0x01, 0x22, 0x03, 0xf0, 0x0d, 0xf8, 0x33, 0x78, 0x00, 0x2b, 0x06, 0xd0,
+ 0x2b, 0x55, 0x63, 0x1c, 0x27, 0x1c, 0x14, 0x2b, 0x01, 0xd0, 0x1c, 0x1c,
+ 0xf0, 0xe7, 0x5b, 0x4c, 0xfc, 0x23, 0xdb, 0x00, 0x23, 0x60, 0xff, 0xf7,
+ 0x5d, 0xfb, 0x30, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x0b, 0xfb, 0x57, 0x48,
+ 0x00, 0xf0, 0x04, 0xfb, 0x38, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x04, 0xfb,
+ 0x54, 0x48, 0x00, 0xf0, 0xfd, 0xfa, 0x40, 0x21, 0x60, 0x20, 0x00, 0xf0,
+ 0xfd, 0xfa, 0x52, 0x48, 0x00, 0xf0, 0xf6, 0xfa, 0x48, 0x21, 0x60, 0x20,
+ 0x00, 0xf0, 0xf6, 0xfa, 0x4f, 0x48, 0x00, 0xf0, 0xef, 0xfa, 0x08, 0x20,
+ 0x40, 0x42, 0xc0, 0x1b, 0x80, 0x00, 0x6e, 0x30, 0x60, 0x21, 0xc0, 0xb2,
+ 0x00, 0xf0, 0xea, 0xfa, 0x4a, 0x48, 0x00, 0xf0, 0xe3, 0xfa, 0x28, 0x1c,
+ 0x00, 0xf0, 0xe0, 0xfa, 0x02, 0xf0, 0xf9, 0xfe, 0x27, 0x1c, 0x00, 0x28,
+ 0x02, 0xd0, 0x46, 0x48, 0xff, 0xf7, 0xac, 0xfe, 0x28, 0x1c, 0x04, 0x21,
+ 0xfe, 0xf7, 0x92, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x42, 0x48, 0xff, 0xf7,
+ 0xa3, 0xfe, 0xfe, 0xf7, 0xc3, 0xff, 0xfe, 0xf7, 0xcd, 0xff, 0x80, 0x23,
+ 0x05, 0x1c, 0x9b, 0x02, 0x98, 0x42, 0x00, 0xd9, 0x1d, 0x1c, 0xfe, 0xf7,
+ 0xaf, 0xff, 0x01, 0x23, 0x5b, 0x42, 0x00, 0x22, 0x00, 0x93, 0x01, 0x92,
+ 0x00, 0x24, 0x1e, 0x20, 0x78, 0x21, 0x00, 0xf0, 0xbd, 0xfa, 0xfc, 0x23,
+ 0xdb, 0x00, 0x3b, 0x60, 0x00, 0x9b, 0xa3, 0x42, 0x02, 0xd1, 0xac, 0x42,
+ 0x1c, 0xd3, 0x48, 0xe0, 0x01, 0x98, 0x32, 0x49, 0x01, 0xf0, 0x52, 0xf8,
+ 0x00, 0x26, 0x00, 0x90, 0x30, 0x1c, 0x01, 0xf0, 0x0d, 0xfb, 0x00, 0x99,
+ 0x00, 0xf0, 0xd8, 0xfc, 0x00, 0x28, 0x04, 0xd0, 0xfc, 0x23, 0xdb, 0x00,
+ 0x3b, 0x60, 0x2b, 0x48, 0x02, 0xe0, 0x2b, 0x4b, 0x2b, 0x48, 0x3b, 0x60,
+ 0x01, 0x36, 0x00, 0xf0, 0x97, 0xfa, 0x14, 0x2e, 0xea, 0xd1, 0xe0, 0xe7,
+ 0x01, 0x98, 0x01, 0xf0, 0xd7, 0xfa, 0x27, 0x4e, 0x80, 0x21, 0x00, 0x90,
+ 0x49, 0x00, 0x30, 0x1c, 0xfe, 0xf7, 0x6e, 0xff, 0xff, 0x28, 0x07, 0xd8,
+ 0x80, 0x22, 0x2b, 0x1b, 0x52, 0x00, 0x93, 0x42, 0x02, 0xd9, 0x21, 0x48,
+ 0xff, 0xf7, 0x54, 0xfe, 0x20, 0x1c, 0x31, 0x1c, 0xfe, 0xf7, 0xa0, 0xff,
+ 0x00, 0x28, 0x03, 0xd0, 0x1d, 0x48, 0xff, 0xf7, 0x4b, 0xfe, 0x01, 0xe0,
+ 0x01, 0x34, 0xff, 0x34, 0x20, 0x1c, 0x01, 0xf0, 0x33, 0xfb, 0x06, 0x1c,
+ 0x28, 0x1c, 0x01, 0xf0, 0x2f, 0xfb, 0x01, 0x1c, 0x30, 0x1c, 0x00, 0xf0,
+ 0x2b, 0xfe, 0x01, 0x90, 0xa9, 0xe7, 0x90, 0x21, 0x4e, 0x20, 0x00, 0xf0,
+ 0x67, 0xfa, 0x13, 0x48, 0x00, 0xf0, 0x60, 0xfa, 0x12, 0x4a, 0x13, 0x4b,
+ 0x01, 0x20, 0xda, 0x60, 0x09, 0xb0, 0xf0, 0xbd, 0x10, 0x01, 0x00, 0x10,
+ 0x9d, 0xe3, 0x03, 0x00, 0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00,
+ 0xac, 0xe3, 0x03, 0x00, 0x06, 0xe4, 0x03, 0x00, 0x0f, 0xe4, 0x03, 0x00,
+ 0x21, 0xe4, 0x03, 0x00, 0x00, 0x00, 0xa0, 0x41, 0x4f, 0xe3, 0x03, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x20, 0xdc, 0x03, 0x00, 0xc0, 0x0b, 0x00, 0x10,
+ 0x30, 0xe4, 0x03, 0x00, 0x43, 0xe4, 0x03, 0x00, 0x55, 0xe4, 0x03, 0x00,
+ 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, 0xf0, 0xb5, 0x00, 0x22,
+ 0x87, 0xb0, 0x01, 0xad, 0x00, 0x23, 0x53, 0x55, 0x01, 0x32, 0x14, 0x2a,
+ 0xf9, 0xd1, 0x3d, 0x4c, 0x3d, 0x4a, 0x26, 0x68, 0x17, 0x68, 0x3d, 0x49,
+ 0xf0, 0x19, 0x0a, 0x26, 0x70, 0x43, 0x08, 0x18, 0xc6, 0x5c, 0x00, 0x2e,
+ 0x02, 0xd0, 0xee, 0x54, 0x01, 0x33, 0xf9, 0xe7, 0x2e, 0x22, 0xea, 0x54,
+ 0xfc, 0x27, 0xeb, 0x18, 0x42, 0x22, 0x5a, 0x70, 0xff, 0x00, 0x49, 0x22,
+ 0x9a, 0x70, 0x38, 0x1c, 0x4e, 0x22, 0xda, 0x70, 0xff, 0xf7, 0xa4, 0xfd,
+ 0x31, 0x4b, 0x30, 0x21, 0x60, 0x20, 0x1f, 0x60, 0x00, 0xf0, 0x0e, 0xfa,
+ 0x2f, 0x48, 0x00, 0xf0, 0x07, 0xfa, 0x38, 0x21, 0x60, 0x20, 0x00, 0xf0,
+ 0x07, 0xfa, 0x2d, 0x48, 0x00, 0xf0, 0x00, 0xfa, 0x40, 0x21, 0x60, 0x20,
+ 0x00, 0xf0, 0x00, 0xfa, 0x2a, 0x48, 0x00, 0xf0, 0xf9, 0xf9, 0x48, 0x21,
+ 0x60, 0x20, 0x00, 0xf0, 0xf9, 0xf9, 0x28, 0x48, 0x00, 0xf0, 0xf2, 0xf9,
+ 0x60, 0x21, 0x38, 0x20, 0x00, 0xf0, 0xf2, 0xf9, 0x25, 0x48, 0x00, 0xf0,
+ 0xeb, 0xf9, 0xff, 0xf7, 0x29, 0xfc, 0x24, 0x49, 0x1c, 0x48, 0x00, 0xf0,
+ 0x49, 0xfb, 0x1b, 0x48, 0x22, 0x49, 0x0a, 0x30, 0x00, 0xf0, 0x44, 0xfb,
+ 0x17, 0x48, 0x27, 0x68, 0x06, 0x60, 0x26, 0x60, 0xff, 0xf7, 0xca, 0xf8,
+ 0x60, 0x20, 0x70, 0x21, 0x1d, 0x4a, 0x1e, 0x4b, 0xff, 0xf7, 0x88, 0xfc,
+ 0xff, 0xf7, 0x54, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x23, 0x23, 0x60,
+ 0xff, 0xf7, 0x56, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0x01, 0x23, 0x23, 0x60,
+ 0xff, 0xf7, 0x68, 0xf8, 0x00, 0x28, 0xe7, 0xd0, 0x23, 0x68, 0x01, 0x2b,
+ 0x04, 0xd1, 0x14, 0x4b, 0x00, 0x22, 0x1a, 0x60, 0x27, 0x60, 0x06, 0xe0,
+ 0x00, 0x20, 0x29, 0x1c, 0x14, 0x22, 0x02, 0xf0, 0x83, 0xfe, 0xff, 0xf7,
+ 0x87, 0xfe, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xc4, 0x0c, 0x00, 0x10,
+ 0xc0, 0x0c, 0x00, 0x10, 0xd0, 0x07, 0x00, 0x10, 0x10, 0x01, 0x00, 0x10,
+ 0x9d, 0xe3, 0x03, 0x00, 0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00,
+ 0xac, 0xe3, 0x03, 0x00, 0x60, 0xe4, 0x03, 0x00, 0x6e, 0xe4, 0x03, 0x00,
+ 0x72, 0xe4, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
+ 0xb8, 0x0b, 0x00, 0x10, 0xf7, 0xb5, 0x00, 0x20, 0xff, 0xf7, 0x14, 0xfc,
+ 0x54, 0x4b, 0x00, 0x24, 0x18, 0x60, 0x01, 0x94, 0xff, 0xf7, 0x7c, 0xf8,
+ 0x52, 0x4d, 0x28, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0xf2, 0xfa,
+ 0x03, 0x1f, 0x17, 0x97, 0x99, 0x00, 0xfc, 0x26, 0xff, 0xf7, 0xd2, 0xf9,
+ 0xf6, 0x00, 0x82, 0x21, 0xc9, 0x00, 0x4c, 0x4a, 0x30, 0x1c, 0xff, 0xf7,
+ 0xab, 0xfc, 0x4b, 0x4b, 0x4b, 0x48, 0x1e, 0x60, 0x00, 0xf0, 0x8a, 0xf9,
+ 0x30, 0x1c, 0xff, 0xf7, 0xd3, 0xfc, 0x02, 0x23, 0x7d, 0xe0, 0x48, 0x4b,
+ 0x18, 0x20, 0x30, 0x21, 0x47, 0x4a, 0xff, 0xf7, 0x1d, 0xfc, 0x01, 0x23,
+ 0x75, 0xe0, 0xff, 0xf7, 0x07, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0xff, 0xf7,
+ 0x2b, 0xff, 0xff, 0xf7, 0x1d, 0xf8, 0x00, 0x28, 0x03, 0xd0, 0x01, 0x9b,
+ 0x01, 0x33, 0x9b, 0xb2, 0x01, 0x93, 0x01, 0x9a, 0xfa, 0x23, 0x9b, 0x00,
+ 0x9a, 0x42, 0x24, 0xd9, 0xff, 0xf7, 0x10, 0xf8, 0x00, 0x28, 0x03, 0xd0,
+ 0x3a, 0x4b, 0x01, 0x9a, 0x9a, 0x42, 0x1c, 0xd9, 0xff, 0xf7, 0x08, 0xf8,
+ 0x38, 0x4e, 0x43, 0x1e, 0x98, 0x41, 0x01, 0x9a, 0x33, 0x68, 0x40, 0x42,
+ 0x02, 0x40, 0x01, 0x3b, 0x01, 0x92, 0x33, 0x60, 0x00, 0x2b, 0x0c, 0xda,
+ 0x33, 0x4f, 0x3b, 0x68, 0x00, 0x2b, 0x07, 0xd0, 0x18, 0x20, 0x30, 0x21,
+ 0xff, 0xf7, 0x4a, 0xfc, 0x3b, 0x68, 0x0d, 0x3b, 0x3b, 0x60, 0x0c, 0x23,
+ 0x33, 0x60, 0x02, 0x23, 0x2b, 0x60, 0xfe, 0xf7, 0xf5, 0xff, 0x00, 0x28,
+ 0x01, 0xd0, 0x01, 0x34, 0xa4, 0xb2, 0xfa, 0x23, 0x9b, 0x00, 0x9c, 0x42,
+ 0x27, 0xd9, 0xfe, 0xf7, 0xeb, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x23, 0x4b,
+ 0x9c, 0x42, 0x20, 0xd9, 0xfe, 0xf7, 0xe4, 0xff, 0x21, 0x4e, 0x22, 0x4f,
+ 0x43, 0x1e, 0x98, 0x41, 0x3a, 0x68, 0x33, 0x68, 0x40, 0x42, 0x99, 0x18,
+ 0x15, 0x4a, 0x04, 0x40, 0x12, 0x68, 0x00, 0x92, 0x01, 0x3a, 0x91, 0x42,
+ 0x01, 0xda, 0x01, 0x33, 0x33, 0x60, 0x33, 0x68, 0x0c, 0x2b, 0x08, 0xdd,
+ 0x18, 0x20, 0x30, 0x21, 0xff, 0xf7, 0x18, 0xfc, 0x00, 0x23, 0x33, 0x60,
+ 0x3b, 0x68, 0x0d, 0x33, 0x3b, 0x60, 0x02, 0x23, 0x2b, 0x60, 0xfe, 0xf7,
+ 0x8d, 0xff, 0x00, 0x28, 0x01, 0xd0, 0x03, 0x23, 0x2b, 0x60, 0xfe, 0xf7,
+ 0x8f, 0xff, 0x00, 0x28, 0x00, 0xd1, 0x63, 0xe7, 0x04, 0x23, 0x2b, 0x60,
+ 0x60, 0xe7, 0x03, 0x22, 0x00, 0xe0, 0x02, 0x22, 0x0b, 0x4b, 0x1a, 0x60,
+ 0xf7, 0xbd, 0xc0, 0x46, 0xbc, 0x0b, 0x00, 0x10, 0xb8, 0x0b, 0x00, 0x10,
+ 0x10, 0x80, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 0x75, 0xe4, 0x03, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0xef, 0x7b, 0x00, 0x00, 0x30, 0x75, 0x00, 0x00,
+ 0xc4, 0x0c, 0x00, 0x10, 0xc0, 0x0c, 0x00, 0x10, 0x14, 0x01, 0x00, 0x10,
+ 0x25, 0x4a, 0x80, 0x23, 0x10, 0xb5, 0x5b, 0x02, 0x9a, 0x42, 0x02, 0xd9,
+ 0x23, 0x4b, 0x01, 0x22, 0x1a, 0x70, 0x62, 0xb6, 0x22, 0x4b, 0x05, 0x22,
+ 0x1a, 0x60, 0xff, 0xf7, 0x49, 0xf9, 0xfe, 0xf7, 0xbb, 0xfe, 0x20, 0x4a,
+ 0x20, 0x4b, 0x00, 0x20, 0x01, 0x1c, 0x1a, 0x60, 0x00, 0xf0, 0xbe, 0xf8,
+ 0x1e, 0x48, 0x00, 0xf0, 0xb7, 0xf8, 0x02, 0xf0, 0xd0, 0xfc, 0x1d, 0x4c,
+ 0x00, 0x28, 0x06, 0xd0, 0xf8, 0x23, 0x1b, 0x02, 0x1b, 0x48, 0x23, 0x60,
+ 0x00, 0xf0, 0xc2, 0xf8, 0xfe, 0xe7, 0xfc, 0x23, 0xdb, 0x00, 0x19, 0x48,
+ 0x23, 0x60, 0x00, 0xf0, 0xbb, 0xf8, 0x18, 0x4b, 0x23, 0x60, 0xff, 0xf7,
+ 0xf3, 0xf8, 0x17, 0x4b, 0x1b, 0x68, 0x02, 0x2b, 0x09, 0xd0, 0x03, 0x2b,
+ 0x0d, 0xd0, 0x01, 0x2b, 0xf9, 0xd1, 0x14, 0x4b, 0x00, 0x22, 0x1a, 0x60,
+ 0xff, 0xf7, 0xfe, 0xfe, 0xf1, 0xe7, 0x11, 0x4b, 0x00, 0x22, 0x1a, 0x60,
+ 0xff, 0xf7, 0xc4, 0xfc, 0xeb, 0xe7, 0x0e, 0x4b, 0x00, 0x22, 0x1a, 0x60,
+ 0xff, 0xf7, 0x0c, 0xfd, 0xe5, 0xe7, 0xc0, 0x46, 0xd9, 0xbd, 0x03, 0x00,
+ 0xc8, 0x0c, 0x00, 0x10, 0x10, 0xe0, 0x00, 0xe0, 0x94, 0xdf, 0x03, 0x00,
+ 0xcc, 0x0c, 0x00, 0x10, 0x91, 0xe4, 0x03, 0x00, 0x10, 0x01, 0x00, 0x10,
+ 0x2b, 0xe4, 0x03, 0x00, 0x9a, 0xe4, 0x03, 0x00, 0xff, 0xff, 0x00, 0x00,
+ 0x14, 0x01, 0x00, 0x10, 0xb8, 0x0b, 0x00, 0x10, 0x10, 0xb5, 0x04, 0x4b,
+ 0x1c, 0x68, 0xa3, 0x78, 0xd3, 0x1a, 0xdb, 0xb2, 0x22, 0x1c, 0xff, 0xf7,
+ 0x09, 0xf8, 0x10, 0xbd, 0xcc, 0x0c, 0x00, 0x10, 0x06, 0x49, 0x07, 0x4b,
+ 0x09, 0x68, 0x1a, 0x78, 0x49, 0x78, 0xb0, 0x20, 0x40, 0x1a, 0x82, 0x42,
+ 0x01, 0xdb, 0x00, 0x22, 0x00, 0xe0, 0x8a, 0x18, 0x1a, 0x70, 0x70, 0x47,
+ 0xcc, 0x0c, 0x00, 0x10, 0xd1, 0x0c, 0x00, 0x10, 0xf8, 0xb5, 0x05, 0x1e,
+ 0x0e, 0x2d, 0x21, 0xd8, 0x00, 0xf0, 0xb6, 0xf9, 0x38, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x0e, 0x20, 0x08, 0x20, 0x20, 0x1c, 0x38, 0x00,
+ 0x18, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0xff, 0xf7, 0xdb, 0xff, 0x29, 0xe0,
+ 0x16, 0x4a, 0x15, 0x4b, 0x12, 0x68, 0x18, 0x78, 0x12, 0x78, 0x80, 0x1a,
+ 0xc0, 0xb2, 0x18, 0x70, 0x13, 0x4b, 0x20, 0x22, 0x19, 0x78, 0xff, 0xf7,
+ 0xc1, 0xff, 0x1b, 0xe0, 0x0e, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0x17, 0xe0,
+ 0x0d, 0x4f, 0x0c, 0x4c, 0x3a, 0x68, 0x20, 0x78, 0x13, 0x78, 0xdc, 0x22,
+ 0xd3, 0x1a, 0x0b, 0x4e, 0x98, 0x42, 0x04, 0xdb, 0x00, 0x23, 0x23, 0x70,
+ 0xff, 0xf7, 0xba, 0xff, 0x20, 0x78, 0x2a, 0x1c, 0x31, 0x78, 0xff, 0xf7,
+ 0xa9, 0xff, 0x3b, 0x68, 0x1a, 0x78, 0x23, 0x78, 0xd3, 0x18, 0x23, 0x70,
+ 0xf8, 0xbd, 0xc0, 0x46, 0xd0, 0x0c, 0x00, 0x10, 0xcc, 0x0c, 0x00, 0x10,
+ 0xd1, 0x0c, 0x00, 0x10, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x78, 0x00, 0x28,
+ 0x03, 0xd0, 0x01, 0x34, 0xff, 0xf7, 0xb2, 0xff, 0xf8, 0xe7, 0x10, 0xbd,
+ 0x08, 0xb5, 0xff, 0xf7, 0xf3, 0xff, 0x08, 0xbd, 0x02, 0x4b, 0x18, 0x70,
+ 0x02, 0x4b, 0x19, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd0, 0x0c, 0x00, 0x10,
+ 0xd1, 0x0c, 0x00, 0x10, 0x08, 0xb5, 0x0d, 0x20, 0xff, 0xf7, 0x9e, 0xff,
+ 0x0a, 0x20, 0xff, 0xf7, 0x9b, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0xff, 0xf7,
+ 0xdd, 0xff, 0xff, 0xf7, 0xf3, 0xff, 0x08, 0xbd, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xb5, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0x5f, 0x46, 0xf0, 0xb4,
+ 0x52, 0x4a, 0x4f, 0x00, 0x7f, 0x0d, 0x83, 0xb0, 0xbe, 0x18, 0x04, 0x1c,
+ 0x0d, 0x1c, 0x89, 0x46, 0x8a, 0x46, 0x80, 0x46, 0x01, 0x97, 0x13, 0x2e,
+ 0x2a, 0xdc, 0x00, 0x2e, 0x56, 0xdb, 0x4c, 0x4f, 0x02, 0x1c, 0x37, 0x41,
+ 0x3b, 0x1c, 0x0b, 0x40, 0x03, 0x43, 0x9c, 0x46, 0xbb, 0x46, 0x67, 0x46,
+ 0x0b, 0x1c, 0x00, 0x2f, 0x13, 0xd0, 0x42, 0x4b, 0x40, 0x4a, 0x01, 0xf0,
+ 0xcf, 0xf8, 0x41, 0x4a, 0x41, 0x4b, 0x00, 0xf0, 0xa9, 0xf9, 0x00, 0x28,
+ 0x07, 0xd0, 0x00, 0x2d, 0x4e, 0xdb, 0x53, 0x46, 0x5f, 0x46, 0xbb, 0x43,
+ 0x00, 0x22, 0x99, 0x46, 0x90, 0x46, 0x4b, 0x46, 0x42, 0x46, 0x10, 0x1c,
+ 0x19, 0x1c, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 0xa2, 0x46,
+ 0xab, 0x46, 0xf0, 0xbd, 0x33, 0x2e, 0x0b, 0xdd, 0x0b, 0x1c, 0x80, 0x21,
+ 0x02, 0x1c, 0xc9, 0x00, 0x8e, 0x42, 0xee, 0xd1, 0x29, 0x1c, 0x01, 0xf0,
+ 0xab, 0xf8, 0x02, 0x1c, 0x0b, 0x1c, 0xe8, 0xe7, 0x01, 0x9f, 0x31, 0x4a,
+ 0xbb, 0x18, 0x01, 0x22, 0x52, 0x42, 0xda, 0x40, 0x93, 0x46, 0x5f, 0x46,
+ 0x02, 0x1c, 0x0b, 0x1c, 0x07, 0x42, 0xdc, 0xd0, 0x26, 0x4b, 0x25, 0x4a,
+ 0x01, 0xf0, 0x98, 0xf8, 0x25, 0x4a, 0x26, 0x4b, 0x00, 0xf0, 0x72, 0xf9,
+ 0x00, 0x28, 0xd0, 0xd0, 0x00, 0x2d, 0x1d, 0xdb, 0x42, 0x46, 0x5b, 0x46,
+ 0x9a, 0x43, 0x90, 0x46, 0xd1, 0x46, 0x4b, 0x46, 0x42, 0x46, 0xc8, 0xe7,
+ 0x1c, 0x4b, 0x1b, 0x4a, 0x01, 0xf0, 0x84, 0xf8, 0x1b, 0x4a, 0x1c, 0x4b,
+ 0x00, 0xf0, 0x5e, 0xf9, 0x00, 0x28, 0xbc, 0xd0, 0x00, 0x2d, 0x17, 0xdb,
+ 0x00, 0x27, 0xb8, 0x46, 0xb9, 0x46, 0xb6, 0xe7, 0x80, 0x23, 0x5b, 0x03,
+ 0x33, 0x41, 0x5e, 0x19, 0xb2, 0x46, 0xaa, 0xe7, 0x14, 0x2e, 0x19, 0xd0,
+ 0x16, 0x4b, 0x01, 0x9a, 0x9f, 0x1a, 0x01, 0x23, 0xbb, 0x40, 0x1b, 0x19,
+ 0x9c, 0x42, 0x0f, 0xd9, 0x6f, 0x1c, 0xba, 0x46, 0x98, 0x46, 0xd3, 0xe7,
+ 0x6b, 0x00, 0x5b, 0x08, 0x1c, 0x43, 0x02, 0xd1, 0x00, 0x27, 0xb8, 0x46,
+ 0x9b, 0xe7, 0x0e, 0x4f, 0x00, 0x23, 0x98, 0x46, 0xb9, 0x46, 0x96, 0xe7,
+ 0x98, 0x46, 0xc5, 0xe7, 0x6b, 0x1c, 0x9a, 0x46, 0xc2, 0xe7, 0xc0, 0x46,
+ 0xc0, 0x46, 0xc0, 0x46, 0x9c, 0x75, 0x00, 0x88, 0x3c, 0xe4, 0x37, 0x7e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff,
+ 0xff, 0xff, 0x0f, 0x00, 0xed, 0xfb, 0xff, 0xff, 0x33, 0x04, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xbf, 0xc0, 0x46, 0xc0, 0x46, 0x08, 0x4b, 0x10, 0xb5,
+ 0x04, 0x1c, 0x00, 0x2b, 0x02, 0xd0, 0x00, 0x21, 0x00, 0xe0, 0x00, 0xbf,
+ 0x05, 0x4b, 0x18, 0x68, 0x83, 0x6a, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47,
+ 0x20, 0x1c, 0xfd, 0xf7, 0x9f, 0xfd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe5, 0x03, 0x00, 0x70, 0xb5, 0x0e, 0x4b, 0x0e, 0x4d, 0x00, 0x24,
+ 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00,
+ 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x02, 0xf0, 0x08, 0xfa,
+ 0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c,
+ 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34,
+ 0xf8, 0xe7, 0x70, 0xbd, 0x90, 0xe5, 0x03, 0x00, 0x90, 0xe5, 0x03, 0x00,
+ 0x90, 0xe5, 0x03, 0x00, 0x9c, 0xe5, 0x03, 0x00, 0x08, 0xb5, 0x03, 0x4b,
+ 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x04, 0xf8, 0x08, 0xbd, 0xc0, 0x46,
+ 0x78, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x00, 0x29, 0x40, 0xd0, 0x04, 0x39,
+ 0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, 0x1e, 0x4a, 0x13, 0x68,
+ 0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, 0x11, 0x60, 0x33, 0xe0,
+ 0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, 0x9a, 0x42, 0x05, 0xd1,
+ 0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, 0x4a, 0x60, 0x00, 0xe0,
+ 0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, 0x03, 0xd8, 0x13, 0x1c,
+ 0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, 0x5c, 0x19, 0x8c, 0x42,
+ 0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, 0x19, 0x60, 0x90, 0x42,
+ 0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, 0x19, 0x60, 0x5a, 0x60,
+ 0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, 0x03, 0x60, 0x09, 0xe0,
+ 0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, 0x14, 0x68, 0x52, 0x68,
+ 0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, 0x30, 0xbd, 0xc0, 0x46,
+ 0xd4, 0x0c, 0x00, 0x10, 0x03, 0x1c, 0x0a, 0x78, 0x01, 0x31, 0x1a, 0x70,
+ 0x01, 0x33, 0x00, 0x2a, 0xf9, 0xd1, 0x70, 0x47, 0x02, 0xb4, 0x71, 0x46,
+ 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc,
+ 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22,
+ 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42,
+ 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7,
+ 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00,
+ 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43,
+ 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43,
+ 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43,
+ 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43,
+ 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7,
+ 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20,
+ 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90,
+ 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0,
+ 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a,
+ 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x84, 0x46, 0x10, 0x1c,
+ 0x62, 0x46, 0x8c, 0x46, 0x19, 0x1c, 0x63, 0x46, 0x00, 0xe0, 0xc0, 0x46,
+ 0x1f, 0xb5, 0x01, 0xf0, 0x2b, 0xfb, 0x00, 0x28, 0x01, 0xd4, 0x00, 0x21,
+ 0xc8, 0x42, 0x1f, 0xbd, 0x10, 0xb5, 0x01, 0xf0, 0x5b, 0xfa, 0x40, 0x42,
+ 0x01, 0x30, 0x10, 0xbd, 0x10, 0xb5, 0x01, 0xf0, 0x1d, 0xfb, 0x00, 0x28,
+ 0x01, 0xdb, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46,
+ 0x10, 0xb5, 0x01, 0xf0, 0x13, 0xfb, 0x00, 0x28, 0x01, 0xdd, 0x00, 0x20,
+ 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x01, 0xf0,
+ 0x8b, 0xfa, 0x00, 0x28, 0x01, 0xdc, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20,
+ 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x01, 0xf0, 0x81, 0xfa, 0x00, 0x28,
+ 0x01, 0xda, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46,
+ 0x84, 0x46, 0x08, 0x1c, 0x61, 0x46, 0xff, 0xe7, 0x1f, 0xb5, 0x00, 0xf0,
+ 0x4f, 0xfb, 0x00, 0x28, 0x01, 0xd4, 0x00, 0x21, 0xc8, 0x42, 0x1f, 0xbd,
+ 0x10, 0xb5, 0x00, 0xf0, 0xd5, 0xfa, 0x40, 0x42, 0x01, 0x30, 0x10, 0xbd,
+ 0x10, 0xb5, 0x00, 0xf0, 0x41, 0xfb, 0x00, 0x28, 0x01, 0xdb, 0x00, 0x20,
+ 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x00, 0xf0,
+ 0x37, 0xfb, 0x00, 0x28, 0x01, 0xdd, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20,
+ 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x00, 0xf0, 0xe5, 0xfa, 0x00, 0x28,
+ 0x01, 0xdc, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46,
+ 0x10, 0xb5, 0x00, 0xf0, 0xdb, 0xfa, 0x00, 0x28, 0x01, 0xda, 0x00, 0x20,
+ 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x9e, 0x21, 0x10, 0xb5,
+ 0xc9, 0x05, 0x04, 0x1c, 0xff, 0xf7, 0xf0, 0xff, 0x00, 0x28, 0x03, 0xd1,
+ 0x20, 0x1c, 0x00, 0xf0, 0xfd, 0xfd, 0x10, 0xbd, 0x9e, 0x21, 0xc9, 0x05,
+ 0x20, 0x1c, 0x00, 0xf0, 0x81, 0xfc, 0x00, 0xf0, 0xf5, 0xfd, 0x80, 0x23,
+ 0x1b, 0x06, 0xc0, 0x18, 0xf3, 0xe7, 0xc0, 0x46, 0xf8, 0xb5, 0x43, 0x02,
+ 0x44, 0x00, 0xc5, 0x0f, 0x4e, 0x02, 0x48, 0x00, 0x24, 0x0e, 0x2a, 0x1c,
+ 0x9b, 0x09, 0x00, 0x0e, 0xc9, 0x0f, 0xb6, 0x09, 0x8d, 0x42, 0x5b, 0xd0,
+ 0x22, 0x1a, 0x00, 0x2a, 0x00, 0xdc, 0x89, 0xe0, 0x00, 0x28, 0x1d, 0xd1,
+ 0x00, 0x2e, 0x00, 0xd0, 0x75, 0xe0, 0x58, 0x07, 0x04, 0xd0, 0x0f, 0x22,
+ 0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x80, 0x21, 0xc9, 0x04,
+ 0x19, 0x40, 0x2a, 0x1c, 0x00, 0x29, 0x3a, 0xd0, 0x01, 0x34, 0xff, 0x2c,
+ 0x00, 0xd1, 0x7f, 0xe0, 0x9b, 0x01, 0x5b, 0x0a, 0x5b, 0x02, 0xe4, 0xb2,
+ 0xe4, 0x05, 0x58, 0x0a, 0xd2, 0x07, 0x20, 0x43, 0x10, 0x43, 0xf8, 0xbd,
+ 0xff, 0x2c, 0xe2, 0xd0, 0x80, 0x21, 0xc9, 0x04, 0x0e, 0x43, 0x1b, 0x2a,
+ 0x00, 0xdd, 0x2d, 0xe1, 0x31, 0x1c, 0x20, 0x20, 0xd1, 0x40, 0x82, 0x1a,
+ 0x96, 0x40, 0x72, 0x1e, 0x96, 0x41, 0x0e, 0x43, 0x9b, 0x1b, 0x58, 0x01,
+ 0xd1, 0xd5, 0x9b, 0x01, 0x9f, 0x09, 0x38, 0x1c, 0x01, 0xf0, 0x60, 0xfb,
+ 0x42, 0x1f, 0x97, 0x40, 0x94, 0x42, 0x5b, 0xdc, 0x14, 0x1b, 0x1f, 0x23,
+ 0x1b, 0x1b, 0x3a, 0x1c, 0x9f, 0x40, 0x61, 0x1c, 0x3b, 0x1c, 0xca, 0x40,
+ 0x5f, 0x1e, 0xbb, 0x41, 0x13, 0x43, 0x00, 0x24, 0xbb, 0xe7, 0x13, 0x1e,
+ 0xb9, 0xd1, 0x00, 0x23, 0x00, 0x22, 0xdb, 0x08, 0xff, 0x2c, 0x04, 0xd1,
+ 0x00, 0x2b, 0x43, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x03, 0x43, 0x5b, 0x02,
+ 0x5b, 0x0a, 0xbf, 0xe7, 0x21, 0x1a, 0x00, 0x29, 0x40, 0xdd, 0x00, 0x28,
+ 0x23, 0xd0, 0xff, 0x2c, 0xa5, 0xd0, 0x80, 0x20, 0xc0, 0x04, 0x06, 0x43,
+ 0x1b, 0x29, 0x00, 0xdd, 0xee, 0xe0, 0x30, 0x1c, 0x20, 0x27, 0xc8, 0x40,
+ 0x79, 0x1a, 0x8e, 0x40, 0x71, 0x1e, 0x8e, 0x41, 0x06, 0x43, 0x9b, 0x19,
+ 0x59, 0x01, 0x00, 0xd4, 0x93, 0xe7, 0x01, 0x34, 0xff, 0x2c, 0x55, 0xd0,
+ 0x71, 0x49, 0x01, 0x22, 0x1a, 0x40, 0x0b, 0x40, 0x5b, 0x08, 0x13, 0x43,
+ 0x89, 0xe7, 0x01, 0x3a, 0x00, 0x2a, 0xb1, 0xd0, 0xff, 0x2c, 0xa4, 0xd1,
+ 0x83, 0xe7, 0x00, 0x2e, 0x00, 0xd1, 0x80, 0xe7, 0x01, 0x39, 0x00, 0x29,
+ 0xe5, 0xd0, 0xff, 0x2c, 0xd8, 0xd1, 0x7a, 0xe7, 0x00, 0x2a, 0x1b, 0xd1,
+ 0x62, 0x1c, 0xd2, 0xb2, 0x01, 0x2a, 0x4b, 0xdd, 0x9f, 0x1b, 0x7a, 0x01,
+ 0x23, 0xd5, 0xf7, 0x1a, 0x0d, 0x1c, 0x9e, 0xe7, 0x00, 0x23, 0x7f, 0xe7,
+ 0x5f, 0x4b, 0xa4, 0x1a, 0x3b, 0x40, 0x68, 0xe7, 0x00, 0x29, 0x46, 0xd1,
+ 0x61, 0x1c, 0xc8, 0xb2, 0x01, 0x28, 0x29, 0xdd, 0xff, 0x29, 0x24, 0xd0,
+ 0xf3, 0x18, 0x5b, 0x08, 0x0c, 0x1c, 0x5c, 0xe7, 0x00, 0x2c, 0x13, 0xd0,
+ 0xff, 0x28, 0x18, 0xd0, 0x80, 0x24, 0xe4, 0x04, 0x52, 0x42, 0x23, 0x43,
+ 0x1b, 0x2a, 0x4d, 0xdd, 0x01, 0x23, 0xf3, 0x1a, 0x04, 0x1c, 0x0d, 0x1c,
+ 0x79, 0xe7, 0x00, 0x2f, 0x00, 0xd0, 0x7a, 0xe7, 0x00, 0x23, 0x00, 0x22,
+ 0x00, 0x24, 0x8e, 0xe7, 0x00, 0x2b, 0x3b, 0xd0, 0xd2, 0x43, 0x00, 0x2a,
+ 0xef, 0xd0, 0xff, 0x28, 0xea, 0xd1, 0x33, 0x1c, 0xff, 0x24, 0x0d, 0x1c,
+ 0x3b, 0xe7, 0xff, 0x24, 0x00, 0x23, 0x80, 0xe7, 0x00, 0x2c, 0x5c, 0xd1,
+ 0x00, 0x2b, 0x00, 0xd1, 0x80, 0xe0, 0x00, 0x2e, 0x00, 0xd1, 0x30, 0xe7,
+ 0x9b, 0x19, 0x58, 0x01, 0x00, 0xd4, 0x2c, 0xe7, 0x3f, 0x4a, 0x01, 0x24,
+ 0x13, 0x40, 0x28, 0xe7, 0x00, 0x2c, 0x15, 0xd1, 0x00, 0x2b, 0x40, 0xd1,
+ 0x00, 0x2e, 0x63, 0xd0, 0x33, 0x1c, 0x0d, 0x1c, 0x1f, 0xe7, 0x00, 0x2c,
+ 0x21, 0xd1, 0x00, 0x2b, 0x54, 0xd0, 0xc9, 0x43, 0x00, 0x29, 0x04, 0xd0,
+ 0xff, 0x28, 0x4c, 0xd0, 0x1b, 0x29, 0x58, 0xdd, 0x01, 0x23, 0x9b, 0x19,
+ 0x04, 0x1c, 0x79, 0xe7, 0x00, 0x2b, 0x19, 0xd1, 0x00, 0x2e, 0x48, 0xd0,
+ 0x33, 0x1c, 0x0d, 0x1c, 0xff, 0x24, 0x08, 0xe7, 0x33, 0x1c, 0x04, 0x1c,
+ 0x0d, 0x1c, 0x04, 0xe7, 0x1c, 0x1c, 0x20, 0x25, 0xd4, 0x40, 0xaa, 0x1a,
+ 0x93, 0x40, 0x5a, 0x1e, 0x93, 0x41, 0x23, 0x43, 0xa9, 0xe7, 0xff, 0x28,
+ 0x2f, 0xd0, 0x80, 0x24, 0xe4, 0x04, 0x49, 0x42, 0x23, 0x43, 0xdd, 0xe7,
+ 0xff, 0x24, 0x00, 0x2e, 0x00, 0xd1, 0xf0, 0xe6, 0x80, 0x22, 0xdb, 0x08,
+ 0xd2, 0x03, 0x13, 0x42, 0x04, 0xd0, 0xf6, 0x08, 0x16, 0x42, 0x01, 0xd1,
+ 0x33, 0x1c, 0x0d, 0x1c, 0xdb, 0x00, 0xff, 0x24, 0xe3, 0xe6, 0x00, 0x2e,
+ 0x00, 0xd1, 0xe0, 0xe6, 0x9a, 0x1b, 0x50, 0x01, 0x00, 0xd4, 0x20, 0xe7,
+ 0xf3, 0x1a, 0x0d, 0x1c, 0xd9, 0xe6, 0x00, 0x2b, 0x0d, 0xd0, 0xff, 0x24,
+ 0x00, 0x2e, 0x00, 0xd1, 0xd3, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03,
+ 0x13, 0x42, 0xe7, 0xd0, 0xf6, 0x08, 0x16, 0x42, 0xe4, 0xd1, 0x33, 0x1c,
+ 0xe2, 0xe7, 0x33, 0x1c, 0xff, 0x24, 0xc6, 0xe6, 0x33, 0x1c, 0x04, 0x1c,
+ 0xc3, 0xe6, 0x80, 0x23, 0x00, 0x22, 0x9b, 0x04, 0xff, 0x24, 0x06, 0xe7,
+ 0x23, 0x1c, 0x00, 0x22, 0x03, 0xe7, 0x1c, 0x1c, 0x20, 0x27, 0xcc, 0x40,
+ 0x79, 0x1a, 0x8b, 0x40, 0x59, 0x1e, 0x8b, 0x41, 0x23, 0x43, 0x9e, 0xe7,
+ 0x33, 0x1c, 0xb0, 0xe6, 0x01, 0x26, 0x16, 0xe7, 0x01, 0x26, 0xd7, 0xe6,
+ 0xff, 0xff, 0xff, 0xfb, 0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46,
+ 0x44, 0x46, 0xf0, 0xb4, 0x46, 0x02, 0x45, 0x00, 0xc0, 0x0f, 0x85, 0xb0,
+ 0x0f, 0x1c, 0x76, 0x0a, 0x2d, 0x0e, 0x80, 0x46, 0x41, 0xd0, 0xff, 0x2d,
+ 0x26, 0xd0, 0x80, 0x24, 0x24, 0x04, 0x00, 0x21, 0x26, 0x43, 0xf6, 0x00,
+ 0x7f, 0x3d, 0x89, 0x46, 0x8b, 0x46, 0xf9, 0x0f, 0x7c, 0x02, 0x78, 0x00,
+ 0x64, 0x0a, 0x00, 0x0e, 0x00, 0x91, 0x8a, 0x46, 0x3c, 0xd0, 0xff, 0x28,
+ 0x34, 0xd0, 0x80, 0x23, 0x1b, 0x04, 0x1c, 0x43, 0x00, 0x23, 0xe4, 0x00,
+ 0x7f, 0x38, 0x01, 0x93, 0x00, 0x9f, 0x43, 0x46, 0x01, 0x9a, 0x7b, 0x40,
+ 0x49, 0x46, 0x9c, 0x46, 0x11, 0x43, 0x0f, 0x29, 0x00, 0xd9, 0x71, 0xe0,
+ 0x76, 0x4f, 0x89, 0x00, 0x7f, 0x58, 0xbf, 0x46, 0x00, 0x2e, 0x3e, 0xd1,
+ 0x08, 0x22, 0x02, 0x23, 0x91, 0x46, 0x9b, 0x46, 0xd9, 0xe7, 0x5a, 0x46,
+ 0x34, 0x1c, 0xc2, 0x46, 0x01, 0x92, 0x01, 0x99, 0x02, 0x29, 0x37, 0xd0,
+ 0x03, 0x29, 0x00, 0xd1, 0xcf, 0xe0, 0x01, 0x29, 0x00, 0xd0, 0xab, 0xe0,
+ 0x53, 0x46, 0x0b, 0x40, 0x00, 0x22, 0x00, 0x26, 0x32, 0xe0, 0x00, 0x2e,
+ 0x19, 0xd1, 0x04, 0x21, 0x01, 0x22, 0x89, 0x46, 0x93, 0x46, 0xc0, 0xe7,
+ 0x22, 0x1c, 0x53, 0x1e, 0x9a, 0x41, 0x02, 0x32, 0x01, 0x92, 0xcb, 0xe7,
+ 0x01, 0x27, 0x01, 0x97, 0x00, 0x2c, 0xc7, 0xd0, 0x20, 0x1c, 0x01, 0xf0,
+ 0xd9, 0xf9, 0x43, 0x1f, 0x9c, 0x40, 0x76, 0x23, 0x5b, 0x42, 0x00, 0x21,
+ 0x18, 0x1a, 0x01, 0x91, 0xbc, 0xe7, 0x30, 0x1c, 0x01, 0xf0, 0xce, 0xf9,
+ 0x76, 0x25, 0x43, 0x1f, 0x9e, 0x40, 0x6d, 0x42, 0x00, 0x23, 0x2d, 0x1a,
+ 0x99, 0x46, 0x9b, 0x46, 0x9f, 0xe7, 0x0c, 0x23, 0x03, 0x21, 0x99, 0x46,
+ 0x8b, 0x46, 0x9a, 0xe7, 0xd4, 0x46, 0x01, 0x23, 0x67, 0x46, 0x3b, 0x40,
+ 0xff, 0x22, 0x00, 0x26, 0x76, 0x02, 0xd2, 0x05, 0x70, 0x0a, 0xdb, 0x07,
+ 0x10, 0x43, 0x18, 0x43, 0x05, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46,
+ 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x80, 0x26, 0x00, 0x23, 0xf6, 0x03,
+ 0xff, 0x22, 0xed, 0xe7, 0x00, 0x22, 0x00, 0x26, 0xea, 0xe7, 0x80, 0x20,
+ 0xc0, 0x03, 0x06, 0x42, 0x3b, 0xd0, 0x04, 0x42, 0x39, 0xd1, 0x06, 0x1c,
+ 0x26, 0x43, 0x76, 0x02, 0x76, 0x0a, 0x00, 0x9b, 0xff, 0x22, 0xdd, 0xe7,
+ 0x28, 0x1a, 0x03, 0x90, 0x76, 0x01, 0x64, 0x01, 0xa6, 0x42, 0x39, 0xd3,
+ 0x36, 0x1b, 0x1a, 0x22, 0x01, 0x23, 0x01, 0x20, 0x31, 0x1c, 0x5b, 0x00,
+ 0x76, 0x00, 0x00, 0x29, 0x01, 0xdb, 0xb4, 0x42, 0x01, 0xd8, 0x36, 0x1b,
+ 0x03, 0x43, 0x01, 0x3a, 0x00, 0x2a, 0xf3, 0xdc, 0x74, 0x1e, 0xa6, 0x41,
+ 0x34, 0x1c, 0x1c, 0x43, 0x03, 0x9a, 0x7f, 0x32, 0x00, 0x2a, 0x27, 0xdd,
+ 0x63, 0x07, 0x04, 0xd0, 0x0f, 0x23, 0x23, 0x40, 0x04, 0x2b, 0x00, 0xd0,
+ 0x04, 0x34, 0x27, 0x01, 0x03, 0xd5, 0x2b, 0x4b, 0x03, 0x9a, 0x1c, 0x40,
+ 0x80, 0x32, 0xfe, 0x2a, 0x0b, 0xdd, 0x01, 0x23, 0x61, 0x46, 0x0b, 0x40,
+ 0xff, 0x22, 0x00, 0x26, 0xaa, 0xe7, 0x06, 0x43, 0x76, 0x02, 0x76, 0x0a,
+ 0x43, 0x46, 0xff, 0x22, 0xa4, 0xe7, 0xa4, 0x01, 0x01, 0x23, 0x67, 0x46,
+ 0x66, 0x0a, 0xd2, 0xb2, 0x3b, 0x40, 0x9d, 0xe7, 0x03, 0x9f, 0x1b, 0x22,
+ 0x01, 0x3f, 0x03, 0x97, 0x00, 0x23, 0xc2, 0xe7, 0x7e, 0x23, 0x03, 0x9f,
+ 0x5b, 0x42, 0xdb, 0x1b, 0x1b, 0x2b, 0x07, 0xdd, 0x01, 0x23, 0x61, 0x46,
+ 0x0b, 0x40, 0x00, 0x22, 0x00, 0x26, 0x8b, 0xe7, 0xd4, 0x46, 0xc5, 0xe7,
+ 0x22, 0x1c, 0xda, 0x40, 0x03, 0x9b, 0x9e, 0x33, 0x9c, 0x40, 0x23, 0x1c,
+ 0x5c, 0x1e, 0xa3, 0x41, 0x13, 0x43, 0x5a, 0x07, 0x04, 0xd0, 0x0f, 0x22,
+ 0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x5f, 0x01, 0x05, 0xd5,
+ 0x01, 0x23, 0x61, 0x46, 0x0b, 0x40, 0x01, 0x22, 0x00, 0x26, 0x71, 0xe7,
+ 0x9e, 0x01, 0x62, 0x46, 0x01, 0x23, 0x13, 0x40, 0x76, 0x0a, 0x00, 0x22,
+ 0x6a, 0xe7, 0x80, 0x26, 0xf6, 0x03, 0x26, 0x43, 0x76, 0x02, 0x76, 0x0a,
+ 0x53, 0x46, 0xff, 0x22, 0x62, 0xe7, 0xc0, 0x46, 0x04, 0xe5, 0x03, 0x00,
+ 0xff, 0xff, 0xff, 0xf7, 0x4a, 0x02, 0x43, 0x02, 0x70, 0xb5, 0x5c, 0x0a,
+ 0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e,
+ 0xc9, 0x0f, 0xff, 0x2b, 0x05, 0xd0, 0xff, 0x2a, 0x08, 0xd0, 0x01, 0x20,
+ 0x93, 0x42, 0x0b, 0xd0, 0x70, 0xbd, 0x01, 0x20, 0x00, 0x2c, 0xfb, 0xd1,
+ 0xff, 0x2a, 0xf6, 0xd1, 0x01, 0x20, 0x00, 0x2d, 0xf6, 0xd1, 0x01, 0x20,
+ 0x93, 0x42, 0xf3, 0xd1, 0xac, 0x42, 0xf1, 0xd1, 0x8e, 0x42, 0x05, 0xd0,
+ 0x00, 0x2b, 0xed, 0xd1, 0x20, 0x1c, 0x44, 0x1e, 0xa0, 0x41, 0xe9, 0xe7,
+ 0x00, 0x20, 0xe7, 0xe7, 0x4a, 0x02, 0x43, 0x02, 0xf0, 0xb5, 0x5c, 0x0a,
+ 0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e,
+ 0xc9, 0x0f, 0xff, 0x2b, 0x31, 0xd0, 0xff, 0x2a, 0x34, 0xd0, 0x00, 0x2b,
+ 0x16, 0xd1, 0x60, 0x42, 0x60, 0x41, 0x84, 0x46, 0x00, 0x2a, 0x14, 0xd0,
+ 0x00, 0x28, 0x20, 0xd1, 0x8e, 0x42, 0x17, 0xd1, 0x93, 0x42, 0x15, 0xdc,
+ 0x04, 0xdb, 0xac, 0x42, 0x12, 0xd8, 0x00, 0x20, 0xac, 0x42, 0x12, 0xd2,
+ 0x70, 0x42, 0x70, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x0c, 0xe0,
+ 0x00, 0x2a, 0xed, 0xd1, 0x94, 0x46, 0x6f, 0x42, 0x6f, 0x41, 0x60, 0x46,
+ 0x00, 0x28, 0x05, 0xd1, 0x00, 0x2f, 0xe5, 0xd0, 0x70, 0x42, 0x01, 0x23,
+ 0x18, 0x43, 0xf0, 0xbd, 0x00, 0x20, 0x00, 0x2f, 0xfb, 0xd1, 0x48, 0x42,
+ 0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xf5, 0xe7, 0x00, 0x2c,
+ 0xcb, 0xd0, 0x02, 0x20, 0x40, 0x42, 0xf0, 0xe7, 0x00, 0x2d, 0xc8, 0xd0,
+ 0xf9, 0xe7, 0xc0, 0x46, 0x4a, 0x02, 0x43, 0x02, 0xf0, 0xb5, 0x5c, 0x0a,
+ 0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e,
+ 0xc9, 0x0f, 0xff, 0x2b, 0x27, 0xd0, 0xff, 0x2a, 0x29, 0xd0, 0x00, 0x2b,
+ 0x10, 0xd0, 0x00, 0x2a, 0x15, 0xd1, 0x94, 0x46, 0x6f, 0x42, 0x6f, 0x41,
+ 0x60, 0x46, 0x00, 0x28, 0x15, 0xd0, 0x00, 0x20, 0x00, 0x2f, 0x04, 0xd1,
+ 0x48, 0x42, 0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xf0, 0xbd,
+ 0x60, 0x42, 0x60, 0x41, 0x84, 0x46, 0x00, 0x2a, 0xec, 0xd0, 0x00, 0x28,
+ 0xf2, 0xd1, 0x8e, 0x42, 0x11, 0xd0, 0x70, 0x42, 0x01, 0x23, 0x18, 0x43,
+ 0xf1, 0xe7, 0x00, 0x2f, 0xf7, 0xd0, 0x70, 0x42, 0x01, 0x23, 0x18, 0x43,
+ 0xeb, 0xe7, 0x02, 0x20, 0x00, 0x2c, 0xe8, 0xd1, 0xd3, 0xe7, 0x02, 0x20,
+ 0x00, 0x2d, 0xe4, 0xd1, 0xd1, 0xe7, 0x93, 0x42, 0xeb, 0xdc, 0x04, 0xdb,
+ 0xac, 0x42, 0xe8, 0xd8, 0x00, 0x20, 0xac, 0x42, 0xdb, 0xd2, 0x70, 0x42,
+ 0x70, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xd5, 0xe7, 0xc0, 0x46,
+ 0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4,
+ 0x44, 0x02, 0x46, 0x00, 0x83, 0xb0, 0x0f, 0x1c, 0x64, 0x0a, 0x36, 0x0e,
+ 0xc5, 0x0f, 0x00, 0x2e, 0x41, 0xd0, 0xff, 0x2e, 0x22, 0xd0, 0x80, 0x23,
+ 0x1b, 0x04, 0x00, 0x20, 0x1c, 0x43, 0xe4, 0x00, 0x7f, 0x3e, 0x82, 0x46,
+ 0x80, 0x46, 0x39, 0x1c, 0x4b, 0x00, 0x7f, 0x02, 0xc9, 0x0f, 0x7f, 0x0a,
+ 0x1b, 0x0e, 0x8b, 0x46, 0x3b, 0xd0, 0xff, 0x2b, 0x34, 0xd0, 0x80, 0x22,
+ 0x12, 0x04, 0x17, 0x43, 0xff, 0x00, 0x7f, 0x3b, 0x00, 0x21, 0x5a, 0x46,
+ 0x6a, 0x40, 0x01, 0x92, 0x52, 0x46, 0x0a, 0x43, 0x0f, 0x2a, 0x63, 0xd8,
+ 0x7a, 0x48, 0x92, 0x00, 0x82, 0x58, 0x97, 0x46, 0x00, 0x2c, 0x3f, 0xd1,
+ 0x08, 0x22, 0x02, 0x23, 0x92, 0x46, 0x98, 0x46, 0xdd, 0xe7, 0x01, 0x95,
+ 0x40, 0x46, 0x02, 0x28, 0x2a, 0xd1, 0x01, 0x9a, 0x01, 0x25, 0x15, 0x40,
+ 0xff, 0x23, 0x00, 0x24, 0x64, 0x02, 0xdb, 0x05, 0x60, 0x0a, 0xed, 0x07,
+ 0x18, 0x43, 0x28, 0x43, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46,
+ 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x2c, 0x27, 0xd1, 0x04, 0x20,
+ 0x01, 0x22, 0x82, 0x46, 0x90, 0x46, 0xc0, 0xe7, 0x39, 0x1c, 0x4a, 0x1e,
+ 0x91, 0x41, 0x02, 0x31, 0xcb, 0xe7, 0x01, 0x21, 0x00, 0x2f, 0xc8, 0xd0,
+ 0x38, 0x1c, 0x00, 0xf0, 0xf7, 0xff, 0x43, 0x1f, 0x9f, 0x40, 0x76, 0x23,
+ 0x5b, 0x42, 0x1b, 0x1a, 0x00, 0x21, 0xbe, 0xe7, 0x03, 0x28, 0x00, 0xd1,
+ 0xae, 0xe0, 0x01, 0x28, 0x4f, 0xd1, 0x01, 0x98, 0x42, 0x46, 0x10, 0x40,
+ 0xc5, 0xb2, 0x00, 0x23, 0x00, 0x24, 0xcd, 0xe7, 0x0c, 0x23, 0x03, 0x20,
+ 0x9a, 0x46, 0x80, 0x46, 0x9d, 0xe7, 0x20, 0x1c, 0x00, 0xf0, 0xdc, 0xff,
+ 0x76, 0x26, 0x43, 0x1f, 0x9c, 0x40, 0x76, 0x42, 0x00, 0x23, 0x36, 0x1a,
+ 0x9a, 0x46, 0x98, 0x46, 0x91, 0xe7, 0x80, 0x24, 0x00, 0x25, 0xe4, 0x03,
+ 0xff, 0x23, 0xb7, 0xe7, 0x5b, 0x46, 0x3c, 0x1c, 0x01, 0x93, 0x88, 0x46,
+ 0xaa, 0xe7, 0x3c, 0x1c, 0x88, 0x46, 0xa7, 0xe7, 0x25, 0x0c, 0x24, 0x04,
+ 0x3a, 0x0c, 0x24, 0x0c, 0x3f, 0x04, 0xf6, 0x18, 0x3f, 0x0c, 0x21, 0x1c,
+ 0x23, 0x1c, 0x79, 0x43, 0x53, 0x43, 0x6f, 0x43, 0x55, 0x43, 0xfb, 0x18,
+ 0x0a, 0x0c, 0x9b, 0x18, 0xb1, 0x46, 0x9f, 0x42, 0x02, 0xd9, 0x80, 0x22,
+ 0x52, 0x02, 0xad, 0x18, 0x09, 0x04, 0x1a, 0x04, 0x09, 0x0c, 0x52, 0x18,
+ 0x94, 0x01, 0x1b, 0x0c, 0x61, 0x1e, 0x8c, 0x41, 0x92, 0x0e, 0xed, 0x18,
+ 0x14, 0x43, 0xad, 0x01, 0x2c, 0x43, 0x23, 0x01, 0x05, 0xd5, 0x01, 0x22,
+ 0x63, 0x08, 0x01, 0x20, 0x14, 0x40, 0x81, 0x44, 0x1c, 0x43, 0x4b, 0x46,
+ 0x7f, 0x33, 0x00, 0x2b, 0x2d, 0xdd, 0x60, 0x07, 0x04, 0xd0, 0x0f, 0x22,
+ 0x22, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x34, 0x22, 0x01, 0x03, 0xd5,
+ 0x2d, 0x4b, 0x1c, 0x40, 0x4b, 0x46, 0x80, 0x33, 0xfe, 0x2b, 0x17, 0xdd,
+ 0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0xff, 0x23, 0x6b, 0xe7,
+ 0x80, 0x20, 0xc0, 0x03, 0x04, 0x42, 0x08, 0xd0, 0x07, 0x42, 0x06, 0xd1,
+ 0x04, 0x1c, 0x3c, 0x43, 0x64, 0x02, 0x64, 0x0a, 0x5d, 0x46, 0xff, 0x23,
+ 0x5e, 0xe7, 0x04, 0x43, 0x64, 0x02, 0x64, 0x0a, 0xff, 0x23, 0x59, 0xe7,
+ 0x01, 0x98, 0xa4, 0x01, 0x01, 0x25, 0x64, 0x0a, 0xdb, 0xb2, 0x05, 0x40,
+ 0x52, 0xe7, 0x7e, 0x23, 0x5b, 0x42, 0x4a, 0x46, 0x9b, 0x1a, 0x1b, 0x2b,
+ 0x05, 0xdd, 0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0x00, 0x23,
+ 0x46, 0xe7, 0x22, 0x1c, 0xda, 0x40, 0x4b, 0x46, 0x9e, 0x33, 0x9c, 0x40,
+ 0x23, 0x1c, 0x5c, 0x1e, 0xa3, 0x41, 0x13, 0x43, 0x58, 0x07, 0x04, 0xd0,
+ 0x0f, 0x22, 0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x5a, 0x01,
+ 0x05, 0xd5, 0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0x01, 0x23,
+ 0x2e, 0xe7, 0x01, 0x98, 0x9c, 0x01, 0x01, 0x25, 0x64, 0x0a, 0x05, 0x40,
+ 0x00, 0x23, 0x27, 0xe7, 0x80, 0x27, 0xff, 0x03, 0x01, 0x9b, 0x3c, 0x43,
+ 0x64, 0x02, 0x01, 0x25, 0x1d, 0x40, 0x64, 0x0a, 0xff, 0x23, 0x1d, 0xe7,
+ 0x44, 0xe5, 0x03, 0x00, 0xff, 0xff, 0xff, 0xf7, 0xf8, 0xb5, 0xc2, 0x0f,
+ 0x43, 0x02, 0x44, 0x00, 0x4d, 0x02, 0x48, 0x00, 0x24, 0x0e, 0x16, 0x1c,
+ 0x9b, 0x09, 0x00, 0x0e, 0xc9, 0x0f, 0xad, 0x09, 0xff, 0x28, 0x00, 0xd1,
+ 0x83, 0xe0, 0x01, 0x27, 0x79, 0x40, 0x8a, 0x42, 0x5c, 0xd0, 0x22, 0x1a,
+ 0x00, 0x2a, 0x00, 0xdc, 0x8e, 0xe0, 0x00, 0x28, 0x1e, 0xd1, 0x00, 0x2d,
+ 0x00, 0xd0, 0x7a, 0xe0, 0x58, 0x07, 0x04, 0xd0, 0x0f, 0x22, 0x1a, 0x40,
+ 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x80, 0x21, 0xc9, 0x04, 0x01, 0x22,
+ 0x19, 0x40, 0x32, 0x40, 0x00, 0x29, 0x3a, 0xd0, 0x01, 0x34, 0xff, 0x2c,
+ 0x00, 0xd1, 0x83, 0xe0, 0x9b, 0x01, 0x5b, 0x0a, 0x5b, 0x02, 0xe4, 0xb2,
+ 0xe4, 0x05, 0x58, 0x0a, 0xd2, 0x07, 0x20, 0x43, 0x10, 0x43, 0xf8, 0xbd,
+ 0xff, 0x2c, 0xe1, 0xd0, 0x80, 0x21, 0xc9, 0x04, 0x0d, 0x43, 0x1b, 0x2a,
+ 0x00, 0xdd, 0x31, 0xe1, 0x29, 0x1c, 0x20, 0x20, 0xd1, 0x40, 0x82, 0x1a,
+ 0x95, 0x40, 0x6a, 0x1e, 0x95, 0x41, 0x0d, 0x43, 0x5b, 0x1b, 0x58, 0x01,
+ 0xd0, 0xd5, 0x9b, 0x01, 0x9f, 0x09, 0x38, 0x1c, 0x00, 0xf0, 0xe0, 0xfe,
+ 0x42, 0x1f, 0x97, 0x40, 0x94, 0x42, 0x5f, 0xdc, 0x14, 0x1b, 0x1f, 0x23,
+ 0x1b, 0x1b, 0x3a, 0x1c, 0x9f, 0x40, 0x61, 0x1c, 0x3b, 0x1c, 0xca, 0x40,
+ 0x5f, 0x1e, 0xbb, 0x41, 0x13, 0x43, 0x00, 0x24, 0xba, 0xe7, 0x13, 0x1e,
+ 0xb8, 0xd1, 0x00, 0x23, 0x00, 0x22, 0xdb, 0x08, 0xff, 0x2c, 0x04, 0xd1,
+ 0x00, 0x2b, 0x47, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x03, 0x43, 0x5b, 0x02,
+ 0x5b, 0x0a, 0xbf, 0xe7, 0x21, 0x1a, 0x00, 0x29, 0x44, 0xdd, 0x00, 0x28,
+ 0x27, 0xd0, 0xff, 0x2c, 0xa4, 0xd0, 0x80, 0x20, 0xc0, 0x04, 0x05, 0x43,
+ 0x1b, 0x29, 0x00, 0xdd, 0xf2, 0xe0, 0x28, 0x1c, 0x20, 0x27, 0xc8, 0x40,
+ 0x79, 0x1a, 0x8d, 0x40, 0x69, 0x1e, 0x8d, 0x41, 0x05, 0x43, 0x5b, 0x19,
+ 0x59, 0x01, 0x00, 0xd4, 0x92, 0xe7, 0x01, 0x34, 0xff, 0x2c, 0x59, 0xd0,
+ 0x73, 0x49, 0x01, 0x22, 0x1a, 0x40, 0x0b, 0x40, 0x5b, 0x08, 0x13, 0x43,
+ 0x88, 0xe7, 0x00, 0x2d, 0x00, 0xd0, 0x7a, 0xe7, 0x77, 0xe7, 0x01, 0x3a,
+ 0x00, 0x2a, 0xad, 0xd0, 0xff, 0x2c, 0xa0, 0xd1, 0x7e, 0xe7, 0x00, 0x2d,
+ 0x00, 0xd1, 0x7b, 0xe7, 0x01, 0x39, 0x00, 0x29, 0xe1, 0xd0, 0xff, 0x2c,
+ 0xd4, 0xd1, 0x75, 0xe7, 0x00, 0x2a, 0x1b, 0xd1, 0x62, 0x1c, 0xd2, 0xb2,
+ 0x01, 0x2a, 0x4b, 0xdd, 0x5f, 0x1b, 0x7a, 0x01, 0x23, 0xd5, 0xef, 0x1a,
+ 0x0e, 0x1c, 0x9a, 0xe7, 0x00, 0x23, 0x7b, 0xe7, 0x5f, 0x4b, 0xa4, 0x1a,
+ 0x3b, 0x40, 0x63, 0xe7, 0x00, 0x29, 0x46, 0xd1, 0x61, 0x1c, 0xc8, 0xb2,
+ 0x01, 0x28, 0x29, 0xdd, 0xff, 0x29, 0x24, 0xd0, 0xeb, 0x18, 0x5b, 0x08,
+ 0x0c, 0x1c, 0x57, 0xe7, 0x00, 0x2c, 0x13, 0xd0, 0xff, 0x28, 0x18, 0xd0,
+ 0x80, 0x24, 0xe4, 0x04, 0x52, 0x42, 0x23, 0x43, 0x1b, 0x2a, 0x4d, 0xdd,
+ 0x01, 0x23, 0xeb, 0x1a, 0x04, 0x1c, 0x0e, 0x1c, 0x75, 0xe7, 0x00, 0x2f,
+ 0x00, 0xd0, 0x76, 0xe7, 0x00, 0x23, 0x00, 0x22, 0x00, 0x24, 0x8a, 0xe7,
+ 0x00, 0x2b, 0x3b, 0xd0, 0xd2, 0x43, 0x00, 0x2a, 0xef, 0xd0, 0xff, 0x28,
+ 0xea, 0xd1, 0x2b, 0x1c, 0xff, 0x24, 0x0e, 0x1c, 0x36, 0xe7, 0xff, 0x24,
+ 0x00, 0x23, 0x7c, 0xe7, 0x00, 0x2c, 0x5c, 0xd1, 0x00, 0x2b, 0x00, 0xd1,
+ 0x80, 0xe0, 0x00, 0x2d, 0x00, 0xd1, 0x2b, 0xe7, 0x5b, 0x19, 0x58, 0x01,
+ 0x00, 0xd4, 0x27, 0xe7, 0x3f, 0x4a, 0x01, 0x24, 0x13, 0x40, 0x23, 0xe7,
+ 0x00, 0x2c, 0x15, 0xd1, 0x00, 0x2b, 0x40, 0xd1, 0x00, 0x2d, 0x63, 0xd0,
+ 0x2b, 0x1c, 0x0e, 0x1c, 0x1a, 0xe7, 0x00, 0x2c, 0x21, 0xd1, 0x00, 0x2b,
+ 0x54, 0xd0, 0xc9, 0x43, 0x00, 0x29, 0x04, 0xd0, 0xff, 0x28, 0x4c, 0xd0,
+ 0x1b, 0x29, 0x58, 0xdd, 0x01, 0x23, 0x5b, 0x19, 0x04, 0x1c, 0x75, 0xe7,
+ 0x00, 0x2b, 0x19, 0xd1, 0x00, 0x2d, 0x48, 0xd0, 0x2b, 0x1c, 0x0e, 0x1c,
+ 0xff, 0x24, 0x03, 0xe7, 0x2b, 0x1c, 0x04, 0x1c, 0x0e, 0x1c, 0xff, 0xe6,
+ 0x1c, 0x1c, 0x20, 0x26, 0xd4, 0x40, 0xb2, 0x1a, 0x93, 0x40, 0x5a, 0x1e,
+ 0x93, 0x41, 0x23, 0x43, 0xa9, 0xe7, 0xff, 0x28, 0x2f, 0xd0, 0x80, 0x24,
+ 0xe4, 0x04, 0x49, 0x42, 0x23, 0x43, 0xdd, 0xe7, 0xff, 0x24, 0x00, 0x2d,
+ 0x00, 0xd1, 0xeb, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03, 0x13, 0x42,
+ 0x04, 0xd0, 0xed, 0x08, 0x15, 0x42, 0x01, 0xd1, 0x2b, 0x1c, 0x0e, 0x1c,
+ 0xdb, 0x00, 0xff, 0x24, 0xde, 0xe6, 0x00, 0x2d, 0x00, 0xd1, 0xdb, 0xe6,
+ 0x5a, 0x1b, 0x50, 0x01, 0x00, 0xd4, 0x1c, 0xe7, 0xeb, 0x1a, 0x0e, 0x1c,
+ 0xd4, 0xe6, 0x00, 0x2b, 0x0d, 0xd0, 0xff, 0x24, 0x00, 0x2d, 0x00, 0xd1,
+ 0xce, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03, 0x13, 0x42, 0xe7, 0xd0,
+ 0xed, 0x08, 0x15, 0x42, 0xe4, 0xd1, 0x2b, 0x1c, 0xe2, 0xe7, 0x2b, 0x1c,
+ 0xff, 0x24, 0xc1, 0xe6, 0x2b, 0x1c, 0x04, 0x1c, 0xbe, 0xe6, 0x80, 0x23,
+ 0x00, 0x22, 0x9b, 0x04, 0xff, 0x24, 0x02, 0xe7, 0x23, 0x1c, 0x00, 0x22,
+ 0xff, 0xe6, 0x1c, 0x1c, 0x20, 0x27, 0xcc, 0x40, 0x79, 0x1a, 0x8b, 0x40,
+ 0x59, 0x1e, 0x8b, 0x41, 0x23, 0x43, 0x9e, 0xe7, 0x2b, 0x1c, 0xab, 0xe6,
+ 0x01, 0x25, 0x12, 0xe7, 0x01, 0x25, 0xd3, 0xe6, 0xff, 0xff, 0xff, 0xfb,
+ 0x43, 0x02, 0x59, 0x0a, 0x43, 0x00, 0xc2, 0x0f, 0x1b, 0x0e, 0x00, 0x20,
+ 0x7e, 0x2b, 0x0d, 0xdd, 0x9d, 0x2b, 0x0c, 0xdc, 0x80, 0x20, 0x00, 0x04,
+ 0x01, 0x43, 0x95, 0x2b, 0x0a, 0xdc, 0x96, 0x20, 0xc3, 0x1a, 0xd9, 0x40,
+ 0x48, 0x42, 0x00, 0x2a, 0x00, 0xd1, 0x08, 0x1c, 0x70, 0x47, 0x03, 0x4b,
+ 0xd0, 0x18, 0xfb, 0xe7, 0x96, 0x3b, 0x99, 0x40, 0xf4, 0xe7, 0xc0, 0x46,
+ 0xff, 0xff, 0xff, 0x7f, 0x70, 0xb5, 0x04, 0x1e, 0x3c, 0xd0, 0xc6, 0x0f,
+ 0x00, 0xd0, 0x44, 0x42, 0x20, 0x1c, 0x00, 0xf0, 0x91, 0xfd, 0x9e, 0x23,
+ 0x25, 0x1c, 0x1b, 0x1a, 0x96, 0x2b, 0x0c, 0xdc, 0x08, 0x38, 0x84, 0x40,
+ 0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2, 0x32, 0x1c, 0x64, 0x02, 0xdb, 0x05,
+ 0x60, 0x0a, 0xd2, 0x07, 0x18, 0x43, 0x10, 0x43, 0x70, 0xbd, 0x99, 0x2b,
+ 0x0a, 0xdd, 0x05, 0x22, 0x12, 0x1a, 0x21, 0x1c, 0xd1, 0x40, 0x0a, 0x1c,
+ 0x01, 0x1c, 0x1b, 0x31, 0x8d, 0x40, 0x69, 0x1e, 0x8d, 0x41, 0x15, 0x43,
+ 0x05, 0x28, 0x01, 0xdd, 0x42, 0x1f, 0x95, 0x40, 0x16, 0x4c, 0x2c, 0x40,
+ 0x6a, 0x07, 0x04, 0xd0, 0x0f, 0x22, 0x15, 0x40, 0x04, 0x2d, 0x00, 0xd0,
+ 0x04, 0x34, 0x61, 0x01, 0x0c, 0xd5, 0x9f, 0x23, 0x18, 0x1a, 0xff, 0x28,
+ 0x1a, 0xd0, 0xa4, 0x01, 0x64, 0x0a, 0xc3, 0xb2, 0x32, 0x1c, 0xd3, 0xe7,
+ 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0xcf, 0xe7, 0xe4, 0x08, 0xff, 0x2b,
+ 0x04, 0xd0, 0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2, 0x32, 0x1c, 0xc7, 0xe7,
+ 0x00, 0x2c, 0x04, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x04, 0x43, 0x64, 0x02,
+ 0x64, 0x0a, 0x32, 0x1c, 0xff, 0x23, 0xbd, 0xe7, 0x32, 0x1c, 0xff, 0x23,
+ 0x00, 0x24, 0xb9, 0xe7, 0xff, 0xff, 0xff, 0xfb, 0x10, 0xb5, 0x04, 0x1e,
+ 0x33, 0xd0, 0x00, 0xf0, 0x39, 0xfd, 0x9e, 0x23, 0x1b, 0x1a, 0x96, 0x2b,
+ 0x09, 0xdc, 0x08, 0x38, 0x84, 0x40, 0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2,
+ 0x64, 0x02, 0xdb, 0x05, 0x60, 0x0a, 0x18, 0x43, 0x10, 0xbd, 0x99, 0x2b,
+ 0x0a, 0xdd, 0x05, 0x22, 0x12, 0x1a, 0x21, 0x1c, 0xd1, 0x40, 0x0a, 0x1c,
+ 0x01, 0x1c, 0x1b, 0x31, 0x8c, 0x40, 0x61, 0x1e, 0x8c, 0x41, 0x14, 0x43,
+ 0x05, 0x28, 0x01, 0xdd, 0x42, 0x1f, 0x94, 0x40, 0x14, 0x4a, 0x22, 0x40,
+ 0x61, 0x07, 0x04, 0xd0, 0x0f, 0x21, 0x0c, 0x40, 0x04, 0x2c, 0x00, 0xd0,
+ 0x04, 0x32, 0x51, 0x01, 0x0a, 0xd5, 0x9f, 0x23, 0x18, 0x1a, 0xff, 0x28,
+ 0x16, 0xd0, 0x94, 0x01, 0x64, 0x0a, 0xc3, 0xb2, 0xd6, 0xe7, 0x00, 0x23,
+ 0x00, 0x24, 0xd3, 0xe7, 0xd2, 0x08, 0xff, 0x2b, 0x03, 0xd0, 0x54, 0x02,
+ 0x64, 0x0a, 0xdb, 0xb2, 0xcc, 0xe7, 0x00, 0x2a, 0x06, 0xd0, 0x80, 0x24,
+ 0xe4, 0x03, 0x14, 0x43, 0x64, 0x02, 0x64, 0x0a, 0xff, 0x23, 0xc3, 0xe7,
+ 0xff, 0x23, 0x00, 0x24, 0xc0, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0xff, 0xfb,
+ 0xf8, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x44, 0x46, 0x4d, 0x46, 0xf0, 0xb4,
+ 0x0c, 0x03, 0x4d, 0x00, 0xce, 0x0f, 0x61, 0x0a, 0x44, 0x0f, 0x21, 0x43,
+ 0xc4, 0x00, 0x18, 0x03, 0x80, 0x46, 0x58, 0x00, 0x40, 0x0d, 0x82, 0x46,
+ 0xd8, 0x0f, 0x84, 0x46, 0x40, 0x46, 0x40, 0x0a, 0x53, 0x0f, 0x03, 0x43,
+ 0xd0, 0x00, 0x6d, 0x0d, 0x37, 0x1c, 0x83, 0x46, 0x52, 0x46, 0x66, 0x45,
+ 0x00, 0xd1, 0xa4, 0xe0, 0xaf, 0x1a, 0x00, 0x2f, 0x00, 0xdc, 0x09, 0xe1,
+ 0x00, 0x2a, 0x3b, 0xd1, 0x18, 0x43, 0x00, 0xd0, 0xea, 0xe0, 0x63, 0x07,
+ 0x00, 0xd1, 0x87, 0xe0, 0x0f, 0x23, 0x23, 0x40, 0x04, 0x2b, 0x00, 0xd1,
+ 0x82, 0xe0, 0x22, 0x1d, 0xa2, 0x42, 0xa4, 0x41, 0x64, 0x42, 0x80, 0x23,
+ 0x09, 0x19, 0x1b, 0x04, 0x0b, 0x40, 0x37, 0x1c, 0x14, 0x1c, 0x00, 0x2b,
+ 0x00, 0xd1, 0x7c, 0xe0, 0xce, 0x4b, 0x01, 0x35, 0x9d, 0x42, 0x00, 0xd1,
+ 0x05, 0xe1, 0xcd, 0x4b, 0xe4, 0x08, 0x19, 0x40, 0x48, 0x07, 0x49, 0x02,
+ 0x04, 0x43, 0x0b, 0x0b, 0x00, 0x20, 0x00, 0x21, 0x1b, 0x03, 0x1a, 0x0b,
+ 0x0b, 0x0d, 0x6d, 0x05, 0x1b, 0x05, 0x13, 0x43, 0x6a, 0x08, 0xc6, 0x4d,
+ 0xff, 0x07, 0x1d, 0x40, 0x15, 0x43, 0x6d, 0x00, 0x6d, 0x08, 0x29, 0x1c,
+ 0x39, 0x43, 0x20, 0x1c, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 0xa2, 0x46,
+ 0xab, 0x46, 0xf8, 0xbd, 0xbc, 0x48, 0x85, 0x42, 0xc3, 0xd0, 0x80, 0x20,
+ 0x00, 0x04, 0x03, 0x43, 0x38, 0x2f, 0x00, 0xdd, 0xf0, 0xe0, 0x1f, 0x2f,
+ 0x00, 0xdd, 0x24, 0xe1, 0x20, 0x20, 0xc0, 0x1b, 0x1a, 0x1c, 0x81, 0x46,
+ 0x82, 0x40, 0x58, 0x46, 0xf8, 0x40, 0x02, 0x43, 0x94, 0x46, 0x58, 0x46,
+ 0x4a, 0x46, 0x90, 0x40, 0x42, 0x1e, 0x90, 0x41, 0xfb, 0x40, 0x62, 0x46,
+ 0x02, 0x43, 0x1f, 0x1c, 0xa2, 0x1a, 0x94, 0x42, 0xa4, 0x41, 0x64, 0x42,
+ 0xc9, 0x1b, 0x09, 0x1b, 0x14, 0x1c, 0x0b, 0x02, 0x9f, 0xd5, 0x49, 0x02,
+ 0x4f, 0x0a, 0x00, 0x2f, 0x00, 0xd1, 0xc8, 0xe0, 0x38, 0x1c, 0x00, 0xf0,
+ 0x5d, 0xfc, 0x02, 0x1c, 0x08, 0x3a, 0x1f, 0x2a, 0x00, 0xdd, 0xb5, 0xe0,
+ 0x28, 0x21, 0x09, 0x1a, 0x20, 0x1c, 0x97, 0x40, 0xc8, 0x40, 0x07, 0x43,
+ 0x94, 0x40, 0x95, 0x42, 0x00, 0xdd, 0xb2, 0xe0, 0x55, 0x1b, 0x69, 0x1c,
+ 0x1f, 0x29, 0x00, 0xdd, 0xdc, 0xe0, 0x1f, 0x22, 0x55, 0x1b, 0x3b, 0x1c,
+ 0x22, 0x1c, 0xab, 0x40, 0xca, 0x40, 0xac, 0x40, 0x65, 0x1e, 0xac, 0x41,
+ 0x13, 0x43, 0xcf, 0x40, 0x1c, 0x43, 0x39, 0x1c, 0x00, 0x25, 0x74, 0xe7,
+ 0x80, 0x23, 0x1b, 0x04, 0x0b, 0x40, 0x37, 0x1c, 0x00, 0x2b, 0x00, 0xd0,
+ 0x82, 0xe7, 0x90, 0x4b, 0x48, 0x07, 0xe4, 0x08, 0x04, 0x43, 0xc9, 0x08,
+ 0x9d, 0x42, 0x48, 0xd0, 0x09, 0x03, 0x0b, 0x0b, 0x84, 0xe7, 0xaa, 0x1a,
+ 0x94, 0x46, 0x00, 0x2a, 0x00, 0xdc, 0x98, 0xe0, 0x50, 0x46, 0x00, 0x28,
+ 0x52, 0xd0, 0x87, 0x48, 0x85, 0x42, 0x00, 0xd1, 0x57, 0xe7, 0x80, 0x20,
+ 0x00, 0x04, 0x03, 0x43, 0x62, 0x46, 0x38, 0x2a, 0x00, 0xdd, 0xfc, 0xe0,
+ 0x1f, 0x2a, 0x00, 0xdd, 0x4a, 0xe1, 0x20, 0x22, 0x60, 0x46, 0x10, 0x1a,
+ 0x1a, 0x1c, 0x82, 0x40, 0x82, 0x46, 0x91, 0x46, 0x58, 0x46, 0x62, 0x46,
+ 0xd0, 0x40, 0x4a, 0x46, 0x02, 0x43, 0x90, 0x46, 0x58, 0x46, 0x52, 0x46,
+ 0x90, 0x40, 0x42, 0x1e, 0x90, 0x41, 0x42, 0x46, 0x02, 0x43, 0x60, 0x46,
+ 0xc3, 0x40, 0x12, 0x19, 0xa2, 0x42, 0xa4, 0x41, 0x64, 0x42, 0x59, 0x18,
+ 0x09, 0x19, 0x14, 0x1c, 0x08, 0x02, 0x00, 0xd4, 0x2d, 0xe7, 0x70, 0x4b,
+ 0x01, 0x35, 0x9d, 0x42, 0x00, 0xd1, 0x22, 0xe1, 0x6e, 0x4b, 0x60, 0x08,
+ 0x19, 0x40, 0x01, 0x23, 0x23, 0x40, 0x1c, 0x1c, 0x04, 0x43, 0xcb, 0x07,
+ 0x1c, 0x43, 0x49, 0x08, 0x1d, 0xe7, 0x23, 0x1c, 0x0b, 0x43, 0x3a, 0xd0,
+ 0x80, 0x23, 0x1b, 0x03, 0x0b, 0x43, 0x1b, 0x03, 0x1b, 0x0b, 0x35, 0xe7,
+ 0x01, 0x3f, 0x00, 0x2f, 0x65, 0xd1, 0x58, 0x46, 0x22, 0x1a, 0x94, 0x42,
+ 0xa4, 0x41, 0x64, 0x42, 0xc9, 0x1a, 0x09, 0x1b, 0x14, 0x1c, 0x66, 0xe7,
+ 0x58, 0x46, 0x18, 0x43, 0x00, 0xd1, 0x04, 0xe7, 0x01, 0x22, 0x52, 0x42,
+ 0x94, 0x44, 0x60, 0x46, 0x00, 0x28, 0x00, 0xd0, 0xc5, 0xe0, 0x58, 0x46,
+ 0x02, 0x19, 0xc3, 0xe7, 0x00, 0x2f, 0x73, 0xd1, 0x68, 0x1c, 0x40, 0x05,
+ 0x40, 0x0d, 0x01, 0x28, 0x00, 0xdc, 0xde, 0xe0, 0x5a, 0x46, 0xa2, 0x1a,
+ 0x94, 0x42, 0xbf, 0x41, 0xc8, 0x1a, 0x7f, 0x42, 0xc7, 0x1b, 0x38, 0x02,
+ 0x00, 0xd4, 0x89, 0xe0, 0x5a, 0x46, 0x14, 0x1b, 0xa3, 0x45, 0x92, 0x41,
+ 0x59, 0x1a, 0x52, 0x42, 0x8f, 0x1a, 0x66, 0x46, 0x41, 0xe7, 0x00, 0x23,
+ 0x00, 0x24, 0xfd, 0xe6, 0x27, 0x1c, 0x28, 0x38, 0x87, 0x40, 0x00, 0x24,
+ 0x95, 0x42, 0x00, 0xdc, 0x4c, 0xe7, 0x45, 0x49, 0xad, 0x1a, 0x39, 0x40,
+ 0xd1, 0xe6, 0x20, 0x1c, 0x00, 0xf0, 0x94, 0xfb, 0x20, 0x30, 0x34, 0xe7,
+ 0x5a, 0x46, 0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0xd2, 0xb2, 0x00, 0x27,
+ 0x1c, 0xe7, 0x00, 0x2a, 0x00, 0xd0, 0xdc, 0xe0, 0x68, 0x1c, 0x42, 0x05,
+ 0x52, 0x0d, 0x01, 0x2a, 0x00, 0xdc, 0x8d, 0xe0, 0x37, 0x4d, 0xa8, 0x42,
+ 0x00, 0xd1, 0xf3, 0xe0, 0x5d, 0x46, 0x2a, 0x19, 0xa2, 0x42, 0xa4, 0x41,
+ 0x64, 0x42, 0x59, 0x18, 0x09, 0x19, 0xcc, 0x07, 0x52, 0x08, 0x14, 0x43,
+ 0x49, 0x08, 0x05, 0x1c, 0xab, 0xe6, 0x2f, 0x48, 0x85, 0x42, 0x00, 0xd0,
+ 0xe6, 0xe6, 0xa6, 0xe6, 0x2b, 0x1c, 0x1f, 0x3b, 0x3a, 0x1c, 0xda, 0x40,
+ 0x13, 0x1c, 0x20, 0x29, 0x6c, 0xd0, 0x3f, 0x22, 0x55, 0x1b, 0xaf, 0x40,
+ 0x3c, 0x43, 0x60, 0x1e, 0x84, 0x41, 0x1c, 0x43, 0x00, 0x21, 0x00, 0x25,
+ 0x95, 0xe6, 0x38, 0x1c, 0x20, 0x38, 0x1a, 0x1c, 0xc2, 0x40, 0x10, 0x1c,
+ 0x20, 0x2f, 0x5d, 0xd0, 0x40, 0x22, 0xd7, 0x1b, 0xbb, 0x40, 0x5a, 0x46,
+ 0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0x02, 0x43, 0x00, 0x27, 0xdb, 0xe6,
+ 0x00, 0x2d, 0x3b, 0xd0, 0x1a, 0x4d, 0xaa, 0x45, 0x00, 0xd1, 0x93, 0xe0,
+ 0x80, 0x25, 0x2d, 0x04, 0x7f, 0x42, 0x29, 0x43, 0x38, 0x2f, 0x00, 0xdd,
+ 0xac, 0xe0, 0x1f, 0x2f, 0x00, 0xdd, 0x29, 0xe1, 0x20, 0x25, 0xed, 0x1b,
+ 0x08, 0x1c, 0x26, 0x1c, 0xa8, 0x40, 0xfe, 0x40, 0xac, 0x40, 0x06, 0x43,
+ 0x65, 0x1e, 0xac, 0x41, 0x34, 0x43, 0xf9, 0x40, 0x5d, 0x46, 0x2c, 0x1b,
+ 0xa3, 0x45, 0x92, 0x41, 0x5b, 0x1a, 0x52, 0x42, 0x99, 0x1a, 0x55, 0x46,
+ 0x66, 0x46, 0xbc, 0xe6, 0x13, 0x1c, 0x3b, 0x43, 0x14, 0x1c, 0x00, 0x2b,
+ 0x00, 0xd0, 0xba, 0xe6, 0x00, 0x27, 0x00, 0x21, 0x00, 0x25, 0x00, 0x24,
+ 0xe5, 0xe6, 0x5a, 0x46, 0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0xd2, 0xb2,
+ 0x00, 0x23, 0x14, 0xe7, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff,
+ 0xff, 0xff, 0x0f, 0x80, 0x0d, 0x1c, 0x25, 0x43, 0x58, 0xd0, 0xff, 0x43,
+ 0x00, 0x2f, 0x51, 0xd1, 0x04, 0x1b, 0xa3, 0x45, 0x92, 0x41, 0x59, 0x1a,
+ 0x52, 0x42, 0x89, 0x1a, 0x55, 0x46, 0x66, 0x46, 0x95, 0xe6, 0x96, 0x48,
+ 0x85, 0x42, 0x00, 0xd0, 0xde, 0xe6, 0x32, 0xe6, 0x00, 0x27, 0x93, 0xe7,
+ 0x00, 0x23, 0xa2, 0xe7, 0x08, 0x1c, 0x20, 0x43, 0x00, 0x2d, 0x00, 0xd0,
+ 0xc4, 0xe0, 0x00, 0x28, 0x00, 0xd1, 0xf7, 0xe0, 0x58, 0x46, 0x18, 0x43,
+ 0x00, 0xd1, 0x22, 0xe6, 0x58, 0x46, 0x02, 0x19, 0xa2, 0x42, 0xa4, 0x41,
+ 0x64, 0x42, 0x59, 0x18, 0x09, 0x19, 0x14, 0x1c, 0x0a, 0x02, 0x00, 0xd4,
+ 0x17, 0xe6, 0x87, 0x4b, 0x01, 0x25, 0x19, 0x40, 0x13, 0xe6, 0x08, 0x1c,
+ 0x20, 0x43, 0x00, 0x2d, 0x39, 0xd1, 0x00, 0x28, 0x71, 0xd1, 0x59, 0x46,
+ 0x19, 0x43, 0x03, 0xd0, 0x19, 0x1c, 0x5c, 0x46, 0x66, 0x46, 0x06, 0xe6,
+ 0x00, 0x27, 0x00, 0x21, 0x00, 0x24, 0x94, 0xe6, 0x60, 0x46, 0x20, 0x38,
+ 0x1a, 0x1c, 0xc2, 0x40, 0x60, 0x46, 0x91, 0x46, 0x20, 0x28, 0x00, 0xd1,
+ 0xac, 0xe0, 0x40, 0x22, 0x12, 0x1a, 0x93, 0x40, 0x5a, 0x46, 0x1a, 0x43,
+ 0x53, 0x1e, 0x9a, 0x41, 0x4b, 0x46, 0x1a, 0x43, 0x00, 0x23, 0xb6, 0xe6,
+ 0x71, 0x4d, 0xaa, 0x45, 0x00, 0xd0, 0x6f, 0xe7, 0x19, 0x1c, 0x5c, 0x46,
+ 0x55, 0x46, 0x66, 0x46, 0xe5, 0xe5, 0x00, 0x2d, 0x22, 0xd1, 0x0d, 0x1c,
+ 0x25, 0x43, 0x77, 0xd0, 0xd5, 0x43, 0x00, 0x2d, 0x71, 0xd1, 0x5c, 0x44,
+ 0x5c, 0x45, 0x92, 0x41, 0x59, 0x18, 0x52, 0x42, 0x89, 0x18, 0x55, 0x46,
+ 0xa4, 0xe6, 0x00, 0x28, 0x4d, 0xd1, 0x59, 0x46, 0x19, 0x43, 0x00, 0xd1,
+ 0x94, 0xe0, 0x19, 0x1c, 0x5c, 0x46, 0x66, 0x46, 0x60, 0x4d, 0xca, 0xe5,
+ 0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0xe4, 0xb2, 0x00, 0x21, 0x5b, 0xe7,
+ 0x05, 0x1c, 0x00, 0x21, 0x00, 0x24, 0x52, 0xe6, 0x5a, 0x4d, 0xaa, 0x45,
+ 0x54, 0xd0, 0x55, 0x42, 0x80, 0x22, 0x10, 0x04, 0x01, 0x43, 0x38, 0x2d,
+ 0x00, 0xdd, 0x81, 0xe0, 0x1f, 0x2d, 0x00, 0xdd, 0x92, 0xe0, 0x20, 0x22,
+ 0x50, 0x1b, 0x0a, 0x1c, 0x84, 0x46, 0x82, 0x40, 0x20, 0x1c, 0xe8, 0x40,
+ 0x02, 0x43, 0x90, 0x46, 0x62, 0x46, 0x94, 0x40, 0x60, 0x1e, 0x84, 0x41,
+ 0x42, 0x46, 0x14, 0x43, 0xe9, 0x40, 0x5c, 0x44, 0x5c, 0x45, 0x92, 0x41,
+ 0xcb, 0x18, 0x52, 0x42, 0x99, 0x18, 0x55, 0x46, 0x6a, 0xe6, 0x58, 0x46,
+ 0x18, 0x43, 0x00, 0xd1, 0x97, 0xe5, 0x58, 0x46, 0x27, 0x1a, 0xbc, 0x42,
+ 0x92, 0x41, 0xc8, 0x1a, 0x52, 0x42, 0x80, 0x1a, 0x02, 0x02, 0x66, 0xd5,
+ 0x58, 0x46, 0x04, 0x1b, 0xa3, 0x45, 0x92, 0x41, 0x59, 0x1a, 0x52, 0x42,
+ 0x89, 0x1a, 0x66, 0x46, 0x85, 0xe5, 0x58, 0x46, 0x18, 0x43, 0x33, 0xd0,
+ 0x48, 0x07, 0xe4, 0x08, 0x04, 0x43, 0x80, 0x20, 0xc9, 0x08, 0x00, 0x03,
+ 0x01, 0x42, 0x08, 0xd0, 0xdd, 0x08, 0x05, 0x42, 0x05, 0xd1, 0x59, 0x46,
+ 0xca, 0x08, 0x5c, 0x07, 0x14, 0x43, 0x29, 0x1c, 0x66, 0x46, 0x63, 0x0f,
+ 0xc9, 0x00, 0x19, 0x43, 0xe4, 0x00, 0x31, 0x4d, 0x6b, 0xe5, 0x30, 0x4a,
+ 0x92, 0x45, 0xae, 0xd1, 0x19, 0x1c, 0x5c, 0x46, 0x55, 0x46, 0x64, 0xe5,
+ 0x00, 0x28, 0x36, 0xd0, 0x58, 0x46, 0x18, 0x43, 0x10, 0xd0, 0x80, 0x25,
+ 0x48, 0x07, 0xe4, 0x08, 0xc9, 0x08, 0x2d, 0x03, 0x04, 0x43, 0x29, 0x42,
+ 0xe5, 0xd0, 0xd8, 0x08, 0x28, 0x42, 0xe2, 0xd1, 0x5d, 0x46, 0xea, 0x08,
+ 0x5c, 0x07, 0x14, 0x43, 0x01, 0x1c, 0xdc, 0xe7, 0x21, 0x4d, 0x4c, 0xe5,
+ 0x00, 0x23, 0x53, 0xe7, 0x3d, 0x1c, 0x20, 0x3d, 0x0a, 0x1c, 0xea, 0x40,
+ 0x15, 0x1c, 0x20, 0x2f, 0x34, 0xd0, 0x40, 0x26, 0xf7, 0x1b, 0xb9, 0x40,
+ 0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0x2c, 0x43, 0x00, 0x21, 0xd1, 0xe6,
+ 0x80, 0x21, 0x00, 0x27, 0xc9, 0x03, 0x16, 0x4d, 0x00, 0x24, 0xc6, 0xe5,
+ 0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0xe4, 0xb2, 0x00, 0x21, 0x8a, 0xe7,
+ 0x19, 0x1c, 0x5c, 0x46, 0x2b, 0xe5, 0x19, 0x1c, 0x5c, 0x46, 0x0f, 0x4d,
+ 0x27, 0xe5, 0x03, 0x1c, 0x3b, 0x43, 0x00, 0xd1, 0x1c, 0xe7, 0x01, 0x1c,
+ 0x3c, 0x1c, 0x20, 0xe5, 0x20, 0x20, 0x40, 0x42, 0x40, 0x19, 0x0a, 0x1c,
+ 0xc2, 0x40, 0x90, 0x46, 0x20, 0x2d, 0x0b, 0xd0, 0x40, 0x20, 0x45, 0x1b,
+ 0xa9, 0x40, 0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0x45, 0x46, 0x2c, 0x43,
+ 0x00, 0x21, 0x6a, 0xe7, 0x00, 0x21, 0xcb, 0xe7, 0x00, 0x21, 0xf4, 0xe7,
+ 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff, 0xf0, 0xb5, 0x5f, 0x46,
+ 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4, 0x0d, 0x1c, 0x04, 0x1c,
+ 0x80, 0x46, 0xe8, 0x0f, 0x81, 0x46, 0x18, 0x03, 0x0f, 0x03, 0x00, 0x0b,
+ 0x3f, 0x0b, 0x83, 0xb0, 0x84, 0x46, 0x1b, 0x48, 0x00, 0x97, 0x49, 0x00,
+ 0x5e, 0x00, 0xdf, 0x0f, 0x49, 0x0d, 0x92, 0x46, 0x76, 0x0d, 0xbb, 0x46,
+ 0x81, 0x42, 0x0c, 0xd0, 0x15, 0x48, 0x86, 0x42, 0x10, 0xd0, 0x01, 0x20,
+ 0xb1, 0x42, 0x15, 0xd0, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46,
+ 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x9f, 0x01, 0x20, 0x27, 0x43,
+ 0xf4, 0xd1, 0x0d, 0x48, 0x86, 0x42, 0xee, 0xd1, 0x60, 0x46, 0x02, 0x43,
+ 0x01, 0x20, 0x00, 0x2a, 0xec, 0xd1, 0x01, 0x20, 0xb1, 0x42, 0xe9, 0xd1,
+ 0x00, 0x9b, 0x63, 0x45, 0xe6, 0xd1, 0xd0, 0x45, 0xe4, 0xd1, 0xd9, 0x45,
+ 0x06, 0xd0, 0x00, 0x29, 0xe0, 0xd1, 0x1c, 0x43, 0x20, 0x1c, 0x44, 0x1e,
+ 0xa0, 0x41, 0xdb, 0xe7, 0x00, 0x20, 0xd9, 0xe7, 0xff, 0x07, 0x00, 0x00,
+ 0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4,
+ 0xcd, 0x0f, 0xde, 0x0f, 0xac, 0x46, 0x1d, 0x03, 0x2d, 0x0b, 0xb1, 0x46,
+ 0x37, 0x4e, 0x0f, 0x03, 0x4c, 0x00, 0xab, 0x46, 0x5d, 0x00, 0x80, 0x46,
+ 0x3f, 0x0b, 0x64, 0x0d, 0x92, 0x46, 0x6d, 0x0d, 0xb4, 0x42, 0x32, 0xd0,
+ 0x31, 0x4e, 0xb5, 0x42, 0x35, 0xd0, 0x00, 0x2c, 0x0e, 0xd1, 0x38, 0x43,
+ 0x41, 0x42, 0x41, 0x41, 0x08, 0x1c, 0x00, 0x2d, 0x0b, 0xd0, 0x00, 0x29,
+ 0x19, 0xd1, 0xcc, 0x45, 0x2d, 0xd0, 0x65, 0x46, 0x68, 0x42, 0x01, 0x23,
+ 0x18, 0x43, 0x18, 0xe0, 0x00, 0x2d, 0xf6, 0xd1, 0x28, 0x1c, 0x59, 0x46,
+ 0x0a, 0x43, 0x53, 0x42, 0x53, 0x41, 0x00, 0x28, 0x06, 0xd1, 0x00, 0x2b,
+ 0xed, 0xd0, 0x63, 0x46, 0x58, 0x42, 0x01, 0x23, 0x18, 0x43, 0x08, 0xe0,
+ 0x00, 0x20, 0x00, 0x2b, 0x05, 0xd1, 0x4a, 0x46, 0x50, 0x42, 0x50, 0x41,
+ 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46,
+ 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x3e, 0x1c, 0x06, 0x43, 0xc9, 0xd0,
+ 0x02, 0x20, 0x40, 0x42, 0xf3, 0xe7, 0x5e, 0x46, 0x16, 0x43, 0xc6, 0xd0,
+ 0xf8, 0xe7, 0xac, 0x42, 0x07, 0xdc, 0x0b, 0xda, 0x61, 0x46, 0x48, 0x42,
+ 0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xe5, 0xe7, 0x66, 0x46,
+ 0x70, 0x42, 0x01, 0x23, 0x18, 0x43, 0xe0, 0xe7, 0x5f, 0x45, 0x0a, 0xd8,
+ 0x0e, 0xd0, 0x00, 0x20, 0x5f, 0x45, 0xda, 0xd2, 0x65, 0x46, 0x68, 0x42,
+ 0x68, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xd3, 0xe7, 0x62, 0x46,
+ 0x50, 0x42, 0x01, 0x23, 0x18, 0x43, 0xce, 0xe7, 0xd0, 0x45, 0xf8, 0xd8,
+ 0x00, 0x20, 0xd0, 0x45, 0xee, 0xd3, 0xc8, 0xe7, 0xff, 0x07, 0x00, 0x00,
+ 0xf0, 0xb5, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0x5f, 0x46, 0xf0, 0xb4,
+ 0x0d, 0x1c, 0x83, 0xb0, 0x04, 0x1c, 0x01, 0x90, 0xe8, 0x0f, 0x81, 0x46,
+ 0x18, 0x03, 0x0f, 0x03, 0x00, 0x0b, 0x3f, 0x0b, 0x84, 0x46, 0x35, 0x48,
+ 0x00, 0x97, 0x49, 0x00, 0x5e, 0x00, 0xdf, 0x0f, 0x49, 0x0d, 0x92, 0x46,
+ 0x76, 0x0d, 0xb8, 0x46, 0x81, 0x42, 0x34, 0xd0, 0x2f, 0x48, 0x86, 0x42,
+ 0x36, 0xd0, 0x00, 0x29, 0x18, 0xd0, 0x00, 0x2e, 0x1f, 0xd1, 0x34, 0x1c,
+ 0x67, 0x46, 0x3a, 0x43, 0x53, 0x42, 0x53, 0x41, 0x00, 0x2c, 0x1f, 0xd0,
+ 0x00, 0x20, 0x00, 0x2b, 0x05, 0xd1, 0x42, 0x46, 0x50, 0x42, 0x50, 0x41,
+ 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46,
+ 0x99, 0x46, 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x98, 0x04, 0x43,
+ 0x60, 0x42, 0x60, 0x41, 0x04, 0x1c, 0x00, 0x2e, 0xe2, 0xd0, 0x00, 0x28,
+ 0xe9, 0xd1, 0xc1, 0x45, 0x15, 0xd0, 0x4f, 0x46, 0x78, 0x42, 0x01, 0x23,
+ 0x18, 0x43, 0xe8, 0xe7, 0x00, 0x2b, 0xf6, 0xd0, 0x4b, 0x46, 0x58, 0x42,
+ 0x01, 0x23, 0x18, 0x43, 0xe1, 0xe7, 0x00, 0x9f, 0x02, 0x20, 0x27, 0x43,
+ 0xdd, 0xd1, 0xc5, 0xe7, 0x67, 0x46, 0x02, 0x20, 0x17, 0x43, 0xd8, 0xd1,
+ 0xc3, 0xe7, 0xb1, 0x42, 0x04, 0xdd, 0x4a, 0x46, 0x50, 0x42, 0x01, 0x23,
+ 0x18, 0x43, 0xd0, 0xe7, 0xb1, 0x42, 0x07, 0xdb, 0x00, 0x98, 0x60, 0x45,
+ 0xe4, 0xd8, 0x0a, 0xd0, 0x00, 0x9f, 0x00, 0x20, 0x67, 0x45, 0xc6, 0xd2,
+ 0x4f, 0x46, 0x78, 0x42, 0x78, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43,
+ 0xbf, 0xe7, 0x01, 0x9a, 0x52, 0x45, 0xd5, 0xd8, 0x01, 0x9a, 0x00, 0x20,
+ 0x52, 0x45, 0xf1, 0xd3, 0xb7, 0xe7, 0xc0, 0x46, 0xff, 0x07, 0x00, 0x00,
+ 0x70, 0xb5, 0x0b, 0x1c, 0x12, 0x4c, 0x09, 0x03, 0x0e, 0x0b, 0x59, 0x00,
+ 0x02, 0x1c, 0x49, 0x0d, 0xdd, 0x0f, 0x00, 0x20, 0xa1, 0x42, 0x11, 0xdd,
+ 0x0e, 0x48, 0x81, 0x42, 0x0f, 0xdc, 0x80, 0x20, 0x40, 0x03, 0x06, 0x43,
+ 0x0c, 0x48, 0x40, 0x1a, 0x1f, 0x28, 0x0b, 0xdd, 0x0b, 0x4a, 0x52, 0x1a,
+ 0xd6, 0x40, 0x32, 0x1c, 0x50, 0x42, 0x00, 0x2d, 0x00, 0xd1, 0x10, 0x1c,
+ 0x70, 0xbd, 0x08, 0x4b, 0xe8, 0x18, 0xfb, 0xe7, 0x07, 0x4b, 0xc2, 0x40,
+ 0xc9, 0x18, 0x8e, 0x40, 0x32, 0x43, 0xf1, 0xe7, 0xfe, 0x03, 0x00, 0x00,
+ 0x1d, 0x04, 0x00, 0x00, 0x33, 0x04, 0x00, 0x00, 0x13, 0x04, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0x7f, 0xed, 0xfb, 0xff, 0xff, 0x43, 0x00, 0x1b, 0x0e,
+ 0x5a, 0x1c, 0x41, 0x02, 0xd2, 0xb2, 0x70, 0xb5, 0x4c, 0x0a, 0xc5, 0x0f,
+ 0x01, 0x2a, 0x17, 0xdd, 0xe0, 0x22, 0x92, 0x00, 0x64, 0x07, 0x09, 0x0b,
+ 0x98, 0x18, 0x00, 0x22, 0x00, 0x23, 0x1e, 0x0d, 0x22, 0x1c, 0x34, 0x05,
+ 0x0c, 0x43, 0x1b, 0x49, 0x40, 0x05, 0x40, 0x08, 0x21, 0x40, 0x01, 0x43,
+ 0x49, 0x00, 0x49, 0x08, 0xed, 0x07, 0x0b, 0x1c, 0x2b, 0x43, 0x10, 0x1c,
+ 0x19, 0x1c, 0x70, 0xbd, 0x00, 0x2b, 0x15, 0xd1, 0x00, 0x2c, 0x1c, 0xd0,
+ 0x20, 0x1c, 0x00, 0xf0, 0x29, 0xf8, 0x0a, 0x28, 0x1a, 0xdc, 0x0b, 0x21,
+ 0x09, 0x1a, 0x23, 0x1c, 0xcb, 0x40, 0x19, 0x1c, 0x03, 0x1c, 0x15, 0x33,
+ 0x9c, 0x40, 0x0d, 0x4b, 0x09, 0x03, 0x18, 0x1a, 0x40, 0x05, 0x09, 0x0b,
+ 0x40, 0x0d, 0xd4, 0xe7, 0x00, 0x2c, 0x03, 0xd0, 0x64, 0x07, 0x09, 0x0b,
+ 0x08, 0x48, 0xce, 0xe7, 0x07, 0x48, 0x00, 0x21, 0xcb, 0xe7, 0x00, 0x20,
+ 0x00, 0x21, 0xc8, 0xe7, 0x01, 0x1c, 0x0b, 0x39, 0x8c, 0x40, 0x21, 0x1c,
+ 0x00, 0x24, 0xe6, 0xe7, 0xff, 0xff, 0x0f, 0x80, 0x89, 0x03, 0x00, 0x00,
+ 0xff, 0x07, 0x00, 0x00, 0x1c, 0x21, 0x01, 0x23, 0x1b, 0x04, 0x98, 0x42,
+ 0x01, 0xd3, 0x00, 0x0c, 0x10, 0x39, 0x1b, 0x0a, 0x98, 0x42, 0x01, 0xd3,
+ 0x00, 0x0a, 0x08, 0x39, 0x1b, 0x09, 0x98, 0x42, 0x01, 0xd3, 0x00, 0x09,
+ 0x04, 0x39, 0x02, 0xa2, 0x10, 0x5c, 0x40, 0x18, 0x70, 0x47, 0xc0, 0x46,
+ 0x04, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x20, 0x61, 0x73, 0x73,
+ 0x65, 0x72, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69,
+ 0x6c, 0x65, 0x64, 0x3a, 0x20, 0x25, 0x73, 0x2c, 0x20, 0x66, 0x69, 0x6c,
+ 0x65, 0x3a, 0x20, 0x25, 0x73, 0x2c, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20,
+ 0x25, 0x64, 0x20, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x9a, 0x03, 0x00,
+ 0xe9, 0x9a, 0x03, 0x00, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f,
+ 0x74, 0x20, 0x70, 0x69, 0x6e, 0x6f, 0x75, 0x74, 0x00, 0x70, 0x69, 0x6e,
+ 0x6d, 0x61, 0x70, 0x20, 0x6d, 0x69, 0x73, 0x2d, 0x6d, 0x61, 0x74, 0x63,
+ 0x68, 0x00, 0x70, 0x69, 0x6e, 0x6d, 0x61, 0x70, 0x20, 0x6e, 0x6f, 0x74,
+ 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70,
+ 0x65, 0x72, 0x69, 0x70, 0x68, 0x65, 0x72, 0x61, 0x6c, 0x00, 0x70, 0x69,
+ 0x6e, 0x6d, 0x61, 0x70, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75,
+ 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x61, 0x9d, 0x03, 0x00, 0x99, 0x9c, 0x03, 0x00, 0xa5, 0x9c, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x39, 0xa7, 0x03, 0x00, 0x99, 0xa7, 0x03, 0x00,
+ 0xc9, 0xa7, 0x03, 0x00, 0xd9, 0xa7, 0x03, 0x00, 0xb5, 0xa7, 0x03, 0x00,
+ 0x78, 0xdc, 0x03, 0x00, 0xa4, 0x01, 0x00, 0x10, 0x6d, 0x62, 0x65, 0x64,
+ 0x2d, 0x73, 0x72, 0x63, 0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73,
+ 0x5c, 0x68, 0x61, 0x6c, 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,
+ 0x4e, 0x58, 0x50, 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c,
+ 0x50, 0x43, 0x31, 0x31, 0x55, 0x36, 0x58, 0x5c, 0x67, 0x70, 0x69, 0x6f,
+ 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x00, 0x6f, 0x62, 0x6a, 0x2d, 0x3e,
+ 0x70, 0x69, 0x6e, 0x20, 0x21, 0x3d, 0x20, 0x28, 0x50, 0x69, 0x6e, 0x4e,
+ 0x61, 0x6d, 0x65, 0x29, 0x4e, 0x43, 0x00, 0x00, 0xed, 0xa0, 0x03, 0x00,
+ 0xf7, 0xa0, 0x03, 0x00, 0x01, 0xa1, 0x03, 0x00, 0x0b, 0xa1, 0x03, 0x00,
+ 0x15, 0xa1, 0x03, 0x00, 0x1f, 0xa1, 0x03, 0x00, 0x29, 0xa1, 0x03, 0x00,
+ 0x33, 0xa1, 0x03, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x2d, 0x73, 0x72, 0x63,
+ 0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5c, 0x68, 0x61, 0x6c,
+ 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x58, 0x50, 0x5c,
+ 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c, 0x50, 0x43, 0x31, 0x31,
+ 0x55, 0x36, 0x58, 0x5c, 0x70, 0x69, 0x6e, 0x6d, 0x61, 0x70, 0x2e, 0x63,
+ 0x00, 0x00, 0x00, 0x00, 0xac, 0x26, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xfc, 0x04, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x10, 0x0f, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x94, 0x1a, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x34, 0x21, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x38, 0x23, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x3c, 0x25, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x40, 0x27, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x50, 0x77, 0x6d, 0x4f, 0x75, 0x74, 0x20, 0x70,
+ 0x69, 0x6e, 0x20, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x66,
+ 0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x4e, 0x6f, 0x20, 0x61, 0x76, 0x61,
+ 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x43, 0x54, 0x00, 0x00,
+ 0x00, 0xc0, 0x00, 0x50, 0x00, 0xe0, 0x00, 0x50, 0x20, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x01, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x58, 0x2c, 0x00, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x03, 0x00, 0x00, 0x00, 0xb4, 0x2a, 0x01, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x02, 0x00, 0x00, 0x00, 0xd4, 0x3a, 0x01, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x10, 0x0f, 0x02, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x28, 0x01, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xcc, 0x36, 0x01, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x28, 0x69, 0x6e, 0x74,
+ 0x29, 0x6f, 0x62, 0x6a, 0x2d, 0x3e, 0x73, 0x70, 0x69, 0x20, 0x21, 0x3d,
+ 0x20, 0x4e, 0x43, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x2d, 0x73, 0x72, 0x63,
+ 0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5c, 0x68, 0x61, 0x6c,
+ 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x58, 0x50, 0x5c,
+ 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c, 0x50, 0x43, 0x31, 0x31,
+ 0x55, 0x36, 0x58, 0x5c, 0x73, 0x70, 0x69, 0x5f, 0x61, 0x70, 0x69, 0x2e,
+ 0x63, 0x00, 0x28, 0x28, 0x62, 0x69, 0x74, 0x73, 0x20, 0x3e, 0x3d, 0x20,
+ 0x34, 0x29, 0x20, 0x26, 0x26, 0x20, 0x28, 0x62, 0x69, 0x74, 0x73, 0x20,
+ 0x3c, 0x3d, 0x20, 0x31, 0x36, 0x29, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x28,
+ 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x29, 0x20,
+ 0x26, 0x26, 0x20, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x3c, 0x3d, 0x20,
+ 0x33, 0x29, 0x29, 0x00, 0x43, 0x6f, 0x75, 0x6c, 0x64, 0x6e, 0x27, 0x74,
+ 0x20, 0x73, 0x65, 0x74, 0x75, 0x70, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x65, 0x64, 0x20, 0x53, 0x50, 0x49, 0x20, 0x66, 0x72, 0x65,
+ 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x00, 0x00, 0x24, 0x12, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x90, 0x18, 0x01, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x54, 0x2a, 0x00, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xb8, 0x2c, 0x01, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x1e, 0x01, 0x00,
+ 0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x2e, 0x00, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x04, 0x00, 0x00, 0x00, 0xbc, 0x2e, 0x01, 0x00,
+ 0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x20, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x4f,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x00, 0x14,
+ 0x7f, 0x7f, 0x14, 0x14, 0x7f, 0x7f, 0x14, 0x00, 0x24, 0x2e, 0x6b, 0x6b,
+ 0x3a, 0x12, 0x00, 0x00, 0x63, 0x33, 0x18, 0x0c, 0x66, 0x63, 0x00, 0x00,
+ 0x32, 0x7f, 0x4d, 0x4d, 0x77, 0x72, 0x50, 0x00, 0x00, 0x00, 0x04, 0x06,
+ 0x03, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x3e, 0x63, 0x41, 0x00, 0x00, 0x00,
+ 0x00, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, 0x08, 0x2a, 0x3e, 0x1c, 0x1c,
+ 0x3e, 0x2a, 0x08, 0x00, 0x08, 0x08, 0x3e, 0x3e, 0x08, 0x08, 0x00, 0x00,
+ 0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00,
+ 0x40, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00, 0x3e, 0x7f, 0x49, 0x45,
+ 0x7f, 0x3e, 0x00, 0x00, 0x40, 0x44, 0x7f, 0x7f, 0x40, 0x40, 0x00, 0x00,
+ 0x62, 0x73, 0x51, 0x49, 0x4f, 0x46, 0x00, 0x00, 0x22, 0x63, 0x49, 0x49,
+ 0x7f, 0x36, 0x00, 0x00, 0x00, 0x18, 0x14, 0x16, 0x7f, 0x7f, 0x10, 0x00,
+ 0x27, 0x67, 0x45, 0x45, 0x7d, 0x39, 0x00, 0x00, 0x3e, 0x7f, 0x49, 0x49,
+ 0x7b, 0x32, 0x00, 0x00, 0x03, 0x03, 0x79, 0x7d, 0x07, 0x03, 0x00, 0x00,
+ 0x36, 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00, 0x00, 0x26, 0x6f, 0x49, 0x49,
+ 0x7f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xe4, 0x64, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1c, 0x36, 0x63,
+ 0x41, 0x41, 0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00,
+ 0x41, 0x41, 0x63, 0x36, 0x1c, 0x08, 0x00, 0x00, 0x02, 0x03, 0x51, 0x59,
+ 0x0f, 0x06, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x4d, 0x6f, 0x2e, 0x00, 0x00,
+ 0x7c, 0x7e, 0x0b, 0x0b, 0x7e, 0x7c, 0x00, 0x00, 0x7f, 0x7f, 0x49, 0x49,
+ 0x7f, 0x36, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x63, 0x22, 0x00, 0x00,
+ 0x7f, 0x7f, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, 0x7f, 0x7f, 0x49, 0x49,
+ 0x41, 0x41, 0x00, 0x00, 0x7f, 0x7f, 0x09, 0x09, 0x01, 0x01, 0x00, 0x00,
+ 0x3e, 0x7f, 0x41, 0x49, 0x7b, 0x3a, 0x00, 0x00, 0x7f, 0x7f, 0x08, 0x08,
+ 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x41, 0x7f, 0x7f, 0x41, 0x00, 0x00, 0x00,
+ 0x20, 0x61, 0x41, 0x7f, 0x3f, 0x01, 0x00, 0x00, 0x7f, 0x7f, 0x1c, 0x36,
+ 0x63, 0x41, 0x00, 0x00, 0x7f, 0x7f, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
+ 0x7f, 0x7f, 0x06, 0x0c, 0x06, 0x7f, 0x7f, 0x00, 0x7f, 0x7f, 0x0e, 0x1c,
+ 0x7f, 0x7f, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x7f, 0x3e, 0x00, 0x00,
+ 0x7f, 0x7f, 0x09, 0x09, 0x0f, 0x06, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x61,
+ 0x7f, 0x5e, 0x00, 0x00, 0x7f, 0x7f, 0x19, 0x39, 0x6f, 0x46, 0x00, 0x00,
+ 0x26, 0x6f, 0x49, 0x49, 0x7b, 0x32, 0x00, 0x00, 0x01, 0x01, 0x7f, 0x7f,
+ 0x01, 0x01, 0x00, 0x00, 0x3f, 0x7f, 0x40, 0x40, 0x7f, 0x3f, 0x00, 0x00,
+ 0x1f, 0x3f, 0x60, 0x60, 0x3f, 0x1f, 0x00, 0x00, 0x7f, 0x7f, 0x30, 0x18,
+ 0x30, 0x7f, 0x7f, 0x00, 0x63, 0x77, 0x1c, 0x1c, 0x77, 0x63, 0x00, 0x00,
+ 0x07, 0x0f, 0x78, 0x78, 0x0f, 0x07, 0x00, 0x00, 0x61, 0x71, 0x59, 0x4d,
+ 0x47, 0x43, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x41, 0x41, 0x00, 0x00, 0x02,
+ 0x06, 0x0c, 0x18, 0x30, 0x60, 0x40, 0x00, 0x00, 0x00, 0x41, 0x41, 0x7f,
+ 0x7f, 0x00, 0x00, 0x00, 0x08, 0x0c, 0xfe, 0xfe, 0x0c, 0x08, 0x00, 0x00,
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03,
+ 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0x38, 0x18, 0x18, 0x18,
+ 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x38, 0xf0, 0xe0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1c, 0x18, 0x18, 0x18,
+ 0x18, 0x1c, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc,
+ 0x00, 0x00, 0x00, 0x33, 0x99, 0xcc, 0x66, 0x33, 0x99, 0xcc, 0x66, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x09, 0x09, 0x07, 0xf1, 0xf1, 0xf1, 0xf1, 0x71, 0x71, 0xf1, 0xf1, 0xf1,
+ 0xf1, 0x71, 0x71, 0xf1, 0xf1, 0xf1, 0xf1, 0x07, 0x09, 0x09, 0xfe, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0xff, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xfe, 0xf7, 0xef, 0xee, 0xef, 0xef, 0xee, 0xef, 0xf7, 0xfe,
+ 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x12, 0x12, 0x0c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0xfc, 0x30,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x00, 0x1c, 0x1c, 0x1c,
+ 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f,
+ 0x92, 0x92, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x12, 0x12,
+ 0x12, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x92, 0x92, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x9c, 0xbc, 0xa0, 0xe0, 0x7c, 0x3c, 0x00, 0x00,
+ 0x44, 0x64, 0x74, 0x5c, 0x4c, 0x44, 0x00, 0x00, 0x08, 0x7f, 0x77, 0x41,
+ 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x41, 0x41, 0x77, 0x7f, 0x08, 0x00, 0x00, 0x02, 0x06, 0x04, 0x02,
+ 0x06, 0x04, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x4e,
+ 0x4f, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x53, 0x00, 0x61, 0x62, 0x62, 0x62,
+ 0x62, 0x63, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x63, 0x20, 0x20, 0x20, 0x20, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x63, 0x00, 0x7c, 0x46, 0x49, 0x4c, 0x45, 0x7c, 0x00, 0x7c, 0x53, 0x45,
+ 0x54, 0x54, 0x49, 0x4e, 0x47, 0x53, 0x7c, 0x20, 0x20, 0x20, 0x20, 0x00,
+ 0x7c, 0x41, 0x42, 0x4f, 0x55, 0x54, 0x7c, 0x00, 0x7c, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x00,
+ 0x66, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x66, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x64, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65,
+ 0x00, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67,
+ 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67,
+ 0x67, 0x67, 0x67, 0x67, 0x00, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68,
+ 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x00,
+ 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x63, 0x00, 0x7c, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x7c, 0x00, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65, 0x00, 0x69, 0x6a, 0x6b,
+ 0x6c, 0x00, 0x6d, 0x6e, 0x6f, 0x70, 0x00, 0x71, 0x72, 0x73, 0x74, 0x00,
+ 0x75, 0x76, 0x77, 0x78, 0x00, 0x54, 0x52, 0x59, 0x20, 0x41, 0x47, 0x41,
+ 0x49, 0x4e, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x63, 0x00, 0x53, 0x45, 0x54, 0x54, 0x49,
+ 0x4e, 0x47, 0x53, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x65, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x00, 0x43, 0x4f, 0x50, 0x59,
+ 0x52, 0x49, 0x47, 0x48, 0x54, 0x00, 0x4c, 0x4f, 0x41, 0x44, 0x49, 0x4e,
+ 0x47, 0x20, 0x00, 0x53, 0x44, 0x20, 0x43, 0x41, 0x52, 0x44, 0x20, 0x49,
+ 0x4e, 0x49, 0x54, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x00, 0x46, 0x49, 0x4c,
+ 0x45, 0x20, 0x4f, 0x50, 0x45, 0x4e, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x00,
+ 0x45, 0x52, 0x52, 0x4f, 0x52, 0x20, 0x52, 0x45, 0x41, 0x44, 0x49, 0x4e,
+ 0x47, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x00, 0x46, 0x4c, 0x41, 0x53, 0x48,
+ 0x20, 0x57, 0x52, 0x49, 0x54, 0x45, 0x20, 0x45, 0x52, 0x52, 0x4f, 0x52,
+ 0x00, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x20, 0x21, 0x21, 0x00,
+ 0x4c, 0x4f, 0x41, 0x44, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d,
+ 0x3f, 0x00, 0x59, 0x45, 0x53, 0x00, 0x4e, 0x4f, 0x00, 0x7c, 0x20, 0x20,
+ 0x20, 0x20, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
+ 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x63,
+ 0x00, 0x53, 0x44, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x20, 0x00, 0x4f, 0x4b,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x10, 0x4c, 0xc8, 0x03, 0x00,
+ 0xfe, 0xc7, 0x03, 0x00, 0x2c, 0xc8, 0x03, 0x00, 0x86, 0xc7, 0x03, 0x00,
+ 0x2c, 0xc8, 0x03, 0x00, 0x22, 0xc8, 0x03, 0x00, 0x2c, 0xc8, 0x03, 0x00,
+ 0x86, 0xc7, 0x03, 0x00, 0xfe, 0xc7, 0x03, 0x00, 0xfe, 0xc7, 0x03, 0x00,
+ 0x22, 0xc8, 0x03, 0x00, 0x86, 0xc7, 0x03, 0x00, 0x7e, 0xc7, 0x03, 0x00,
+ 0x7e, 0xc7, 0x03, 0x00, 0x7e, 0xc7, 0x03, 0x00, 0x32, 0xc8, 0x03, 0x00,
+ 0xf0, 0xcb, 0x03, 0x00, 0xea, 0xcb, 0x03, 0x00, 0xea, 0xcb, 0x03, 0x00,
+ 0xe0, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00,
+ 0xd6, 0xcb, 0x03, 0x00, 0xe0, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00,
+ 0xd6, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 0xe0, 0xcb, 0x03, 0x00,
+ 0x3e, 0xcb, 0x03, 0x00, 0x3e, 0xcb, 0x03, 0x00, 0x3e, 0xcb, 0x03, 0x00,
+ 0x78, 0xcc, 0x03, 0x00, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc,
+ 0x9e, 0x46, 0x70, 0x47, 0xa5, 0x91, 0x03, 0x00, 0x8d, 0xa9, 0x03, 0x00,
+ 0xf1, 0xad, 0x03, 0x00, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc,
+ 0x9e, 0x46, 0x70, 0x47, 0xff, 0x22, 0x38, 0xb5, 0x52, 0x00, 0x02, 0x23,
+ 0x04, 0x1c, 0x0d, 0x1c, 0xfa, 0xf7, 0xf2, 0xfe, 0x03, 0x23, 0x00, 0x28,
+ 0x2d, 0xd1, 0x61, 0x78, 0x23, 0x78, 0x09, 0x02, 0x19, 0x43, 0x16, 0x4a,
+ 0x09, 0xb2, 0x02, 0x23, 0x91, 0x42, 0x24, 0xd1, 0x20, 0x1c, 0x29, 0x1c,
+ 0x36, 0x22, 0xfa, 0xf7, 0xe1, 0xfe, 0x00, 0x28, 0x09, 0xd1, 0x62, 0x78,
+ 0x23, 0x78, 0x12, 0x02, 0x1a, 0x43, 0x0f, 0x4b, 0x12, 0xb2, 0x9a, 0x42,
+ 0x01, 0xd1, 0x03, 0x1c, 0x13, 0xe0, 0x20, 0x1c, 0x29, 0x1c, 0x52, 0x22,
+ 0x02, 0x23, 0xfa, 0xf7, 0xcf, 0xfe, 0x00, 0x28, 0x0a, 0xd1, 0x63, 0x78,
+ 0x22, 0x78, 0x1b, 0x02, 0x13, 0x43, 0x07, 0x4a, 0x1b, 0xb2, 0x9b, 0x18,
+ 0x5a, 0x1e, 0x93, 0x41, 0xdb, 0xb2, 0x00, 0xe0, 0x01, 0x23, 0x18, 0x1c,
+ 0x38, 0xbd, 0xc0, 0x46, 0x55, 0xaa, 0xff, 0xff, 0x46, 0x41, 0x00, 0x00,
+ 0xba, 0xbe, 0xff, 0xff, 0xf0, 0xb5, 0x52, 0x4b, 0x00, 0x22, 0x8d, 0xb0,
+ 0x05, 0x1c, 0x1a, 0x60, 0x90, 0x42, 0x00, 0xd1, 0x9a, 0xe0, 0xfa, 0xf7,
+ 0x1f, 0xfe, 0x01, 0x23, 0x06, 0x1c, 0x1e, 0x40, 0x02, 0x20, 0x00, 0x2e,
+ 0x00, 0xd0, 0x91, 0xe0, 0x03, 0xac, 0x20, 0x1c, 0x31, 0x1c, 0xff, 0xf7,
+ 0xa7, 0xff, 0x01, 0x28, 0x1d, 0xd1, 0xdf, 0x22, 0x20, 0x1c, 0x31, 0x1c,
+ 0x52, 0x00, 0x10, 0x23, 0xfa, 0xf7, 0x98, 0xfe, 0x00, 0x28, 0x01, 0xd0,
+ 0x01, 0x20, 0x7f, 0xe0, 0x23, 0x79, 0x00, 0x2b, 0x01, 0xd1, 0x07, 0x20,
+ 0x7a, 0xe0, 0xe6, 0x7a, 0xa3, 0x7a, 0x36, 0x06, 0x1b, 0x04, 0x1e, 0x43,
+ 0x23, 0x7a, 0x20, 0x1c, 0x1e, 0x43, 0x63, 0x7a, 0x1b, 0x02, 0x1e, 0x43,
+ 0x31, 0x1c, 0xff, 0xf7, 0x87, 0xff, 0x03, 0x28, 0xe8, 0xd0, 0x00, 0x28,
+ 0xeb, 0xd1, 0x20, 0x1c, 0x31, 0x1c, 0x0d, 0x22, 0x24, 0x23, 0xfa, 0xf7,
+ 0x77, 0xfe, 0x00, 0x28, 0xde, 0xd1, 0xa7, 0x7a, 0x63, 0x7a, 0x3f, 0x02,
+ 0x1f, 0x43, 0x09, 0xd1, 0xa7, 0x7e, 0x63, 0x7e, 0x3f, 0x06, 0x1b, 0x04,
+ 0x1f, 0x43, 0xe3, 0x7d, 0x1f, 0x43, 0x23, 0x7e, 0x1b, 0x02, 0x1f, 0x43,
+ 0xe3, 0x78, 0xa2, 0x78, 0x5f, 0x43, 0x63, 0x78, 0x12, 0x02, 0x1a, 0x43,
+ 0x21, 0x78, 0xb6, 0x18, 0x01, 0x92, 0x2e, 0x61, 0x69, 0x70, 0x60, 0x79,
+ 0x23, 0x79, 0x00, 0x02, 0x18, 0x43, 0xa8, 0x80, 0xe3, 0x79, 0x1b, 0x02,
+ 0x00, 0x93, 0xa2, 0x79, 0x13, 0x43, 0x0b, 0xd1, 0xa3, 0x7d, 0x1b, 0x06,
+ 0x9c, 0x46, 0x63, 0x7d, 0x62, 0x46, 0x1b, 0x04, 0x1a, 0x43, 0xe3, 0x7c,
+ 0x24, 0x7d, 0x13, 0x43, 0x24, 0x02, 0x23, 0x43, 0x01, 0x9a, 0x04, 0x09,
+ 0x98, 0x1a, 0xc0, 0x1b, 0x00, 0x1b, 0xfd, 0xf7, 0xa3, 0xfd, 0x16, 0x4a,
+ 0x02, 0x30, 0xe8, 0x60, 0x01, 0x23, 0x90, 0x42, 0x04, 0xd9, 0x14, 0x4b,
+ 0x83, 0x42, 0x9b, 0x41, 0x5b, 0x42, 0x02, 0x33, 0x2b, 0x70, 0x03, 0x2b,
+ 0x10, 0xd1, 0x6b, 0x46, 0x0f, 0x33, 0xda, 0x7f, 0x01, 0x3b, 0xdb, 0x7f,
+ 0x12, 0x06, 0x1b, 0x04, 0x13, 0x43, 0x03, 0xaa, 0xd2, 0x7f, 0x13, 0x43,
+ 0x6a, 0x46, 0x0d, 0x32, 0xd2, 0x7f, 0x12, 0x02, 0x13, 0x43, 0x00, 0xe0,
+ 0xbb, 0x19, 0x6b, 0x61, 0x36, 0x19, 0x04, 0x4b, 0xf7, 0x19, 0x00, 0x20,
+ 0xaf, 0x61, 0xa8, 0x70, 0x1d, 0x60, 0xff, 0xe7, 0x0d, 0xb0, 0xf0, 0xbd,
+ 0x9c, 0x01, 0x00, 0x10, 0xf6, 0x0f, 0x00, 0x00, 0xf6, 0xff, 0x00, 0x00,
+ 0xa0, 0x22, 0x80, 0x23, 0x12, 0x06, 0x9b, 0x01, 0xd0, 0x58, 0x80, 0x21,
+ 0x89, 0x00, 0x01, 0x43, 0xd1, 0x50, 0xd0, 0x58, 0x80, 0x21, 0x49, 0x00,
+ 0x01, 0x43, 0xd1, 0x50, 0xd1, 0x58, 0x40, 0x20, 0x01, 0x43, 0xd1, 0x50,
+ 0xd1, 0x58, 0x80, 0x20, 0x01, 0x43, 0xd1, 0x50, 0x70, 0x47, 0x10, 0xb5,
+ 0xff, 0xf7, 0xe6, 0xff, 0xfa, 0xf7, 0x62, 0xfd, 0x08, 0x4c, 0x20, 0x70,
+ 0x08, 0x48, 0xff, 0xf7, 0x33, 0xff, 0x08, 0x49, 0x20, 0x70, 0x08, 0x48,
+ 0xfb, 0xf7, 0x96, 0xf8, 0x07, 0x4b, 0x20, 0x70, 0x00, 0x22, 0x00, 0x28,
+ 0x00, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x10, 0xbd, 0x4b, 0x02, 0x00, 0x10,
+ 0xdc, 0x01, 0x00, 0x10, 0x18, 0xe3, 0x03, 0x00, 0x4c, 0x02, 0x00, 0x10,
+ 0x60, 0x02, 0x00, 0x10, 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x3e, 0x4a,
+ 0x3e, 0x49, 0x99, 0x50, 0x80, 0x22, 0x04, 0x33, 0x52, 0x00, 0x93, 0x42,
+ 0xf7, 0xd1, 0xff, 0xf7, 0xd2, 0xff, 0xe0, 0x23, 0x9b, 0x02, 0x1b, 0x78,
+ 0x01, 0xa8, 0xaa, 0x2b, 0x03, 0xd0, 0xbb, 0x2b, 0x07, 0xd1, 0x43, 0x23,
+ 0x06, 0xe0, 0x42, 0x23, 0x2e, 0x22, 0x03, 0x70, 0x43, 0x70, 0x82, 0x70,
+ 0x05, 0xe0, 0x41, 0x23, 0x03, 0x70, 0x43, 0x70, 0x2e, 0x23, 0x83, 0x70,
+ 0x42, 0x23, 0xc3, 0x70, 0x49, 0x23, 0x03, 0x71, 0x4e, 0x23, 0x43, 0x71,
+ 0x04, 0x21, 0x00, 0x23, 0x83, 0x71, 0xfc, 0xf7, 0x55, 0xf8, 0x00, 0x28,
+ 0x4c, 0xd1, 0x28, 0x4d, 0x27, 0x4c, 0x01, 0x35, 0xff, 0x35, 0x20, 0x1c,
+ 0x04, 0x21, 0x04, 0x34, 0xfc, 0xf7, 0x70, 0xf8, 0xac, 0x42, 0xf8, 0xd1,
+ 0x24, 0x4c, 0x25, 0x4e, 0x36, 0x23, 0x23, 0x60, 0x20, 0x1c, 0x31, 0x1c,
+ 0x23, 0x4b, 0x98, 0x47, 0x72, 0xb6, 0x1c, 0x25, 0x32, 0x23, 0x23, 0x60,
+ 0x31, 0x1c, 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x1e, 0x4b, 0x98, 0x47,
+ 0x1e, 0x4f, 0x34, 0x23, 0xfa, 0x21, 0x23, 0x60, 0x38, 0x68, 0x65, 0x60,
+ 0xa5, 0x60, 0x89, 0x00, 0xfd, 0xf7, 0xe4, 0xfc, 0x31, 0x1c, 0xe0, 0x60,
+ 0x17, 0x4b, 0x20, 0x1c, 0x98, 0x47, 0x32, 0x23, 0x23, 0x60, 0x31, 0x1c,
+ 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x13, 0x4b, 0x98, 0x47, 0x33, 0x23,
+ 0x23, 0x60, 0xe0, 0x23, 0x9b, 0x02, 0x63, 0x60, 0x0b, 0x4b, 0xfa, 0x21,
+ 0xa3, 0x60, 0x80, 0x23, 0x5b, 0x00, 0xe3, 0x60, 0x38, 0x68, 0x89, 0x00,
+ 0xfd, 0xf7, 0xc8, 0xfc, 0x31, 0x1c, 0x20, 0x61, 0x09, 0x4b, 0x20, 0x1c,
+ 0x98, 0x47, 0x62, 0xb6, 0x09, 0x4a, 0x0a, 0x4b, 0xda, 0x60, 0xfe, 0xe7,
+ 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x64, 0x02, 0x00, 0x10,
+ 0x1e, 0xab, 0x07, 0xb0, 0x64, 0x03, 0x00, 0x10, 0x78, 0x03, 0x00, 0x10,
+ 0xf1, 0x1f, 0xff, 0x1f, 0x04, 0x01, 0x00, 0x10, 0x04, 0x00, 0xfa, 0x05,
+ 0x00, 0xed, 0x00, 0xe0, 0x10, 0xb5, 0x3d, 0x23, 0x8a, 0xb0, 0x05, 0x93,
+ 0x0d, 0x4b, 0x07, 0x91, 0xfa, 0x21, 0x06, 0x90, 0x89, 0x00, 0x18, 0x68,
+ 0x08, 0x92, 0xfd, 0xf7, 0x9d, 0xfc, 0x0a, 0x4c, 0x01, 0x23, 0x09, 0x90,
+ 0x63, 0x60, 0x72, 0xb6, 0x08, 0x4b, 0x05, 0xa8, 0x1b, 0x68, 0x01, 0xa9,
+ 0x98, 0x47, 0x62, 0xb6, 0x00, 0x23, 0x63, 0x60, 0x01, 0x9b, 0x00, 0x2b,
+ 0x00, 0xd0, 0xfe, 0xe7, 0x0a, 0xb0, 0x10, 0xbd, 0x04, 0x01, 0x00, 0x10,
+ 0x00, 0x40, 0x01, 0x40, 0x0c, 0x01, 0x00, 0x10, 0x00, 0xb5, 0x3e, 0x23,
+ 0x8b, 0xb0, 0x05, 0x93, 0x0b, 0x4b, 0x07, 0x91, 0xfa, 0x21, 0x06, 0x90,
+ 0x89, 0x00, 0x18, 0x68, 0x08, 0x92, 0xfd, 0xf7, 0x77, 0xfc, 0x09, 0x90,
+ 0x72, 0xb6, 0x07, 0x4b, 0x05, 0xa8, 0x1b, 0x68, 0x01, 0xa9, 0x98, 0x47,
+ 0x62, 0xb6, 0x01, 0x9b, 0x00, 0x2b, 0x00, 0xd0, 0xfe, 0xe7, 0x0b, 0xb0,
+ 0x00, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10, 0x0c, 0x01, 0x00, 0x10,
+ 0x00, 0xb5, 0x3e, 0x23, 0x8b, 0xb0, 0x05, 0x93, 0x0b, 0x4b, 0x07, 0x91,
+ 0xfa, 0x21, 0x06, 0x90, 0x89, 0x00, 0x18, 0x68, 0x08, 0x92, 0xfd, 0xf7,
+ 0x57, 0xfc, 0x09, 0x90, 0x72, 0xb6, 0x07, 0x4b, 0x05, 0xa8, 0x1b, 0x68,
+ 0x01, 0xa9, 0x98, 0x47, 0x62, 0xb6, 0x01, 0x9b, 0x00, 0x2b, 0x00, 0xd0,
+ 0xfe, 0xe7, 0x0b, 0xb0, 0x00, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10,
+ 0x0c, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x02, 0x4b, 0x1b, 0x68, 0x98, 0x47,
+ 0x08, 0xbd, 0xc0, 0x46, 0xf1, 0x1f, 0xff, 0x1f, 0x00, 0xb5, 0x03, 0x1c,
+ 0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0a, 0xd3, 0x32, 0x22, 0x03, 0x92,
+ 0x04, 0x93, 0x05, 0x91, 0x72, 0xb6, 0x03, 0xa8, 0x69, 0x46, 0xff, 0xf7,
+ 0xe9, 0xff, 0x62, 0xb6, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0x00, 0xb5,
+ 0x33, 0x23, 0x89, 0xb0, 0x03, 0x93, 0x08, 0x4b, 0x05, 0x91, 0xfa, 0x21,
+ 0x04, 0x90, 0x89, 0x00, 0x18, 0x68, 0x06, 0x92, 0xfd, 0xf7, 0x1c, 0xfc,
+ 0x69, 0x46, 0x07, 0x90, 0x03, 0xa8, 0xff, 0xf7, 0xd3, 0xff, 0x00, 0x98,
+ 0x09, 0xb0, 0x00, 0xbd, 0x04, 0x01, 0x00, 0x10, 0x00, 0xb5, 0x03, 0x1c,
+ 0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0f, 0xd3, 0x04, 0x93, 0x08, 0x4b,
+ 0x05, 0x91, 0xfa, 0x21, 0x34, 0x22, 0x18, 0x68, 0x89, 0x00, 0x03, 0x92,
+ 0xfd, 0xf7, 0x02, 0xfc, 0x69, 0x46, 0x06, 0x90, 0x03, 0xa8, 0xff, 0xf7,
+ 0xb9, 0xff, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0x04, 0x01, 0x00, 0x10,
+ 0x10, 0xb5, 0x0c, 0x23, 0x88, 0xb0, 0x14, 0x1c, 0x81, 0x42, 0x0d, 0xd3,
+ 0x35, 0x23, 0x04, 0x90, 0x05, 0x91, 0x03, 0xa8, 0x69, 0x46, 0x03, 0x93,
+ 0xff, 0xf7, 0xa6, 0xff, 0x00, 0x9b, 0x08, 0x2b, 0x02, 0xd1, 0x01, 0x9a,
+ 0x23, 0x60, 0x62, 0x60, 0x18, 0x1c, 0x08, 0xb0, 0x10, 0xbd, 0x10, 0xb5,
+ 0x36, 0x23, 0x88, 0xb0, 0x04, 0x1c, 0x03, 0x93, 0x72, 0xb6, 0x03, 0xa8,
+ 0x69, 0x46, 0xff, 0xf7, 0x93, 0xff, 0x62, 0xb6, 0x01, 0x9b, 0x00, 0x98,
+ 0x23, 0x60, 0x08, 0xb0, 0x10, 0xbd, 0x30, 0xb5, 0x89, 0xb0, 0x05, 0x1c,
+ 0x0c, 0x1c, 0x37, 0x23, 0x03, 0xa8, 0x69, 0x46, 0x03, 0x93, 0xff, 0xf7,
+ 0x83, 0xff, 0x01, 0x9b, 0x00, 0x98, 0x1a, 0x04, 0x12, 0x0e, 0xdb, 0xb2,
+ 0x2a, 0x60, 0x23, 0x60, 0x09, 0xb0, 0x30, 0xbd, 0x10, 0xb5, 0x88, 0xb0,
+ 0x04, 0x90, 0x05, 0x91, 0x03, 0xa8, 0x1c, 0x1c, 0x69, 0x46, 0x38, 0x23,
+ 0x03, 0x93, 0x06, 0x92, 0xff, 0xf7, 0x6e, 0xff, 0x00, 0x98, 0x0a, 0x28,
+ 0x03, 0xd1, 0x00, 0x2c, 0x01, 0xd0, 0x01, 0x9b, 0x23, 0x60, 0x08, 0xb0,
+ 0x10, 0xbd, 0x00, 0xb5, 0x89, 0xb0, 0x39, 0x23, 0x03, 0xa8, 0x69, 0x46,
+ 0x03, 0x93, 0xff, 0xf7, 0x5d, 0xff, 0x09, 0xb0, 0x00, 0xbd, 0x10, 0xb5,
+ 0x8a, 0xb0, 0x04, 0x1c, 0x3a, 0x23, 0x05, 0xa8, 0x69, 0x46, 0x05, 0x93,
+ 0xff, 0xf7, 0x52, 0xff, 0x02, 0x9b, 0x00, 0x98, 0x23, 0x60, 0x03, 0x9b,
+ 0x63, 0x60, 0x04, 0x9b, 0xa3, 0x60, 0x0a, 0xb0, 0x10, 0xbd, 0x00, 0xb5,
+ 0x03, 0x1c, 0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0f, 0xd3, 0x04, 0x93,
+ 0x08, 0x4b, 0x05, 0x91, 0xfa, 0x21, 0x3b, 0x22, 0x18, 0x68, 0x89, 0x00,
+ 0x03, 0x92, 0xfd, 0xf7, 0x7d, 0xfb, 0x69, 0x46, 0x06, 0x90, 0x03, 0xa8,
+ 0xff, 0xf7, 0x34, 0xff, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0xc0, 0x46,
+ 0x04, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xdc, 0x02,
+ 0x10, 0x00, 0x00, 0x00, 0xf1, 0x1f, 0xff, 0x1f, 0xff, 0xff, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xe4, 0x03, 0x00,
+ 0xc0, 0xe4, 0x03, 0x00, 0xe0, 0xe4, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x7a, 0xde, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+//const unsigned long flash_key1[1] __attribute__((section(".ARM.__at_0x3FFF4"))) = {0x1eab07b0};
+
+
+//static const unsigned char bootable[] __attribute__((section(".ARM.__at_0x3FFF4"))) = {
+static const unsigned char bootable[]__attribute__((at(0x3FE04))) = {
+ //(.bootable*)
+ 0x1E,
+ 0xAB,
+ 0x07,
+ 0xB0,
+ // version and options
+ 0x01,
+ 0x00,
+ 0x00,
+ 0x00,
+ // jump address
+ 0x00,
+ 0x90,
+ 0x03,
+ 0x00
+};
+
+#endif
Binary file POKITTO_HW/minihi.txt has changed
--- a/POKITTO_LIBS/Synth/Synth.cpp Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/**************************************************************************/ -/*! - @file Synth.cpp - @author Jonne Valola - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Jonne Valola - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#include "Pokitto.h" -#include "Synth.h" - -/** COMMON TO BOTH HW AND SIMULATED SOUND **/ - -boolean playing=false; //external to share between player and synth -boolean track1on = true, track2on = true, track3on = true, tableRefresh = false; - -uint8_t sequencepos=0, tempo = 120; -long writeindex=0, readindex=0; -uint16_t playerpos=0; -long per = 1000*60/tempo/4; // ms per minute was 1000*60 -uint16_t samplespertick = (uint16_t)per*57, notetick; // samplespertick is a calculated value based on song speed. notetick is a counter -long samplesperpattern=0; - -uint8_t tick=3; // loops between 3 channels. Tick 3 is used to calculate volume envelopes - - -SONG song; -OSC osc1,osc2,osc3; -OSC patch[15]; -BLOCK block[1]; //30 blocks maximum - - - - - - -
--- a/POKITTO_LIBS/Synth/Synth.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth.h
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#ifndef SYNTH_H
-#define SYNTH_H
-
-#include "Synth_osc.h"
-#include "Synth_song.h"
-
-/* PROPER WAY
-void f() {}
-
-int main()
-{
- using FunctionPtr = void (*)();
-
- FunctionPtr ptr = f;
-}
-*/
-
-#ifndef boolean
-typedef bool boolean;
-#endif
-
-//extern void fakeISR(); // was defined in Rboy_soundsim.h
-
-typedef void (*waveFunction)(OSC*);
-typedef void (*envFunction)(OSC*);
-typedef void (*mixFunction)();
-
-extern waveFunction Farr [];
-extern envFunction Earr [];
-extern mixFunction Marr []; // counts down
-extern mixFunction HWMarr []; // counts down
-/** COMMON TO BOTH HW AND SIM SOUND OUTPUT **/
-
-#define RBTRACKER_VERSION 0.03f
-
-#define WOFF 0
-#define WSQUARE 1
-#define WSAW 2
-#define WTRI 3
-#define WNOISE 4
-#define WSAMPLE 5
-#define WPNOISE 5
-
-#define OVERDRIVE 4
-
-#define ARPSTEPMAX 4 // was 5
-#define PATTERNLENGTH 64
-#define MAXPATTERNS 10
-#define MAXBLOCKS 30 // 10 *3
-
-#define VOLTICK 5
-#define ARPTICK 50 // 150 // was 200
-
-#define NUMWAVES 5
-#define NUMENVELOPES 3
-#define NUMMIXES 4
-
-extern void getNoteString(char *, uint8_t);
-
-extern void playNote(uint8_t,uint8_t,uint8_t);
-extern void makeSampleInstruments();
-
-extern void setPitch(int);
-extern void setWave(int);
-extern void setVolume(int);
-extern void initAudio();
-extern void testOsc();
-extern void terminateSound();
-extern void killSound();
-extern void startSound();
-extern void stopSound();
-extern void updatePlayback(); // from flash
-extern void updatePlaybackSD(uint8_t); // from SD
-extern void initStreams(uint8_t);
-extern void emptyOscillators();
-extern void emptyPatches();
-extern void emptyBlocks();
-extern void emptySong();
-extern int openSongFromSD(char *);
-extern void writeChunkToSD(uint8_t *);
-extern void readChunkFromSD(uint8_t *);
-
-
-extern boolean playing, track1on, track2on, track3on, tableRefresh;
-extern uint16_t playerpos;
-extern uint16_t samplespertick, notetick;
-extern long samplesperpattern;
-
-extern long readindex, writeindex;
-extern uint8_t tick, sequencepos;
-
-extern SONG song;
-extern OSC osc1,osc2,osc3;
-extern OSC patch[];
-extern BLOCK block[]; // array of blocks
-
-#define MAX_ARPMODE 16
-
-extern int8_t arptable[][5];
-
-extern uint16_t freqs[];
-extern uint16_t cincs[];
-
-extern uint8_t xorshift8();
-extern uint16_t xorshift16();
-
-extern uint16_t noiseval;
-
-extern void setOSC(OSC*,byte, byte, byte, byte, byte,
- uint8_t, uint8_t,
- uint16_t, uint16_t, uint16_t, uint16_t,
- int16_t, int16_t, uint8_t, uint8_t, uint8_t);
-
-extern void setOSC(OSC*,byte,byte,uint16_t, uint8_t, uint32_t);
-
-extern void waveoff(OSC*);
-#endif // SYNTH_H
-
--- a/POKITTO_LIBS/Synth/Synth_envfuncs.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_envfuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "Synth.h"
-
-/** ENVELOPE FUNCTIONS **/
-
-void noADSR(OSC* o){
-}
-
-void attackFunc(OSC* o){
- if (o->adsrvol >= o->vol) {
- if (o->decay) {
- o->adsrvol = o->vol;
- o->adsrphase = 2;
- } else {
- o->adsrvol = o->sustain;
- o->adsrphase = 3;
- }
- return;
- }
- o->adsrvol += o->attack;
-}
-
-void decayFunc(OSC* o){
- if (o->adsrvol >= o->sustain + o->decay) {
- o->adsrvol -= o->decay;
- return;
- } else {
- o->adsrvol = o->sustain;
- o->adsrphase = 3;
- }
-}
-
-void releaseFunc(OSC* o){
- if (o->adsrvol > o->release) o->adsrvol -= o->release;
- else o->adsrvol = 0;
- if (!o->adsrvol) { // we have hit zero volume level
- if (o->loop) {
- if (o->attack) {
- o->adsrvol = 0;
- } else {
- o->adsrvol = o->vol;
- }
- if (o->echo) o->echodiv++;
- o->adsrphase = 1;
- return;
- }
- else {
- o->adsrphase = 0;
- o->adsrvol = 0;
- return;
- }
- }
-}
-
-
-
-
--- a/POKITTO_LIBS/Synth/Synth_helpers.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_envfuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#include "Pokitto.h"
-#include "Synth.h"
-
-#define PROGMEM
- #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
- #ifndef WIN32
- #ifndef pgm_read_word
- #define pgm_read_word(addr) (*(const unsigned short *)(addr))
- #endif
- #else
- #define pgm_read_word(addr) (*(const unsigned int *)(addr))
- #endif // WIN32
-
-// http://www.arklyffe.com/main/2010/08/29/xorshift-pseudorandom-number-generator/
-static uint8_t y8 = 1;
-static uint16_t y16 = 1;
-
-// returns values from 1 to 255 inclusive, period is 255
-uint8_t xorshift8(void) {
- //y8 ^= (y8 << 7);
- y8 ^= (y8 * 128);
- y8 ^= (y8 >> 5);
- //return y8 ^= (y8 << 3);
- return y8 ^= (y8 * 8);
-}
-
-// returns values from 1 to 65535 inclusive, period is 65535
-uint16_t xorshift16(void) {
- //y16 ^= (y16 << 13);
- y16 ^= (y16 * 8192);
- y16 ^= (y16 >> 9);
- //return y16 ^= (y16 << 7);
- return y16 ^= (y16 * 128);
-}
-
-
-int8_t arptable[MAX_ARPMODE][5] = {
-{0,0,0,0,0}, // Off
-{0,4,7,4,0}, // Major tonic, 3rd, 5th
-{0,3,7,3,0}, // Minor tonic, 3rd, 5th
-{0,1,0,-1,0}, // vibrato test
-{0,12,0,12,0}, // octave test
-{0,11,14,17,21}, // funky test
-};
-
-/** VITAL TABLES **/
-
-uint16_t cincs[] ={
-36, // 0 - NOTE_B0
-38, // 1 - NOTE_C1
-40, // 2 - NOTE_CS1
-43, // 3 - NOTE_D1
-45, // 4 - NOTE_DS1
-47, // 5 - NOTE_E1
-51, // 6 - NOTE_F1
-53, // 7 - NOTE_FS1
-56, // 8 - NOTE_G1
-60, // 9 - NOTE_GS1
-63, // 10 - NOTE_A1
-67, // 11 - NOTE_AS1
-71, // 12 - NOTE_B1
-75, // 13 - NOTE_C2
-79, // 14 - NOTE_CS2
-84, // 15 - NOTE_D2
-90, // 16 - NOTE_DS2
-94, // 17 - NOTE_E2
-100, // 18 - NOTE_F2
-107, // 19 - NOTE_FS2
-113, // 20 - NOTE_G2
-120, // 21 - NOTE_GS2
-127, // 22 - NOTE_A2
-135, // 23 - NOTE_AS2
-142, // 24 - NOTE_B2
-151, // 25 - NOTE_C3
-160, // 26 - NOTE_CS3
-169, // 27 - NOTE_D3
-180, // 28 - NOTE_DS3
-190, // 29 - NOTE_E3
-201, // 30 - NOTE_F3
-213, // 31 - NOTE_FS3
-225, // 32 - NOTE_G3
-239, //239, // 33 - NOTE_GS3
-253, // 34 - NOTE_A3
-267, // 35 - NOTE_AS3
-284, // 36 - NOTE_B3
-301, // 37 - NOTE_C4
-318, // 38 - NOTE_CS4
-338, // 39 - NOTE_D4
-358, // 40 - NOTE_DS4
-379, // 41 - NOTE_E4
-402, // 42 - NOTE_F4
-426, // 43 - NOTE_FS4
-452, // 44 - NOTE_G4
-478, // 45 - NOTE_GS4
-504, // 46 - NOTE_A4 // 440Hz
-537, // 47 - NOTE_AS4
-570, // 48 - NOTE_B4
-601, // 49 - NOTE_C5
-636, // 50 - NOTE_CS5
-676, // 51 - NOTE_D5
-712, // 52 - NOTE_DS5
-762, // 53 - NOTE_E5
-799, // 54 - NOTE_F5
-851, // 55 - NOTE_FS5
-898, // 56 - NOTE_G5
-950, // 57 - NOTE_GS5
-1008, // 58 - NOTE_A5
-1074, // 59 - NOTE_AS5
-1130, // 60 - NOTE_B5
-1214, // 61 - NOTE_C6
-1285, // 62 - NOTE_CS6
-1337, // 63 - NOTE_D6
-1425, // 64 - NOTE_DS6
-1524, // 65 - NOTE_E6
-1598, // 66 - NOTE_F6
-1680, // 67 - NOTE_FS6
-1820, // 68 - NOTE_G6
-1928, // 69 - NOTE_GS6
-2048, // 70 - NOTE_A6
-2114, // 71 - NOTE_AS6
-2260, // 72 - NOTE_B6
-2427, // 73 - NOTE_C7
-2521, // 74 - NOTE_CS7
-2731, // 75 - NOTE_D7
-2849, // 76 - NOTE_DS7
-2979, // 77 - NOTE_E7
-3277, // 78 - NOTE_F7
-3449, // 79 - NOTE_FS7
-3641, // 80 - NOTE_G7
-3855, // 81 - NOTE_GS7
-4096, // 82 - NOTE_A7
-4369, // 83 - NOTE_AS7
-4681, // 84 - NOTE_B7
-4681, // 85 - NOTE_C8
-5041, // 86 - NOTE_CS8
-5461, // 87 - NOTE_D8
-5958, // 88 - NOTE_DS8
-};
-
-
-/** NOTE TO TEXT TABLES **/
-
-const char note_0[] PROGMEM = "B-0"; // 0 - NOTE_B0
-const char note_1[] PROGMEM = "C-1"; // 1 - NOTE_C1
-const char note_2[] PROGMEM = "C#1"; // 2 - NOTE_CS1
-const char note_3[] PROGMEM = "D-1"; // 3 - NOTE_D1
-const char note_4[] PROGMEM = "D#1"; // 4 - NOTE_DS1
-const char note_5[] PROGMEM = "E-1"; // 5 - NOTE_E1
-const char note_6[] PROGMEM = "F-1"; // 6 - NOTE_F1
-const char note_7[] PROGMEM = "F#1"; // 7 - NOTE_FS1
-const char note_8[] PROGMEM = "G-1"; // 8 - NOTE_G1
-const char note_9[] PROGMEM = "G#1"; // 9 - NOTE_GS1
-const char note_10[] PROGMEM = "A-1"; // 10 - NOTE_A1
-const char note_11[] PROGMEM = "A#1"; // 11 - NOTE_AS1
-const char note_12[] PROGMEM = "B-1"; // 12 - NOTE_B1
-const char note_13[] PROGMEM = "C-2"; // 2 - NOTE_C2
-const char note_14[] PROGMEM = "C#2"; // 2 - NOTE_CS2
-const char note_15[] PROGMEM = "D-2"; // 3 - NOTE_D2
-const char note_16[] PROGMEM = "D#2"; // 4 - NOTE_DS2
-const char note_17[] PROGMEM = "E-2"; // 5 - NOTE_E2
-const char note_18[] PROGMEM = "F-2"; // 6 - NOTE_F2
-const char note_19[] PROGMEM = "F#2"; // 7 - NOTE_FS2
-const char note_20[] PROGMEM = "G-2"; // 8 - NOTE_G2
-const char note_21[] PROGMEM = "G#2"; // 9 - NOTE_GS2
-const char note_22[] PROGMEM = "A-2"; // 20 - NOTE_A2
-const char note_23[] PROGMEM = "A#2"; // 22 - NOTE_AS2
-const char note_24[] PROGMEM = "B-2"; // 22 - NOTE_B2
-const char note_25[] PROGMEM = "C-3"; // 3 - NOTE_C3
-const char note_26[] PROGMEM = "C#3"; // 3 - NOTE_CS3
-const char note_27[] PROGMEM = "D-3"; // 3 - NOTE_D3
-const char note_28[] PROGMEM = "D#3"; // 4 - NOTE_DS3
-const char note_29[] PROGMEM = "E-3"; // 5 - NOTE_E3
-const char note_30[] PROGMEM = "F-3"; // 6 - NOTE_F3
-const char note_31[] PROGMEM = "F#3"; // 7 - NOTE_FS3
-const char note_32[] PROGMEM = "G-3"; // 8 - NOTE_G3
-const char note_33[] PROGMEM = "G#3"; // 9 - NOTE_GS3
-const char note_34[] PROGMEM = "A-3"; // 30 - NOTE_A3
-const char note_35[] PROGMEM = "A#3"; // 33 - NOTE_AS3
-const char note_36[] PROGMEM = "B-3"; // 33 - NOTE_B3
-const char note_37[] PROGMEM = "C-4"; // 4 - NOTE_C4
-const char note_38[] PROGMEM = "C#4"; // 4 - NOTE_CS4
-const char note_39[] PROGMEM = "D-4"; // 3 - NOTE_D4
-const char note_40[] PROGMEM = "D#4"; // 4 - NOTE_DS4
-const char note_41[] PROGMEM = "E-4"; // 5 - NOTE_E4
-const char note_42[] PROGMEM = "F-4"; // 6 - NOTE_F4
-const char note_43[] PROGMEM = "F#4"; // 7 - NOTE_FS4
-const char note_44[] PROGMEM = "G-4"; // 8 - NOTE_G4
-const char note_45[] PROGMEM = "G#4"; // 9 - NOTE_GS4
-const char note_46[] PROGMEM = "A-4"; // 40 - NOTE_A4
-const char note_47[] PROGMEM = "A#4"; // 44 - NOTE_AS4
-const char note_48[] PROGMEM = "B-4"; // 44 - NOTE_B4
-const char note_49[] PROGMEM = "C-5"; // 5 - NOTE_C5
-const char note_50[] PROGMEM = "C#5"; // 5 - NOTE_CS5
-const char note_51[] PROGMEM = "D-5"; // 3 - NOTE_D5
-const char note_52[] PROGMEM = "D#5"; // 4 - NOTE_DS5
-const char note_53[] PROGMEM = "E-5"; // 5 - NOTE_E5
-const char note_54[] PROGMEM = "F-5"; // 6 - NOTE_F5
-const char note_55[] PROGMEM = "F#5"; // 7 - NOTE_FS5
-const char note_56[] PROGMEM = "G-5"; // 8 - NOTE_G5
-const char note_57[] PROGMEM = "G#5"; // 9 - NOTE_GS5
-const char note_58[] PROGMEM = "A-5"; // 50 - NOTE_A5
-const char note_59[] PROGMEM = "A#5"; // 55 - NOTE_AS5
-const char note_60[] PROGMEM = "B-5"; // 55 - NOTE_B5
-const char note_61[] PROGMEM = "C-6"; // 6 - NOTE_C6
-const char note_62[] PROGMEM = "C#6"; // 6 - NOTE_CS6
-const char note_63[] PROGMEM = "D-6"; // 3 - NOTE_D6
-const char note_64[] PROGMEM = "D#6"; // 4 - NOTE_DS6
-const char note_65[] PROGMEM = "E-6"; // 5 - NOTE_E6
-const char note_66[] PROGMEM = "F-6"; // 6 - NOTE_F6
-const char note_67[] PROGMEM = "F#6"; // 7 - NOTE_FS6
-const char note_68[] PROGMEM = "G-6"; // 8 - NOTE_G6
-const char note_69[] PROGMEM = "G#6"; // 9 - NOTE_GS6
-const char note_70[] PROGMEM = "A-6"; // 60 - NOTE_A6
-const char note_71[] PROGMEM = "A#6"; // 66 - NOTE_AS6
-const char note_72[] PROGMEM = "B-6"; // 66 - NOTE_B6
-const char note_73[] PROGMEM = "C-7"; // 7 - NOTE_C7
-const char note_74[] PROGMEM = "C#7"; // 7 - NOTE_CS7
-const char note_75[] PROGMEM = "D-7"; // 3 - NOTE_D7
-const char note_76[] PROGMEM = "D#7"; // 4 - NOTE_DS7
-const char note_77[] PROGMEM = "E-7"; // 5 - NOTE_E7
-const char note_78[] PROGMEM = "F-7"; // 6 - NOTE_F7
-const char note_79[] PROGMEM = "F#7"; // 7 - NOTE_FS7
-const char note_80[] PROGMEM = "G-7"; // 8 - NOTE_G7
-const char note_81[] PROGMEM = "G#7"; // 9 - NOTE_GS7
-const char note_82[] PROGMEM = "A-7"; // 70 - NOTE_A7
-const char note_83[] PROGMEM = "A#7"; // 77 - NOTE_AS7
-const char note_84[] PROGMEM = "B-7"; // 77 - NOTE_B7
-const char note_85[] PROGMEM = "C-8"; // 8 - NOTE_C8
-const char note_86[] PROGMEM = "C#8"; // 8 - NOTE_CS8
-const char note_87[] PROGMEM = "D-8"; // 3 - NOTE_D8
-const char note_88[] PROGMEM = "D#8"; // 4 - NOTE_DS8
-
-const char* note_table[] PROGMEM = {
- note_0,
- note_1,
- note_2,
- note_3,
- note_4,
- note_5,
- note_6,
- note_7,
- note_8,
- note_9,
- note_10,
- note_11,
- note_12,
- note_13,
- note_14,
- note_15,
- note_16,
- note_17,
- note_18,
- note_19,
- note_20,
- note_21,
- note_22,
- note_23,
- note_24,
- note_25,
- note_26,
- note_27,
- note_28,
- note_29,
- note_30,
- note_31,
- note_32,
- note_33,
- note_34,
- note_35,
- note_36,
- note_37,
- note_38,
- note_39,
- note_40,
- note_41,
- note_42,
- note_43,
- note_44,
- note_45,
- note_46,
- note_47,
- note_48,
- note_49,
- note_50,
- note_51,
- note_52,
- note_53,
- note_54,
- note_55,
- note_56,
- note_57,
- note_58,
- note_59,
- note_60,
- note_61,
- note_62,
- note_63,
- note_64,
- note_65,
- note_66,
- note_67,
- note_68,
- note_69,
- note_70,
- note_71,
- note_72,
- note_73,
- note_74,
- note_75,
- note_76,
- note_77,
- note_78,
- note_79,
- note_80,
- note_81,
- note_82,
- note_83,
- note_84,
- note_85,
- note_86,
- note_87,
- note_88,
-};
-
-void getNoteString(char * buffer, uint8_t i) {
- if (i>88) strcpy(buffer,"@@@");
- else strcpy(buffer, note_table[i]);
-}
-
--- a/POKITTO_LIBS/Synth/Synth_mixfuncs.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_mixfuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoGlobs.h"
-#include "Synth.h"
-
-/** MIXING FUNCTIONS **/
-
-char voltick=0; // i need to make volume changes even slower
-uint16_t arptick=0; // i need to make volume changes even slower
-int8_t bendtick = 0; // ditto for bend.
-
-
-void mix1(){
- // Track 1
- if (osc1.on) {
- Farr[osc1.wave](&osc1);
- #if PROJ_ARDUBOY > 0
- if (osc1.duration) {
- /**this is special for osc1 and is only used to emulate arduino Tone(); */
- osc1.duration--;
- } else osc1.on = 0;
- #endif
-
- #ifdef POK_SIM
- soundbyte = (((osc1.output>>8) * (osc1.adsrvol >>8 )) >> 8) >> osc1.echodiv; // To output, shift back to 8-bit
- if (osc1.overdrive) soundbyte *= OVERDRIVE;
- if (osc1.kick ) soundbyte >>= 2;
- osc1.output = soundbyte;
- #else
- //OCR2B = osc1.output>>8;
- #if POK_ENABLE_SOUND > 1
- soundbyte = (((osc1.output>>8) * (osc1.adsrvol >>8 )) >> 8) >> osc1.echodiv; // To output, shift back to 8-bit
- if (osc1.overdrive) soundbyte *= OVERDRIVE;
- if (osc1.kick ) soundbyte >>= 2;
- osc1.output = soundbyte;
- #endif
- #endif
- }
-}
-
-void mix2(){
- // Track 2
- if (osc2.on) {
- Farr[osc2.wave](&osc2);
- #ifdef POK_SIM
- soundbyte = (((osc2.output>>8) * (osc2.adsrvol >>8 )) >> 8) >> osc2.echodiv;
- if (osc2.overdrive) soundbyte *= OVERDRIVE;
- if (osc2.kick ) soundbyte >>= 2;
- osc2.output = soundbyte;
- #else
- //OCR2B = osc2.output>>8;
- #if POK_ENABLE_SOUND > 1
- soundbyte = (((osc2.output>>8) * (osc2.adsrvol >>8 )) >> 8) >> osc2.echodiv;
- if (osc2.overdrive) soundbyte *= OVERDRIVE;
- if (osc2.kick ) soundbyte >>= 2;
- osc2.output = soundbyte;
- #endif
- #endif
- }
-}
-
-void mix3(){
- // Track 3
- if (osc3.on) {
- Farr[osc3.wave](&osc3);
- #ifdef POK_SIM
- soundbyte = (((osc3.output>>8) * (osc3.adsrvol >>8 )) >> 8) >> osc3.echodiv;
- if (osc3.overdrive) soundbyte *= OVERDRIVE;
- if (osc3.kick ) soundbyte >>= 2;
- osc3.output = soundbyte;
- #else
- //OCR2B = osc3.output>>8;
- #if POK_ENABLE_SOUND > 1
- soundbyte = (((osc3.output>>8) * (osc3.adsrvol >>8 )) >> 8) >> osc3.echodiv;
- if (osc3.overdrive) soundbyte *= OVERDRIVE;
- if (osc3.kick ) soundbyte >>= 2;
- osc3.output = soundbyte;
- #endif
- #endif
- }
-}
-
-void updateEnvelopes(){
- //calculate volume envelopes, I do this to save cpu power
- if (arptick) --arptick;
- else {
- if (osc1.arpmode && osc1.on) {
- osc1.cinc = cincs[osc1.tonic+arptable[osc1.arpmode][osc1.arpstep]];
- osc1.arpstep++;
- if (osc1.arpstep==ARPSTEPMAX) osc1.arpstep = 0;
- arptick = ARPTICK << (3-osc1.arpspeed);
- }
- if (osc2.arpmode && osc2.on) {
- osc2.cinc = cincs[osc2.tonic+arptable[osc2.arpmode][osc2.arpstep]];
- osc2.arpstep++;
- if (osc2.arpstep==ARPSTEPMAX) osc2.arpstep = 0;
- arptick = ARPTICK << (3-osc2.arpspeed);
- }
- if (osc3.arpmode && osc3.on) {
- osc3.cinc = cincs[osc3.tonic+arptable[osc3.arpmode][osc3.arpstep]];
- osc3.arpstep++;
- if (osc3.arpstep==ARPSTEPMAX) osc3.arpstep = 0;
- arptick = ARPTICK << (3-osc3.arpspeed);
- }
-
- }
-
- if (voltick) --voltick;
- else {
- bendtick = !bendtick;
- if (osc1.on) Earr[osc1.adsrphase](&osc1);
- if (bendtick) osc1.pitchbend += osc1.bendrate; //slow bend to every second beat
- if (osc1.bendrate > 0 && osc1.pitchbend > osc1.maxbend) {
- osc1.pitchbend = osc1.maxbend;
- osc1.bendrate = 0; // STOP BENDING !
- }
- else if (osc1.bendrate < 0 && osc1.pitchbend < osc1.maxbend) {
- osc1.pitchbend = osc1.maxbend;
- osc1.bendrate = 0; // STOP BENDING !
- }
-
- if (osc2.on) Earr[osc2.adsrphase](&osc2);
- if (bendtick) osc2.pitchbend += osc2.bendrate;
- if (osc2.bendrate > 0 && osc2.pitchbend > osc2.maxbend) osc2.pitchbend = osc2.maxbend;
- else if (osc2.bendrate < 0 && osc2.pitchbend < osc2.maxbend) osc2.pitchbend = osc2.maxbend;
-
- if (osc3.on) Earr[osc3.adsrphase](&osc3);
- if (bendtick) osc3.pitchbend += osc3.bendrate;
- if (osc3.bendrate > 0 && osc3.pitchbend > osc3.maxbend) osc3.pitchbend = osc3.maxbend;
- else if (osc3.bendrate < 0 && osc3.pitchbend < osc3.maxbend) osc3.pitchbend = osc3.maxbend;
-
- voltick = VOLTICK;
- }
- tick = 4;
-}
-
--- a/POKITTO_LIBS/Synth/Synth_osc.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_osc.h
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#ifndef SYNTH_OSC_H
-#define SYNTH_OSC_H
-
-#include "Pokitto.h"
-
-typedef uint8_t byte;
-
-struct OSC {
- byte on;
- byte wave;
- byte loop;
- byte echo;
- byte echodiv;
- byte adsr;
- byte tonic;
-
- uint16_t count;
-
- uint16_t vol;
- uint16_t cinc; // how much to add per cycle
- uint16_t output; // output is stored as 16 bit value and shifted before its put in OCR2B
-
- uint8_t adsrphase;
- uint16_t adsrvol;
- uint16_t attack; // Attack change
- uint16_t decay; // Attack change
- uint16_t sustain; // Attack change
- uint16_t release; // Attack change
-
- int16_t pitchbend; // bends cycle counter (more is higher pitch)
- int16_t maxbend; // maximum bend before stopping
- int16_t bendrate; // how much to bend by every cycle
-
- uint8_t vibrate;
- uint8_t arpmode;
- uint8_t arpspeed;
- uint8_t arpstep;
- uint8_t overdrive;
- uint8_t kick;
-
- uint32_t duration;
-};
-
-
-
-#endif // SYNTH_OSC_H
-
--- a/POKITTO_LIBS/Synth/Synth_oscfuncs.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_oscfuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "Synth.h"
-
-/** OSCILLATOR FUNCTIONS **/
-
-void setOSC(OSC* o,byte on=1, byte wave=1, byte loop=0, byte echo=0, byte adsr=0,
- uint8_t notenumber=25, uint8_t volume=127,
- uint16_t attack=0, uint16_t decay=0, uint16_t sustain=0, uint16_t release=0,
- int16_t maxbend=0, int16_t bendrate=0, uint8_t arpmode = 0, uint8_t overdrive=0, uint8_t kick=0){
- //Serial.println("SetOsc "); osc1
- o->on = on;
- o->overdrive = overdrive;
- o->kick = kick;
- o->wave = wave;
- o->loop = loop;
- o->echo = echo; //echo shifts left 8 steps to zero
- o->echodiv = 0;
- o->adsr = adsr;
- if (arpmode) {
- if (arpmode < 4) {o->arpmode = 1; o->arpspeed = arpmode;}
- else if (arpmode < 7) {o->arpmode = 2; o->arpspeed = arpmode-3;}
- else if (arpmode < 10) {o->arpmode = 3; o->arpspeed = arpmode-6; } // vibrato trial
- else if (arpmode < 13) {o->arpmode = 4; o->arpspeed = arpmode-9; } // octave trial
- else if (arpmode < 16) {o->arpmode = 5; o->arpspeed = arpmode-12; } // funk trial*/
- } else o->arpmode = 0;
- o->arpstep = 0;
- o->count = 0;
- noiseval = xorshift16(); //random(0,0xFFFF);
-
- o->cinc = cincs[notenumber]<<POK_CINC_MULTIPLIER; // direct cinc from table, no calculation
- o->tonic = notenumber; // save tonic for arpeggio use
- if (wave == 2) o->cinc >>= 1; // correct pitch for saw wave
- if (wave == 4) o->cinc <<= 1; // enable higher pitch for pure noise
- o->vol = volume << 8;//volume;
-
- if (adsr) {
- o->attack = attack;
- o->decay = decay;
- o->sustain = sustain;
- o->release = release;
- o->adsrphase = 1;
- if (!o->attack) o->adsrvol = o->vol; // start directly, no attack ramp
- else o->adsrvol = 0;
- } else {
- o->attack = 0;
- o->decay = 0;
- o->sustain = 0;
- o->release = 0;
- o->adsrphase = 0;
- o->adsrvol = o->vol; // will stay same all the time
- }
-
- if (bendrate != 0) {
- o->bendrate = bendrate; // test value
- o->pitchbend = 0;
- o->maxbend = maxbend;
- }
-}
-
-void setOSC(OSC* o,byte on, byte wave, uint16_t frq, uint8_t volume, uint32_t duration){
- o->on = on;
- o->overdrive = 0;
- o->kick = 0;
- o->wave = wave;
- o->loop = 1;
- o->echo = 1; //echo shifts left 8 steps to zero
- o->echodiv = 0;
- o->adsr = 1;
- o->attack = 200;
- o->decay = 200;
- o->sustain = 20;
- o->release = 10;
- o->adsrphase = 1;
- o->arpmode = 0;
- o->count = 0;
- noiseval = xorshift16(); //random(0,0xFFFF);
- o->cinc = (frq/100)*(cincs[18]<<POK_CINC_MULTIPLIER); // its a kludge, i know. cant be bothered.
- if (wave == 2) o->cinc >>= 1; // correct pitch for saw wave
- if (wave == 4) o->cinc <<= 1; // enable higher pitch for pure noise
- o->vol = volume << 8;//volume;
- o->adsrvol = o->vol;
- o->duration = duration*100;
- o->maxbend = -4000;
- o->bendrate = 1000;
-}
-
-
-
-void emptyOscillators(){
- osc1.on = false; osc1.wave = 0; osc1.echo = 0; osc1.count = 0; osc1.cinc =0;
- osc1.attack = 0; osc1.loop = 0; osc1.adsrphase = 1; osc1.adsr = 1; osc1.decay = 100;
- osc1.pitchbend = 0; osc1.bendrate = 0; osc1.maxbend = 0; osc1.sustain = 0; osc1.release = 0;
-
- osc2.on = false; osc2.wave = 0; osc2.echo = 0; osc2.count = 0; osc2.cinc =0;
- osc2.attack = 0; osc2.loop = 0; osc2.adsrphase = 1; osc2.adsr = 1; osc2.decay = 100;
- osc2.pitchbend = 0; osc2.bendrate = 0; osc2.maxbend = 0; osc2.sustain = 0; osc2.release = 0;
-
- osc3.on = false; osc3.wave = 0; osc3.echo = 0; osc3.count = 0; osc3.cinc =0;
- osc3.attack = 0; osc3.loop = 0; osc3.adsrphase = 1; osc3.adsr = 1; osc3.decay = 100;
- osc3.pitchbend = 0; osc3.bendrate = 0; osc3.maxbend = 0; osc3.sustain = 0; osc3.release = 0;
-}
-
-
-void testOsc(){
- setOSC(&osc1,1,WTRI,1,0,1,25,127,10,10,20,2,0,0,0,0,0); // C3 = 25
- setOSC(&osc2,1,WTRI,1,0,1,29-12,63,2,1,20,2,0,0,14,0,0); // E3 = 29
- setOSC(&osc3,1,WSAW,1,0,1,25,15,30,30,20,2,-1,-1000,12,0,0); // G3 = 32
-}
-
-void playNote(uint8_t oscnum, uint8_t notenum, uint8_t i) {
- OSC* o;
- if (oscnum == 1) o = &osc1; else if (oscnum == 2) o = &osc2; else o = &osc3;
- setOSC(o,1,patch[i].wave,patch[i].loop,patch[i].echo,patch[i].adsr,notenum,patch[i].vol,
- patch[i].attack,patch[i].decay,patch[i].sustain,patch[i].release,
- patch[i].maxbend,patch[i].bendrate,patch[i].arpmode,patch[i].overdrive,patch[i].kick);
-}
-
-void makeSampleInstruments() {
- /* sample instruments for testing */
- patch[0].wave = WSQUARE;
- patch[0].on = 1;
- patch[0].vol = 127;
- patch[0].loop = 0;
- patch[0].echo = 0;
-
- patch[0].adsr = 0;
- patch[0].attack = 0;
- patch[0].decay = 0;
- patch[0].sustain = 0;
- patch[0].release = 0;
-
- patch[0].maxbend = -1000;
- patch[0].bendrate = 100;
- patch[0].arpmode = 3;
- patch[0].overdrive = 0;
- patch[0].kick = 0;
-
- patch[1].wave = WSAW;
- patch[1].on = 1;
- patch[1].vol = 200;
- patch[1].loop = 0;
- patch[1].echo = 0;
-
- patch[1].adsr = 0;
- patch[1].attack = 0;
- patch[1].decay = 0;
- patch[1].sustain = 0;
- patch[1].release = 0;
-
- patch[1].maxbend = 0;
- patch[1].bendrate = 0;
- patch[1].arpmode = 1;
- patch[1].overdrive = 0;
- patch[1].kick = 0;
-
- patch[2].wave = WTRI;
- patch[2].on = 1;
- patch[2].vol = 127;
- patch[2].loop = 0;
- patch[2].echo = 0;
-
- patch[2].adsr = 1;
- patch[2].attack = 10;
- patch[2].decay = 0;
- patch[2].sustain = 0;
- patch[2].release = 0;
-
- patch[2].maxbend = 0;
- patch[2].bendrate = 0;
- patch[2].arpmode = 1;
- patch[2].overdrive = 0;
- patch[2].kick = 0;
-
- patch[3].wave = WNOISE;
- patch[3].on = 1;
- patch[3].vol = 127;
- patch[3].loop = 1;
- patch[3].echo = 1;
-
- patch[3].adsr = 1;
- patch[3].attack = 0;
- patch[3].decay = 30;
- patch[3].sustain = 30;
- patch[3].release = 5;
-
- patch[3].maxbend = 0;
- patch[3].bendrate = 0;
- patch[3].arpmode = 0;
- patch[3].overdrive = 0;
- patch[3].kick = 0;
-
- patch[4].wave = WPNOISE;
- patch[4].on = 1;
- patch[4].vol = 127;
- patch[4].loop = 0;
- patch[4].echo = 0;
-
- patch[4].adsr = 1;
- patch[4].attack = 0;
- patch[4].decay = 30;
- patch[4].sustain = 30;
- patch[4].release = 5;
-
- patch[4].maxbend = 0;
- patch[4].bendrate = 0;
- patch[4].arpmode = 1;
- patch[4].overdrive = 0;
- patch[4].kick = 0;
-}
-
--- a/POKITTO_LIBS/Synth/Synth_song.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_song.h
- @author Jonne Valola
-
- @section LICENSE
-
- Pokitto development stage library
- Software License Agreement
-
- Copyright (c) 2015, Jonne Valola ("Author")
- All rights reserved.
-
- This library is intended solely for the purpose of Pokitto development.
-
- Redistribution and use in source and binary forms, with or without
- modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#ifndef SYNTH_SONG_H
-#define SYNTH_SONG_H
-
-#define CHUNKSIZE 8*3*2 // 48 bytes
-//extern uint8_t chunk1[], chunk2[];
-extern uint8_t chunk[2][CHUNKSIZE];
-extern uint8_t cc; // current chunk
-
-struct SONG {
- byte rb_version; // rbtracker version with which the song was created
- uint16_t song_bpm; // song beats per minute
- byte num_patches; // how many different instruments ie patches
- byte num_channels; // how many channels are used by this song (1-3)
- byte num_patterns; // how many different patterns are used
- byte song_end; // at what position song ends
- int8_t song_loop; // where to loop at end of song. -1 means no loop
- byte block_sequence[3][10]; //the sequence of blocks for each track
- const uint8_t * instrument_stream[3]; //pointers to the instruments in the track streams
- const uint8_t * note_stream[3]; //pointers to the notes in the track streams
-};
-
-struct BLOCK {
- uint8_t notenumber[64]; // was 64
- uint8_t instrument[64]; // was 64
-};
-
-
-#endif // SYNTH_SONG_H
-
--- a/POKITTO_LIBS/Synth/Synth_songfuncs.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_songfuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoDisk.h"
-#include "Synth.h"
-#ifdef POK_SIM
-#include "FileIO.h"
-#endif
-
-/** SONG FUNCTIONS **/
-
-//uint8_t chunk1[CHUNKSIZE], chunk2[CHUNKSIZE]; // 8 rows, 3 channels (columns), 2 bytes per entry
-uint8_t chunk[2][CHUNKSIZE]; // 8 rows, 3 channels (columns), 2 bytes per entry
-uint8_t cc = 0;
-
-
-#if POK_ENABLE_SOUND > 0
-#if POK_ENABLE_SD > 0
-void updatePlaybackSD(uint8_t row) {
- // samplespertick determines how long the oscillators are active before they are recalculated (i.e. the next tick
- uint8_t i=0;
-
- if (notetick > samplespertick ) {
- // TRACK 1
- //if (track1on) i = *song.instrument_stream[0];
- i = 0xF;
- if (track1on) i = chunk[cc][row+1]>>4;
- if (i!=0xF) {
- setOSC(&osc1,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- chunk[cc][row],patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- // TRACK 2
- //if (track2on) i = *song.instrument_stream[1];
- i = 0xF;
- if (track2on) i = chunk[cc][row+3]>>4;
- if (i!=0xF) {
- setOSC(&osc2,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- chunk[cc][row+2],patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- // TRACK 3
- i = 0xF;
- if (track3on) i = chunk[cc][row+5]>>4;
- if (i!=0xF) {
- setOSC(&osc3,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- chunk[cc][row]+4,patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- playerpos++;
- if (playerpos == PATTERNLENGTH) {
- // move to next song position
- playerpos = 0;
- /*sequencepos++;
- if (sequencepos > song.song_end) {
- if (song.song_loop == -1) {
- emptyOscillators();
- playing = false;
- sequencepos--;
- } else {
- sequencepos = song.song_loop;
- }
- }
- playerpos = 0;
- initStreams(sequencepos);
- tableRefresh=true;*/
- }
- notetick =0;
- }
-}
-
-void updatePlayback() {
- // samplespertick determines how long the oscillators are active before they are recalculated (i.e. the next tick
- uint8_t i=0;
-
- if (notetick > samplespertick ) {
- // TRACK 1
- if (track1on) i = *song.instrument_stream[0];
- else i = 0;
- if (i) {
- setOSC(&osc1,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- *song.note_stream[0],patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- // TRACK 2
- if (track2on) i = *song.instrument_stream[1];
- else i = 0;
- if (i) {
- setOSC(&osc2,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- *song.note_stream[1],patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- // TRACK 3
- if (track3on) i = *song.instrument_stream[2];
- else i = 0;
- if (i) {
- setOSC(&osc3,1,patch[i].wave,patch[i].loop, patch[i].echo, patch[i].adsr,
- *song.note_stream[2],patch[i].vol,
- patch[i].attack, patch[i].decay, patch[i].sustain,patch[i].release,
- patch[i].maxbend, patch[i].bendrate, patch[i].arpmode, patch[i].overdrive, patch[i].kick );
- }
- playerpos++;
- song.instrument_stream[0]++;
- song.note_stream[0]++;
- song.instrument_stream[1]++;
- song.note_stream[1]++;
- song.instrument_stream[2]++;
- song.note_stream[2]++;
- if (playerpos == PATTERNLENGTH) {
- // move to next song position
- sequencepos++;
- if (sequencepos > song.song_end) {
- if (song.song_loop == -1) {
- emptyOscillators();
- playing = false;
- sequencepos--;
- } else {
- sequencepos = song.song_loop;
- }
- }
- playerpos = 0;
- initStreams(sequencepos);
- tableRefresh=true;
- }
- notetick =0;
- }
-}
-
-void emptyPatches(){
- for (int i=0; i<16; i++) {
- patch[i].vol = 127;
- patch[i].on = true; patch[i].wave = 1; patch[i].echo = 0; patch[i].count = 0; patch[i].cinc =0;
- patch[i].attack = 0; patch[i].loop = 0; patch[i].adsrphase = 0; patch[i].adsr = 0; patch[i].decay = 20;
- patch[i].pitchbend = 0; patch[i].bendrate = 0; patch[i].maxbend = 0; patch[i].sustain = 0; patch[i].release = 0, patch[i].overdrive = 0, patch[i].kick = 0;
- }
-}
-
-void emptyBlocks(){
- for (int i=0; i<MAXBLOCKS; i++) {
- for (int j = 0; j < PATTERNLENGTH; j++) {
- block[i].instrument[j] = 0;
- block[i].notenumber[j] = 255;
- }
- }
-}
-
-void initStreams(uint8_t seqpos){
- uint8_t blocknum;
- // retarget pointers for track 1
- // byte = pgm_read_byte(&(mydata[i][j]));
- blocknum=song.block_sequence[0][seqpos];
- //blocknum=pgm_read_byte(Song+SONG_SEQUENCE+seqpos);
- song.instrument_stream[0]=&block[blocknum].instrument[0];
- song.note_stream[0]=&block[blocknum].notenumber[0];
- // retarget pointers for track 2
- blocknum=song.block_sequence[1][seqpos];
- song.instrument_stream[1]=&block[blocknum].instrument[0];
- song.note_stream[1]=&block[blocknum].notenumber[0];
- // retarget pointers for track 3
- blocknum=song.block_sequence[2][seqpos];
- song.instrument_stream[2]=&block[blocknum].instrument[0];
- song.note_stream[2]=&block[blocknum].notenumber[0];
-}
-
-void emptySong(){
- song.num_channels = 3;
- song.num_patches = 1;
- song.song_bpm = 120;
- song.num_patterns = 1;
- song.song_end = 0;
- song.song_loop = 0; // loop back to start
- song.rb_version = RBTRACKER_VERSION;
- for (uint8_t i = 0; i<10; i++) {
- song.block_sequence[0][i]=i*3; // track 1
- song.block_sequence[1][i]=i*3+1; // track 2
- song.block_sequence[2][i]=i*3+2; // track 3
- }
- song.instrument_stream[0] = &block[0].instrument[0];
- song.note_stream[0] = &block[0].notenumber[0];
- song.instrument_stream[1] = &block[1].instrument[0];
- song.note_stream[1] = &block[1].notenumber[0];
- song.instrument_stream[2] = &block[2].instrument[0];
- song.note_stream[2] = &block[2].notenumber[0];
- sequencepos = 0;
-}
-
-int openSongFromSD(char* buffer) {
- if (!isThisFileOpen(buffer)) {
- fileClose(); // close any open files
- fileOpen(buffer,FILE_MODE_OVERWRITE | FILE_MODE_BINARY);
- }
- return isThisFileOpen(buffer);
-}
-
-void writeChunkToSD(uint8_t* buffer) {
- if (fileOK()) {
- fileWriteBytes(buffer, CHUNKSIZE);
- }
-}
-
-void readChunkFromSD(uint8_t* buffer) {
- if (fileOK()) {
- fileReadBytes(buffer, CHUNKSIZE);
- }
-}
-#endif
-#endif // POK_ENABLE_SOUND
-
--- a/POKITTO_LIBS/Synth/Synth_wavefuncs.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/**************************************************************************/
-/*!
- @file Synth_wavefuncs.cpp
- @author Jonne Valola
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2016, Jonne Valola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "Synth.h"
-
-uint16_t noiseval, noiseval2;
-
-void waveoff(OSC* o); void sqwave(OSC* o); void sawwave(OSC* o); void triwave(OSC* o); void noise(OSC* o); void tonenoise(OSC* o); void sample(OSC* o);
-void noADSR(OSC* o); void attackFunc(OSC* o); void decayFunc(OSC* o); void releaseFunc(OSC* o);
-void mix1(); void mix2(); void mix3(); void updateEnvelopes();
-
-waveFunction Farr [] = {waveoff, sqwave, sawwave, triwave, noise, tonenoise};
-envFunction Earr [] = {noADSR, attackFunc, decayFunc, releaseFunc};
-mixFunction Marr [] = {updateEnvelopes,mix3,mix2,mix1}; // counts down
-mixFunction HWMarr [] = {updateEnvelopes,mix3,mix2,mix1}; // counts down
-
-/** SOUND FUNCTIONS **/
-
-void waveoff(OSC* o){
- o->output = 0;
-}
-
-void sqwave(OSC* o){
-// square. If bit 16 set, its 2nd half of cycle and then output. if not, silence.
- if (o->count & 0x8000) o->output = 0;
- else o->output = 0xFFFF;
-}
-
-void sawwave(OSC* o){
- // saw is just twice the count, so it happens 2 times in a cycle.
- o->output = o->count << 1; // simple, eh ?
-}
-
-void triwave(OSC* o){
- // exploit the fact that above 0x7FFF bit 16 will be set (ie. when on second side of cycle)
- if (o->count & 0x8000) o->output = (~o->count) << 1; // counts down because complement goes other way
- else o->output = o->count << 1; // count up on first side of cycle
-}
-
-void noise(OSC* o){
- // Standard libc random gives 10-12 fps
- // Xorshift16 gives 32-39 fps
- // Xorshift8 gives
-
- if (o->count > 0x8000) {
- o->output = noiseval2;
- //noiseval = random(0,0xFFFF);
- noiseval = xorshift16();
- //noiseval = xorshift8()*256;
- }
- else {
- o->output = noiseval;
- //noiseval2 = random(0,0xFFFF);
- noiseval2 = xorshift16();
- //noiseval2 = xorshift8()*256;
- }
-}
-
-void tonenoise(OSC* o){
- // square. If bit 16 set, its 2nd half of cycle and then output. if not, silence.
- if (o->count & 0x8000) o->output = (xorshift16()>>6); //was 0
- else o->output = (xorshift16()>>1) + 0x4000;//random(0,0xFFFF);
-}
-
-void sample(OSC* o) {
-
- /*if (o->samplepos > o->samplelength ) o->samplepos = 0;
-
- if (o->count > o->wcycle) {
- o->count=0;
- if (o->output) o->output = 0;
- //else o->output = o->output=pgm_read_byte((uint32_t)(sfxBike) + o->inccount);
- }*/
-}
-
--- a/Pokitto_settings.h Tue Sep 19 13:42:25 2017 +0000
+++ b/Pokitto_settings.h Wed Oct 11 20:35:27 2017 +0000
@@ -243,15 +243,19 @@
#endif // PROJ_TILEBITDEPTH
#else
#ifndef PROJ_SCREENMODE
+ #undef POK_COLORDEPTH
#ifdef PROJ_HIRES
#if PROJ_HIRES > 0
#define POK_SCREENMODE MODE_HI_4COLOR
+ #undef POK_COLORDEPTH
#define POK_COLORDEPTH 2
#elif PROJ_HICOLOR > 0
#define POK_SCREENMODE MODE_256_COLOR
+ #undef POK_COLORDEPTH
#define POK_COLORDEPTH 8
#else
#define POK_SCREENMODE MODE_FAST_16COLOR
+ #undef POK_COLORDEPTH
#define POK_COLORDEPTH 4
#endif // PROJ_HIRES
#else
--- a/libpff/connect.h Tue Sep 19 13:42:25 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#ifndef _CONNECT_H_ - -//SDFileSystem sd(P0_9,P0_8, P1_29, P1_19, "sd"); // mosi,miso,clk,cs -#define CONNECT_MOSI P0_9 //p5 -#define CONNECT_MISO P0_8 //p6 -#define CONNECT_SCK P0_6 //p7 -#define CONNECT_CS P0_7 //p13 -#define SPI_FREQ 400000 - -#define _CONNECT_H_ -#endif -
--- a/libpff/diskio.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*-----------------------------------------------------------------------
-/ PFF - Low level disk interface modlue include file (C)ChaN, 2009
-/-----------------------------------------------------------------------*/
-
-#ifndef _DISKIO
-
-#include "integer.h"
-
-/* Status of Disk Functions */
-typedef BYTE DSTATUS;
-
-/* Results of Disk Functions */
-typedef enum {
- RES_OK = 0, /* 0: Function succeeded */
- RES_ERROR, /* 1: Disk error */
- RES_NOTRDY, /* 2: Not ready */
- RES_PARERR /* 3: Invalid parameter */
-} DRESULT;
-
-/*---------------------------------------*/
-/* Prototypes for disk control functions */
-
-DSTATUS disk_initialize (void);
-DRESULT disk_readp (BYTE*, DWORD, WORD, WORD);
-DRESULT disk_writep (const BYTE*, DWORD);
-
-#define STA_NOINIT 0x01 /* Drive not initialized */
-#define STA_NODISK 0x02 /* No medium in the drive */
-
-/* Card type flags (CardType) */
-#define CT_MMC 0x01 /* MMC ver 3 */
-#define CT_SD1 0x02 /* SD ver 1 */
-#define CT_SD2 0x04 /* SD ver 2 */
-#define CT_SDC (CT_SD1|CT_SD2) /* SD */
-#define CT_BLOCK 0x08 /* Block addressing */
-
-#define _DISKIO
-#endif
-
--- a/libpff/integer.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*-------------------------------------------*/
-/* Integer type definitions for FatFs module */
-/*-------------------------------------------*/
-
-#ifndef _INTEGER
-
-/* These types must be 16-bit, 32-bit or larger integer */
-typedef int INT;
-typedef unsigned int UINT;
-
-/* These types must be 8-bit integer */
-typedef signed char CHAR;
-typedef unsigned char UCHAR;
-typedef unsigned char BYTE;
-
-/* These types must be 16-bit integer */
-typedef short SHORT;
-typedef unsigned short USHORT;
-typedef unsigned short WORD;
-typedef unsigned short WCHAR;
-
-/* These types must be 32-bit integer */
-typedef long LONG;
-typedef unsigned long ULONG;
-typedef unsigned long DWORD;
-
-/* Boolean type */
-// typedef enum { FALSE = 0, TRUE } BOOL; // for soe reason does not work, but otoh isnt used anywhere
-
-#define _INTEGER
-#endif
-
--- a/libpff/mmc.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*-----------------------------------------------------------------------*/
-/* PFF - Low level disk control module for ATtiny85 (C)ChaN, 2009 */
-/*-----------------------------------------------------------------------*/
-
-#define _WRITE_FUNC 1
-
-#include "diskio.h"
-#include "mbed.h"
-#include "connect.h"
-#include "PokittoDisk.h"
-
-/* Definitions for MMC/SDC command */
-#define CMD0 (0x40+0) /* GO_IDLE_STATE */
-#define CMD1 (0x40+1) /* SEND_OP_COND (MMC) */
-#define ACMD41 (0xC0+41) /* SEND_OP_COND (SDC) */
-#define CMD8 (0x40+8) /* SEND_IF_COND */
-#define CMD16 (0x40+16) /* SET_BLOCKLEN */
-#define CMD17 (0x40+17) /* READ_SINGLE_BLOCK */
-#define CMD24 (0x40+24) /* WRITE_BLOCK */
-#define CMD55 (0x40+55) /* APP_CMD */
-#define CMD58 (0x40+58) /* READ_OCR */
-
-
-
-/* Port Controls (Platform dependent) */
-#define SELECT() CLR_SD_CS //mmccs.write(0) /* MMC CS = L */
-#define DESELECT() SET_SD_CS // mmccs.write(1) /* MMC CS = H */
-#define MMC_SEL !GET_SD_CS // !mmccs.read() /* MMC CS status (true:selected) */
-
-void xmit_spi (BYTE c) {
- device.write(c); /* Send a byte */
-}
-
-BYTE rcv_spi (void) {
- return device.write(0xff);
-}
-
-/*--------------------------------------------------------------------------
-
- Module Private Functions
-
----------------------------------------------------------------------------*/
-
-static
-BYTE CardType;
-
-
-/*-----------------------------------------------------------------------*/
-/* Deselect the card and release SPI bus */
-/*-----------------------------------------------------------------------*/
-
-static
-void release_spi (void) {
- DESELECT();
- rcv_spi();
-}
-
-
-/*-----------------------------------------------------------------------*/
-/* Send a command packet to MMC */
-/*-----------------------------------------------------------------------*/
-
-static
-BYTE send_cmd (
- BYTE cmd, /* Command byte */
- DWORD arg /* Argument */
-) {
- BYTE n, res;
-
-
- if (cmd & 0x80) { /* ACMD<n> is the command sequense of CMD55-CMD<n> */
- cmd &= 0x7F;
- res = send_cmd(CMD55, 0);
- if (res > 1) return res;
- }
-
- /* Select the card */
- DESELECT();
- rcv_spi();
- SELECT();
- rcv_spi();
-
- /* Send a command packet */
- xmit_spi(cmd); /* Start + Command index */
- xmit_spi((BYTE)(arg >> 24)); /* Argument[31..24] */
- xmit_spi((BYTE)(arg >> 16)); /* Argument[23..16] */
- xmit_spi((BYTE)(arg >> 8)); /* Argument[15..8] */
- xmit_spi((BYTE)arg); /* Argument[7..0] */
- n = 0x01; /* Dummy CRC + Stop */
- if (cmd == CMD0) n = 0x95; /* Valid CRC for CMD0(0) */
- if (cmd == CMD8) n = 0x87; /* Valid CRC for CMD8(0x1AA) */
- xmit_spi(n);
-
- /* Receive a command response */
- n = 10; /* Wait for a valid response in timeout of 10 attempts */
- do {
- res = rcv_spi();
- } while ((res & 0x80) && --n);
-
- return res; /* Return with the response value */
-}
-
-
-
-/*--------------------------------------------------------------------------
-
- Public Functions
-
----------------------------------------------------------------------------*/
-
-
-/*-----------------------------------------------------------------------*/
-/* Initialize Disk Drive */
-/*-----------------------------------------------------------------------*/
-
-//__attribute__((section(".SD_Code")))
-DSTATUS disk_initialize (void) {
- BYTE n, cmd, ty, ocr[4];
- WORD tmr;
-
- DESELECT();
- device.frequency(SPI_FREQ);
- device.format(8);
- // device.frequency(SPI_FREQ); // hangs if this is after format
-
-#if _WRITE_FUNC
- if (MMC_SEL) disk_writep(0, 0); /* Finalize write process if it is in progress */
-#endif
- for (n = 100; n; n--) rcv_spi(); /* Dummy clocks */
-
- ty = 0;
- if (send_cmd(CMD0, 0) == 1) { /* Enter Idle state */
- if (send_cmd(CMD8, 0x1AA) == 1) { /* SDv2 */
- for (n = 0; n < 4; n++) ocr[n] = rcv_spi(); /* Get trailing return value of R7 resp */
- if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* The card can work at vdd range of 2.7-3.6V */
- for (tmr = 12000; tmr && send_cmd(ACMD41, 1UL << 30); tmr--) ; /* Wait for leaving idle state (ACMD41 with HCS bit) */
- if (tmr && send_cmd(CMD58, 0) == 0) { /* Check CCS bit in the OCR */
- for (n = 0; n < 4; n++) ocr[n] = rcv_spi();
- ty = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2; /* SDv2 (HC or SC) */
- }
- }
- } else { /* SDv1 or MMCv3 */
- if (send_cmd(ACMD41, 0) <= 1) {
- ty = CT_SD1;
- cmd = ACMD41; /* SDv1 */
- } else {
- ty = CT_MMC;
- cmd = CMD1; /* MMCv3 */
- }
- for (tmr = 25000; tmr && send_cmd(cmd, 0); tmr--) ; /* Wait for leaving idle state */
- if (!tmr || send_cmd(CMD16, 512) != 0) /* Set R/W block length to 512 */
- ty = 0;
- }
- }
- CardType = ty;
- release_spi();
-
- return ty ? 0 : STA_NOINIT;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read partial sector */
-/*-----------------------------------------------------------------------*/
-
-DRESULT disk_readp (
- BYTE *buff, /* Pointer to the read buffer (NULL:Read bytes are forwarded to the stream) */
- DWORD lba, /* Sector number (LBA) */
- WORD ofs, /* Byte offset to read from (0..511) */
- WORD cnt /* Number of bytes to read (ofs + cnt mus be <= 512) */
-) {
- DRESULT res;
- BYTE rc;
- WORD bc;
-
-
- if (!(CardType & CT_BLOCK)) lba *= 512; /* Convert to byte address if needed */
-
- res = RES_ERROR;
- if (send_cmd(CMD17, lba) == 0) { /* READ_SINGLE_BLOCK */
-
- bc = 30000;
- do { /* Wait for data packet in timeout of 100ms */
- rc = rcv_spi();
- } while (rc == 0xFF && --bc);
-
- if (rc == 0xFE) { /* A data packet arrived */
- bc = 514 - ofs - cnt;
-
- /* Skip leading bytes */
- if (ofs) {
- do {
- rcv_spi();
- } while (--ofs);
- }
-
- /* Receive a part of the sector */
- if (buff) { /* Store data to the memory */
- do {
- *buff++ = rcv_spi();
- } while (--cnt);
- } else { /* Forward data to the outgoing stream (depends on the project) */
- do {
- rcv_spi();
- } while (--cnt);
- }
-
- /* Skip trailing bytes and CRC */
- do rcv_spi();
- while (--bc);
-
- res = RES_OK;
- }
- }
-
- release_spi();
-
- return res;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Write partial sector */
-/*-----------------------------------------------------------------------*/
-#if _WRITE_FUNC
-
-DRESULT disk_writep (
- const BYTE *buff, /* Pointer to the bytes to be written (NULL:Initiate/Finalize sector write) */
- DWORD sa /* Number of bytes to send, Sector number (LBA) or zero */
-) {
- DRESULT res;
- WORD bc;
- static WORD wc;
-
-
- res = RES_ERROR;
-
- if (buff) { /* Send data bytes */
- bc = (WORD)sa;
- while (bc && wc) { /* Send data bytes to the card */
- xmit_spi(*buff++);
- wc--;
- bc--;
- }
- res = RES_OK;
- } else {
- if (sa) { /* Initiate sector write process */
- if (!(CardType & CT_BLOCK)) sa *= 512; /* Convert to byte address if needed */
- if (send_cmd(CMD24, sa) == 0) { /* WRITE_SINGLE_BLOCK */
- xmit_spi(0xFF);
- xmit_spi(0xFE); /* Data block header */
- wc = 512; /* Set byte counter */
- res = RES_OK;
- }
- } else { /* Finalize sector write process */
- bc = wc + 2;
- while (bc--) xmit_spi(0); /* Fill left bytes and CRC with zeros */
- if ((rcv_spi() & 0x1F) == 0x05) { /* Receive data resp and wait for end of write process in timeout of 300ms */
- for (bc = 65000; rcv_spi() != 0xFF && bc; bc--) ; /* Wait ready */
- if (bc) res = RES_OK;
- }
- release_spi();
- }
- }
-
- return res;
-}
-#endif
-
--- a/libpff/pff.cpp Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,841 +0,0 @@
-/*----------------------------------------------------------------------------/
-/ Petit FatFs - FAT file system module R0.02 (C)ChaN, 2009
-/-----------------------------------------------------------------------------/
-/ Petit FatFs module is an open source software to implement FAT file system to
-/ small embedded systems. This is a free software and is opened for education,
-/ research and commercial developments under license policy of following trems.
-/
-/ Copyright (C) 2009, ChaN, all right reserved.
-/
-/ * The Petit FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/-----------------------------------------------------------------------------/
-/ Jun 15,'09 R0.01a First release. (Branched from FatFs R0.07b.)
-/
-/ Dec 14,'09 R0.02 Added multiple code page support.
-/ Added write funciton.
-/ Changed stream read mode interface.
-/----------------------------------------------------------------------------*/
-
-#include "pff.h" /* Petit FatFs configurations and declarations */
-#include "diskio.h" /* Declarations of low level disk I/O functions */
-
-
-/*--------------------------------------------------------------------------
-
- Private Functions
-
----------------------------------------------------------------------------*/
-
-static
-FATFS *FatFs; /* Pointer to the file system object (logical drive) */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* String functions */
-/*-----------------------------------------------------------------------*/
-
-/* Fill memory */
-static
-void mem_set (void* dst, int val, int cnt) {
- char *d = (char*)dst;
- while (cnt--) *d++ = (char)val;
-}
-
-/* Compare memory to memory */
-static
-int mem_cmp (const void* dst, const void* src, int cnt) {
- const char *d = (const char *)dst, *s = (const char *)src;
- int r = 0;
- while (cnt-- && (r = *d++ - *s++) == 0) ;
- return r;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT access - Read value of a FAT entry */
-/*-----------------------------------------------------------------------*/
-
-static
-CLUST get_fat ( /* 1:IO error, Else:Cluster status */
- CLUST clst /* Cluster# to get the link information */
-) {
- WORD wc, bc, ofs;
- BYTE buf[4];
- FATFS *fs = FatFs;
-
-
- if (clst < 2 || clst >= fs->max_clust) /* Range check */
- return 1;
-
- switch (fs->fs_type) {
- case FS_FAT12 :
- bc = (WORD)clst;
- bc += bc / 2;
- ofs = bc % 512;
- bc /= 512;
- if (ofs != 511) {
- if (disk_readp(buf, fs->fatbase + bc, ofs, 2)) break;
- } else {
- if (disk_readp(buf, fs->fatbase + bc, 511, 1)) break;
- if (disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break;
- }
- wc = LD_WORD(buf);
- return (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
-
- case FS_FAT16 :
- if (disk_readp(buf, fs->fatbase + clst / 256, (WORD)(((WORD)clst % 256) * 2), 2)) break;
- return LD_WORD(buf);
-#if _FS_FAT32
- case FS_FAT32 :
- if (disk_readp(buf, fs->fatbase + clst / 128, (WORD)(((WORD)clst % 128) * 4), 4)) break;
- return ((WORD)(((WORD)*(BYTE*)((buf)+1)<<8)|(WORD)*(BYTE*)(buf))) & 0x0FFFFFFF; //return LD_DWORD(buf) & 0x0FFFFFFF; //get rid of out of bounds warning in online IDE
-#endif
- }
-
- return 1; /* An error occured at the disk I/O layer */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get sector# from cluster# */
-/*-----------------------------------------------------------------------*/
-
-static
-DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
- CLUST clst /* Cluster# to be converted */
-) {
- FATFS *fs = FatFs;
-
-
- clst -= 2;
- if (clst >= (fs->max_clust - 2)) return 0; /* Invalid cluster# */
- return (DWORD)clst * fs->csize + fs->database;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Rewind directory index */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_rewind (
- FATDIR *dj /* Pointer to directory object */
-) {
- CLUST clst;
- FATFS *fs = FatFs;
-
-
- dj->index = 0;
- clst = dj->sclust;
- if (clst == 1 || clst >= fs->max_clust) /* Check start cluster range */
- return FR_DISK_ERR;
-#if _FS_FAT32
- if (!clst && fs->fs_type == FS_FAT32) /* Replace cluster# 0 with root cluster# if in FAT32 */
- clst = fs->dirbase;
-#endif
- dj->clust = clst; /* Current cluster */
- dj->sect = clst ? clust2sect(clst) : fs->dirbase; /* Current sector */
-
- return FR_OK; /* Seek succeeded */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Move directory index next */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table */
- FATDIR *dj /* Pointer to directory object */
-) {
- CLUST clst;
- WORD i;
- FATFS *fs = FatFs;
-
-
- i = dj->index + 1;
- if (!i || !dj->sect) /* Report EOT when index has reached 65535 */
- return FR_NO_FILE;
-
- if (!(i & (16-1))) { /* Sector changed? */
- dj->sect++; /* Next sector */
-
- if (dj->clust == 0) { /* Static table */
- if (i >= fs->n_rootdir) /* Report EOT when end of table */
- return FR_NO_FILE;
- } else { /* Dynamic table */
- if (((i / 16) & (fs->csize-1)) == 0) { /* Cluster changed? */
- clst = get_fat(dj->clust); /* Get next cluster */
- if (clst <= 1) return FR_DISK_ERR;
- if (clst >= fs->max_clust) /* When it reached end of dynamic table */
- return FR_NO_FILE; /* Report EOT */
- dj->clust = clst; /* Initialize data for new cluster */
- dj->sect = clust2sect(clst);
- }
- }
- }
-
- dj->index = i;
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Find an object in the directory */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_find (
- FATDIR *dj /* Pointer to the directory object linked to the file name */
-) {
- FRESULT res;
- BYTE c, *dir;
-
-
- res = dir_rewind(dj); /* Rewind directory object */
- if (res != FR_OK) return res;
-
- dir = FatFs->buf;
- do {
- res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */
- ? FR_DISK_ERR : FR_OK;
- if (res != FR_OK) break;
- c = dir[DIR_Name]; /* First character */
- if (c == 0) {
- res = FR_NO_FILE; /* Reached to end of table */
- break;
- }
- if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */
- break;
- res = dir_next(dj); /* Next entry */
- } while (res == FR_OK);
-
- return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read an object from the directory */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-static
-FRESULT dir_read (
- FATDIR *dj /* Pointer to the directory object to store read object name */
-) {
- FRESULT res;
- BYTE a, c, *dir;
-
-
- res = FR_NO_FILE;
- dir = FatFs->buf;
- while (dj->sect) {
- res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */
- ? FR_DISK_ERR : FR_OK;
- if (res != FR_OK) break;
- c = dir[DIR_Name];
- if (c == 0) {
- res = FR_NO_FILE; /* Reached to end of table */
- break;
- }
- a = dir[DIR_Attr] & AM_MASK;
- if (c != 0xE5 && c != '.' && !(a & AM_VOL)) /* Is it a valid entry? */
- break;
- res = dir_next(dj); /* Next entry */
- if (res != FR_OK) break;
- }
-
- if (res != FR_OK) dj->sect = 0;
-
- return res;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Pick a segment and create the object name in directory form */
-/*-----------------------------------------------------------------------*/
-
-#ifdef _EXCVT
-static const BYTE cvt[] = _EXCVT;
-#endif
-
-static
-FRESULT create_name (
- FATDIR *dj, /* Pointer to the directory object */
- const char **path /* Pointer to pointer to the segment in the path string */
-) {
- BYTE c, d, ni, si, i, *sfn;
- const char *p;
-
- /* Create file name in directory form */
- sfn = dj->fn;
- mem_set(sfn, ' ', 11);
- si = i = 0;
- ni = 8;
- p = *path;
- for (;;) {
- c = p[si++];
- if (c <= ' ' || c == '/') break; /* Break on end of segment */
- if (c == '.' || i >= ni) {
- if (ni != 8 || c != '.') break;
- i = 8;
- ni = 11;
- continue;
- }
-#ifdef _EXCVT
- if (c >= 0x80) /* To upper extended char (SBCS) */
- c = cvt[c - 0x80];
-#endif
- if (IsDBCS1(c) && i >= ni - 1) { /* DBC 1st byte? */
- d = p[si++]; /* Get 2nd byte */
- sfn[i++] = c;
- sfn[i++] = d;
- } else { /* Single byte code */
- if (IsLower(c)) c -= 0x20; /* toupper */
- sfn[i++] = c;
- }
- }
- *path = &p[si]; /* Rerurn pointer to the next segment */
-
- sfn[11] = (c <= ' ') ? 1 : 0; /* Set last segment flag if end of path */
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get file information from directory entry */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-static
-void get_fileinfo ( /* No return code */
- FATDIR *dj, /* Pointer to the directory object */
- FILINFO *fno /* Pointer to store the file information */
-) {
- BYTE i, c, *dir;
- char *p;
-
-
- p = fno->fname;
- if (dj->sect) {
- dir = FatFs->buf;
- for (i = 0; i < 8; i++) { /* Copy file name body */
- c = dir[i];
- if (c == ' ') break;
- if (c == 0x05) c = 0xE5;
- *p++ = c;
- }
- if (dir[8] != ' ') { /* Copy file name extension */
- *p++ = '.';
- for (i = 8; i < 11; i++) {
- c = dir[i];
- if (c == ' ') break;
- *p++ = c;
- }
- }
- fno->fattrib = dir[DIR_Attr]; /* Attribute */
- fno->fsize = LD_DWORD(dir+DIR_FileSize); /* Size */
- fno->fdate = LD_WORD(dir+DIR_WrtDate); /* Date */
- fno->ftime = LD_WORD(dir+DIR_WrtTime); /* Time */
- }
- *p = 0;
-}
-#endif /* _USE_DIR */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Follow a file path */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
- FATDIR *dj, /* Directory object to return last directory and found object */
- const char *path /* Full-path string to find a file or directory */
-) {
- FRESULT res;
- BYTE *dir;
-
-
- while (*path == ' ') path++; /* Skip leading spaces */
- if (*path == '/') path++; /* Strip heading separator */
- dj->sclust = 0; /* Set start directory (always root dir) */
-
- if ((BYTE)*path <= ' ') { /* Null path means the root directory */
- res = dir_rewind(dj);
- FatFs->buf[0] = 0;
-
- } else { /* Follow path */
- for (;;) {
- res = create_name(dj, &path); /* Get a segment */
- if (res != FR_OK) break;
- res = dir_find(dj); /* Find it */
- if (res != FR_OK) { /* Could not find the object */
- if (res == FR_NO_FILE && !*(dj->fn+11))
- res = FR_NO_PATH;
- break;
- }
- if (*(dj->fn+11)) break; /* Last segment match. Function completed. */
- dir = FatFs->buf; /* There is next segment. Follow the sub directory */
- if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */
- res = FR_NO_PATH;
- break;
- }
- dj->sclust =
-#if _FS_FAT32
- ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
- LD_WORD(dir+DIR_FstClusLO);
- }
- }
-
- return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Check a sector if it is an FAT boot record */
-/*-----------------------------------------------------------------------*/
-
-static
-__attribute__((section(".SD_Code"))) BYTE check_fs ( /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:Not a boot record, 3:Error */
- BYTE *buf, /* Working buffer */
- DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
-) {
- if (disk_readp(buf, sect, 510, 2)) /* Read the boot sector */
- return 3;
- if (LD_WORD(buf) != 0xAA55) /* Check record signature */
- return 2;
-
- if (!disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */
- return 0;
-#if _FS_FAT32
- if (!disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */
- return 0;
-#endif
- return 1;
-}
-
-
-
-
-/*--------------------------------------------------------------------------
-
- Public Functions
-
---------------------------------------------------------------------------*/
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Mount/Unmount a Locical Drive */
-/*-----------------------------------------------------------------------*/
-
-__attribute__((section(".SD_Code"))) FRESULT pf_mount (
- FATFS *fs /* Pointer to new file system object (NULL: Unmount) */
-) {
- BYTE fmt, buf[36];
- DWORD bsect, fsize, tsect, mclst;
-
-
- FatFs = 0;
- if (!fs) return FR_OK; /* Unregister fs object */
-
- if (disk_initialize() & STA_NOINIT) /* Check if the drive is ready or not */
- return FR_NOT_READY;
-
- /* Search FAT partition on the drive */
- bsect = 0;
- fmt = check_fs(buf, bsect); /* Check sector 0 as an SFD format */
- if (fmt == 1) { /* Not an FAT boot record, it may be FDISK format */
- /* Check a partition listed in top of the partition table */
- if (disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */
- fmt = 3;
- } else {
- if (buf[4]) { /* Is the partition existing? */
- bsect = LD_DWORD(&buf[8]); /* Partition offset in LBA */
- fmt = check_fs(buf, bsect); /* Check the partition */
- }
- }
- }
- if (fmt == 3) return FR_DISK_ERR;
- if (fmt) return FR_NO_FILESYSTEM; /* No valid FAT patition is found */
-
- /* Initialize the file system object */
- if (disk_readp(buf, bsect, 13, sizeof(buf))) return FR_DISK_ERR;
-
- fsize = LD_WORD(buf+BPB_FATSz16-13); /* Number of sectors per FAT */
- if (!fsize) fsize = LD_DWORD(buf+BPB_FATSz32-13);
-
- fsize *= buf[BPB_NumFATs-13]; /* Number of sectors in FAT area */
- fs->fatbase = bsect + LD_WORD(buf+BPB_RsvdSecCnt-13); /* FAT start sector (lba) */
- fs->csize = buf[BPB_SecPerClus-13]; /* Number of sectors per cluster */
- fs->n_rootdir = LD_WORD(buf+BPB_RootEntCnt-13); /* Nmuber of root directory entries */
- tsect = LD_WORD(buf+BPB_TotSec16-13); /* Number of sectors on the file system */
- if (!tsect) tsect = LD_DWORD(buf+BPB_TotSec32-13);
- mclst = (tsect /* Last cluster# + 1 */
- - LD_WORD(buf+BPB_RsvdSecCnt-13) - fsize - fs->n_rootdir / 16
- ) / fs->csize + 2;
- fs->max_clust = (CLUST)mclst;
-
- fmt = FS_FAT12; /* Determine the FAT sub type */
- if (mclst >= 0xFF7) fmt = FS_FAT16; /* Number of clusters >= 0xFF5 */
- if (mclst >= 0xFFF7) /* Number of clusters >= 0xFFF5 */
-#if _FS_FAT32
- fmt = FS_FAT32;
-#else
- return FR_NO_FILESYSTEM;
-#endif
-
- fs->fs_type = fmt; /* FAT sub-type */
-#if _FS_FAT32
- if (fmt == FS_FAT32)
- fs->dirbase = LD_DWORD(buf+(BPB_RootClus-13)); /* Root directory start cluster */
- else
-#endif
- fs->dirbase = fs->fatbase + fsize; /* Root directory start sector (lba) */
- fs->database = fs->fatbase + fsize + fs->n_rootdir / 16; /* Data start sector (lba) */
-
- fs->flag = 0;
- FatFs = fs;
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Open or Create a File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT pf_open (
- const char *path /* Pointer to the file name */
-) {
- FRESULT res;
- FATDIR dj;
- BYTE sp[12], dir[32];
- FATFS *fs = FatFs;
-
-
- if (!fs) /* Check file system */
- return FR_NOT_ENABLED;
-
- fs->flag = 0;
- fs->buf = dir;
- dj.fn = sp;
- res = follow_path(&dj, path); /* Follow the file path */
- if (res != FR_OK) return res; /* Follow failed */
- if (!dir[0] || (dir[DIR_Attr] & AM_DIR)) /* It is a directory */
- return FR_NO_FILE;
-
- fs->org_clust = /* File start cluster */
-#if _FS_FAT32
- ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
- LD_WORD(dir+DIR_FstClusLO);
- fs->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
- fs->fptr = 0; /* File pointer */
- fs->flag = FA_OPENED;
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read File */
-/*-----------------------------------------------------------------------*/
-#if _USE_READ
-
-FRESULT pf_read (
- void* buff, /* Pointer to the read buffer (NULL:Forward data to the stream)*/
- WORD btr, /* Number of bytes to read */
- WORD* br /* Pointer to number of bytes read */
-) {
- DRESULT dr;
- CLUST clst;
- DWORD sect, remain;
- BYTE *rbuff = (BYTE *)buff;
- WORD rcnt;
- FATFS *fs = FatFs;
-
-
- *br = 0;
- if (!fs) return FR_NOT_ENABLED; /* Check file system */
- if (!(fs->flag & FA_OPENED)) /* Check if opened */
- return FR_NOT_OPENED;
-
- remain = fs->fsize - fs->fptr;
- if (btr > remain) btr = (WORD)remain; /* Truncate btr by remaining bytes */
-
- while (btr) { /* Repeat until all data transferred */
- if ((fs->fptr % 512) == 0) { /* On the sector boundary? */
- if ((fs->fptr / 512 % fs->csize) == 0) { /* On the cluster boundary? */
- clst = (fs->fptr == 0) ? /* On the top of the file? */
- fs->org_clust : get_fat(fs->curr_clust);
- if (clst <= 1) goto fr_abort;
- fs->curr_clust = clst; /* Update current cluster */
- fs->csect = 0; /* Reset sector offset in the cluster */
- }
- sect = clust2sect(fs->curr_clust); /* Get current sector */
- if (!sect) goto fr_abort;
- fs->dsect = sect + fs->csect++;
- }
- rcnt = 512 - ((WORD)fs->fptr % 512); /* Get partial sector data from sector buffer */
- if (rcnt > btr) rcnt = btr;
- dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (WORD)(fs->fptr % 512), rcnt);
- if (dr) goto fr_abort;
- fs->fptr += rcnt;
- rbuff += rcnt; /* Update pointers and counters */
- btr -= rcnt;
- *br += rcnt;
- }
-
- return FR_OK;
-
-fr_abort:
- fs->flag = 0;
- return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Write File */
-/*-----------------------------------------------------------------------*/
-#if _USE_WRITE
-
-FRESULT pf_write (
- const void* buff, /* Pointer to the data to be written */
- WORD btw, /* Number of bytes to write (0:Finalize the current write operation) */
- WORD* bw /* Pointer to number of bytes written */
-) {
- CLUST clst;
- DWORD sect, remain;
- const BYTE *p = (const BYTE *)buff;
- WORD wcnt;
- FATFS *fs = FatFs;
-
-
- *bw = 0;
- if (!fs) return FR_NOT_ENABLED; /* Check file system */
- if (!(fs->flag & FA_OPENED)) /* Check if opened */
- return FR_NOT_OPENED;
-
- if (!btw) { /* Finalize request */
- if ((fs->flag & FA__WIP) && disk_writep(0, 0)) goto fw_abort;
- fs->flag &= ~FA__WIP;
- return FR_OK;
- } else { /* Write data request */
- if (!(fs->flag & FA__WIP)) /* Round down fptr to the sector boundary */
- fs->fptr &= 0xFFFFFE00;
- }
- remain = fs->fsize - fs->fptr;
- if (btw > remain) btw = (WORD)remain; /* Truncate btw by remaining bytes */
-
- while (btw) { /* Repeat until all data transferred */
- if (((WORD)fs->fptr % 512) == 0) { /* On the sector boundary? */
- if ((fs->fptr / 512 % fs->csize) == 0) { /* On the cluster boundary? */
- clst = (fs->fptr == 0) ? /* On the top of the file? */
- fs->org_clust : get_fat(fs->curr_clust);
- if (clst <= 1) goto fw_abort;
- fs->curr_clust = clst; /* Update current cluster */
- fs->csect = 0; /* Reset sector offset in the cluster */
- }
- sect = clust2sect(fs->curr_clust); /* Get current sector */
- if (!sect) goto fw_abort;
- fs->dsect = sect + fs->csect++;
- if (disk_writep(0, fs->dsect)) goto fw_abort; /* Initiate a sector write operation */
- fs->flag |= FA__WIP;
- }
- wcnt = 512 - ((WORD)fs->fptr % 512); /* Number of bytes to write to the sector */
- if (wcnt > btw) wcnt = btw;
- if (disk_writep(p, wcnt)) goto fw_abort; /* Send data to the sector */
- fs->fptr += wcnt;
- p += wcnt; /* Update pointers and counters */
- btw -= wcnt;
- *bw += wcnt;
- if (((WORD)fs->fptr % 512) == 0) {
- if (disk_writep(0, 0)) goto fw_abort; /* Finalize the currtent secter write operation */
- fs->flag &= ~FA__WIP;
- }
- }
-
- return FR_OK;
-
-fw_abort:
- fs->flag = 0;
- return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Seek File R/W Pointer */
-/*-----------------------------------------------------------------------*/
-#if _USE_LSEEK
-
-FRESULT pf_lseek (
- DWORD ofs /* File pointer from top of file */
-) {
- CLUST clst;
- DWORD bcs, sect, ifptr;
- FATFS *fs = FatFs;
-
-
- if (!fs) return FR_NOT_ENABLED; /* Check file system */
- if (!(fs->flag & FA_OPENED)) /* Check if opened */
- return FR_NOT_OPENED;
-
- if (ofs > fs->fsize) ofs = fs->fsize; /* Clip offset with the file size */
- ifptr = fs->fptr;
- fs->fptr = 0;
- if (ofs > 0) {
- bcs = (DWORD)fs->csize * 512; /* Cluster size (byte) */
- if (ifptr > 0 &&
- (ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */
- fs->fptr = (ifptr - 1) & ~(bcs - 1); /* start from the current cluster */
- ofs -= fs->fptr;
- clst = fs->curr_clust;
- } else { /* When seek to back cluster, */
- clst = fs->org_clust; /* start from the first cluster */
- fs->curr_clust = clst;
- }
- while (ofs > bcs) { /* Cluster following loop */
- clst = get_fat(clst); /* Follow cluster chain */
- if (clst <= 1 || clst >= fs->max_clust) goto fe_abort;
- fs->curr_clust = clst;
- fs->fptr += bcs;
- ofs -= bcs;
- }
- fs->fptr += ofs;
- sect = clust2sect(clst); /* Current sector */
- if (!sect) goto fe_abort;
- fs->csect = (BYTE)(ofs / 512); /* Sector offset in the cluster */
- if (ofs % 512)
- fs->dsect = sect + fs->csect++;
- }
-
- return FR_OK;
-
-fe_abort:
- fs->flag = 0;
- return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Create a Directroy Object */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-
-FRESULT pf_opendir (
- FATDIR *dj, /* Pointer to directory object to create */
- const char *path /* Pointer to the directory path */
-) {
- FRESULT res;
- BYTE sp[12], dir[32];
- FATFS *fs = FatFs;
-
-
- if (!fs) { /* Check file system */
- res = FR_NOT_ENABLED;
- } else {
- fs->buf = dir;
- dj->fn = sp;
- res = follow_path(dj, path); /* Follow the path to the directory */
- if (res == FR_OK) { /* Follow completed */
- if (dir[0]) { /* It is not the root dir */
- if (dir[DIR_Attr] & AM_DIR) { /* The object is a directory */
- dj->sclust =
-#if _FS_FAT32
- ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
- LD_WORD(dir+DIR_FstClusLO);
- } else { /* The object is not a directory */
- res = FR_NO_PATH;
- }
- }
- if (res == FR_OK)
- res = dir_rewind(dj); /* Rewind dir */
- }
- if (res == FR_NO_FILE) res = FR_NO_PATH;
- }
-
- return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read Directory Entry in Sequense */
-/*-----------------------------------------------------------------------*/
-
-FRESULT pf_readdir (
- FATDIR *dj, /* Pointer to the open directory object */
- FILINFO *fno /* Pointer to file information to return */
-) {
- FRESULT res;
- BYTE sp[12], dir[32];
- FATFS *fs = FatFs;
-
-
- if (!fs) { /* Check file system */
- res = FR_NOT_ENABLED;
- } else {
- fs->buf = dir;
- dj->fn = sp;
- if (!fno) {
- res = dir_rewind(dj);
- } else {
- res = dir_read(dj);
- if (res == FR_NO_FILE) {
- dj->sect = 0;
- res = FR_OK;
- }
- if (res == FR_OK) { /* A valid entry is found */
- get_fileinfo(dj, fno); /* Get the object information */
- res = dir_next(dj); /* Increment index for next */
- if (res == FR_NO_FILE) {
- dj->sect = 0;
- res = FR_OK;
- }
- }
- }
- }
-
- return res;
-}
-
-#endif /* _USE_DIR */
-
-
--- a/libpff/pff.h Tue Sep 19 13:42:25 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-/*---------------------------------------------------------------------------/
-/ Petit FatFs - FAT file system module include file R0.02 (C)ChaN, 2009
-/----------------------------------------------------------------------------/
-/ Petit FatFs module is an open source software to implement FAT file system to
-/ small embedded systems. This is a free software and is opened for education,
-/ research and commercial developments under license policy of following trems.
-/
-/ Copyright (C) 2009, ChaN, all right reserved.
-/
-/ * The Petit FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/----------------------------------------------------------------------------*/
-
-#include "integer.h"
-
-/*---------------------------------------------------------------------------/
-/ Petit FatFs Configuration Options
-/
-/ CAUTION! Do not forget to make clean the project after any changes to
-/ the configuration options.
-/
-/----------------------------------------------------------------------------*/
-#ifndef _FATFS
-#define _FATFS
-
-#define _USE_READ 1 /* pf_read(): 0:Remove ,1:Enable */
-
-#define _USE_DIR 1 /* pf_opendir() and pf_readdir(): 0:Remove ,1:Enable */
-
-#define _USE_LSEEK 1 /* pf_lseek(): 0:Remove ,1:Enable */
-
-#define _USE_WRITE 1 /* pf_write(): 0:Remove ,1:Enable */
-
-#define _FS_FAT32 1 /* 0:Supports FAT12/16 only, 1:Enable FAT32 supprt */
-
-
-#define _CODE_PAGE 1
-/* Defines which code page is used for path name. Supported code pages are:
-/ 932, 936, 949, 950, 437, 720, 737, 775, 850, 852, 855, 857, 858, 862, 866,
-/ 874, 1250, 1251, 1252, 1253, 1254, 1255, 1257, 1258 and 1 (ASCII only).
-/ SBCS configurations except for 1 requiers a case conversion table. This
-/ might occupy 128 bytes on the RAM on some platforms, e.g. avr-gcc. */
-
-
-#define _WORD_ACCESS 0 //jonne 1 gives hard fault with lpc11u68
-/* The _WORD_ACCESS option defines which access method is used to the word
-/ data in the FAT structure.
-/
-/ 0: Byte-by-byte access. Always compatible with all platforms.
-/ 1: Word access. Do not choose this unless following condition is met.
-/
-/ When the byte order on the memory is big-endian or address miss-aligned
-/ word access results incorrect behavior, the _WORD_ACCESS must be set to 0.
-/ If it is not the case, the value can also be set to 1 to improve the
-/ performance and code efficiency. */
-
-
-/* End of configuration options. Do not change followings without care. */
-/*--------------------------------------------------------------------------*/
-
-#if _FS_FAT32
-#define CLUST DWORD
-#else
-#define CLUST WORD
-#endif
-
-
-/* File system object structure */
-
-typedef struct _FATFS_ {
- BYTE fs_type; /* FAT sub type */
- BYTE csize; /* Number of sectors per cluster */
- BYTE flag; /* File status flags */
- BYTE csect; /* File sector address in the cluster */
- WORD n_rootdir; /* Number of root directory entries (0 on FAT32) */
- BYTE* buf; /* Pointer to the disk access buffer */
- CLUST max_clust; /* Maximum cluster# + 1. Number of clusters is max_clust - 2 */
- DWORD fatbase; /* FAT start sector */
- DWORD dirbase; /* Root directory start sector (Cluster# on FAT32) */
- DWORD database; /* Data start sector */
- DWORD fptr; /* File R/W pointer */
- DWORD fsize; /* File size */
- CLUST org_clust; /* File start cluster */
- CLUST curr_clust; /* File current cluster */
- DWORD dsect; /* File current data sector */
-} FATFS;
-
-
-
-/* Directory object structure */
-
-typedef struct _DIR_ {
- WORD index; /* Current read/write index number */
- BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
- CLUST sclust; /* Table start cluster (0:Static table) */
- CLUST clust; /* Current cluster */
- DWORD sect; /* Current sector */
-} FATDIR;
-
-
-
-/* File status structure */
-
-typedef struct _FILINFO_ {
- DWORD fsize; /* File size */
- WORD fdate; /* Last modified date */
- WORD ftime; /* Last modified time */
- BYTE fattrib; /* Attribute */
- char fname[13]; /* File name */
-} FILINFO;
-
-
-
-/* File function return code (FRESULT) */
-
-typedef enum {
- FR_OK = 0, /* 0 */
- FR_DISK_ERR, /* 1 */
- FR_NOT_READY, /* 2 */
- FR_NO_FILE, /* 3 */
- FR_NO_PATH, /* 4 */
- FR_NOT_OPENED, /* 5 */
- FR_NOT_ENABLED, /* 6 */
- FR_NO_FILESYSTEM /* 7 */
-} FRESULT;
-
-
-
-/*--------------------------------------------------------------*/
-/* Petit FatFs module application interface */
-
-FRESULT pf_mount (FATFS*); /* Mount/Unmount a logical drive */
-FRESULT pf_open (const char*); /* Open a file */
-FRESULT pf_read (void*, WORD, WORD*); /* Read data from the open file */
-FRESULT pf_write (const void*, WORD, WORD*); /* Write data to the open file */
-FRESULT pf_lseek (DWORD); /* Move file pointer of the open file */
-FRESULT pf_opendir (FATDIR*, const char*); /* Open a directory */
-FRESULT pf_readdir (FATDIR*, FILINFO*); /* Read a directory item from the open directory */
-
-
-
-/*--------------------------------------------------------------*/
-/* Flags and offset address */
-
-/* File status flag (FATFS.flag) */
-
-#define FA_OPENED 0x01
-#define FA_WPRT 0x02
-#define FA__WIP 0x40
-
-
-/* FAT sub type (FATFS.fs_type) */
-
-#define FS_FAT12 1
-#define FS_FAT16 2
-#define FS_FAT32 3
-
-
-/* File attribute bits for directory entry */
-
-#define AM_RDO 0x01 /* Read only */
-#define AM_HID 0x02 /* Hidden */
-#define AM_SYS 0x04 /* System */
-#define AM_VOL 0x08 /* Volume label */
-#define AM_LFN 0x0F /* LFN entry */
-#define AM_DIR 0x10 /* Directory */
-#define AM_ARC 0x20 /* Archive */
-#define AM_MASK 0x3F /* Mask of defined bits */
-
-
-/* FatFs refers the members in the FAT structures with byte offset instead
-/ of structure member because there are incompatibility of the packing option
-/ between various compilers. */
-
-#define BS_jmpBoot 0
-#define BS_OEMName 3
-#define BPB_BytsPerSec 11
-#define BPB_SecPerClus 13
-#define BPB_RsvdSecCnt 14
-#define BPB_NumFATs 16
-#define BPB_RootEntCnt 17
-#define BPB_TotSec16 19
-#define BPB_Media 21
-#define BPB_FATSz16 22
-#define BPB_SecPerTrk 24
-#define BPB_NumHeads 26
-#define BPB_HiddSec 28
-#define BPB_TotSec32 32
-#define BS_55AA 510
-
-#define BS_DrvNum 36
-#define BS_BootSig 38
-#define BS_VolID 39
-#define BS_VolLab 43
-#define BS_FilSysType 54
-
-#define BPB_FATSz32 36
-#define BPB_ExtFlags 40
-#define BPB_FSVer 42
-#define BPB_RootClus 44
-#define BPB_FSInfo 48
-#define BPB_BkBootSec 50
-#define BS_DrvNum32 64
-#define BS_BootSig32 66
-#define BS_VolID32 67
-#define BS_VolLab32 71
-#define BS_FilSysType32 82
-
-#define MBR_Table 446
-
-#define DIR_Name 0
-#define DIR_Attr 11
-#define DIR_NTres 12
-#define DIR_CrtTime 14
-#define DIR_CrtDate 16
-#define DIR_FstClusHI 20
-#define DIR_WrtTime 22
-#define DIR_WrtDate 24
-#define DIR_FstClusLO 26
-#define DIR_FileSize 28
-
-
-
-/*--------------------------------*/
-/* Multi-byte word access macros */
-
-#if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */
-#define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr))
-#define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
-#define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val)
-#define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
-#else /* Use byte-by-byte access to the FAT structure */
-#define LD_WORD(ptr) (WORD)(((WORD)*(BYTE*)((ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
-#define LD_DWORD(ptr) (DWORD)(((DWORD)*(BYTE*)((ptr)+3)<<24)|((DWORD)*(BYTE*)((ptr)+2)<<16)|((WORD)*(BYTE*)((ptr)+1)<<8)|*(BYTE*)(ptr))
-#define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *(BYTE*)((ptr)+1)=(BYTE)((WORD)(val)>>8)
-#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *(BYTE*)((ptr)+1)=(BYTE)((WORD)(val)>>8); *(BYTE*)((ptr)+2)=(BYTE)((DWORD)(val)>>16); *(BYTE*)((ptr)+3)=(BYTE)((DWORD)(val)>>24)
-#endif
-
-
-/*--------------------------------------------------------*/
-/* DBCS code ranges and SBCS extend char conversion table */
-
-#if _CODE_PAGE == 932 /* Japanese Shift-JIS */
-#define _DF1S 0x81 /* DBC 1st byte range 1 start */
-#define _DF1E 0x9F /* DBC 1st byte range 1 end */
-#define _DF2S 0xE0 /* DBC 1st byte range 2 start */
-#define _DF2E 0xFC /* DBC 1st byte range 2 end */
-#define _DS1S 0x40 /* DBC 2nd byte range 1 start */
-#define _DS1E 0x7E /* DBC 2nd byte range 1 end */
-#define _DS2S 0x80 /* DBC 2nd byte range 2 start */
-#define _DS2E 0xFC /* DBC 2nd byte range 2 end */
-
-#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x40
-#define _DS1E 0x7E
-#define _DS2S 0x80
-#define _DS2E 0xFE
-
-#elif _CODE_PAGE == 949 /* Korean */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x41
-#define _DS1E 0x5A
-#define _DS2S 0x61
-#define _DS2E 0x7A
-#define _DS3S 0x81
-#define _DS3E 0xFE
-
-#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x40
-#define _DS1E 0x7E
-#define _DS2S 0xA1
-#define _DS2E 0xFE
-
-#elif _CODE_PAGE == 437 /* U.S. (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 720 /* Arabic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 737 /* Greek (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
- 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 775 /* Baltic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 850 /* Multilingual Latin 1 (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 852 /* Latin 2 (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
-
-#elif _CODE_PAGE == 855 /* Cyrillic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
- 0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
- 0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 857 /* Turkish (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 858 /* Multilingual Latin 1 + Euro (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 862 /* Hebrew (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 866 /* Russian (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
- 0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
-
-#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1253 /* Greek (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
- 0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
-
-#elif _CODE_PAGE == 1254 /* Turkish (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1256 /* Arabic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1257 /* Baltic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
-
-#elif _CODE_PAGE == 1 /* ASCII (for only non-LFN cfg) */
-#define _DF1S 0
-
-#else
-#error Unknown code page
-
-#endif
-
-
-
-/* Character code support macros */
-
-#define IsUpper(c) (((c)>='A')&&((c)<='Z'))
-#define IsLower(c) (((c)>='a')&&((c)<='z'))
-
-#if _DF1S /* DBCS configuration */
-
-#ifdef _DF2S /* Two 1st byte areas */
-#define IsDBCS1(c) (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
-#else /* One 1st byte area */
-#define IsDBCS1(c) ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
-#endif
-
-#ifdef _DS3S /* Three 2nd byte areas */
-#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
-#else /* Two 2nd byte areas */
-#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
-#endif
-
-#else /* SBCS configuration */
-
-#define IsDBCS1(c) 0
-#define IsDBCS2(c) 0
-
-#endif /* _DF1S */
-
-
-#endif /* _FATFS */
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/.yotta_ignore Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,14 @@ +# ignore files for targets that aren't supported by the yotta build (to +# minimise the size of the published module) + +TARGET_ARM_SSG +TARGET_Freescale +TARGET_RENESAS +TARGET_Silicon_Labs +TARGET_Atmel +TARGET_Maxim +TARGET_NXP +TARGET_STM +TARGET_WIZNET +TOOLCHAIN_IAR +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/CMakeLists.txt Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,112 @@
+#
+# mbed-2 yotta-compatible build system
+#
+
+# make sure necessary features are enabled:
+project(mbed-classic)
+enable_language(ASM)
+
+# override compilation flags:
+if(CMAKE_C_COMPILER_ID MATCHES GNU)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+endif()
+
+# the mbed.a library is built from two sets of source files + include
+# directories:
+#
+# MBED_COMMON_SOURCES: the source files that are the same for all targets,
+# these are easily found by globbing:
+#
+file(GLOB MBED_COMMON_SOURCES "common/*.cpp" "common/*.c")
+#
+# (always include the hal header directory, too)
+set(MBED_COMMON_INCLUDE_DIRS "hal")
+
+# and MBED_TARGET_SOURCES: these depend on which target we are building for. To
+# find these we need to walk the directories in targets/, and wherever we see a
+# TARGET_<something> name, recurse only if <something> matches what we're
+# currently building for
+macro(mbed_find_target_dirs PARENT_DIRECTORY SOURCES_LIST INCLUDES_LIST)
+ # append this directory to the search path:
+ list(APPEND ${INCLUDES_LIST} "${PARENT_DIRECTORY}")
+ # add all source files in this directory to the sources list:
+ file(GLOB sources "${PARENT_DIRECTORY}/*.cpp" "${PARENT_DIRECTORY}/*.c" "${PARENT_DIRECTORY}/*.s" "${PARENT_DIRECTORY}/*.S" )
+ list(APPEND ${SOURCES_LIST} ${sources})
+
+ # get a list of all subdirectories that we want to recurse into:
+ file(GLOB dir_children RELATIVE "${PARENT_DIRECTORY}" "${PARENT_DIRECTORY}/*")
+ set(matching_subdirs "")
+ foreach(child ${dir_children})
+ if(IS_DIRECTORY "${PARENT_DIRECTORY}/${child}")
+ # is this directory name a magic one?
+ if("${child}" MATCHES "^TARGET_")
+ # target-magic: recurse if the MBED_LEGACY_TARGET_DEFINITIONS **list**
+ # contains a matching value:
+ foreach(legacy_magic_def ${MBED_LEGACY_TARGET_DEFINITIONS})
+ # we could probably unroll the list into a single regex if
+ # this is a performance problem:
+ if("${child}" MATCHES "^TARGET_${legacy_magic_def}$")
+ list(APPEND matching_subdirs ${child})
+ break()
+ endif()
+ endforeach()
+ elseif("${child}" MATCHES "^TOOLCHAIN_")
+ # toolchain-magic: (recurse if the MBED_LEGACY_TOOLCHAIN matches
+ # this name)
+ if("${child}" MATCHES "^TOOLCHAIN_${MBED_LEGACY_TOOLCHAIN}$")
+ list(APPEND matching_subdirs "${child}")
+ endif()
+ else()
+ # not special: always recurse into this directory
+ list(APPEND matching_subdirs "${child}")
+ endif()
+ endif()
+ endforeach()
+ #message("matching_subdirs: ${matching_subdirs}")
+
+ # recurse:
+ foreach(subdir ${matching_subdirs})
+ mbed_find_target_dirs("${PARENT_DIRECTORY}/${subdir}" ${SOURCES_LIST} ${INCLUDES_LIST})
+ endforeach()
+endmacro()
+
+set(MBED_TARGET_SOURCES "")
+set(MBED_TARGET_INCLUDE_DIRS "")
+mbed_find_target_dirs("${CMAKE_CURRENT_SOURCE_DIR}/targets" MBED_TARGET_SOURCES MBED_TARGET_INCLUDE_DIRS)
+#message("found target sources: ${MBED_TARGET_SOURCES}")
+#message("found target include dirs: ${MBED_TARGET_INCLUDE_DIRS}")
+
+# unfortunately, for ARMCC, the startup code needs to be provided as an object
+# on the command line (not as part of an archive). To do this we override the
+# CMake add_executable command.
+if(CMAKE_C_COMPILER_ID STREQUAL "ARMCC")
+ set(MBED_TARGET_STARTUP_CODE_SOURCES "")
+ foreach(src ${MBED_TARGET_SOURCES})
+ if("${src}" MATCHES .*startup_.*\\.[sS])
+ LIST(APPEND MBED_TARGET_STARTUP_CODE_SOURCES "${src}")
+ endif()
+ endforeach()
+ add_library(mbed_classic_startupcod OBJECT ${MBED_TARGET_STARTUP_CODE_SOURCES})
+ macro (add_executable _name)
+ _add_executable(${ARGV} $<TARGET_OBJECTS:mbed_classic_startupcod>)
+ endmacro()
+endif()
+
+# we have to append any target-specific include dirs to the global include dirs
+# list, so that any indirect includes (e.g. via mbed.h) of files in those
+# directories will work:
+# (non-target-specific include dirs are listed in extraIncludes in module.json)
+foreach(dir ${MBED_TARGET_INCLUDE_DIRS})
+ set_property(GLOBAL APPEND PROPERTY YOTTA_GLOBAL_INCLUDE_DIRS ${dir})
+endforeach()
+
+# finally, we can construct a library using the determined set of include paths
+# + source files. Note that the library name must match the name of the yotta
+# module (defined in module.json) for this module to link properly with other
+# yotta modules.
+include_directories(${MBED_COMMON_INCLUDE_DIRS})
+include_directories(${MBED_TARGET_INCLUDE_DIRS})
+add_library(mbed-classic
+ ${MBED_COMMON_SOURCES}
+ ${MBED_TARGET_SOURCES}
+)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/AnalogIn.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,103 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ANALOGIN_H
+#define MBED_ANALOGIN_H
+
+#include "platform.h"
+
+#if DEVICE_ANALOGIN
+
+#include "analogin_api.h"
+
+namespace mbed {
+
+/** An analog input, used for reading the voltage on a pin
+ *
+ * Example:
+ * @code
+ * // Print messages when the AnalogIn is greater than 50%
+ *
+ * #include "mbed.h"
+ *
+ * AnalogIn temperature(p20);
+ *
+ * int main() {
+ * while(1) {
+ * if(temperature > 0.5) {
+ * printf("Too hot! (%f)", temperature.read());
+ * }
+ * }
+ * }
+ * @endcode
+ */
+class AnalogIn {
+
+public:
+
+ /** Create an AnalogIn, connected to the specified pin
+ *
+ * @param pin AnalogIn pin to connect to
+ * @param name (optional) A string to identify the object
+ */
+ AnalogIn(PinName pin) {
+ analogin_init(&_adc, pin);
+ }
+
+ /** Read the input voltage, represented as a float in the range [0.0, 1.0]
+ *
+ * @returns A floating-point value representing the current input voltage, measured as a percentage
+ */
+ float read() {
+ return analogin_read(&_adc);
+ }
+
+ /** Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF]
+ *
+ * @returns
+ * 16-bit unsigned short representing the current input voltage, normalised to a 16-bit value
+ */
+ unsigned short read_u16() {
+ return analogin_read_u16(&_adc);
+ }
+
+#ifdef MBED_OPERATORS
+ /** An operator shorthand for read()
+ *
+ * The float() operator can be used as a shorthand for read() to simplify common code sequences
+ *
+ * Example:
+ * @code
+ * float x = volume.read();
+ * float x = volume;
+ *
+ * if(volume.read() > 0.25) { ... }
+ * if(volume > 0.25) { ... }
+ * @endcode
+ */
+ operator float() {
+ return read();
+ }
+#endif
+
+protected:
+ analogin_t _adc;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/AnalogOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,121 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ANALOGOUT_H
+#define MBED_ANALOGOUT_H
+
+#include "platform.h"
+
+#if DEVICE_ANALOGOUT
+
+#include "analogout_api.h"
+
+namespace mbed {
+
+/** An analog output, used for setting the voltage on a pin
+ *
+ * Example:
+ * @code
+ * // Make a sawtooth output
+ *
+ * #include "mbed.h"
+ *
+ * AnalogOut tri(p18);
+ * int main() {
+ * while(1) {
+ * tri = tri + 0.01;
+ * wait_us(1);
+ * if(tri == 1) {
+ * tri = 0;
+ * }
+ * }
+ * }
+ * @endcode
+ */
+class AnalogOut {
+
+public:
+
+ /** Create an AnalogOut connected to the specified pin
+ *
+ * @param AnalogOut pin to connect to (18)
+ */
+ AnalogOut(PinName pin) {
+ analogout_init(&_dac, pin);
+ }
+
+ /** Set the output voltage, specified as a percentage (float)
+ *
+ * @param value A floating-point value representing the output voltage,
+ * specified as a percentage. The value should lie between
+ * 0.0f (representing 0v / 0%) and 1.0f (representing 3.3v / 100%).
+ * Values outside this range will be saturated to 0.0f or 1.0f.
+ */
+ void write(float value) {
+ analogout_write(&_dac, value);
+ }
+
+ /** Set the output voltage, represented as an unsigned short in the range [0x0, 0xFFFF]
+ *
+ * @param value 16-bit unsigned short representing the output voltage,
+ * normalised to a 16-bit value (0x0000 = 0v, 0xFFFF = 3.3v)
+ */
+ void write_u16(unsigned short value) {
+ analogout_write_u16(&_dac, value);
+ }
+
+ /** Return the current output voltage setting, measured as a percentage (float)
+ *
+ * @returns
+ * A floating-point value representing the current voltage being output on the pin,
+ * measured as a percentage. The returned value will lie between
+ * 0.0f (representing 0v / 0%) and 1.0f (representing 3.3v / 100%).
+ *
+ * @note
+ * This value may not match exactly the value set by a previous write().
+ */
+ float read() {
+ return analogout_read(&_dac);
+ }
+
+#ifdef MBED_OPERATORS
+ /** An operator shorthand for write()
+ */
+ AnalogOut& operator= (float percent) {
+ write(percent);
+ return *this;
+ }
+
+ AnalogOut& operator= (AnalogOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** An operator shorthand for read()
+ */
+ operator float() {
+ return read();
+ }
+#endif
+
+protected:
+ dac_t _dac;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/BusIn.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,98 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_BUSIN_H
+#define MBED_BUSIN_H
+
+#include "platform.h"
+#include "DigitalIn.h"
+
+namespace mbed {
+
+/** A digital input bus, used for reading the state of a collection of pins
+ */
+class BusIn {
+
+public:
+ /* Group: Configuration Methods */
+
+ /** Create an BusIn, connected to the specified pins
+ *
+ * @param <n> DigitalIn pin to connect to bus bit <n> (p5-p30, NC)
+ *
+ * @note
+ * It is only required to specify as many pin variables as is required
+ * for the bus; the rest will default to NC (not connected)
+ */
+ BusIn(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
+ PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
+ PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
+ PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
+
+ BusIn(PinName pins[16]);
+
+ virtual ~BusIn();
+
+ /** Read the value of the input bus
+ *
+ * @returns
+ * An integer with each bit corresponding to the value read from the associated DigitalIn pin
+ */
+ int read();
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone
+ */
+ void mode(PinMode pull);
+
+ /** Binary mask of bus pins connected to actual pins (not NC pins)
+ * If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
+ *
+ * @returns
+ * Binary mask of connected pins
+ */
+ int mask() {
+ return _nc_mask;
+ }
+
+#ifdef MBED_OPERATORS
+ /** A shorthand for read()
+ */
+ operator int();
+
+ /** Access to particular bit in random-iterator fashion
+ */
+ DigitalIn & operator[] (int index);
+#endif
+
+protected:
+ DigitalIn* _pin[16];
+
+ /** Mask of bus's NC pins
+ * If bit[n] is set to 1 - pin is connected
+ * if bit[n] is cleared - pin is not connected (NC)
+ */
+ int _nc_mask;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ BusIn(const BusIn&);
+ BusIn & operator = (const BusIn&);
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/BusInOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,117 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_BUSINOUT_H
+#define MBED_BUSINOUT_H
+
+#include "DigitalInOut.h"
+
+namespace mbed {
+
+/** A digital input output bus, used for setting the state of a collection of pins
+ */
+class BusInOut {
+
+public:
+
+ /** Create an BusInOut, connected to the specified pins
+ *
+ * @param p<n> DigitalInOut pin to connect to bus bit p<n> (p5-p30, NC)
+ *
+ * @note
+ * It is only required to specify as many pin variables as is required
+ * for the bus; the rest will default to NC (not connected)
+ */
+ BusInOut(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
+ PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
+ PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
+ PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
+
+ BusInOut(PinName pins[16]);
+
+ virtual ~BusInOut();
+
+ /* Group: Access Methods */
+
+ /** Write the value to the output bus
+ *
+ * @param value An integer specifying a bit to write for every corresponding DigitalInOut pin
+ */
+ void write(int value);
+
+ /** Read the value currently output on the bus
+ *
+ * @returns
+ * An integer with each bit corresponding to associated DigitalInOut pin setting
+ */
+ int read();
+
+ /** Set as an output
+ */
+ void output();
+
+ /** Set as an input
+ */
+ void input();
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone
+ */
+ void mode(PinMode pull);
+
+ /** Binary mask of bus pins connected to actual pins (not NC pins)
+ * If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
+ *
+ * @returns
+ * Binary mask of connected pins
+ */
+ int mask() {
+ return _nc_mask;
+ }
+
+#ifdef MBED_OPERATORS
+ /** A shorthand for write()
+ */
+ BusInOut& operator= (int v);
+ BusInOut& operator= (BusInOut& rhs);
+
+ /** Access to particular bit in random-iterator fashion
+ */
+ DigitalInOut& operator[] (int index);
+
+ /** A shorthand for read()
+ */
+ operator int();
+#endif
+
+protected:
+ DigitalInOut* _pin[16];
+
+ /** Mask of bus's NC pins
+ * If bit[n] is set to 1 - pin is connected
+ * if bit[n] is cleared - pin is not connected (NC)
+ */
+ int _nc_mask;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ BusInOut(const BusInOut&);
+ BusInOut & operator = (const BusInOut&);
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/BusOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,101 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_BUSOUT_H
+#define MBED_BUSOUT_H
+
+#include "DigitalOut.h"
+
+namespace mbed {
+
+/** A digital output bus, used for setting the state of a collection of pins
+ */
+class BusOut {
+
+public:
+
+ /** Create an BusOut, connected to the specified pins
+ *
+ * @param p<n> DigitalOut pin to connect to bus bit <n> (p5-p30, NC)
+ *
+ * @note
+ * It is only required to specify as many pin variables as is required
+ * for the bus; the rest will default to NC (not connected)
+ */
+ BusOut(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC,
+ PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC,
+ PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC,
+ PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC);
+
+ BusOut(PinName pins[16]);
+
+ virtual ~BusOut();
+
+ /** Write the value to the output bus
+ *
+ * @param value An integer specifying a bit to write for every corresponding DigitalOut pin
+ */
+ void write(int value);
+
+ /** Read the value currently output on the bus
+ *
+ * @returns
+ * An integer with each bit corresponding to associated DigitalOut pin setting
+ */
+ int read();
+
+ /** Binary mask of bus pins connected to actual pins (not NC pins)
+ * If bus pin is in NC state make corresponding bit will be cleared (set to 0), else bit will be set to 1
+ *
+ * @returns
+ * Binary mask of connected pins
+ */
+ int mask() {
+ return _nc_mask;
+ }
+
+#ifdef MBED_OPERATORS
+ /** A shorthand for write()
+ */
+ BusOut& operator= (int v);
+ BusOut& operator= (BusOut& rhs);
+
+ /** Access to particular bit in random-iterator fashion
+ */
+ DigitalOut& operator[] (int index);
+
+ /** A shorthand for read()
+ */
+ operator int();
+#endif
+
+protected:
+ DigitalOut* _pin[16];
+
+ /** Mask of bus's NC pins
+ * If bit[n] is set to 1 - pin is connected
+ * if bit[n] is cleared - pin is not connected (NC)
+ */
+ int _nc_mask;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ BusOut(const BusOut&);
+ BusOut & operator = (const BusOut&);
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/CAN.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,243 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_CAN_H
+#define MBED_CAN_H
+
+#include "platform.h"
+
+#if DEVICE_CAN
+
+#include "can_api.h"
+#include "can_helper.h"
+#include "FunctionPointer.h"
+
+namespace mbed {
+
+/** CANMessage class
+ */
+class CANMessage : public CAN_Message {
+
+public:
+ /** Creates empty CAN message.
+ */
+ CANMessage() : CAN_Message() {
+ len = 8;
+ type = CANData;
+ format = CANStandard;
+ id = 0;
+ memset(data, 0, 8);
+ }
+
+ /** Creates CAN message with specific content.
+ */
+ CANMessage(int _id, const char *_data, char _len = 8, CANType _type = CANData, CANFormat _format = CANStandard) {
+ len = _len & 0xF;
+ type = _type;
+ format = _format;
+ id = _id;
+ memcpy(data, _data, _len);
+ }
+
+ /** Creates CAN remote message.
+ */
+ CANMessage(int _id, CANFormat _format = CANStandard) {
+ len = 0;
+ type = CANRemote;
+ format = _format;
+ id = _id;
+ memset(data, 0, 8);
+ }
+};
+
+/** A can bus client, used for communicating with can devices
+ */
+class CAN {
+
+public:
+ /** Creates an CAN interface connected to specific pins.
+ *
+ * @param rd read from transmitter
+ * @param td transmit to transmitter
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * Ticker ticker;
+ * DigitalOut led1(LED1);
+ * DigitalOut led2(LED2);
+ * CAN can1(p9, p10);
+ * CAN can2(p30, p29);
+ *
+ * char counter = 0;
+ *
+ * void send() {
+ * if(can1.write(CANMessage(1337, &counter, 1))) {
+ * printf("Message sent: %d\n", counter);
+ * counter++;
+ * }
+ * led1 = !led1;
+ * }
+ *
+ * int main() {
+ * ticker.attach(&send, 1);
+ * CANMessage msg;
+ * while(1) {
+ * if(can2.read(msg)) {
+ * printf("Message received: %d\n\n", msg.data[0]);
+ * led2 = !led2;
+ * }
+ * wait(0.2);
+ * }
+ * }
+ * @endcode
+ */
+ CAN(PinName rd, PinName td);
+ virtual ~CAN();
+
+ /** Set the frequency of the CAN interface
+ *
+ * @param hz The bus frequency in hertz
+ *
+ * @returns
+ * 1 if successful,
+ * 0 otherwise
+ */
+ int frequency(int hz);
+
+ /** Write a CANMessage to the bus.
+ *
+ * @param msg The CANMessage to write.
+ *
+ * @returns
+ * 0 if write failed,
+ * 1 if write was successful
+ */
+ int write(CANMessage msg);
+
+ /** Read a CANMessage from the bus.
+ *
+ * @param msg A CANMessage to read to.
+ * @param handle message filter handle (0 for any message)
+ *
+ * @returns
+ * 0 if no message arrived,
+ * 1 if message arrived
+ */
+ int read(CANMessage &msg, int handle = 0);
+
+ /** Reset CAN interface.
+ *
+ * To use after error overflow.
+ */
+ void reset();
+
+ /** Puts or removes the CAN interface into silent monitoring mode
+ *
+ * @param silent boolean indicating whether to go into silent mode or not
+ */
+ void monitor(bool silent);
+
+ enum Mode {
+ Reset = 0,
+ Normal,
+ Silent,
+ LocalTest,
+ GlobalTest,
+ SilentTest
+ };
+
+ /** Change CAN operation to the specified mode
+ *
+ * @param mode The new operation mode (CAN::Normal, CAN::Silent, CAN::LocalTest, CAN::GlobalTest, CAN::SilentTest)
+ *
+ * @returns
+ * 0 if mode change failed or unsupported,
+ * 1 if mode change was successful
+ */
+ int mode(Mode mode);
+
+ /** Filter out incomming messages
+ *
+ * @param id the id to filter on
+ * @param mask the mask applied to the id
+ * @param format format to filter on (Default CANAny)
+ * @param handle message filter handle (Optional)
+ *
+ * @returns
+ * 0 if filter change failed or unsupported,
+ * new filter handle if successful
+ */
+ int filter(unsigned int id, unsigned int mask, CANFormat format = CANAny, int handle = 0);
+
+ /** Returns number of read errors to detect read overflow errors.
+ */
+ unsigned char rderror();
+
+ /** Returns number of write errors to detect write overflow errors.
+ */
+ unsigned char tderror();
+
+ enum IrqType {
+ RxIrq = 0,
+ TxIrq,
+ EwIrq,
+ DoIrq,
+ WuIrq,
+ EpIrq,
+ AlIrq,
+ BeIrq,
+ IdIrq
+ };
+
+ /** Attach a function to call whenever a CAN frame received interrupt is
+ * generated.
+ *
+ * @param fptr A pointer to a void function, or 0 to set as none
+ * @param event Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, CAN::TxIrq for transmitted or aborted, CAN::EwIrq for error warning, CAN::DoIrq for data overrun, CAN::WuIrq for wake-up, CAN::EpIrq for error passive, CAN::AlIrq for arbitration lost, CAN::BeIrq for bus error)
+ */
+ void attach(void (*fptr)(void), IrqType type=RxIrq);
+
+ /** Attach a member function to call whenever a CAN frame received interrupt
+ * is generated.
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ * @param event Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, TxIrq for transmitted or aborted, EwIrq for error warning, DoIrq for data overrun, WuIrq for wake-up, EpIrq for error passive, AlIrq for arbitration lost, BeIrq for bus error)
+ */
+ template<typename T>
+ void attach(T* tptr, void (T::*mptr)(void), IrqType type=RxIrq) {
+ if((mptr != NULL) && (tptr != NULL)) {
+ _irq[type].attach(tptr, mptr);
+ can_irq_set(&_can, (CanIrqType)type, 1);
+ }
+ else {
+ can_irq_set(&_can, (CanIrqType)type, 0);
+ }
+ }
+
+ static void _irq_handler(uint32_t id, CanIrqType type);
+
+protected:
+ can_t _can;
+ FunctionPointer _irq[9];
+};
+
+} // namespace mbed
+
+#endif
+
+#endif // MBED_CAN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/CThunk.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,202 @@
+/* General C++ Object Thunking class
+ *
+ * - allows direct callbacks to non-static C++ class functions
+ * - keeps track for the corresponding class instance
+ * - supports an optional context parameter for the called function
+ * - ideally suited for class object receiving interrupts (NVIC_SetVector)
+ *
+ * Copyright (c) 2014-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef __CTHUNK_H__
+#define __CTHUNK_H__
+
+#define CTHUNK_ADDRESS 1
+
+#if defined(__CORTEX_M3) || defined(__CORTEX_M4) || defined(__thumb2__)
+#define CTHUNK_VARIABLES volatile uint32_t code[1]
+/**
+* CTHUNK disassembly for Cortex-M3/M4 (thumb2):
+* * ldm.w pc,{r0,r1,r2,pc}
+*
+* This instruction loads the arguments for the static thunking function to r0-r2, and
+* branches to that function by loading its address into PC.
+*
+* This is safe for both regular calling and interrupt calling, since it only touches scratch registers
+* which should be saved by the caller, and are automatically saved as part of the IRQ context switch.
+*/
+#define CTHUNK_ASSIGMENT m_thunk.code[0] = 0x8007E89F
+
+#elif defined(__CORTEX_M0PLUS) || defined(__CORTEX_M0)
+/*
+* CTHUNK disassembly for Cortex M0 (thumb):
+* * push {r0,r1,r2,r3,r4,lr} save touched registers and return address
+* * movs r4,#4 set up address to load arguments from (immediately following this code block) (1)
+* * add r4,pc set up address to load arguments from (immediately following this code block) (2)
+* * ldm r4!,{r0,r1,r2,r3} load arguments for static thunk function
+* * blx r3 call static thunk function
+* * pop {r0,r1,r2,r3,r4,pc} restore scratch registers and return from function
+*/
+#define CTHUNK_VARIABLES volatile uint32_t code[3]
+#define CTHUNK_ASSIGMENT do { \
+ m_thunk.code[0] = 0x2404B51F; \
+ m_thunk.code[1] = 0xCC0F447C; \
+ m_thunk.code[2] = 0xBD1F4798; \
+ } while (0)
+
+#else
+#error "Target is not currently suported."
+#endif
+
+/* IRQ/Exception compatible thunk entry function */
+typedef void (*CThunkEntry)(void);
+
+template<class T>
+class CThunk
+{
+ public:
+ typedef void (T::*CCallbackSimple)(void);
+ typedef void (T::*CCallback)(void* context);
+
+ inline CThunk(T *instance)
+ {
+ init(instance, NULL, NULL);
+ }
+
+ inline CThunk(T *instance, CCallback callback)
+ {
+ init(instance, callback, NULL);
+ }
+
+ ~CThunk() {
+
+ }
+
+ inline CThunk(T *instance, CCallbackSimple callback)
+ {
+ init(instance, (CCallback)callback, NULL);
+ }
+
+ inline CThunk(T &instance, CCallback callback)
+ {
+ init(instance, callback, NULL);
+ }
+
+ inline CThunk(T &instance, CCallbackSimple callback)
+ {
+ init(instance, (CCallback)callback, NULL);
+ }
+
+ inline CThunk(T &instance, CCallback callback, void* context)
+ {
+ init(instance, callback, context);
+ }
+
+ inline void callback(CCallback callback)
+ {
+ m_callback = callback;
+ }
+
+ inline void callback(CCallbackSimple callback)
+ {
+ m_callback = (CCallback)callback;
+ }
+
+ inline void context(void* context)
+ {
+ m_thunk.context = (uint32_t)context;
+ }
+
+ inline void context(uint32_t context)
+ {
+ m_thunk.context = context;
+ }
+
+ inline uint32_t entry(void)
+ {
+ return (((uint32_t)&m_thunk)|CTHUNK_ADDRESS);
+ }
+
+ /* get thunk entry point for connecting rhunk to an IRQ table */
+ inline operator CThunkEntry(void)
+ {
+ return (CThunkEntry)entry();
+ }
+
+ /* get thunk entry point for connecting rhunk to an IRQ table */
+ inline operator uint32_t(void)
+ {
+ return entry();
+ }
+
+ /* simple test function */
+ inline void call(void)
+ {
+ (((CThunkEntry)(entry()))());
+ }
+
+ private:
+ T* m_instance;
+ volatile CCallback m_callback;
+
+// TODO: this needs proper fix, to refactor toolchain header file and all its use
+// PACKED there is not defined properly for IAR
+#if defined (__ICCARM__)
+ typedef __packed struct
+ {
+ CTHUNK_VARIABLES;
+ volatile uint32_t instance;
+ volatile uint32_t context;
+ volatile uint32_t callback;
+ volatile uint32_t trampoline;
+ } CThunkTrampoline;
+#else
+ typedef struct
+ {
+ CTHUNK_VARIABLES;
+ volatile uint32_t instance;
+ volatile uint32_t context;
+ volatile uint32_t callback;
+ volatile uint32_t trampoline;
+ } __attribute__((__packed__)) CThunkTrampoline;
+#endif
+
+ static void trampoline(T* instance, void* context, CCallback* callback)
+ {
+ if(instance && *callback) {
+ (static_cast<T*>(instance)->**callback)(context);
+ }
+ }
+
+ volatile CThunkTrampoline m_thunk;
+
+ inline void init(T *instance, CCallback callback, void* context)
+ {
+ /* remember callback - need to add this level of redirection
+ as pointer size for member functions differs between platforms */
+ m_callback = callback;
+
+ /* populate thunking trampoline */
+ CTHUNK_ASSIGMENT;
+ m_thunk.context = (uint32_t)context;
+ m_thunk.instance = (uint32_t)instance;
+ m_thunk.callback = (uint32_t)&m_callback;
+ m_thunk.trampoline = (uint32_t)&trampoline;
+
+ __ISB();
+ __DSB();
+ }
+};
+
+#endif/*__CTHUNK_H__*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/CallChain.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,181 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_CALLCHAIN_H
+#define MBED_CALLCHAIN_H
+
+#include "FunctionPointer.h"
+#include <string.h>
+
+namespace mbed {
+
+/** Group one or more functions in an instance of a CallChain, then call them in
+ * sequence using CallChain::call(). Used mostly by the interrupt chaining code,
+ * but can be used for other purposes.
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * CallChain chain;
+ *
+ * void first(void) {
+ * printf("'first' function.\n");
+ * }
+ *
+ * void second(void) {
+ * printf("'second' function.\n");
+ * }
+ *
+ * class Test {
+ * public:
+ * void f(void) {
+ * printf("A::f (class member).\n");
+ * }
+ * };
+ *
+ * int main() {
+ * Test test;
+ *
+ * chain.add(second);
+ * chain.add_front(first);
+ * chain.add(&test, &Test::f);
+ * chain.call();
+ * }
+ * @endcode
+ */
+
+typedef FunctionPointer* pFunctionPointer_t;
+
+class CallChain {
+public:
+ /** Create an empty chain
+ *
+ * @param size (optional) Initial size of the chain
+ */
+ CallChain(int size = 4);
+ virtual ~CallChain();
+
+ /** Add a function at the end of the chain
+ *
+ * @param function A pointer to a void function
+ *
+ * @returns
+ * The function object created for 'function'
+ */
+ pFunctionPointer_t add(void (*function)(void));
+
+ /** Add a function at the end of the chain
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ *
+ * @returns
+ * The function object created for 'tptr' and 'mptr'
+ */
+ template<typename T>
+ pFunctionPointer_t add(T *tptr, void (T::*mptr)(void)) {
+ return common_add(new FunctionPointer(tptr, mptr));
+ }
+
+ /** Add a function at the beginning of the chain
+ *
+ * @param function A pointer to a void function
+ *
+ * @returns
+ * The function object created for 'function'
+ */
+ pFunctionPointer_t add_front(void (*function)(void));
+
+ /** Add a function at the beginning of the chain
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ *
+ * @returns
+ * The function object created for 'tptr' and 'mptr'
+ */
+ template<typename T>
+ pFunctionPointer_t add_front(T *tptr, void (T::*mptr)(void)) {
+ return common_add_front(new FunctionPointer(tptr, mptr));
+ }
+
+ /** Get the number of functions in the chain
+ */
+ int size() const;
+
+ /** Get a function object from the chain
+ *
+ * @param i function object index
+ *
+ * @returns
+ * The function object at position 'i' in the chain
+ */
+ pFunctionPointer_t get(int i) const;
+
+ /** Look for a function object in the call chain
+ *
+ * @param f the function object to search
+ *
+ * @returns
+ * The index of the function object if found, -1 otherwise.
+ */
+ int find(pFunctionPointer_t f) const;
+
+ /** Clear the call chain (remove all functions in the chain).
+ */
+ void clear();
+
+ /** Remove a function object from the chain
+ *
+ * @arg f the function object to remove
+ *
+ * @returns
+ * true if the function object was found and removed, false otherwise.
+ */
+ bool remove(pFunctionPointer_t f);
+
+ /** Call all the functions in the chain in sequence
+ */
+ void call();
+
+#ifdef MBED_OPERATORS
+ void operator ()(void) {
+ call();
+ }
+ pFunctionPointer_t operator [](int i) const {
+ return get(i);
+ }
+#endif
+
+private:
+ void _check_size();
+ pFunctionPointer_t common_add(pFunctionPointer_t pf);
+ pFunctionPointer_t common_add_front(pFunctionPointer_t pf);
+
+ pFunctionPointer_t* _chain;
+ int _size;
+ int _elements;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ CallChain(const CallChain&);
+ CallChain & operator = (const CallChain&);
+};
+
+} // namespace mbed
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/CircularBuffer.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,98 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_CIRCULARBUFFER_H
+#define MBED_CIRCULARBUFFER_H
+
+namespace mbed {
+
+/** Templated Circular buffer class
+ */
+template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
+class CircularBuffer {
+public:
+ CircularBuffer() : _head(0), _tail(0), _full(false) {
+ }
+
+ ~CircularBuffer() {
+ }
+
+ /** Push the transaction to the buffer. This overwrites the buffer if it's
+ * full
+ *
+ * @param data Data to be pushed to the buffer
+ */
+ void push(const T& data) {
+ if (full()) {
+ _tail++;
+ _tail %= BufferSize;
+ }
+ _pool[_head++] = data;
+ _head %= BufferSize;
+ if (_head == _tail) {
+ _full = true;
+ }
+ }
+
+ /** Pop the transaction from the buffer
+ *
+ * @param data Data to be pushed to the buffer
+ * @return True if the buffer is not empty and data contains a transaction, false otherwise
+ */
+ bool pop(T& data) {
+ if (!empty()) {
+ data = _pool[_tail++];
+ _tail %= BufferSize;
+ _full = false;
+ return true;
+ }
+ return false;
+ }
+
+ /** Check if the buffer is empty
+ *
+ * @return True if the buffer is empty, false if not
+ */
+ bool empty() {
+ return (_head == _tail) && !_full;
+ }
+
+ /** Check if the buffer is full
+ *
+ * @return True if the buffer is full, false if not
+ */
+ bool full() {
+ return _full;
+ }
+
+ /** Reset the buffer
+ *
+ */
+ void reset() {
+ _head = 0;
+ _tail = 0;
+ _full = false;
+ }
+
+private:
+ T _pool[BufferSize];
+ volatile CounterType _head;
+ volatile CounterType _tail;
+ volatile bool _full;
+};
+
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/DigitalIn.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,107 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DIGITALIN_H
+#define MBED_DIGITALIN_H
+
+#include "platform.h"
+
+#include "gpio_api.h"
+
+namespace mbed {
+
+/** A digital input, used for reading the state of a pin
+ *
+ * Example:
+ * @code
+ * // Flash an LED while a DigitalIn is true
+ *
+ * #include "mbed.h"
+ *
+ * DigitalIn enable(p5);
+ * DigitalOut led(LED1);
+ *
+ * int main() {
+ * while(1) {
+ * if(enable) {
+ * led = !led;
+ * }
+ * wait(0.25);
+ * }
+ * }
+ * @endcode
+ */
+class DigitalIn {
+
+public:
+ /** Create a DigitalIn connected to the specified pin
+ *
+ * @param pin DigitalIn pin to connect to
+ */
+ DigitalIn(PinName pin) : gpio() {
+ gpio_init_in(&gpio, pin);
+ }
+
+ /** Create a DigitalIn connected to the specified pin
+ *
+ * @param pin DigitalIn pin to connect to
+ * @param mode the initial mode of the pin
+ */
+ DigitalIn(PinName pin, PinMode mode) : gpio() {
+ gpio_init_in_ex(&gpio, pin, mode);
+ }
+ /** Read the input, represented as 0 or 1 (int)
+ *
+ * @returns
+ * An integer representing the state of the input pin,
+ * 0 for logical 0, 1 for logical 1
+ */
+ int read() {
+ return gpio_read(&gpio);
+ }
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone, OpenDrain
+ */
+ void mode(PinMode pull) {
+ gpio_mode(&gpio, pull);
+ }
+
+ /** Return the output setting, represented as 0 or 1 (int)
+ *
+ * @returns
+ * Non zero value if pin is connected to uc GPIO
+ * 0 if gpio object was initialized with NC
+ */
+ int is_connected() {
+ return gpio_is_connected(&gpio);
+ }
+
+#ifdef MBED_OPERATORS
+ /** An operator shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+#endif
+
+protected:
+ gpio_t gpio;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/DigitalInOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,124 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DIGITALINOUT_H
+#define MBED_DIGITALINOUT_H
+
+#include "platform.h"
+
+#include "gpio_api.h"
+
+namespace mbed {
+
+/** A digital input/output, used for setting or reading a bi-directional pin
+ */
+class DigitalInOut {
+
+public:
+ /** Create a DigitalInOut connected to the specified pin
+ *
+ * @param pin DigitalInOut pin to connect to
+ */
+ DigitalInOut(PinName pin) : gpio() {
+ gpio_init_in(&gpio, pin);
+ }
+
+ /** Create a DigitalInOut connected to the specified pin
+ *
+ * @param pin DigitalInOut pin to connect to
+ * @param direction the initial direction of the pin
+ * @param mode the initial mode of the pin
+ * @param value the initial value of the pin if is an output
+ */
+ DigitalInOut(PinName pin, PinDirection direction, PinMode mode, int value) : gpio() {
+ gpio_init_inout(&gpio, pin, direction, mode, value);
+ }
+
+ /** Set the output, specified as 0 or 1 (int)
+ *
+ * @param value An integer specifying the pin output value,
+ * 0 for logical 0, 1 (or any other non-zero value) for logical 1
+ */
+ void write(int value) {
+ gpio_write(&gpio, value);
+ }
+
+ /** Return the output setting, represented as 0 or 1 (int)
+ *
+ * @returns
+ * an integer representing the output setting of the pin if it is an output,
+ * or read the input if set as an input
+ */
+ int read() {
+ return gpio_read(&gpio);
+ }
+
+ /** Set as an output
+ */
+ void output() {
+ gpio_dir(&gpio, PIN_OUTPUT);
+ }
+
+ /** Set as an input
+ */
+ void input() {
+ gpio_dir(&gpio, PIN_INPUT);
+ }
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone, OpenDrain
+ */
+ void mode(PinMode pull) {
+ gpio_mode(&gpio, pull);
+ }
+
+ /** Return the output setting, represented as 0 or 1 (int)
+ *
+ * @returns
+ * Non zero value if pin is connected to uc GPIO
+ * 0 if gpio object was initialized with NC
+ */
+ int is_connected() {
+ return gpio_is_connected(&gpio);
+ }
+
+#ifdef MBED_OPERATORS
+ /** A shorthand for write()
+ */
+ DigitalInOut& operator= (int value) {
+ write(value);
+ return *this;
+ }
+
+ DigitalInOut& operator= (DigitalInOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** A shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+#endif
+
+protected:
+ gpio_t gpio;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/DigitalOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,116 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DIGITALOUT_H
+#define MBED_DIGITALOUT_H
+
+#include "platform.h"
+#include "gpio_api.h"
+
+namespace mbed {
+
+/** A digital output, used for setting the state of a pin
+ *
+ * Example:
+ * @code
+ * // Toggle a LED
+ * #include "mbed.h"
+ *
+ * DigitalOut led(LED1);
+ *
+ * int main() {
+ * while(1) {
+ * led = !led;
+ * wait(0.2);
+ * }
+ * }
+ * @endcode
+ */
+class DigitalOut {
+
+public:
+ /** Create a DigitalOut connected to the specified pin
+ *
+ * @param pin DigitalOut pin to connect to
+ */
+ DigitalOut(PinName pin) : gpio() {
+ gpio_init_out(&gpio, pin);
+ }
+
+ /** Create a DigitalOut connected to the specified pin
+ *
+ * @param pin DigitalOut pin to connect to
+ * @param value the initial pin value
+ */
+ DigitalOut(PinName pin, int value) : gpio() {
+ gpio_init_out_ex(&gpio, pin, value);
+ }
+
+ /** Set the output, specified as 0 or 1 (int)
+ *
+ * @param value An integer specifying the pin output value,
+ * 0 for logical 0, 1 (or any other non-zero value) for logical 1
+ */
+ void write(int value) {
+ gpio_write(&gpio, value);
+ }
+
+ /** Return the output setting, represented as 0 or 1 (int)
+ *
+ * @returns
+ * an integer representing the output setting of the pin,
+ * 0 for logical 0, 1 for logical 1
+ */
+ int read() {
+ return gpio_read(&gpio);
+ }
+
+ /** Return the output setting, represented as 0 or 1 (int)
+ *
+ * @returns
+ * Non zero value if pin is connected to uc GPIO
+ * 0 if gpio object was initialized with NC
+ */
+ int is_connected() {
+ return gpio_is_connected(&gpio);
+ }
+
+#ifdef MBED_OPERATORS
+ /** A shorthand for write()
+ */
+ DigitalOut& operator= (int value) {
+ write(value);
+ return *this;
+ }
+
+ DigitalOut& operator= (DigitalOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** A shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+#endif
+
+protected:
+ gpio_t gpio;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/DirHandle.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,104 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DIRHANDLE_H
+#define MBED_DIRHANDLE_H
+
+#if defined(__ARMCC_VERSION) || defined(__ICCARM__)
+# define NAME_MAX 255
+typedef int mode_t;
+
+#else
+# include <sys/syslimits.h>
+#endif
+
+#include "FileHandle.h"
+
+struct dirent {
+ char d_name[NAME_MAX+1];
+};
+
+namespace mbed {
+
+/** Represents a directory stream. Objects of this type are returned
+ * by a FileSystemLike's opendir method. Implementations must define
+ * at least closedir, readdir and rewinddir.
+ *
+ * If a FileSystemLike class defines the opendir method, then the
+ * directories of an object of that type can be accessed by
+ * DIR *d = opendir("/example/directory") (or opendir("/example")
+ * to open the root of the filesystem), and then using readdir(d) etc.
+ *
+ * The root directory is considered to contain all FileLike and
+ * FileSystemLike objects, so the DIR* returned by opendir("/") will
+ * reflect this.
+ */
+class DirHandle {
+
+public:
+ /** Closes the directory.
+ *
+ * @returns
+ * 0 on success,
+ * -1 on error.
+ */
+ virtual int closedir()=0;
+
+ /** Return the directory entry at the current position, and
+ * advances the position to the next entry.
+ *
+ * @returns
+ * A pointer to a dirent structure representing the
+ * directory entry at the current position, or NULL on reaching
+ * end of directory or error.
+ */
+ virtual struct dirent *readdir()=0;
+
+ /** Resets the position to the beginning of the directory.
+ */
+ virtual void rewinddir()=0;
+
+ /** Returns the current position of the DirHandle.
+ *
+ * @returns
+ * the current position,
+ * -1 on error.
+ */
+ virtual off_t telldir() { return -1; }
+
+ /** Sets the position of the DirHandle.
+ *
+ * @param location The location to seek to. Must be a value returned by telldir.
+ */
+ virtual void seekdir(off_t location) { }
+
+ virtual ~DirHandle() {}
+};
+
+} // namespace mbed
+
+typedef mbed::DirHandle DIR;
+
+extern "C" {
+ DIR *opendir(const char*);
+ struct dirent *readdir(DIR *);
+ int closedir(DIR*);
+ void rewinddir(DIR*);
+ long telldir(DIR*);
+ void seekdir(DIR*, long);
+ int mkdir(const char *name, mode_t n);
+};
+
+#endif /* MBED_DIRHANDLE_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Ethernet.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,170 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ETHERNET_H
+#define MBED_ETHERNET_H
+
+#include "platform.h"
+
+#if DEVICE_ETHERNET
+
+namespace mbed {
+
+/** An ethernet interface, to use with the ethernet pins.
+ *
+ * Example:
+ * @code
+ * // Read destination and source from every ethernet packet
+ *
+ * #include "mbed.h"
+ *
+ * Ethernet eth;
+ *
+ * int main() {
+ * char buf[0x600];
+ *
+ * while(1) {
+ * int size = eth.receive();
+ * if(size > 0) {
+ * eth.read(buf, size);
+ * printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\n",
+ * buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
+ * printf("Source: %02X:%02X:%02X:%02X:%02X:%02X\n",
+ * buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]);
+ * }
+ *
+ * wait(1);
+ * }
+ * }
+ * @endcode
+ */
+class Ethernet {
+
+public:
+
+ /** Initialise the ethernet interface.
+ */
+ Ethernet();
+
+ /** Powers the hardware down.
+ */
+ virtual ~Ethernet();
+
+ enum Mode {
+ AutoNegotiate,
+ HalfDuplex10,
+ FullDuplex10,
+ HalfDuplex100,
+ FullDuplex100
+ };
+
+ /** Writes into an outgoing ethernet packet.
+ *
+ * It will append size bytes of data to the previously written bytes.
+ *
+ * @param data An array to write.
+ * @param size The size of data.
+ *
+ * @returns
+ * The number of written bytes.
+ */
+ int write(const char *data, int size);
+
+ /** Send an outgoing ethernet packet.
+ *
+ * After filling in the data in an ethernet packet it must be send.
+ * Send will provide a new packet to write to.
+ *
+ * @returns
+ * 0 if the sending was failed,
+ * or the size of the packet successfully sent.
+ */
+ int send();
+
+ /** Recevies an arrived ethernet packet.
+ *
+ * Receiving an ethernet packet will drop the last received ethernet packet
+ * and make a new ethernet packet ready to read.
+ * If no ethernet packet is arrived it will return 0.
+ *
+ * @returns
+ * 0 if no ethernet packet is arrived,
+ * or the size of the arrived packet.
+ */
+ int receive();
+
+ /** Read from an recevied ethernet packet.
+ *
+ * After receive returnd a number bigger than 0it is
+ * possible to read bytes from this packet.
+ * Read will write up to size bytes into data.
+ *
+ * It is possible to use read multible times.
+ * Each time read will start reading after the last read byte before.
+ *
+ * @returns
+ * The number of byte read.
+ */
+ int read(char *data, int size);
+
+ /** Gives the ethernet address of the mbed.
+ *
+ * @param mac Must be a pointer to a 6 byte char array to copy the ethernet address in.
+ */
+ void address(char *mac);
+
+ /** Returns if an ethernet link is pressent or not. It takes a wile after Ethernet initializion to show up.
+ *
+ * @returns
+ * 0 if no ethernet link is pressent,
+ * 1 if an ethernet link is pressent.
+ *
+ * Example:
+ * @code
+ * // Using the Ethernet link function
+ * #include "mbed.h"
+ *
+ * Ethernet eth;
+ *
+ * int main() {
+ * wait(1); // Needed after startup.
+ * if (eth.link()) {
+ * printf("online\n");
+ * } else {
+ * printf("offline\n");
+ * }
+ * }
+ * @endcode
+ */
+ int link();
+
+ /** Sets the speed and duplex parameters of an ethernet link
+ *
+ * - AutoNegotiate Auto negotiate speed and duplex
+ * - HalfDuplex10 10 Mbit, half duplex
+ * - FullDuplex10 10 Mbit, full duplex
+ * - HalfDuplex100 100 Mbit, half duplex
+ * - FullDuplex100 100 Mbit, full duplex
+ *
+ * @param mode the speed and duplex mode to set the link to:
+ */
+ void set_link(Mode mode);
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FileBase.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,80 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FILEBASE_H
+#define MBED_FILEBASE_H
+
+typedef int FILEHANDLE;
+
+#include <stdio.h>
+
+#if defined(__ARMCC_VERSION) || defined(__ICCARM__)
+# define O_RDONLY 0
+# define O_WRONLY 1
+# define O_RDWR 2
+# define O_CREAT 0x0200
+# define O_TRUNC 0x0400
+# define O_APPEND 0x0008
+
+# define NAME_MAX 255
+
+typedef int mode_t;
+typedef int ssize_t;
+typedef long off_t;
+
+#else
+# include <sys/fcntl.h>
+# include <sys/types.h>
+# include <sys/syslimits.h>
+#endif
+
+#include "platform.h"
+
+namespace mbed {
+
+typedef enum {
+ FilePathType,
+ FileSystemPathType
+} PathType;
+
+class FileBase {
+public:
+ FileBase(const char *name, PathType t);
+
+ virtual ~FileBase();
+
+ const char* getName(void);
+ PathType getPathType(void);
+
+ static FileBase *lookup(const char *name, unsigned int len);
+
+ static FileBase *get(int n);
+
+protected:
+ static FileBase *_head;
+
+ FileBase *_next;
+ const char *_name;
+ PathType _path_type;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ FileBase(const FileBase&);
+ FileBase & operator = (const FileBase&);
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FileHandle.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,119 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FILEHANDLE_H
+#define MBED_FILEHANDLE_H
+
+typedef int FILEHANDLE;
+
+#include <stdio.h>
+
+#if defined(__ARMCC_VERSION) || defined(__ICCARM__)
+typedef int ssize_t;
+typedef long off_t;
+
+#else
+# include <sys/types.h>
+#endif
+
+namespace mbed {
+
+/** An OO equivalent of the internal FILEHANDLE variable
+ * and associated _sys_* functions.
+ *
+ * FileHandle is an abstract class, needing at least sys_write and
+ * sys_read to be implmented for a simple interactive device.
+ *
+ * No one ever directly tals to/instanciates a FileHandle - it gets
+ * created by FileSystem, and wrapped up by stdio.
+ */
+class FileHandle {
+
+public:
+ /** Write the contents of a buffer to the file
+ *
+ * @param buffer the buffer to write from
+ * @param length the number of characters to write
+ *
+ * @returns
+ * The number of characters written (possibly 0) on success, -1 on error.
+ */
+ virtual ssize_t write(const void* buffer, size_t length) = 0;
+
+ /** Close the file
+ *
+ * @returns
+ * Zero on success, -1 on error.
+ */
+ virtual int close() = 0;
+
+ /** Function read
+ * Reads the contents of the file into a buffer
+ *
+ * @param buffer the buffer to read in to
+ * @param length the number of characters to read
+ *
+ * @returns
+ * The number of characters read (zero at end of file) on success, -1 on error.
+ */
+ virtual ssize_t read(void* buffer, size_t length) = 0;
+
+ /** Check if the handle is for a interactive terminal device.
+ * If so, line buffered behaviour is used by default
+ *
+ * @returns
+ * 1 if it is a terminal,
+ * 0 otherwise
+ */
+ virtual int isatty() = 0;
+
+ /** Move the file position to a given offset from a given location.
+ *
+ * @param offset The offset from whence to move to
+ * @param whence SEEK_SET for the start of the file, SEEK_CUR for the
+ * current file position, or SEEK_END for the end of the file.
+ *
+ * @returns
+ * new file position on success,
+ * -1 on failure or unsupported
+ */
+ virtual off_t lseek(off_t offset, int whence) = 0;
+
+ /** Flush any buffers associated with the FileHandle, ensuring it
+ * is up to date on disk
+ *
+ * @returns
+ * 0 on success or un-needed,
+ * -1 on error
+ */
+ virtual int fsync() = 0;
+
+ virtual off_t flen() {
+ /* remember our current position */
+ off_t pos = lseek(0, SEEK_CUR);
+ if(pos == -1) return -1;
+ /* seek to the end to get the file length */
+ off_t res = lseek(0, SEEK_END);
+ /* return to our old position */
+ lseek(pos, SEEK_SET);
+ return res;
+ }
+
+ virtual ~FileHandle();
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FileLike.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,44 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FILELIKE_H
+#define MBED_FILELIKE_H
+
+#include "FileBase.h"
+#include "FileHandle.h"
+
+namespace mbed {
+
+/* Class FileLike
+ * A file-like object is one that can be opened with fopen by
+ * fopen("/name", mode). It is intersection of the classes Base and
+ * FileHandle.
+ */
+class FileLike : public FileHandle, public FileBase {
+
+public:
+ /* Constructor FileLike
+ *
+ * Variables
+ * name - The name to use to open the file.
+ */
+ FileLike(const char *name);
+
+ virtual ~FileLike();
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FilePath.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,46 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FILEPATH_H
+#define MBED_FILEPATH_H
+
+#include "platform.h"
+
+#include "FileSystemLike.h"
+#include "FileLike.h"
+
+namespace mbed {
+
+class FilePath {
+public:
+ FilePath(const char* file_path);
+
+ const char* fileName(void);
+
+ bool isFileSystem(void);
+ FileSystemLike* fileSystem(void);
+
+ bool isFile(void);
+ FileLike* file(void);
+ bool exists(void);
+
+private:
+ const char* file_name;
+ FileBase* fb;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FileSystemLike.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,104 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FILESYSTEMLIKE_H
+#define MBED_FILESYSTEMLIKE_H
+
+#include "platform.h"
+
+#include "FileBase.h"
+#include "FileHandle.h"
+#include "DirHandle.h"
+
+namespace mbed {
+
+/** A filesystem-like object is one that can be used to open files
+ * though it by fopen("/name/filename", mode)
+ *
+ * Implementations must define at least open (the default definitions
+ * of the rest of the functions just return error values).
+ */
+class FileSystemLike : public FileBase {
+
+public:
+ /** FileSystemLike constructor
+ *
+ * @param name The name to use for the filesystem.
+ */
+ FileSystemLike(const char *name);
+
+ virtual ~FileSystemLike();
+
+ static DirHandle *opendir();
+ friend class BaseDirHandle;
+
+ /** Opens a file from the filesystem
+ *
+ * @param filename The name of the file to open.
+ * @param flags One of O_RDONLY, O_WRONLY, or O_RDWR, OR'd with
+ * zero or more of O_CREAT, O_TRUNC, or O_APPEND.
+ *
+ * @returns
+ * A pointer to a FileHandle object representing the
+ * file on success, or NULL on failure.
+ */
+ virtual FileHandle *open(const char *filename, int flags) = 0;
+
+ /** Remove a file from the filesystem.
+ *
+ * @param filename the name of the file to remove.
+ * @param returns 0 on success, -1 on failure.
+ */
+ virtual int remove(const char *filename) { return -1; };
+
+ /** Rename a file in the filesystem.
+ *
+ * @param oldname the name of the file to rename.
+ * @param newname the name to rename it to.
+ *
+ * @returns
+ * 0 on success,
+ * -1 on failure.
+ */
+ virtual int rename(const char *oldname, const char *newname) { return -1; };
+
+ /** Opens a directory in the filesystem and returns a DirHandle
+ * representing the directory stream.
+ *
+ * @param name The name of the directory to open.
+ *
+ * @returns
+ * A DirHandle representing the directory stream, or
+ * NULL on failure.
+ */
+ virtual DirHandle *opendir(const char *name) { return NULL; };
+
+ /** Creates a directory in the filesystem.
+ *
+ * @param name The name of the directory to create.
+ * @param mode The permissions to create the directory with.
+ *
+ * @returns
+ * 0 on success,
+ * -1 on failure.
+ */
+ virtual int mkdir(const char *name, mode_t mode) { return -1; }
+
+ // TODO other filesystem functions (mkdir, rm, rn, ls etc)
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/FunctionPointer.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,202 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_FUNCTIONPOINTER_H
+#define MBED_FUNCTIONPOINTER_H
+
+#include <string.h>
+#include <stdint.h>
+
+namespace mbed {
+
+/* If we had variaditic templates, this wouldn't be a problem, but until C++11 is enabled, we are stuck with multiple classes... */
+
+/** A class for storing and calling a pointer to a static or member function
+ */
+template <typename R, typename A1>
+class FunctionPointerArg1{
+public:
+ /** Create a FunctionPointer, attaching a static function
+ *
+ * @param function The static function to attach (default is none)
+ */
+ FunctionPointerArg1(R (*function)(A1) = 0) {
+ attach(function);
+ }
+
+ /** Create a FunctionPointer, attaching a member function
+ *
+ * @param object The object pointer to invoke the member function on (i.e. the this pointer)
+ * @param function The address of the member function to attach
+ */
+ template<typename T>
+ FunctionPointerArg1(T *object, R (T::*member)(A1)) {
+ attach(object, member);
+ }
+
+ /** Attach a static function
+ *
+ * @param function The static function to attach (default is none)
+ */
+ void attach(R (*function)(A1)) {
+ _p.function = function;
+ _membercaller = 0;
+ }
+
+ /** Attach a member function
+ *
+ * @param object The object pointer to invoke the member function on (i.e. the this pointer)
+ * @param function The address of the member function to attach
+ */
+ template<typename T>
+ void attach(T *object, R (T::*member)(A1)) {
+ _p.object = static_cast<void*>(object);
+ *reinterpret_cast<R (T::**)(A1)>(_member) = member;
+ _membercaller = &FunctionPointerArg1::membercaller<T>;
+ }
+
+ /** Call the attached static or member function
+ */
+ R call(A1 a) {
+ if (_membercaller == 0 && _p.function) {
+ return _p.function(a);
+ } else if (_membercaller && _p.object) {
+ return _membercaller(_p.object, _member, a);
+ }
+ return (R)0;
+ }
+
+ /** Get registered static function
+ */
+ R(*get_function(A1))() {
+ return _membercaller ? (R(*)(A1))0 : (R(*)(A1))_p.function;
+ }
+
+#ifdef MBED_OPERATORS
+ R operator ()(A1 a) {
+ return call(a);
+ }
+ operator bool(void) const {
+ return (_membercaller != NULL ? _p.object : (void*)_p.function) != NULL;
+ }
+#endif
+private:
+ template<typename T>
+ static R membercaller(void *object, uintptr_t *member, A1 a) {
+ T* o = static_cast<T*>(object);
+ R (T::**m)(A1) = reinterpret_cast<R (T::**)(A1)>(member);
+ return (o->**m)(a);
+ }
+
+ union {
+ R (*function)(A1); // static function pointer
+ void *object; // object this pointer
+ } _p;
+ uintptr_t _member[4]; // aligned raw member function pointer storage - converted back by registered _membercaller
+ R (*_membercaller)(void*, uintptr_t*, A1); // registered membercaller function to convert back and call _m.member on _object
+};
+
+/** A class for storing and calling a pointer to a static or member function (R ()(void))
+ */
+template <typename R>
+class FunctionPointerArg1<R, void>{
+public:
+ /** Create a FunctionPointer, attaching a static function
+ *
+ * @param function The static function to attach (default is none)
+ */
+ FunctionPointerArg1(R (*function)(void) = 0) {
+ attach(function);
+ }
+
+ /** Create a FunctionPointer, attaching a member function
+ *
+ * @param object The object pointer to invoke the member function on (i.e. the this pointer)
+ * @param function The address of the void member function to attach
+ */
+ template<typename T>
+ FunctionPointerArg1(T *object, R (T::*member)(void)) {
+ attach(object, member);
+ }
+
+ /** Attach a static function
+ *
+ * @param function The void static function to attach (default is none)
+ */
+ void attach(R (*function)(void)) {
+ _p.function = function;
+ _membercaller = 0;
+ }
+
+ /** Attach a member function
+ *
+ * @param object The object pointer to invoke the member function on (i.e. the this pointer)
+ * @param function The address of the void member function to attach
+ */
+ template<typename T>
+ void attach(T *object, R (T::*member)(void)) {
+ _p.object = static_cast<void*>(object);
+ *reinterpret_cast<R (T::**)(void)>(_member) = member;
+ _membercaller = &FunctionPointerArg1::membercaller<T>;
+ }
+
+ /** Call the attached static or member function
+ */
+ R call(){
+ if (_membercaller == 0 && _p.function) {
+ return _p.function();
+ } else if (_membercaller && _p.object) {
+ return _membercaller(_p.object, _member);
+ }
+ return (R)0;
+ }
+
+ /** Get registered static function
+ */
+ R(*get_function())() {
+ return _membercaller ? (R(*)())0 : (R(*)())_p.function;
+ }
+
+#ifdef MBED_OPERATORS
+ R operator ()(void) {
+ return call();
+ }
+ operator bool(void) const {
+ return (_membercaller != NULL ? _p.object : (void*)_p.function) != NULL;
+ }
+#endif
+
+private:
+ template<typename T>
+ static R membercaller(void *object, uintptr_t *member) {
+ T* o = static_cast<T*>(object);
+ R (T::**m)(void) = reinterpret_cast<R (T::**)(void)>(member);
+ return (o->**m)();
+ }
+
+ union {
+ R (*function)(void); // static function pointer
+ void *object; // object this pointer
+ } _p;
+ uintptr_t _member[4]; // aligned raw member function pointer storage - converted back by registered _membercaller
+ R (*_membercaller)(void*, uintptr_t*); // registered membercaller function to convert back and call _m.member on _object
+};
+
+typedef FunctionPointerArg1<void, void> FunctionPointer;
+typedef FunctionPointerArg1<void, int> event_callback_t;
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/I2C.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,176 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_I2C_H
+#define MBED_I2C_H
+
+#include "platform.h"
+
+#if DEVICE_I2C
+
+#include "i2c_api.h"
+
+#if DEVICE_I2C_ASYNCH
+#include "CThunk.h"
+#include "dma_api.h"
+#include "FunctionPointer.h"
+#endif
+
+namespace mbed {
+
+/** An I2C Master, used for communicating with I2C slave devices
+ *
+ * Example:
+ * @code
+ * // Read from I2C slave at address 0x62
+ *
+ * #include "mbed.h"
+ *
+ * I2C i2c(p28, p27);
+ *
+ * int main() {
+ * int address = 0x62;
+ * char data[2];
+ * i2c.read(address, data, 2);
+ * }
+ * @endcode
+ */
+class I2C {
+
+public:
+ enum RxStatus {
+ NoData,
+ MasterGeneralCall,
+ MasterWrite,
+ MasterRead
+ };
+
+ enum Acknowledge {
+ NoACK = 0,
+ ACK = 1
+ };
+
+ /** Create an I2C Master interface, connected to the specified pins
+ *
+ * @param sda I2C data line pin
+ * @param scl I2C clock line pin
+ */
+ I2C(PinName sda, PinName scl);
+
+ /** Set the frequency of the I2C interface
+ *
+ * @param hz The bus frequency in hertz
+ */
+ void frequency(int hz);
+
+ /** Read from an I2C slave
+ *
+ * Performs a complete read transaction. The bottom bit of
+ * the address is forced to 1 to indicate a read.
+ *
+ * @param address 8-bit I2C slave address [ addr | 1 ]
+ * @param data Pointer to the byte-array to read data in to
+ * @param length Number of bytes to read
+ * @param repeated Repeated start, true - don't send stop at end
+ *
+ * @returns
+ * 0 on success (ack),
+ * non-0 on failure (nack)
+ */
+ int read(int address, char *data, int length, bool repeated = false);
+
+ /** Read a single byte from the I2C bus
+ *
+ * @param ack indicates if the byte is to be acknowledged (1 = acknowledge)
+ *
+ * @returns
+ * the byte read
+ */
+ int read(int ack);
+
+ /** Write to an I2C slave
+ *
+ * Performs a complete write transaction. The bottom bit of
+ * the address is forced to 0 to indicate a write.
+ *
+ * @param address 8-bit I2C slave address [ addr | 0 ]
+ * @param data Pointer to the byte-array data to send
+ * @param length Number of bytes to send
+ * @param repeated Repeated start, true - do not send stop at end
+ *
+ * @returns
+ * 0 on success (ack),
+ * non-0 on failure (nack)
+ */
+ int write(int address, const char *data, int length, bool repeated = false);
+
+ /** Write single byte out on the I2C bus
+ *
+ * @param data data to write out on bus
+ *
+ * @returns
+ * '1' if an ACK was received,
+ * '0' otherwise
+ */
+ int write(int data);
+
+ /** Creates a start condition on the I2C bus
+ */
+
+ void start(void);
+
+ /** Creates a stop condition on the I2C bus
+ */
+ void stop(void);
+
+#if DEVICE_I2C_ASYNCH
+
+ /** Start non-blocking I2C transfer.
+ *
+ * @param address 8/10 bit I2c slave address
+ * @param tx_buffer The TX buffer with data to be transfered
+ * @param tx_length The length of TX buffer in bytes
+ * @param rx_buffer The RX buffer which is used for received data
+ * @param rx_length The length of RX buffer in bytes
+ * @param event The logical OR of events to modify
+ * @param callback The event callback function
+ * @param repeated Repeated start, true - do not send stop at end
+ * @return Zero if the transfer has started, or -1 if I2C peripheral is busy
+ */
+ int transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false);
+
+ /** Abort the on-going I2C transfer
+ */
+ void abort_transfer();
+protected:
+ void irq_handler_asynch(void);
+ event_callback_t _callback;
+ CThunk<I2C> _irq;
+ DMAUsage _usage;
+#endif
+
+protected:
+ void aquire();
+
+ i2c_t _i2c;
+ static I2C *_owner;
+ int _hz;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/I2CSlave.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,154 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_I2C_SLAVE_H
+#define MBED_I2C_SLAVE_H
+
+#include "platform.h"
+
+#if DEVICE_I2CSLAVE
+
+#include "i2c_api.h"
+
+namespace mbed {
+
+/** An I2C Slave, used for communicating with an I2C Master device
+ *
+ * Example:
+ * @code
+ * // Simple I2C responder
+ * #include <mbed.h>
+ *
+ * I2CSlave slave(p9, p10);
+ *
+ * int main() {
+ * char buf[10];
+ * char msg[] = "Slave!";
+ *
+ * slave.address(0xA0);
+ * while (1) {
+ * int i = slave.receive();
+ * switch (i) {
+ * case I2CSlave::ReadAddressed:
+ * slave.write(msg, strlen(msg) + 1); // Includes null char
+ * break;
+ * case I2CSlave::WriteGeneral:
+ * slave.read(buf, 10);
+ * printf("Read G: %s\n", buf);
+ * break;
+ * case I2CSlave::WriteAddressed:
+ * slave.read(buf, 10);
+ * printf("Read A: %s\n", buf);
+ * break;
+ * }
+ * for(int i = 0; i < 10; i++) buf[i] = 0; // Clear buffer
+ * }
+ * }
+ * @endcode
+ */
+class I2CSlave {
+
+public:
+ enum RxStatus {
+ NoData = 0,
+ ReadAddressed = 1,
+ WriteGeneral = 2,
+ WriteAddressed = 3
+ };
+
+ /** Create an I2C Slave interface, connected to the specified pins.
+ *
+ * @param sda I2C data line pin
+ * @param scl I2C clock line pin
+ */
+ I2CSlave(PinName sda, PinName scl);
+
+ /** Set the frequency of the I2C interface
+ *
+ * @param hz The bus frequency in hertz
+ */
+ void frequency(int hz);
+
+ /** Checks to see if this I2C Slave has been addressed.
+ *
+ * @returns
+ * A status indicating if the device has been addressed, and how
+ * - NoData - the slave has not been addressed
+ * - ReadAddressed - the master has requested a read from this slave
+ * - WriteAddressed - the master is writing to this slave
+ * - WriteGeneral - the master is writing to all slave
+ */
+ int receive(void);
+
+ /** Read from an I2C master.
+ *
+ * @param data pointer to the byte array to read data in to
+ * @param length maximum number of bytes to read
+ *
+ * @returns
+ * 0 on success,
+ * non-0 otherwise
+ */
+ int read(char *data, int length);
+
+ /** Read a single byte from an I2C master.
+ *
+ * @returns
+ * the byte read
+ */
+ int read(void);
+
+ /** Write to an I2C master.
+ *
+ * @param data pointer to the byte array to be transmitted
+ * @param length the number of bytes to transmite
+ *
+ * @returns
+ * 0 on success,
+ * non-0 otherwise
+ */
+ int write(const char *data, int length);
+
+ /** Write a single byte to an I2C master.
+ *
+ * @data the byte to write
+ *
+ * @returns
+ * '1' if an ACK was received,
+ * '0' otherwise
+ */
+ int write(int data);
+
+ /** Sets the I2C slave address.
+ *
+ * @param address The address to set for the slave (ignoring the least
+ * signifcant bit). If set to 0, the slave will only respond to the
+ * general call address.
+ */
+ void address(int address);
+
+ /** Reset the I2C slave back into the known ready receiving state.
+ */
+ void stop(void);
+
+protected:
+ i2c_t _i2c;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/InterruptIn.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,135 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_INTERRUPTIN_H
+#define MBED_INTERRUPTIN_H
+
+#include "platform.h"
+
+#if DEVICE_INTERRUPTIN
+
+#include "gpio_api.h"
+#include "gpio_irq_api.h"
+#include "FunctionPointer.h"
+
+namespace mbed {
+
+/** A digital interrupt input, used to call a function on a rising or falling edge
+ *
+ * Example:
+ * @code
+ * // Flash an LED while waiting for events
+ *
+ * #include "mbed.h"
+ *
+ * InterruptIn event(p16);
+ * DigitalOut led(LED1);
+ *
+ * void trigger() {
+ * printf("triggered!\n");
+ * }
+ *
+ * int main() {
+ * event.rise(&trigger);
+ * while(1) {
+ * led = !led;
+ * wait(0.25);
+ * }
+ * }
+ * @endcode
+ */
+class InterruptIn {
+
+public:
+
+ /** Create an InterruptIn connected to the specified pin
+ *
+ * @param pin InterruptIn pin to connect to
+ * @param name (optional) A string to identify the object
+ */
+ InterruptIn(PinName pin);
+ virtual ~InterruptIn();
+
+ int read();
+#ifdef MBED_OPERATORS
+ operator int();
+
+#endif
+
+ /** Attach a function to call when a rising edge occurs on the input
+ *
+ * @param fptr A pointer to a void function, or 0 to set as none
+ */
+ void rise(void (*fptr)(void));
+
+ /** Attach a member function to call when a rising edge occurs on the input
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ */
+ template<typename T>
+ void rise(T* tptr, void (T::*mptr)(void)) {
+ _rise.attach(tptr, mptr);
+ gpio_irq_set(&gpio_irq, IRQ_RISE, 1);
+ }
+
+ /** Attach a function to call when a falling edge occurs on the input
+ *
+ * @param fptr A pointer to a void function, or 0 to set as none
+ */
+ void fall(void (*fptr)(void));
+
+ /** Attach a member function to call when a falling edge occurs on the input
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ */
+ template<typename T>
+ void fall(T* tptr, void (T::*mptr)(void)) {
+ _fall.attach(tptr, mptr);
+ gpio_irq_set(&gpio_irq, IRQ_FALL, 1);
+ }
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone
+ */
+ void mode(PinMode pull);
+
+ /** Enable IRQ. This method depends on hw implementation, might enable one
+ * port interrupts. For further information, check gpio_irq_enable().
+ */
+ void enable_irq();
+
+ /** Disable IRQ. This method depends on hw implementation, might disable one
+ * port interrupts. For further information, check gpio_irq_disable().
+ */
+ void disable_irq();
+
+ static void _irq_handler(uint32_t id, gpio_irq_event event);
+
+protected:
+ gpio_t gpio;
+ gpio_irq_t gpio_irq;
+
+ FunctionPointer _rise;
+ FunctionPointer _fall;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/InterruptManager.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,143 @@
+#ifndef MBED_INTERRUPTMANAGER_H
+#define MBED_INTERRUPTMANAGER_H
+
+#include "cmsis.h"
+#include "CallChain.h"
+#include <string.h>
+
+namespace mbed {
+
+/** Use this singleton if you need to chain interrupt handlers.
+ *
+ * Example (for LPC1768):
+ * @code
+ * #include "InterruptManager.h"
+ * #include "mbed.h"
+ *
+ * Ticker flipper;
+ * DigitalOut led1(LED1);
+ * DigitalOut led2(LED2);
+ *
+ * void flip(void) {
+ * led1 = !led1;
+ * }
+ *
+ * void handler(void) {
+ * led2 = !led1;
+ * }
+ *
+ * int main() {
+ * led1 = led2 = 0;
+ * flipper.attach(&flip, 1.0);
+ * InterruptManager::get()->add_handler(handler, TIMER3_IRQn);
+ * }
+ * @endcode
+ */
+class InterruptManager {
+public:
+ /** Return the only instance of this class
+ */
+ static InterruptManager* get();
+
+ /** Destroy the current instance of the interrupt manager
+ */
+ static void destroy();
+
+ /** Add a handler for an interrupt at the end of the handler list
+ *
+ * @param function the handler to add
+ * @param irq interrupt number
+ *
+ * @returns
+ * The function object created for 'function'
+ */
+ pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) {
+ return add_common(function, irq);
+ }
+
+ /** Add a handler for an interrupt at the beginning of the handler list
+ *
+ * @param function the handler to add
+ * @param irq interrupt number
+ *
+ * @returns
+ * The function object created for 'function'
+ */
+ pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) {
+ return add_common(function, irq, true);
+ }
+
+ /** Add a handler for an interrupt at the end of the handler list
+ *
+ * @param tptr pointer to the object that has the handler function
+ * @param mptr pointer to the actual handler function
+ * @param irq interrupt number
+ *
+ * @returns
+ * The function object created for 'tptr' and 'mptr'
+ */
+ template<typename T>
+ pFunctionPointer_t add_handler(T* tptr, void (T::*mptr)(void), IRQn_Type irq) {
+ return add_common(tptr, mptr, irq);
+ }
+
+ /** Add a handler for an interrupt at the beginning of the handler list
+ *
+ * @param tptr pointer to the object that has the handler function
+ * @param mptr pointer to the actual handler function
+ * @param irq interrupt number
+ *
+ * @returns
+ * The function object created for 'tptr' and 'mptr'
+ */
+ template<typename T>
+ pFunctionPointer_t add_handler_front(T* tptr, void (T::*mptr)(void), IRQn_Type irq) {
+ return add_common(tptr, mptr, irq, true);
+ }
+
+ /** Remove a handler from an interrupt
+ *
+ * @param handler the function object for the handler to remove
+ * @param irq the interrupt number
+ *
+ * @returns
+ * true if the handler was found and removed, false otherwise
+ */
+ bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
+
+private:
+ InterruptManager();
+ ~InterruptManager();
+
+ // We declare the copy contructor and the assignment operator, but we don't
+ // implement them. This way, if someone tries to copy/assign our instance,
+ // he will get an error at compile time.
+ InterruptManager(const InterruptManager&);
+ InterruptManager& operator =(const InterruptManager&);
+
+ template<typename T>
+ pFunctionPointer_t add_common(T *tptr, void (T::*mptr)(void), IRQn_Type irq, bool front=false) {
+ int irq_pos = get_irq_index(irq);
+ bool change = must_replace_vector(irq);
+
+ pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(tptr, mptr) : _chains[irq_pos]->add(tptr, mptr);
+ if (change)
+ NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper);
+ return pf;
+ }
+
+ pFunctionPointer_t add_common(void (*function)(void), IRQn_Type irq, bool front=false);
+ bool must_replace_vector(IRQn_Type irq);
+ int get_irq_index(IRQn_Type irq);
+ void irq_helper();
+ void add_helper(void (*function)(void), IRQn_Type irq, bool front=false);
+ static void static_irq_helper();
+
+ CallChain* _chains[NVIC_NUM_VECTORS];
+ static InterruptManager* _instance;
+};
+
+} // namespace mbed
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/LocalFileSystem.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,103 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_LOCALFILESYSTEM_H
+#define MBED_LOCALFILESYSTEM_H
+
+#include "platform.h"
+
+#if DEVICE_LOCALFILESYSTEM
+
+#include "FileSystemLike.h"
+
+namespace mbed {
+
+FILEHANDLE local_file_open(const char* name, int flags);
+
+class LocalFileHandle : public FileHandle {
+
+public:
+ LocalFileHandle(FILEHANDLE fh);
+
+ virtual int close();
+
+ virtual ssize_t write(const void *buffer, size_t length);
+
+ virtual ssize_t read(void *buffer, size_t length);
+
+ virtual int isatty();
+
+ virtual off_t lseek(off_t position, int whence);
+
+ virtual int fsync();
+
+ virtual off_t flen();
+
+protected:
+ FILEHANDLE _fh;
+ int pos;
+};
+
+/** A filesystem for accessing the local mbed Microcontroller USB disk drive
+ *
+ * This allows programs to read and write files on the same disk drive that is used to program the
+ * mbed Microcontroller. Once created, the standard C file access functions are used to open,
+ * read and write files.
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * LocalFileSystem local("local"); // Create the local filesystem under the name "local"
+ *
+ * int main() {
+ * FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing
+ * fprintf(fp, "Hello World!");
+ * fclose(fp);
+ * remove("/local/out.txt"); // Removes the file "out.txt" from the local file system
+ *
+ * DIR *d = opendir("/local"); // Opens the root directory of the local file system
+ * struct dirent *p;
+ * while((p = readdir(d)) != NULL) { // Print the names of the files in the local file system
+ * printf("%s\n", p->d_name); // to stdout.
+ * }
+ * closedir(d);
+ * }
+ * @endcode
+ *
+ * @note
+ * If the microcontroller program makes an access to the local drive, it will be marked as "removed"
+ * on the Host computer. This means it is no longer accessible from the Host Computer.
+ *
+ * The drive will only re-appear when the microcontroller program exists. Note that if the program does
+ * not exit, you will need to hold down reset on the mbed Microcontroller to be able to see the drive again!
+ */
+class LocalFileSystem : public FileSystemLike {
+
+public:
+ LocalFileSystem(const char* n) : FileSystemLike(n) {
+
+ }
+
+ virtual FileHandle *open(const char* name, int flags);
+ virtual int remove(const char *filename);
+ virtual DirHandle *opendir(const char *name);
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/LowPowerTicker.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,44 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_LOWPOWERTICKER_H
+#define MBED_LOWPOWERTICKER_H
+
+#include "platform.h"
+#include "Ticker.h"
+
+#if DEVICE_LOWPOWERTIMER
+
+#include "lp_ticker_api.h"
+
+namespace mbed {
+
+/** Low Power Ticker
+ */
+class LowPowerTicker : public Ticker {
+
+public:
+ LowPowerTicker() : Ticker(get_lp_ticker_data()) {
+ }
+
+ virtual ~LowPowerTicker() {
+ }
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/LowPowerTimeout.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,42 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_LOWPOWERTIMEOUT_H
+#define MBED_LOWPOWERTIMEOUT_H
+
+#include "platform.h"
+
+#if DEVICE_LOWPOWERTIMER
+
+#include "lp_ticker_api.h"
+#include "LowPowerTicker.h"
+
+namespace mbed {
+
+/** Low Power Timout
+ */
+class LowPowerTimeout : public LowPowerTicker {
+
+private:
+ virtual void handler(void) {
+ _function.call();
+ }
+};
+
+}
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/LowPowerTimer.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,42 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_LOWPOWERTIMER_H
+#define MBED_LOWPOWERTIMER_H
+
+#include "platform.h"
+#include "Timer.h"
+
+#if DEVICE_LOWPOWERTIMER
+
+#include "lp_ticker_api.h"
+
+namespace mbed {
+
+/** Low power timer
+ */
+class LowPowerTimer : public Timer {
+
+public:
+ LowPowerTimer() : Timer(get_lp_ticker_data()) {
+ }
+
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/PortIn.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,93 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PORTIN_H
+#define MBED_PORTIN_H
+
+#include "platform.h"
+
+#if DEVICE_PORTIN
+
+#include "port_api.h"
+
+namespace mbed {
+
+/** A multiple pin digital input
+ *
+ * Example:
+ * @code
+ * // Switch on an LED if any of mbed pins 21-26 is high
+ *
+ * #include "mbed.h"
+ *
+ * PortIn p(Port2, 0x0000003F); // p21-p26
+ * DigitalOut ind(LED4);
+ *
+ * int main() {
+ * while(1) {
+ * int pins = p.read();
+ * if(pins) {
+ * ind = 1;
+ * } else {
+ * ind = 0;
+ * }
+ * }
+ * }
+ * @endcode
+ */
+class PortIn {
+public:
+
+ /** Create an PortIn, connected to the specified port
+ *
+ * @param port Port to connect to (Port0-Port5)
+ * @param mask A bitmask to identify which bits in the port should be included (0 - ignore)
+ */
+ PortIn(PortName port, int mask = 0xFFFFFFFF) {
+ port_init(&_port, port, mask, PIN_INPUT);
+ }
+
+ /** Read the value currently output on the port
+ *
+ * @returns
+ * An integer with each bit corresponding to associated port pin setting
+ */
+ int read() {
+ return port_read(&_port);
+ }
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone, OpenDrain
+ */
+ void mode(PinMode mode) {
+ port_mode(&_port, mode);
+ }
+
+ /** A shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+
+private:
+ port_t _port;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/PortInOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,104 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PORTINOUT_H
+#define MBED_PORTINOUT_H
+
+#include "platform.h"
+
+#if DEVICE_PORTINOUT
+
+#include "port_api.h"
+
+namespace mbed {
+
+/** A multiple pin digital in/out used to set/read multiple bi-directional pins
+ */
+class PortInOut {
+public:
+
+ /** Create an PortInOut, connected to the specified port
+ *
+ * @param port Port to connect to (Port0-Port5)
+ * @param mask A bitmask to identify which bits in the port should be included (0 - ignore)
+ */
+ PortInOut(PortName port, int mask = 0xFFFFFFFF) {
+ port_init(&_port, port, mask, PIN_INPUT);
+ }
+
+ /** Write the value to the output port
+ *
+ * @param value An integer specifying a bit to write for every corresponding port pin
+ */
+ void write(int value) {
+ port_write(&_port, value);
+ }
+
+ /** Read the value currently output on the port
+ *
+ * @returns
+ * An integer with each bit corresponding to associated port pin setting
+ */
+ int read() {
+ return port_read(&_port);
+ }
+
+ /** Set as an output
+ */
+ void output() {
+ port_dir(&_port, PIN_OUTPUT);
+ }
+
+ /** Set as an input
+ */
+ void input() {
+ port_dir(&_port, PIN_INPUT);
+ }
+
+ /** Set the input pin mode
+ *
+ * @param mode PullUp, PullDown, PullNone, OpenDrain
+ */
+ void mode(PinMode mode) {
+ port_mode(&_port, mode);
+ }
+
+ /** A shorthand for write()
+ */
+ PortInOut& operator= (int value) {
+ write(value);
+ return *this;
+ }
+
+ PortInOut& operator= (PortInOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** A shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+
+private:
+ port_t _port;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/PortOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,104 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PORTOUT_H
+#define MBED_PORTOUT_H
+
+#include "platform.h"
+
+#if DEVICE_PORTOUT
+
+#include "port_api.h"
+
+namespace mbed {
+/** A multiple pin digital out
+ *
+ * Example:
+ * @code
+ * // Toggle all four LEDs
+ *
+ * #include "mbed.h"
+ *
+ * // LED1 = P1.18 LED2 = P1.20 LED3 = P1.21 LED4 = P1.23
+ * #define LED_MASK 0x00B40000
+ *
+ * PortOut ledport(Port1, LED_MASK);
+ *
+ * int main() {
+ * while(1) {
+ * ledport = LED_MASK;
+ * wait(1);
+ * ledport = 0;
+ * wait(1);
+ * }
+ * }
+ * @endcode
+ */
+class PortOut {
+public:
+
+ /** Create an PortOut, connected to the specified port
+ *
+ * @param port Port to connect to (Port0-Port5)
+ * @param mask A bitmask to identify which bits in the port should be included (0 - ignore)
+ */
+ PortOut(PortName port, int mask = 0xFFFFFFFF) {
+ port_init(&_port, port, mask, PIN_OUTPUT);
+ }
+
+ /** Write the value to the output port
+ *
+ * @param value An integer specifying a bit to write for every corresponding PortOut pin
+ */
+ void write(int value) {
+ port_write(&_port, value);
+ }
+
+ /** Read the value currently output on the port
+ *
+ * @returns
+ * An integer with each bit corresponding to associated PortOut pin setting
+ */
+ int read() {
+ return port_read(&_port);
+ }
+
+ /** A shorthand for write()
+ */
+ PortOut& operator= (int value) {
+ write(value);
+ return *this;
+ }
+
+ PortOut& operator= (PortOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** A shorthand for read()
+ */
+ operator int() {
+ return read();
+ }
+
+private:
+ port_t _port;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/PwmOut.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,158 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PWMOUT_H
+#define MBED_PWMOUT_H
+
+#include "platform.h"
+
+#if DEVICE_PWMOUT
+#include "pwmout_api.h"
+
+namespace mbed {
+
+/** A pulse-width modulation digital output
+ *
+ * Example
+ * @code
+ * // Fade a led on.
+ * #include "mbed.h"
+ *
+ * PwmOut led(LED1);
+ *
+ * int main() {
+ * while(1) {
+ * led = led + 0.01;
+ * wait(0.2);
+ * if(led == 1.0) {
+ * led = 0;
+ * }
+ * }
+ * }
+ * @endcode
+ *
+ * @note
+ * On the LPC1768 and LPC2368, the PWMs all share the same
+ * period - if you change the period for one, you change it for all.
+ * Although routines that change the period maintain the duty cycle
+ * for its PWM, all other PWMs will require their duty cycle to be
+ * refreshed.
+ */
+class PwmOut {
+
+public:
+
+ /** Create a PwmOut connected to the specified pin
+ *
+ * @param pin PwmOut pin to connect to
+ */
+ PwmOut(PinName pin) {
+ pwmout_init(&_pwm, pin);
+ }
+
+ /** Set the ouput duty-cycle, specified as a percentage (float)
+ *
+ * @param value A floating-point value representing the output duty-cycle,
+ * specified as a percentage. The value should lie between
+ * 0.0f (representing on 0%) and 1.0f (representing on 100%).
+ * Values outside this range will be saturated to 0.0f or 1.0f.
+ */
+ void write(float value) {
+ pwmout_write(&_pwm, value);
+ }
+
+ /** Return the current output duty-cycle setting, measured as a percentage (float)
+ *
+ * @returns
+ * A floating-point value representing the current duty-cycle being output on the pin,
+ * measured as a percentage. The returned value will lie between
+ * 0.0f (representing on 0%) and 1.0f (representing on 100%).
+ *
+ * @note
+ * This value may not match exactly the value set by a previous <write>.
+ */
+ float read() {
+ return pwmout_read(&_pwm);
+ }
+
+ /** Set the PWM period, specified in seconds (float), keeping the duty cycle the same.
+ *
+ * @note
+ * The resolution is currently in microseconds; periods smaller than this
+ * will be set to zero.
+ */
+ void period(float seconds) {
+ pwmout_period(&_pwm, seconds);
+ }
+
+ /** Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same.
+ */
+ void period_ms(int ms) {
+ pwmout_period_ms(&_pwm, ms);
+ }
+
+ /** Set the PWM period, specified in micro-seconds (int), keeping the duty cycle the same.
+ */
+ void period_us(int us) {
+ pwmout_period_us(&_pwm, us);
+ }
+
+ /** Set the PWM pulsewidth, specified in seconds (float), keeping the period the same.
+ */
+ void pulsewidth(float seconds) {
+ pwmout_pulsewidth(&_pwm, seconds);
+ }
+
+ /** Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same.
+ */
+ void pulsewidth_ms(int ms) {
+ pwmout_pulsewidth_ms(&_pwm, ms);
+ }
+
+ /** Set the PWM pulsewidth, specified in micro-seconds (int), keeping the period the same.
+ */
+ void pulsewidth_us(int us) {
+ pwmout_pulsewidth_us(&_pwm, us);
+ }
+
+#ifdef MBED_OPERATORS
+ /** A operator shorthand for write()
+ */
+ PwmOut& operator= (float value) {
+ write(value);
+ return *this;
+ }
+
+ PwmOut& operator= (PwmOut& rhs) {
+ write(rhs.read());
+ return *this;
+ }
+
+ /** An operator shorthand for read()
+ */
+ operator float() {
+ return read();
+ }
+#endif
+
+protected:
+ pwmout_t _pwm;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/RawSerial.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,90 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_RAW_SERIAL_H
+#define MBED_RAW_SERIAL_H
+
+#include "platform.h"
+
+#if DEVICE_SERIAL
+
+#include "SerialBase.h"
+#include "serial_api.h"
+
+namespace mbed {
+
+/** A serial port (UART) for communication with other serial devices
+ * This is a variation of the Serial class that doesn't use streams,
+ * thus making it safe to use in interrupt handlers with the RTOS.
+ *
+ * Can be used for Full Duplex communication, or Simplex by specifying
+ * one pin as NC (Not Connected)
+ *
+ * Example:
+ * @code
+ * // Send a char to the PC
+ *
+ * #include "mbed.h"
+ *
+ * RawSerial pc(USBTX, USBRX);
+ *
+ * int main() {
+ * pc.putc('A');
+ * }
+ * @endcode
+ */
+class RawSerial: public SerialBase {
+
+public:
+ /** Create a RawSerial port, connected to the specified transmit and receive pins
+ *
+ * @param tx Transmit pin
+ * @param rx Receive pin
+ *
+ * @note
+ * Either tx or rx may be specified as NC if unused
+ */
+ RawSerial(PinName tx, PinName rx);
+
+ /** Write a char to the serial port
+ *
+ * @param c The char to write
+ *
+ * @returns The written char or -1 if an error occured
+ */
+ int putc(int c);
+
+ /** Read a char from the serial port
+ *
+ * @returns The char read from the serial port
+ */
+ int getc();
+
+ /** Write a string to the serial port
+ *
+ * @param str The string to write
+ *
+ * @returns 0 if the write succeeds, EOF for error
+ */
+ int puts(const char *str);
+
+ int printf(const char *format, ...);
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/SPI.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,245 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SPI_H
+#define MBED_SPI_H
+
+#include "platform.h"
+
+#if DEVICE_SPI
+
+#include "spi_api.h"
+
+#if DEVICE_SPI_ASYNCH
+#include "CThunk.h"
+#include "dma_api.h"
+#include "CircularBuffer.h"
+#include "FunctionPointer.h"
+#include "Transaction.h"
+#endif
+
+namespace mbed {
+
+/** A SPI Master, used for communicating with SPI slave devices
+ *
+ * The default format is set to 8-bits, mode 0, and a clock frequency of 1MHz
+ *
+ * Most SPI devices will also require Chip Select and Reset signals. These
+ * can be controlled using <DigitalOut> pins
+ *
+ * Example:
+ * @code
+ * // Send a byte to a SPI slave, and record the response
+ *
+ * #include "mbed.h"
+ *
+ * // hardware ssel (where applicable)
+ * //SPI device(p5, p6, p7, p8); // mosi, miso, sclk, ssel
+ *
+ * // software ssel
+ * SPI device(p5, p6, p7); // mosi, miso, sclk
+ * DigitalOut cs(p8); // ssel
+ *
+ * int main() {
+ * // hardware ssel (where applicable)
+ * //int response = device.write(0xFF);
+ *
+ * // software ssel
+ * cs = 0;
+ * int response = device.write(0xFF);
+ * cs = 1;
+ * }
+ * @endcode
+ */
+class SPI {
+
+public:
+
+ /** Create a SPI master connected to the specified pins
+ *
+ * mosi or miso can be specfied as NC if not used
+ *
+ * @param mosi SPI Master Out, Slave In pin
+ * @param miso SPI Master In, Slave Out pin
+ * @param sclk SPI Clock pin
+ * @param ssel SPI chip select pin
+ */
+ SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel=NC);
+
+ /** Configure the data transmission format
+ *
+ * @param bits Number of bits per SPI frame (4 - 16)
+ * @param mode Clock polarity and phase mode (0 - 3)
+ *
+ * @code
+ * mode | POL PHA
+ * -----+--------
+ * 0 | 0 0
+ * 1 | 0 1
+ * 2 | 1 0
+ * 3 | 1 1
+ * @endcode
+ */
+ void format(int bits, int mode = 0);
+
+ /** Set the spi bus clock frequency
+ *
+ * @param hz SCLK frequency in hz (default = 1MHz)
+ */
+ void frequency(int hz = 1000000);
+
+ /** Write to the SPI Slave and return the response
+ *
+ * @param value Data to be sent to the SPI slave
+ *
+ * @returns
+ * Response from the SPI slave
+ */
+ virtual int write(int value);
+
+#if DEVICE_SPI_ASYNCH
+
+ /** Start non-blocking SPI transfer using 8bit buffers.
+ *
+ * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
+ * the default SPI value is sent
+ * @param tx_length The length of TX buffer in bytes
+ * @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
+ * received data are ignored
+ * @param rx_length The length of RX buffer in bytes
+ * @param callback The event callback function
+ * @param event The logical OR of events to modify. Look at spi hal header file for SPI events.
+ * @return Zero if the transfer has started, or -1 if SPI peripheral is busy
+ */
+ template<typename Type>
+ int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
+ if (spi_active(&_spi)) {
+ return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
+ }
+ start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
+ return 0;
+ }
+
+ /** Abort the on-going SPI transfer, and continue with transfer's in the queue if any.
+ */
+ void abort_transfer();
+
+ /** Clear the transaction buffer
+ */
+ void clear_transfer_buffer();
+
+ /** Clear the transaction buffer and abort on-going transfer.
+ */
+ void abort_all_transfers();
+
+ /** Configure DMA usage suggestion for non-blocking transfers
+ *
+ * @param usage The usage DMA hint for peripheral
+ * @return Zero if the usage was set, -1 if a transaction is on-going
+ */
+ int set_dma_usage(DMAUsage usage);
+
+protected:
+ /** SPI IRQ handler
+ *
+ */
+ void irq_handler_asynch(void);
+
+ /** Common transfer method
+ *
+ * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
+ * the default SPI value is sent
+ * @param tx_length The length of TX buffer in bytes
+ * @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
+ * received data are ignored
+ * @param rx_length The length of RX buffer in bytes
+ * @param bit_width The buffers element width
+ * @param callback The event callback function
+ * @param event The logical OR of events to modify
+ * @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full
+ */
+ int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+
+ /**
+ *
+ * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
+ * the default SPI value is sent
+ * @param tx_length The length of TX buffer in bytes
+ * @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
+ * received data are ignored
+ * @param rx_length The length of RX buffer in bytes
+ * @param bit_width The buffers element width
+ * @param callback The event callback function
+ * @param event The logical OR of events to modify
+ * @return Zero if a transfer was added to the queue, or -1 if the queue is full
+ */
+ int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+
+ /** Configures a callback, spi peripheral and initiate a new transfer
+ *
+ * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
+ * the default SPI value is sent
+ * @param tx_length The length of TX buffer in bytes
+ * @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
+ * received data are ignored
+ * @param rx_length The length of RX buffer in bytes
+ * @param bit_width The buffers element width
+ * @param callback The event callback function
+ * @param event The logical OR of events to modify
+ */
+ void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
+
+#if TRANSACTION_QUEUE_SIZE_SPI
+
+ /** Start a new transaction
+ *
+ * @param data Transaction data
+ */
+ void start_transaction(transaction_t *data);
+
+ /** Dequeue a transaction
+ *
+ */
+ void dequeue_transaction();
+ static CircularBuffer<Transaction<SPI>, TRANSACTION_QUEUE_SIZE_SPI> _transaction_buffer;
+#endif
+
+#endif
+
+public:
+ virtual ~SPI() {
+ }
+
+protected:
+ spi_t _spi;
+
+#if DEVICE_SPI_ASYNCH
+ CThunk<SPI> _irq;
+ event_callback_t _callback;
+ DMAUsage _usage;
+#endif
+
+ void aquire(void);
+ static SPI *_owner;
+ int _bits;
+ int _mode;
+ int _hz;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/SPISlave.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,122 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SPISLAVE_H
+#define MBED_SPISLAVE_H
+
+#include "platform.h"
+
+#if DEVICE_SPISLAVE
+
+#include "spi_api.h"
+
+namespace mbed {
+
+/** A SPI slave, used for communicating with a SPI Master device
+ *
+ * The default format is set to 8-bits, mode 0, and a clock frequency of 1MHz
+ *
+ * Example:
+ * @code
+ * // Reply to a SPI master as slave
+ *
+ * #include "mbed.h"
+ *
+ * SPISlave device(p5, p6, p7, p8); // mosi, miso, sclk, ssel
+ *
+ * int main() {
+ * device.reply(0x00); // Prime SPI with first reply
+ * while(1) {
+ * if(device.receive()) {
+ * int v = device.read(); // Read byte from master
+ * v = (v + 1) % 0x100; // Add one to it, modulo 256
+ * device.reply(v); // Make this the next reply
+ * }
+ * }
+ * }
+ * @endcode
+ */
+class SPISlave {
+
+public:
+
+ /** Create a SPI slave connected to the specified pins
+ *
+ * mosi or miso can be specfied as NC if not used
+ *
+ * @param mosi SPI Master Out, Slave In pin
+ * @param miso SPI Master In, Slave Out pin
+ * @param sclk SPI Clock pin
+ * @param ssel SPI chip select pin
+ */
+ SPISlave(PinName mosi, PinName miso, PinName sclk, PinName ssel);
+
+ /** Configure the data transmission format
+ *
+ * @param bits Number of bits per SPI frame (4 - 16)
+ * @param mode Clock polarity and phase mode (0 - 3)
+ *
+ * @code
+ * mode | POL PHA
+ * -----+--------
+ * 0 | 0 0
+ * 1 | 0 1
+ * 2 | 1 0
+ * 3 | 1 1
+ * @endcode
+ */
+ void format(int bits, int mode = 0);
+
+ /** Set the spi bus clock frequency
+ *
+ * @param hz SCLK frequency in hz (default = 1MHz)
+ */
+ void frequency(int hz = 1000000);
+
+ /** Polls the SPI to see if data has been received
+ *
+ * @returns
+ * 0 if no data,
+ * 1 otherwise
+ */
+ int receive(void);
+
+ /** Retrieve data from receive buffer as slave
+ *
+ * @returns
+ * the data in the receive buffer
+ */
+ int read(void);
+
+ /** Fill the transmission buffer with the value to be written out
+ * as slave on the next received message from the master.
+ *
+ * @param value the data to be transmitted next
+ */
+ void reply(int value);
+
+protected:
+ spi_t _spi;
+
+ int _bits;
+ int _mode;
+ int _hz;
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Serial.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,74 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SERIAL_H
+#define MBED_SERIAL_H
+
+#include "platform.h"
+
+#if DEVICE_SERIAL
+
+#include "Stream.h"
+#include "SerialBase.h"
+#include "serial_api.h"
+
+namespace mbed {
+
+/** A serial port (UART) for communication with other serial devices
+ *
+ * Can be used for Full Duplex communication, or Simplex by specifying
+ * one pin as NC (Not Connected)
+ *
+ * Example:
+ * @code
+ * // Print "Hello World" to the PC
+ *
+ * #include "mbed.h"
+ *
+ * Serial pc(USBTX, USBRX);
+ *
+ * int main() {
+ * pc.printf("Hello World\n");
+ * }
+ * @endcode
+ */
+class Serial : public SerialBase, public Stream {
+
+public:
+#if DEVICE_SERIAL_ASYNCH
+ using SerialBase::read;
+ using SerialBase::write;
+#endif
+
+ /** Create a Serial port, connected to the specified transmit and receive pins
+ *
+ * @param tx Transmit pin
+ * @param rx Receive pin
+ *
+ * @note
+ * Either tx or rx may be specified as NC if unused
+ */
+ Serial(PinName tx, PinName rx, const char *name=NULL);
+
+protected:
+ virtual int _getc();
+ virtual int _putc(int c);
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/SerialBase.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,223 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SERIALBASE_H
+#define MBED_SERIALBASE_H
+
+#include "platform.h"
+
+#if DEVICE_SERIAL
+
+#include "Stream.h"
+#include "FunctionPointer.h"
+#include "serial_api.h"
+
+#if DEVICE_SERIAL_ASYNCH
+#include "CThunk.h"
+#include "dma_api.h"
+#endif
+
+namespace mbed {
+
+/** A base class for serial port implementations
+ * Can't be instantiated directly (use Serial or RawSerial)
+ */
+class SerialBase {
+
+public:
+ /** Set the baud rate of the serial port
+ *
+ * @param baudrate The baudrate of the serial port (default = 9600).
+ */
+ void baud(int baudrate);
+
+ enum Parity {
+ None = 0,
+ Odd,
+ Even,
+ Forced1,
+ Forced0
+ };
+
+ enum IrqType {
+ RxIrq = 0,
+ TxIrq
+ };
+
+ enum Flow {
+ Disabled = 0,
+ RTS,
+ CTS,
+ RTSCTS
+ };
+
+ /** Set the transmission format used by the serial port
+ *
+ * @param bits The number of bits in a word (5-8; default = 8)
+ * @param parity The parity used (SerialBase::None, SerialBase::Odd, SerialBase::Even, SerialBase::Forced1, SerialBase::Forced0; default = SerialBase::None)
+ * @param stop The number of stop bits (1 or 2; default = 1)
+ */
+ void format(int bits=8, Parity parity=SerialBase::None, int stop_bits=1);
+
+ /** Determine if there is a character available to read
+ *
+ * @returns
+ * 1 if there is a character available to read,
+ * 0 otherwise
+ */
+ int readable();
+
+ /** Determine if there is space available to write a character
+ *
+ * @returns
+ * 1 if there is space to write a character,
+ * 0 otherwise
+ */
+ int writeable();
+
+ /** Attach a function to call whenever a serial interrupt is generated
+ *
+ * @param fptr A pointer to a void function, or 0 to set as none
+ * @param type Which serial interrupt to attach the member function to (Seriall::RxIrq for receive, TxIrq for transmit buffer empty)
+ */
+ void attach(void (*fptr)(void), IrqType type=RxIrq);
+
+ /** Attach a member function to call whenever a serial interrupt is generated
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ * @param type Which serial interrupt to attach the member function to (Seriall::RxIrq for receive, TxIrq for transmit buffer empty)
+ */
+ template<typename T>
+ void attach(T* tptr, void (T::*mptr)(void), IrqType type=RxIrq) {
+ if((mptr != NULL) && (tptr != NULL)) {
+ _irq[type].attach(tptr, mptr);
+ serial_irq_set(&_serial, (SerialIrq)type, 1);
+ } else {
+ serial_irq_set(&_serial, (SerialIrq)type, 0);
+ }
+ }
+
+ /** Generate a break condition on the serial line
+ */
+ void send_break();
+
+#if DEVICE_SERIAL_FC
+ /** Set the flow control type on the serial port
+ *
+ * @param type the flow control type (Disabled, RTS, CTS, RTSCTS)
+ * @param flow1 the first flow control pin (RTS for RTS or RTSCTS, CTS for CTS)
+ * @param flow2 the second flow control pin (CTS for RTSCTS)
+ */
+ void set_flow_control(Flow type, PinName flow1=NC, PinName flow2=NC);
+#endif
+
+ static void _irq_handler(uint32_t id, SerialIrq irq_type);
+
+#if DEVICE_SERIAL_ASYNCH
+
+ /** Begin asynchronous write using 8bit buffer. The completition invokes registered TX event callback
+ *
+ * @param buffer The buffer where received data will be stored
+ * @param length The buffer length in bytes
+ * @param callback The event callback function
+ * @param event The logical OR of TX events
+ */
+ int write(const uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
+
+ /** Begin asynchronous write using 16bit buffer. The completition invokes registered TX event callback
+ *
+ * @param buffer The buffer where received data will be stored
+ * @param length The buffer length in bytes
+ * @param callback The event callback function
+ * @param event The logical OR of TX events
+ */
+ int write(const uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE);
+
+ /** Abort the on-going write transfer
+ */
+ void abort_write();
+
+ /** Begin asynchronous reading using 8bit buffer. The completition invokes registred RX event callback.
+ *
+ * @param buffer The buffer where received data will be stored
+ * @param length The buffer length in bytes
+ * @param callback The event callback function
+ * @param event The logical OR of RX events
+ * @param char_match The matching character
+ */
+ int read(uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH);
+
+ /** Begin asynchronous reading using 16bit buffer. The completition invokes registred RX event callback.
+ *
+ * @param buffer The buffer where received data will be stored
+ * @param length The buffer length in bytes
+ * @param callback The event callback function
+ * @param event The logical OR of RX events
+ * @param char_match The matching character
+ */
+ int read(uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH);
+
+ /** Abort the on-going read transfer
+ */
+ void abort_read();
+
+ /** Configure DMA usage suggestion for non-blocking TX transfers
+ *
+ * @param usage The usage DMA hint for peripheral
+ * @return Zero if the usage was set, -1 if a transaction is on-going
+ */
+ int set_dma_usage_tx(DMAUsage usage);
+
+ /** Configure DMA usage suggestion for non-blocking RX transfers
+ *
+ * @param usage The usage DMA hint for peripheral
+ * @return Zero if the usage was set, -1 if a transaction is on-going
+ */
+ int set_dma_usage_rx(DMAUsage usage);
+
+protected:
+ void start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event, unsigned char char_match);
+ void start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event);
+ void interrupt_handler_asynch(void);
+#endif
+
+protected:
+ SerialBase(PinName tx, PinName rx);
+ virtual ~SerialBase() {
+ }
+
+ int _base_getc();
+ int _base_putc(int c);
+
+#if DEVICE_SERIAL_ASYNCH
+ CThunk<SerialBase> _thunk_irq;
+ event_callback_t _tx_callback;
+ event_callback_t _rx_callback;
+ DMAUsage _tx_usage;
+ DMAUsage _rx_usage;
+#endif
+
+ serial_t _serial;
+ FunctionPointer _irq[2];
+ int _baud;
+
+};
+
+} // namespace mbed
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Stream.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,65 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_STREAM_H
+#define MBED_STREAM_H
+
+#include "platform.h"
+#include "FileLike.h"
+
+namespace mbed {
+
+extern void mbed_set_unbuffered_stream(FILE *_file);
+extern int mbed_getc(FILE *_file);
+extern char* mbed_gets(char *s, int size, FILE *_file);
+
+class Stream : public FileLike {
+
+public:
+ Stream(const char *name=NULL);
+ virtual ~Stream();
+
+ int putc(int c);
+ int puts(const char *s);
+ int getc();
+ char *gets(char *s, int size);
+ int printf(const char* format, ...);
+ int scanf(const char* format, ...);
+
+ operator std::FILE*() {return _file;}
+
+protected:
+ virtual int close();
+ virtual ssize_t write(const void* buffer, size_t length);
+ virtual ssize_t read(void* buffer, size_t length);
+ virtual off_t lseek(off_t offset, int whence);
+ virtual int isatty();
+ virtual int fsync();
+ virtual off_t flen();
+
+ virtual int _putc(int c) = 0;
+ virtual int _getc() = 0;
+
+ std::FILE *_file;
+
+ /* disallow copy constructor and assignment operators */
+private:
+ Stream(const Stream&);
+ Stream & operator = (const Stream&);
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Ticker.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,127 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TICKER_H
+#define MBED_TICKER_H
+
+#include "TimerEvent.h"
+#include "FunctionPointer.h"
+
+namespace mbed {
+
+/** A Ticker is used to call a function at a recurring interval
+ *
+ * You can use as many seperate Ticker objects as you require.
+ *
+ * Example:
+ * @code
+ * // Toggle the blinking led after 5 seconds
+ *
+ * #include "mbed.h"
+ *
+ * Ticker timer;
+ * DigitalOut led1(LED1);
+ * DigitalOut led2(LED2);
+ *
+ * int flip = 0;
+ *
+ * void attime() {
+ * flip = !flip;
+ * }
+ *
+ * int main() {
+ * timer.attach(&attime, 5);
+ * while(1) {
+ * if(flip == 0) {
+ * led1 = !led1;
+ * } else {
+ * led2 = !led2;
+ * }
+ * wait(0.2);
+ * }
+ * }
+ * @endcode
+ */
+class Ticker : public TimerEvent {
+
+public:
+ Ticker() : TimerEvent() {
+ }
+
+ Ticker(const ticker_data_t *data) : TimerEvent(data) {
+ }
+
+ /** Attach a function to be called by the Ticker, specifiying the interval in seconds
+ *
+ * @param fptr pointer to the function to be called
+ * @param t the time between calls in seconds
+ */
+ void attach(void (*fptr)(void), float t) {
+ attach_us(fptr, t * 1000000.0f);
+ }
+
+ /** Attach a member function to be called by the Ticker, specifiying the interval in seconds
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ * @param t the time between calls in seconds
+ */
+ template<typename T>
+ void attach(T* tptr, void (T::*mptr)(void), float t) {
+ attach_us(tptr, mptr, t * 1000000.0f);
+ }
+
+ /** Attach a function to be called by the Ticker, specifiying the interval in micro-seconds
+ *
+ * @param fptr pointer to the function to be called
+ * @param t the time between calls in micro-seconds
+ */
+ void attach_us(void (*fptr)(void), timestamp_t t) {
+ _function.attach(fptr);
+ setup(t);
+ }
+
+ /** Attach a member function to be called by the Ticker, specifiying the interval in micro-seconds
+ *
+ * @param tptr pointer to the object to call the member function on
+ * @param mptr pointer to the member function to be called
+ * @param t the time between calls in micro-seconds
+ */
+ template<typename T>
+ void attach_us(T* tptr, void (T::*mptr)(void), timestamp_t t) {
+ _function.attach(tptr, mptr);
+ setup(t);
+ }
+
+ virtual ~Ticker() {
+ detach();
+ }
+
+ /** Detach the function
+ */
+ void detach();
+
+protected:
+ void setup(timestamp_t t);
+ virtual void handler();
+
+protected:
+ timestamp_t _delay; /**< Time delay (in microseconds) for re-setting the multi-shot callback. */
+ FunctionPointer _function; /**< Callback. */
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Timeout.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,59 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TIMEOUT_H
+#define MBED_TIMEOUT_H
+
+#include "Ticker.h"
+
+namespace mbed {
+
+/** A Timeout is used to call a function at a point in the future
+ *
+ * You can use as many seperate Timeout objects as you require.
+ *
+ * Example:
+ * @code
+ * // Blink until timeout.
+ *
+ * #include "mbed.h"
+ *
+ * Timeout timeout;
+ * DigitalOut led(LED1);
+ *
+ * int on = 1;
+ *
+ * void attimeout() {
+ * on = 0;
+ * }
+ *
+ * int main() {
+ * timeout.attach(&attimeout, 5);
+ * while(on) {
+ * led = !led;
+ * wait(0.2);
+ * }
+ * }
+ * @endcode
+ */
+class Timeout : public Ticker {
+
+protected:
+ virtual void handler();
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Timer.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,91 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TIMER_H
+#define MBED_TIMER_H
+
+#include "platform.h"
+#include "ticker_api.h"
+
+namespace mbed {
+
+/** A general purpose timer
+ *
+ * Example:
+ * @code
+ * // Count the time to toggle a LED
+ *
+ * #include "mbed.h"
+ *
+ * Timer timer;
+ * DigitalOut led(LED1);
+ * int begin, end;
+ *
+ * int main() {
+ * timer.start();
+ * begin = timer.read_us();
+ * led = !led;
+ * end = timer.read_us();
+ * printf("Toggle the led takes %d us", end - begin);
+ * }
+ * @endcode
+ */
+class Timer {
+
+public:
+ Timer();
+ Timer(const ticker_data_t *data);
+
+ /** Start the timer
+ */
+ void start();
+
+ /** Stop the timer
+ */
+ void stop();
+
+ /** Reset the timer to 0.
+ *
+ * If it was already counting, it will continue
+ */
+ void reset();
+
+ /** Get the time passed in seconds
+ */
+ float read();
+
+ /** Get the time passed in mili-seconds
+ */
+ int read_ms();
+
+ /** Get the time passed in micro-seconds
+ */
+ int read_us();
+
+#ifdef MBED_OPERATORS
+ operator float();
+#endif
+
+protected:
+ int slicetime();
+ int _running; // whether the timer is running
+ unsigned int _start; // the start time of the latest slice
+ int _time; // any accumulated time from previous slices
+ const ticker_data_t *_ticker_data;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/TimerEvent.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,56 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TIMEREVENT_H
+#define MBED_TIMEREVENT_H
+
+#include "ticker_api.h"
+#include "us_ticker_api.h"
+
+namespace mbed {
+
+/** Base abstraction for timer interrupts
+*/
+class TimerEvent {
+public:
+ TimerEvent();
+ TimerEvent(const ticker_data_t *data);
+
+ /** The handler registered with the underlying timer interrupt
+ */
+ static void irq(uint32_t id);
+
+ /** Destruction removes it...
+ */
+ virtual ~TimerEvent();
+
+protected:
+ // The handler called to service the timer event of the derived class
+ virtual void handler() = 0;
+
+ // insert in to linked list
+ void insert(timestamp_t timestamp);
+
+ // remove from linked list, if in it
+ void remove();
+
+ ticker_event_t event;
+
+ const ticker_data_t *_ticker_data;
+};
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/Transaction.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,73 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TRANSACTION_H
+#define MBED_TRANSACTION_H
+
+#include "platform.h"
+#include "FunctionPointer.h"
+
+namespace mbed {
+
+/** Transaction structure
+ */
+typedef struct {
+ void *tx_buffer; /**< Tx buffer */
+ size_t tx_length; /**< Length of Tx buffer*/
+ void *rx_buffer; /**< Rx buffer */
+ size_t rx_length; /**< Length of Rx buffer */
+ uint32_t event; /**< Event for a transaction */
+ event_callback_t callback; /**< User's callback */
+ uint8_t width; /**< Buffer's word width (8, 16, 32, 64) */
+} transaction_t;
+
+/** Transaction class defines a transaction.
+ */
+template<typename Class>
+class Transaction {
+public:
+ Transaction(Class *tpointer, const transaction_t& transaction) : _obj(tpointer), _data(transaction) {
+ }
+
+ Transaction() : _obj(), _data() {
+ }
+
+ ~Transaction() {
+ }
+
+ /** Get object's instance for the transaction
+ *
+ * @return The object which was stored
+ */
+ Class* get_object() {
+ return _obj;
+ }
+
+ /** Get the transaction
+ *
+ * @return The transaction which was stored
+ */
+ transaction_t* get_transaction() {
+ return &_data;
+ }
+
+private:
+ Class* _obj;
+ transaction_t _data;
+};
+
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/can_helper.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,53 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_CAN_HELPER_H
+#define MBED_CAN_HELPER_H
+
+#if DEVICE_CAN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum CANFormat {
+ CANStandard = 0,
+ CANExtended = 1,
+ CANAny = 2
+};
+typedef enum CANFormat CANFormat;
+
+enum CANType {
+ CANData = 0,
+ CANRemote = 1
+};
+typedef enum CANType CANType;
+
+struct CAN_Message {
+ unsigned int id; // 29 bit identifier
+ unsigned char data[8]; // Data field
+ unsigned char len; // Length of data field in bytes
+ CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER
+ CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME
+};
+typedef struct CAN_Message CAN_Message;
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
+
+#endif // MBED_CAN_HELPER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/api/mbed.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,69 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * 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. + */ +#ifndef MBED_H +#define MBED_H + +#define MBED_LIBRARY_VERSION 107 + +#include "platform.h" + +// Useful C libraries +#include <math.h> +#include <time.h> + +// mbed Debug libraries +#include "mbed_error.h" +#include "mbed_interface.h" + +// mbed Peripheral components +#include "DigitalIn.h" +#include "DigitalOut.h" +#include "DigitalInOut.h" +#include "BusIn.h" +#include "BusOut.h" +#include "BusInOut.h" +#include "PortIn.h" +#include "PortInOut.h" +#include "PortOut.h" +#include "AnalogIn.h" +#include "AnalogOut.h" +#include "PwmOut.h" +#include "Serial.h" +#include "SPI.h" +#include "SPISlave.h" +#include "I2C.h" +#include "I2CSlave.h" +#include "Ethernet.h" +#include "CAN.h" +#include "RawSerial.h" + +// mbed Internal components +#include "Timer.h" +#include "Ticker.h" +#include "Timeout.h" +#include "LowPowerTimeout.h" +#include "LowPowerTicker.h" +#include "LowPowerTimer.h" +#include "LocalFileSystem.h" +#include "InterruptIn.h" +#include "wait_api.h" +#include "sleep_api.h" +#include "rtc_time.h" + +using namespace mbed; +using namespace std; + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/mbed_assert.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,49 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ASSERT_H
+#define MBED_ASSERT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Internal mbed assert function which is invoked when MBED_ASSERT macro failes.
+ * This function is active only if NDEBUG is not defined prior to including this
+ * assert header file.
+ * In case of MBED_ASSERT failing condition, error() is called with the assertation message.
+ * @param expr Expresion to be checked.
+ * @param file File where assertation failed.
+ * @param line Failing assertation line number.
+ */
+void mbed_assert_internal(const char *expr, const char *file, int line);
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef NDEBUG
+#define MBED_ASSERT(expr) ((void)0)
+
+#else
+#define MBED_ASSERT(expr) \
+do { \
+ if (!(expr)) { \
+ mbed_assert_internal(#expr, __FILE__, __LINE__); \
+ } \
+} while (0)
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/mbed_debug.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,66 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DEBUG_H
+#define MBED_DEBUG_H
+#include "device.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if DEVICE_STDIO_MESSAGES
+#include <stdio.h>
+#include <stdarg.h>
+
+/** Output a debug message
+ *
+ * @param format printf-style format string, followed by variables
+ */
+static inline void debug(const char *format, ...) {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+}
+
+/** Conditionally output a debug message
+ *
+ * NOTE: If the condition is constant false (!= 1) and the compiler optimization
+ * level is greater than 0, then the whole function will be compiled away.
+ *
+ * @param condition output only if condition is true (== 1)
+ * @param format printf-style format string, followed by variables
+ */
+static inline void debug_if(int condition, const char *format, ...) {
+ if (condition == 1) {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stderr, format, args);
+ va_end(args);
+ }
+}
+
+#else
+static inline void debug(const char *format, ...) {}
+static inline void debug_if(int condition, const char *format, ...) {}
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/mbed_error.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,66 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ERROR_H
+#define MBED_ERROR_H
+
+/** To generate a fatal compile-time error, you can use the pre-processor #error directive.
+ *
+ * @code
+ * #error "That shouldn't have happened!"
+ * @endcode
+ *
+ * If the compiler evaluates this line, it will report the error and stop the compile.
+ *
+ * For example, you could use this to check some user-defined compile-time variables:
+ *
+ * @code
+ * #define NUM_PORTS 7
+ * #if (NUM_PORTS > 4)
+ * #error "NUM_PORTS must be less than 4"
+ * #endif
+ * @endcode
+ *
+ * Reporting Run-Time Errors:
+ * To generate a fatal run-time error, you can use the mbed error() function.
+ *
+ * @code
+ * error("That shouldn't have happened!");
+ * @endcode
+ *
+ * If the mbed running the program executes this function, it will print the
+ * message via the USB serial port, and then die with the blue lights of death!
+ *
+ * The message can use printf-style formatting, so you can report variables in the
+ * message too. For example, you could use this to check a run-time condition:
+ *
+ * @code
+ * if(x >= 5) {
+ * error("expected x to be less than 5, but got %d", x);
+ * }
+ * #endcode
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void error(const char* format, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/mbed_interface.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,114 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_INTERFACE_H
+#define MBED_INTERFACE_H
+
+#include "device.h"
+
+/* Mbed interface mac address
+ * if MBED_MAC_ADD_x are zero, interface uid sets mac address,
+ * otherwise MAC_ADD_x are used.
+ */
+#define MBED_MAC_ADDR_INTERFACE 0x00
+#define MBED_MAC_ADDR_0 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDR_1 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDR_2 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDR_3 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDR_4 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDR_5 MBED_MAC_ADDR_INTERFACE
+#define MBED_MAC_ADDRESS_SUM (MBED_MAC_ADDR_0 | MBED_MAC_ADDR_1 | MBED_MAC_ADDR_2 | MBED_MAC_ADDR_3 | MBED_MAC_ADDR_4 | MBED_MAC_ADDR_5)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if DEVICE_SEMIHOST
+
+/** Functions to control the mbed interface
+ *
+ * mbed Microcontrollers have a built-in interface to provide functionality such as
+ * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file
+ * system. These functions provide means to control the interface suing semihost
+ * calls it supports.
+ */
+
+/** Determine whether the mbed interface is connected, based on whether debug is enabled
+ *
+ * @returns
+ * 1 if interface is connected,
+ * 0 otherwise
+ */
+int mbed_interface_connected(void);
+
+/** Instruct the mbed interface to reset, as if the reset button had been pressed
+ *
+ * @returns
+ * 1 if successful,
+ * 0 otherwise (e.g. interface not present)
+ */
+int mbed_interface_reset(void);
+
+/** This will disconnect the debug aspect of the interface, so semihosting will be disabled.
+ * The interface will still support the USB serial aspect
+ *
+ * @returns
+ * 0 if successful,
+ * -1 otherwise (e.g. interface not present)
+ */
+int mbed_interface_disconnect(void);
+
+/** This will disconnect the debug aspect of the interface, and if the USB cable is not
+ * connected, also power down the interface. If the USB cable is connected, the interface
+ * will remain powered up and visible to the host
+ *
+ * @returns
+ * 0 if successful,
+ * -1 otherwise (e.g. interface not present)
+ */
+int mbed_interface_powerdown(void);
+
+/** This returns a string containing the 32-character UID of the mbed interface
+ * This is a weak function that can be overwritten if required
+ *
+ * @param uid A 33-byte array to write the null terminated 32-byte string
+ *
+ * @returns
+ * 0 if successful,
+ * -1 otherwise (e.g. interface not present)
+ */
+int mbed_interface_uid(char *uid);
+
+#endif
+
+/** This returns a unique 6-byte MAC address, based on the interface UID
+ * If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00)
+ *
+ * This is a weak function that can be overwritten if you want to provide your own mechanism to
+ * provide a MAC address.
+ *
+ * @param mac A 6-byte array to write the MAC address
+ */
+void mbed_mac_address(char *mac);
+
+/** Cause the mbed to flash the BLOD (Blue LEDs Of Death) sequence
+ */
+void mbed_die(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/api/platform.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,30 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * 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. + */ +#ifndef MBED_PLATFORM_H +#define MBED_PLATFORM_H + +#define MBED_OPERATORS 1 + +#include "device.h" +#include "PinNames.h" +#include "PeripheralNames.h" + +#include <cstddef> +#include <cstdlib> +#include <cstdio> +#include <cstring> + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/rtc_time.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,85 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Implementation of the C time.h functions
+ *
+ * Provides mechanisms to set and read the current time, based
+ * on the microcontroller Real-Time Clock (RTC), plus some
+ * standard C manipulation and formating functions.
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * int main() {
+ * set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37
+ *
+ * while(1) {
+ * time_t seconds = time(NULL);
+ *
+ * printf("Time as seconds since January 1, 1970 = %d\n", seconds);
+ *
+ * printf("Time as a basic string = %s", ctime(&seconds));
+ *
+ * char buffer[32];
+ * strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
+ * printf("Time as a custom formatted string = %s", buffer);
+ *
+ * wait(1);
+ * }
+ * }
+ * @endcode
+ */
+
+/** Set the current time
+ *
+ * Initialises and sets the time of the microcontroller Real-Time Clock (RTC)
+ * to the time represented by the number of seconds since January 1, 1970
+ * (the UNIX timestamp).
+ *
+ * @param t Number of seconds since January 1, 1970 (the UNIX timestamp)
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * int main() {
+ * set_time(1256729737); // Set time to Wed, 28 Oct 2009 11:35:37
+ * }
+ * @endcode
+ */
+void set_time(time_t t);
+
+/** Attach an external RTC to be used for the C time functions
+ *
+ * Do not call this function from an interrupt while an RTC read/write operation may be occurring
+ *
+ * @param read_rtc pointer to function which returns current UNIX timestamp
+ * @param write_rtc pointer to function which sets current UNIX timestamp, can be NULL
+ * @param init_rtc pointer to funtion which initializes RTC, can be NULL
+ * @param isenabled_rtc pointer to function wich returns if the rtc is enabled, can be NULL
+ */
+void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void));
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/semihost_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,93 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SEMIHOST_H
+#define MBED_SEMIHOST_H
+
+#include "device.h"
+#include "toolchain.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if DEVICE_SEMIHOST
+
+#ifndef __CC_ARM
+
+#if defined(__ICCARM__)
+inline int __semihost(int reason, const void *arg) {
+ return __semihosting(reason, (void*)arg);
+}
+#else
+
+#ifdef __thumb__
+# define AngelSWI 0xAB
+# define AngelSWIInsn "bkpt"
+# define AngelSWIAsm bkpt
+#else
+# define AngelSWI 0x123456
+# define AngelSWIInsn "swi"
+# define AngelSWIAsm swi
+#endif
+
+static inline int __semihost(int reason, const void *arg) {
+ int value;
+
+ asm volatile (
+ "mov r0, %1" "\n\t"
+ "mov r1, %2" "\n\t"
+ AngelSWIInsn " %a3" "\n\t"
+ "mov %0, r0"
+ : "=r" (value) /* output operands */
+ : "r" (reason), "r" (arg), "i" (AngelSWI) /* input operands */
+ : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" /* list of clobbered registers */
+ );
+
+ return value;
+}
+#endif
+#endif
+
+#if DEVICE_LOCALFILESYSTEM
+FILEHANDLE semihost_open(const char* name, int openmode);
+int semihost_close (FILEHANDLE fh);
+int semihost_read (FILEHANDLE fh, unsigned char* buffer, unsigned int length, int mode);
+int semihost_write (FILEHANDLE fh, const unsigned char* buffer, unsigned int length, int mode);
+int semihost_ensure(FILEHANDLE fh);
+long semihost_flen (FILEHANDLE fh);
+int semihost_seek (FILEHANDLE fh, long position);
+int semihost_istty (FILEHANDLE fh);
+
+int semihost_remove(const char *name);
+int semihost_rename(const char *old_name, const char *new_name);
+#endif
+
+int semihost_uid(char *uid);
+int semihost_reset(void);
+int semihost_vbus(void);
+int semihost_powerdown(void);
+int semihost_exit(void);
+
+int semihost_connected(void);
+int semihost_disabledebug(void);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/api/toolchain.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,35 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * 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. + */ +#ifndef MBED_TOOLCHAIN_H +#define MBED_TOOLCHAIN_H + +#if defined(TOOLCHAIN_ARM) +#include <rt_sys.h> +#endif + +#ifndef FILEHANDLE +typedef int FILEHANDLE; +#endif + +#if defined (__ICCARM__) +# define WEAK __weak +# define PACKED __packed +#else +# define WEAK __attribute__((weak)) +# define PACKED __attribute__((packed)) +#endif + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/api/wait_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,66 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_WAIT_API_H
+#define MBED_WAIT_API_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Generic wait functions.
+ *
+ * These provide simple NOP type wait capabilities.
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ *
+ * DigitalOut heartbeat(LED1);
+ *
+ * int main() {
+ * while (1) {
+ * heartbeat = 1;
+ * wait(0.5);
+ * heartbeat = 0;
+ * wait(0.5);
+ * }
+ * }
+ */
+
+/** Waits for a number of seconds, with microsecond resolution (within
+ * the accuracy of single precision floating point).
+ *
+ * @param s number of seconds to wait
+ */
+void wait(float s);
+
+/** Waits a number of milliseconds.
+ *
+ * @param ms the whole number of milliseconds to wait
+ */
+void wait_ms(int ms);
+
+/** Waits a number of microseconds.
+ *
+ * @param us the whole number of microseconds to wait
+ */
+void wait_us(int us);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/BusIn.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,82 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "BusIn.h"
+#include "mbed_assert.h"
+
+namespace mbed {
+
+BusIn::BusIn(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
+ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
+
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusIn::BusIn(PinName pins[16]) {
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusIn::~BusIn() {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ delete _pin[i];
+ }
+ }
+}
+
+int BusIn::read() {
+ int v = 0;
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ v |= _pin[i]->read() << i;
+ }
+ }
+ return v;
+}
+
+void BusIn::mode(PinMode pull) {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->mode(pull);
+ }
+ }
+}
+
+#ifdef MBED_OPERATORS
+BusIn::operator int() {
+ return read();
+}
+
+DigitalIn& BusIn::operator[] (int index) {
+ MBED_ASSERT(index >= 0 && index <= 16);
+ MBED_ASSERT(_pin[index]);
+ return *_pin[index];
+}
+
+#endif
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/BusInOut.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,115 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "BusInOut.h"
+#include "mbed_assert.h"
+
+namespace mbed {
+
+BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
+ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
+
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusInOut::BusInOut(PinName pins[16]) {
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusInOut::~BusInOut() {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ delete _pin[i];
+ }
+ }
+}
+
+void BusInOut::write(int value) {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->write((value >> i) & 1);
+ }
+ }
+}
+
+int BusInOut::read() {
+ int v = 0;
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ v |= _pin[i]->read() << i;
+ }
+ }
+ return v;
+}
+
+void BusInOut::output() {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->output();
+ }
+ }
+}
+
+void BusInOut::input() {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->input();
+ }
+ }
+}
+
+void BusInOut::mode(PinMode pull) {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->mode(pull);
+ }
+ }
+}
+
+#ifdef MBED_OPERATORS
+BusInOut& BusInOut::operator= (int v) {
+ write(v);
+ return *this;
+}
+
+BusInOut& BusInOut::operator= (BusInOut& rhs) {
+ write(rhs.read());
+ return *this;
+}
+
+DigitalInOut& BusInOut::operator[] (int index) {
+ MBED_ASSERT(index >= 0 && index <= 16);
+ MBED_ASSERT(_pin[index]);
+ return *_pin[index];
+}
+
+BusInOut::operator int() {
+ return read();
+}
+#endif
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/BusOut.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,91 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "BusOut.h"
+#include "mbed_assert.h"
+
+namespace mbed {
+
+BusOut::BusOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) {
+ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15};
+
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusOut::BusOut(PinName pins[16]) {
+ _nc_mask = 0;
+ for (int i=0; i<16; i++) {
+ _pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0;
+ if (pins[i] != NC) {
+ _nc_mask |= (1 << i);
+ }
+ }
+}
+
+BusOut::~BusOut() {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ delete _pin[i];
+ }
+ }
+}
+
+void BusOut::write(int value) {
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ _pin[i]->write((value >> i) & 1);
+ }
+ }
+}
+
+int BusOut::read() {
+ int v = 0;
+ for (int i=0; i<16; i++) {
+ if (_pin[i] != 0) {
+ v |= _pin[i]->read() << i;
+ }
+ }
+ return v;
+}
+
+#ifdef MBED_OPERATORS
+BusOut& BusOut::operator= (int v) {
+ write(v);
+ return *this;
+}
+
+BusOut& BusOut::operator= (BusOut& rhs) {
+ write(rhs.read());
+ return *this;
+}
+
+DigitalOut& BusOut::operator[] (int index) {
+ MBED_ASSERT(index >= 0 && index <= 16);
+ MBED_ASSERT(_pin[index]);
+ return *_pin[index];
+}
+
+BusOut::operator int() {
+ return read();
+}
+#endif
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/CAN.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,86 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "CAN.h"
+
+#if DEVICE_CAN
+
+#include "cmsis.h"
+
+namespace mbed {
+
+CAN::CAN(PinName rd, PinName td) : _can(), _irq() {
+ can_init(&_can, rd, td);
+ can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this);
+}
+
+CAN::~CAN() {
+ can_irq_free(&_can);
+ can_free(&_can);
+}
+
+int CAN::frequency(int f) {
+ return can_frequency(&_can, f);
+}
+
+int CAN::write(CANMessage msg) {
+ return can_write(&_can, msg, 0);
+}
+
+int CAN::read(CANMessage &msg, int handle) {
+ return can_read(&_can, &msg, handle);
+}
+
+void CAN::reset() {
+ can_reset(&_can);
+}
+
+unsigned char CAN::rderror() {
+ return can_rderror(&_can);
+}
+
+unsigned char CAN::tderror() {
+ return can_tderror(&_can);
+}
+
+void CAN::monitor(bool silent) {
+ can_monitor(&_can, (silent) ? 1 : 0);
+}
+
+int CAN::mode(Mode mode) {
+ return can_mode(&_can, (CanMode)mode);
+}
+
+int CAN::filter(unsigned int id, unsigned int mask, CANFormat format, int handle) {
+ return can_filter(&_can, id, mask, format, handle);
+}
+
+void CAN::attach(void (*fptr)(void), IrqType type) {
+ if (fptr) {
+ _irq[(CanIrqType)type].attach(fptr);
+ can_irq_set(&_can, (CanIrqType)type, 1);
+ } else {
+ can_irq_set(&_can, (CanIrqType)type, 0);
+ }
+}
+
+void CAN::_irq_handler(uint32_t id, CanIrqType type) {
+ CAN *handler = (CAN*)id;
+ handler->_irq[type].call();
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/CallChain.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,90 @@
+#include "CallChain.h"
+#include "cmsis.h"
+
+namespace mbed {
+
+CallChain::CallChain(int size) : _chain(), _size(size), _elements(0) {
+ _chain = new pFunctionPointer_t[size]();
+}
+
+CallChain::~CallChain() {
+ clear();
+ delete _chain;
+}
+
+pFunctionPointer_t CallChain::add(void (*function)(void)) {
+ return common_add(new FunctionPointer(function));
+}
+
+pFunctionPointer_t CallChain::add_front(void (*function)(void)) {
+ return common_add_front(new FunctionPointer(function));
+}
+
+int CallChain::size() const {
+ return _elements;
+}
+
+pFunctionPointer_t CallChain::get(int i) const {
+ if (i < 0 || i >= _elements)
+ return NULL;
+ return _chain[i];
+}
+
+int CallChain::find(pFunctionPointer_t f) const {
+ for (int i = 0; i < _elements; i++)
+ if (f == _chain[i])
+ return i;
+ return -1;
+}
+
+void CallChain::clear() {
+ for(int i = 0; i < _elements; i ++) {
+ delete _chain[i];
+ _chain[i] = NULL;
+ }
+ _elements = 0;
+}
+
+bool CallChain::remove(pFunctionPointer_t f) {
+ int i;
+
+ if ((i = find(f)) == -1)
+ return false;
+ if (i != _elements - 1)
+ memmove(_chain + i, _chain + i + 1, (_elements - i - 1) * sizeof(pFunctionPointer_t));
+ delete f;
+ _elements --;
+ return true;
+}
+
+void CallChain::call() {
+ for(int i = 0; i < _elements; i++)
+ _chain[i]->call();
+}
+
+void CallChain::_check_size() {
+ if (_elements < _size)
+ return;
+ _size = (_size < 4) ? 4 : _size + 4;
+ pFunctionPointer_t* new_chain = new pFunctionPointer_t[_size]();
+ memcpy(new_chain, _chain, _elements * sizeof(pFunctionPointer_t));
+ delete _chain;
+ _chain = new_chain;
+}
+
+pFunctionPointer_t CallChain::common_add(pFunctionPointer_t pf) {
+ _check_size();
+ _chain[_elements] = pf;
+ _elements ++;
+ return pf;
+}
+
+pFunctionPointer_t CallChain::common_add_front(pFunctionPointer_t pf) {
+ _check_size();
+ memmove(_chain + 1, _chain, _elements * sizeof(pFunctionPointer_t));
+ _chain[0] = pf;
+ _elements ++;
+ return pf;
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Ethernet.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,73 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Ethernet.h"
+
+#if DEVICE_ETHERNET
+
+#include "ethernet_api.h"
+
+namespace mbed {
+
+Ethernet::Ethernet() {
+ ethernet_init();
+}
+
+Ethernet::~Ethernet() {
+ ethernet_free();
+}
+
+int Ethernet::write(const char *data, int size) {
+ return ethernet_write(data, size);
+}
+
+int Ethernet::send() {
+ return ethernet_send();
+}
+
+int Ethernet::receive() {
+ return ethernet_receive();
+}
+
+int Ethernet::read(char *data, int size) {
+ return ethernet_read(data, size);
+}
+
+void Ethernet::address(char *mac) {
+ return ethernet_address(mac);
+}
+
+int Ethernet::link() {
+ return ethernet_link();
+}
+
+void Ethernet::set_link(Mode mode) {
+ int speed = -1;
+ int duplex = 0;
+
+ switch(mode) {
+ case AutoNegotiate : speed = -1; duplex = 0; break;
+ case HalfDuplex10 : speed = 0; duplex = 0; break;
+ case FullDuplex10 : speed = 0; duplex = 1; break;
+ case HalfDuplex100 : speed = 1; duplex = 0; break;
+ case FullDuplex100 : speed = 1; duplex = 1; break;
+ }
+
+ ethernet_set_link(speed, duplex);
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/FileBase.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,82 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "FileBase.h"
+
+namespace mbed {
+
+FileBase *FileBase::_head = NULL;
+
+FileBase::FileBase(const char *name, PathType t) : _next(NULL),
+ _name(name),
+ _path_type(t) {
+ if (name != NULL) {
+ // put this object at head of the list
+ _next = _head;
+ _head = this;
+ } else {
+ _next = NULL;
+ }
+}
+
+FileBase::~FileBase() {
+ if (_name != NULL) {
+ // remove this object from the list
+ if (_head == this) { // first in the list, so just drop me
+ _head = _next;
+ } else { // find the object before me, then drop me
+ FileBase *p = _head;
+ while (p->_next != this) {
+ p = p->_next;
+ }
+ p->_next = _next;
+ }
+ }
+}
+
+FileBase *FileBase::lookup(const char *name, unsigned int len) {
+ FileBase *p = _head;
+ while (p != NULL) {
+ /* Check that p->_name matches name and is the correct length */
+ if (p->_name != NULL && std::strncmp(p->_name, name, len) == 0 && std::strlen(p->_name) == len) {
+ return p;
+ }
+ p = p->_next;
+ }
+ return NULL;
+}
+
+FileBase *FileBase::get(int n) {
+ FileBase *p = _head;
+ int m = 0;
+ while (p != NULL) {
+ if (m == n) return p;
+
+ m++;
+ p = p->_next;
+ }
+ return NULL;
+}
+
+const char* FileBase::getName(void) {
+ return _name;
+}
+
+PathType FileBase::getPathType(void) {
+ return _path_type;
+}
+
+} // namespace mbed
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/FileLike.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,28 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "FileLike.h"
+
+namespace mbed {
+
+FileLike::FileLike(const char *name) : FileHandle(), FileBase(name, FilePathType) {
+
+}
+
+FileLike::~FileLike() {
+
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/FilePath.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,76 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "FilePath.h"
+
+namespace mbed {
+
+FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) {
+ if ((file_path[0] != '/') || (file_path[1] == 0)) return;
+
+ const char* file_system = &file_path[1];
+ file_name = file_system;
+ int len = 0;
+ while (true) {
+ char c = *file_name;
+ if (c == '/') { // end of object name
+ file_name++; // point to one char after the '/'
+ break;
+ }
+ if (c == 0) { // end of object name, with no filename
+ break;
+ }
+ len++;
+ file_name++;
+ }
+
+ fb = FileBase::lookup(file_system, len);
+}
+
+const char* FilePath::fileName(void) {
+ return file_name;
+}
+
+bool FilePath::isFileSystem(void) {
+ if (NULL == fb)
+ return false;
+ return (fb->getPathType() == FileSystemPathType);
+}
+
+FileSystemLike* FilePath::fileSystem(void) {
+ if (isFileSystem()) {
+ return (FileSystemLike*)fb;
+ }
+ return NULL;
+}
+
+bool FilePath::isFile(void) {
+ if (NULL == fb)
+ return false;
+ return (fb->getPathType() == FilePathType);
+}
+
+FileLike* FilePath::file(void) {
+ if (isFile()) {
+ return (FileLike*)fb;
+ }
+ return NULL;
+}
+
+bool FilePath::exists(void) {
+ return fb != NULL;
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/FileSystemLike.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,77 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "FileSystemLike.h"
+
+namespace mbed {
+
+class BaseDirHandle : public DirHandle {
+public:
+ /*
+ We keep track of our current location as the n'th object in the
+ FileSystemLike list. Using a Base* instead would cause problems if that
+ object were to be destroyed between readdirs.
+ Using this method does mean though that destroying/creating objects can
+ give unusual results from readdir.
+ */
+ off_t n;
+ struct dirent cur_entry;
+
+ BaseDirHandle() : n(0), cur_entry() {
+ }
+
+ virtual int closedir() {
+ delete this;
+ return 0;
+ }
+
+ virtual struct dirent *readdir() {
+ FileBase *ptr = FileBase::get(n);
+ if (ptr == NULL) return NULL;
+
+ /* Increment n, so next readdir gets the next item */
+ n++;
+
+ /* Setup cur entry and return a pointer to it */
+ std::strncpy(cur_entry.d_name, ptr->getName(), NAME_MAX);
+ return &cur_entry;
+ }
+
+ virtual off_t telldir() {
+ return n;
+ }
+
+ virtual void seekdir(off_t offset) {
+ n = offset;
+ }
+
+ virtual void rewinddir() {
+ n = 0;
+ }
+};
+
+FileSystemLike::FileSystemLike(const char *name) : FileBase(name, FileSystemPathType) {
+
+}
+
+FileSystemLike::~FileSystemLike() {
+
+}
+
+DirHandle *FileSystemLike::opendir() {
+ return new BaseDirHandle();
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/I2C.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,128 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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 "I2C.h"
+
+#if DEVICE_I2C
+
+namespace mbed {
+
+I2C *I2C::_owner = NULL;
+
+I2C::I2C(PinName sda, PinName scl) :
+#if DEVICE_I2C_ASYNCH
+ _irq(this), _usage(DMA_USAGE_NEVER),
+#endif
+ _i2c(), _hz(100000) {
+ // The init function also set the frequency to 100000
+ i2c_init(&_i2c, sda, scl);
+
+ // Used to avoid unnecessary frequency updates
+ _owner = this;
+}
+
+void I2C::frequency(int hz) {
+ _hz = hz;
+
+ // We want to update the frequency even if we are already the bus owners
+ i2c_frequency(&_i2c, _hz);
+
+ // Updating the frequency of the bus we become the owners of it
+ _owner = this;
+}
+
+void I2C::aquire() {
+ if (_owner != this) {
+ i2c_frequency(&_i2c, _hz);
+ _owner = this;
+ }
+}
+
+// write - Master Transmitter Mode
+int I2C::write(int address, const char* data, int length, bool repeated) {
+ aquire();
+
+ int stop = (repeated) ? 0 : 1;
+ int written = i2c_write(&_i2c, address, data, length, stop);
+
+ return length != written;
+}
+
+int I2C::write(int data) {
+ return i2c_byte_write(&_i2c, data);
+}
+
+// read - Master Reciever Mode
+int I2C::read(int address, char* data, int length, bool repeated) {
+ aquire();
+
+ int stop = (repeated) ? 0 : 1;
+ int read = i2c_read(&_i2c, address, data, length, stop);
+
+ return length != read;
+}
+
+int I2C::read(int ack) {
+ if (ack) {
+ return i2c_byte_read(&_i2c, 0);
+ } else {
+ return i2c_byte_read(&_i2c, 1);
+ }
+}
+
+void I2C::start(void) {
+ i2c_start(&_i2c);
+}
+
+void I2C::stop(void) {
+ i2c_stop(&_i2c);
+}
+
+#if DEVICE_I2C_ASYNCH
+
+int I2C::transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event, bool repeated)
+{
+ if (i2c_active(&_i2c)) {
+ return -1; // transaction ongoing
+ }
+ aquire();
+
+ _callback = callback;
+ int stop = (repeated) ? 0 : 1;
+ _irq.callback(&I2C::irq_handler_asynch);
+ i2c_transfer_asynch(&_i2c, (void *)tx_buffer, tx_length, (void *)rx_buffer, rx_length, address, stop, _irq.entry(), event, _usage);
+ return 0;
+}
+
+void I2C::abort_transfer(void)
+{
+ i2c_abort_asynch(&_i2c);
+}
+
+void I2C::irq_handler_asynch(void)
+{
+ int event = i2c_irq_handler_asynch(&_i2c);
+ if (_callback && event) {
+ _callback.call(event);
+ }
+
+}
+
+
+#endif
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/I2CSlave.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,63 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "I2CSlave.h"
+
+#if DEVICE_I2CSLAVE
+
+namespace mbed {
+
+I2CSlave::I2CSlave(PinName sda, PinName scl) : _i2c() {
+ i2c_init(&_i2c, sda, scl);
+ i2c_frequency(&_i2c, 100000);
+ i2c_slave_mode(&_i2c, 1);
+}
+
+void I2CSlave::frequency(int hz) {
+ i2c_frequency(&_i2c, hz);
+}
+
+void I2CSlave::address(int address) {
+ int addr = (address & 0xFF) | 1;
+ i2c_slave_address(&_i2c, 0, addr, 0);
+}
+
+int I2CSlave::receive(void) {
+ return i2c_slave_receive(&_i2c);
+}
+
+int I2CSlave::read(char *data, int length) {
+ return i2c_slave_read(&_i2c, data, length) != length;
+}
+
+int I2CSlave::read(void) {
+ return i2c_byte_read(&_i2c, 0);
+}
+
+int I2CSlave::write(const char *data, int length) {
+ return i2c_slave_write(&_i2c, data, length) != length;
+}
+
+int I2CSlave::write(int data) {
+ return i2c_byte_write(&_i2c, data);
+}
+
+void I2CSlave::stop(void) {
+ i2c_stop(&_i2c);
+}
+
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/InterruptIn.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,85 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "InterruptIn.h"
+
+#if DEVICE_INTERRUPTIN
+
+namespace mbed {
+
+InterruptIn::InterruptIn(PinName pin) : gpio(),
+ gpio_irq(),
+ _rise(),
+ _fall() {
+ gpio_irq_init(&gpio_irq, pin, (&InterruptIn::_irq_handler), (uint32_t)this);
+ gpio_init_in(&gpio, pin);
+}
+
+InterruptIn::~InterruptIn() {
+ gpio_irq_free(&gpio_irq);
+}
+
+int InterruptIn::read() {
+ return gpio_read(&gpio);
+}
+
+void InterruptIn::mode(PinMode pull) {
+ gpio_mode(&gpio, pull);
+}
+
+void InterruptIn::rise(void (*fptr)(void)) {
+ if (fptr) {
+ _rise.attach(fptr);
+ gpio_irq_set(&gpio_irq, IRQ_RISE, 1);
+ } else {
+ gpio_irq_set(&gpio_irq, IRQ_RISE, 0);
+ }
+}
+
+void InterruptIn::fall(void (*fptr)(void)) {
+ if (fptr) {
+ _fall.attach(fptr);
+ gpio_irq_set(&gpio_irq, IRQ_FALL, 1);
+ } else {
+ gpio_irq_set(&gpio_irq, IRQ_FALL, 0);
+ }
+}
+
+void InterruptIn::_irq_handler(uint32_t id, gpio_irq_event event) {
+ InterruptIn *handler = (InterruptIn*)id;
+ switch (event) {
+ case IRQ_RISE: handler->_rise.call(); break;
+ case IRQ_FALL: handler->_fall.call(); break;
+ case IRQ_NONE: break;
+ }
+}
+
+void InterruptIn::enable_irq() {
+ gpio_irq_enable(&gpio_irq);
+}
+
+void InterruptIn::disable_irq() {
+ gpio_irq_disable(&gpio_irq);
+}
+
+#ifdef MBED_OPERATORS
+InterruptIn::operator int() {
+ return read();
+}
+#endif
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/InterruptManager.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,93 @@
+#include "cmsis.h"
+#if defined(NVIC_NUM_VECTORS)
+
+#include "InterruptManager.h"
+#include <string.h>
+
+#define CHAIN_INITIAL_SIZE 4
+
+namespace mbed {
+
+typedef void (*pvoidf)(void);
+
+InterruptManager* InterruptManager::_instance = (InterruptManager*)NULL;
+
+InterruptManager* InterruptManager::get() {
+ if (NULL == _instance)
+ _instance = new InterruptManager();
+ return _instance;
+}
+
+InterruptManager::InterruptManager() {
+ memset(_chains, 0, NVIC_NUM_VECTORS * sizeof(CallChain*));
+}
+
+void InterruptManager::destroy() {
+ // Not a good idea to call this unless NO interrupt at all
+ // is under the control of the handler; otherwise, a system crash
+ // is very likely to occur
+ if (NULL != _instance) {
+ delete _instance;
+ _instance = (InterruptManager*)NULL;
+ }
+}
+
+InterruptManager::~InterruptManager() {
+ for(int i = 0; i < NVIC_NUM_VECTORS; i++)
+ if (NULL != _chains[i])
+ delete _chains[i];
+}
+
+bool InterruptManager::must_replace_vector(IRQn_Type irq) {
+ int irq_pos = get_irq_index(irq);
+
+ if (NULL == _chains[irq_pos]) {
+ _chains[irq_pos] = new CallChain(CHAIN_INITIAL_SIZE);
+ _chains[irq_pos]->add((pvoidf)NVIC_GetVector(irq));
+ return true;
+ }
+ return false;
+}
+
+pFunctionPointer_t InterruptManager::add_common(void (*function)(void), IRQn_Type irq, bool front) {
+ int irq_pos = get_irq_index(irq);
+ bool change = must_replace_vector(irq);
+
+ pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(function) : _chains[irq_pos]->add(function);
+ if (change)
+ NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper);
+ return pf;
+}
+
+bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq) {
+ int irq_pos = get_irq_index(irq);
+
+ if (NULL == _chains[irq_pos])
+ return false;
+ if (!_chains[irq_pos]->remove(handler))
+ return false;
+ // If there's a single function left in the chain, swith the interrupt vector
+ // to call that function directly. This way we save both time and space.
+ if (_chains[irq_pos]->size() == 1 && NULL != _chains[irq_pos]->get(0)->get_function()) {
+ NVIC_SetVector(irq, (uint32_t)_chains[irq_pos]->get(0)->get_function());
+ delete _chains[irq_pos];
+ _chains[irq_pos] = (CallChain*) NULL;
+ }
+ return true;
+}
+
+void InterruptManager::irq_helper() {
+ _chains[__get_IPSR()]->call();
+}
+
+int InterruptManager::get_irq_index(IRQn_Type irq) {
+ return (int)irq + NVIC_USER_IRQ_OFFSET;
+}
+
+void InterruptManager::static_irq_helper() {
+ InterruptManager::get()->irq_helper();
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/LocalFileSystem.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,223 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "LocalFileSystem.h"
+
+#if DEVICE_LOCALFILESYSTEM
+
+#include "semihost_api.h"
+#include <string.h>
+#include <stdio.h>
+
+namespace mbed {
+
+/* Extension to FINFO type defined in RTL.h (in Keil RL) - adds 'create time'. */
+typedef struct {
+ unsigned char hr; /* Hours [0..23] */
+ unsigned char min; /* Minutes [0..59] */
+ unsigned char sec; /* Seconds [0..59] */
+ unsigned char day; /* Day [1..31] */
+ unsigned char mon; /* Month [1..12] */
+ unsigned short year; /* Year [1980..2107] */
+} FTIME;
+
+typedef struct { /* File Search info record */
+ char name[32]; /* File name */
+ long size; /* File size in bytes */
+ int fileID; /* System File Identification */
+ FTIME create_time; /* Date & time file was created */
+ FTIME write_time; /* Date & time of last write */
+} XFINFO;
+
+#define RESERVED_FOR_USER_APPLICATIONS (0x100) /* 0x100 - 0x1ff */
+#define USR_XFFIND (RESERVED_FOR_USER_APPLICATIONS + 0)
+
+static int xffind (const char *pattern, XFINFO *info) {
+ unsigned param[4];
+
+ param[0] = (unsigned long)pattern;
+ param[1] = (unsigned long)strlen(pattern);
+ param[2] = (unsigned long)info;
+ param[3] = (unsigned long)sizeof(XFINFO);
+
+ return __semihost(USR_XFFIND, param);
+}
+
+#define OPEN_R 0
+#define OPEN_B 1
+#define OPEN_PLUS 2
+#define OPEN_W 4
+#define OPEN_A 8
+#define OPEN_INVALID -1
+
+int posix_to_semihost_open_flags(int flags) {
+ /* POSIX flags -> semihosting open mode */
+ int openmode;
+ if (flags & O_RDWR) {
+ /* a plus mode */
+ openmode = OPEN_PLUS;
+ if (flags & O_APPEND) {
+ openmode |= OPEN_A;
+ } else if (flags & O_TRUNC) {
+ openmode |= OPEN_W;
+ } else {
+ openmode |= OPEN_R;
+ }
+ } else if (flags & O_WRONLY) {
+ /* write or append */
+ if (flags & O_APPEND) {
+ openmode = OPEN_A;
+ } else {
+ openmode = OPEN_W;
+ }
+ } else if (flags == O_RDONLY) {
+ /* read mode */
+ openmode = OPEN_R;
+ } else {
+ /* invalid flags */
+ openmode = OPEN_INVALID;
+ }
+
+ return openmode;
+}
+
+FILEHANDLE local_file_open(const char* name, int flags) {
+ int openmode = posix_to_semihost_open_flags(flags);
+ if (openmode == OPEN_INVALID) {
+ return (FILEHANDLE)NULL;
+ }
+
+ FILEHANDLE fh = semihost_open(name, openmode);
+ if (fh == -1) {
+ return (FILEHANDLE)NULL;
+ }
+
+ return fh;
+}
+
+LocalFileHandle::LocalFileHandle(FILEHANDLE fh) : _fh(fh), pos(0) {
+}
+
+int LocalFileHandle::close() {
+ int retval = semihost_close(_fh);
+ delete this;
+ return retval;
+}
+
+ssize_t LocalFileHandle::write(const void *buffer, size_t length) {
+ ssize_t n = semihost_write(_fh, (const unsigned char*)buffer, length, 0); // number of characters not written
+ n = length - n; // number of characters written
+ pos += n;
+ return n;
+}
+
+ssize_t LocalFileHandle::read(void *buffer, size_t length) {
+ ssize_t n = semihost_read(_fh, (unsigned char*)buffer, length, 0); // number of characters not read
+ n = length - n; // number of characters read
+ pos += n;
+ return n;
+}
+
+int LocalFileHandle::isatty() {
+ return semihost_istty(_fh);
+}
+
+off_t LocalFileHandle::lseek(off_t position, int whence) {
+ if (whence == SEEK_CUR) {
+ position += pos;
+ } else if (whence == SEEK_END) {
+ position += semihost_flen(_fh);
+ } /* otherwise SEEK_SET, so position is fine */
+
+ /* Always seems to return -1, so just ignore for now. */
+ semihost_seek(_fh, position);
+ pos = position;
+ return position;
+}
+
+int LocalFileHandle::fsync() {
+ return semihost_ensure(_fh);
+}
+
+off_t LocalFileHandle::flen() {
+ return semihost_flen(_fh);
+}
+
+class LocalDirHandle : public DirHandle {
+
+public:
+ struct dirent cur_entry;
+ XFINFO info;
+
+ LocalDirHandle() : cur_entry(), info() {
+ }
+
+ virtual int closedir() {
+ delete this;
+ return 0;
+ }
+
+ virtual struct dirent *readdir() {
+ if (xffind("*", &info)!=0) {
+ return NULL;
+ }
+ memcpy(cur_entry.d_name, info.name, sizeof(info.name));
+ return &cur_entry;
+ }
+
+ virtual void rewinddir() {
+ info.fileID = 0;
+ }
+
+ virtual off_t telldir() {
+ return info.fileID;
+ }
+
+ virtual void seekdir(off_t offset) {
+ info.fileID = offset;
+ }
+};
+
+FileHandle *LocalFileSystem::open(const char* name, int flags) {
+ /* reject filenames with / in them */
+ for (const char *tmp = name; *tmp; tmp++) {
+ if (*tmp == '/') {
+ return NULL;
+ }
+ }
+
+ int openmode = posix_to_semihost_open_flags(flags);
+ if (openmode == OPEN_INVALID) {
+ return NULL;
+ }
+
+ FILEHANDLE fh = semihost_open(name, openmode);
+ if (fh == -1) {
+ return NULL;
+ }
+ return new LocalFileHandle(fh);
+}
+
+int LocalFileSystem::remove(const char *filename) {
+ return semihost_remove(filename);
+}
+
+DirHandle *LocalFileSystem::opendir(const char *name) {
+ return new LocalDirHandle();
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/RawSerial.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,67 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "RawSerial.h"
+#include "wait_api.h"
+#include <cstdarg>
+
+#if DEVICE_SERIAL
+
+#define STRING_STACK_LIMIT 120
+
+namespace mbed {
+
+RawSerial::RawSerial(PinName tx, PinName rx) : SerialBase(tx, rx) {
+}
+
+int RawSerial::getc() {
+ return _base_getc();
+}
+
+int RawSerial::putc(int c) {
+ return _base_putc(c);
+}
+
+int RawSerial::puts(const char *str) {
+ while (*str)
+ putc(*str ++);
+ return 0;
+}
+
+// Experimental support for printf in RawSerial. No Stream inheritance
+// means we can't call printf() directly, so we use sprintf() instead.
+// We only call malloc() for the sprintf() buffer if the buffer
+// length is above a certain threshold, otherwise we use just the stack.
+int RawSerial::printf(const char *format, ...) {
+ std::va_list arg;
+ va_start(arg, format);
+ int len = vsnprintf(NULL, 0, format, arg);
+ if (len < STRING_STACK_LIMIT) {
+ char temp[STRING_STACK_LIMIT];
+ vsprintf(temp, format, arg);
+ puts(temp);
+ } else {
+ char *temp = new char[len + 1];
+ vsprintf(temp, format, arg);
+ puts(temp);
+ delete[] temp;
+ }
+ va_end(arg);
+ return len;
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/SPI.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,180 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "SPI.h"
+
+#if DEVICE_SPI
+
+namespace mbed {
+
+#if DEVICE_SPI_ASYNCH && TRANSACTION_QUEUE_SIZE_SPI
+CircularBuffer<Transaction<SPI>, TRANSACTION_QUEUE_SIZE_SPI> SPI::_transaction_buffer;
+#endif
+
+SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
+ _spi(),
+#if DEVICE_SPI_ASYNCH
+ _irq(this),
+ _usage(DMA_USAGE_NEVER),
+#endif
+ _bits(8),
+ _mode(0),
+ _hz(1000000) {
+ spi_init(&_spi, mosi, miso, sclk, ssel);
+ spi_format(&_spi, _bits, _mode, 0);
+ spi_frequency(&_spi, _hz);
+}
+
+void SPI::format(int bits, int mode) {
+ _bits = bits;
+ _mode = mode;
+ SPI::_owner = NULL; // Not that elegant, but works. rmeyer
+ aquire();
+}
+
+void SPI::frequency(int hz) {
+ _hz = hz;
+ SPI::_owner = NULL; // Not that elegant, but works. rmeyer
+ aquire();
+}
+
+SPI* SPI::_owner = NULL;
+
+// ignore the fact there are multiple physical spis, and always update if it wasnt us last
+void SPI::aquire() {
+ if (_owner != this) {
+ spi_format(&_spi, _bits, _mode, 0);
+ spi_frequency(&_spi, _hz);
+ _owner = this;
+ }
+}
+
+int SPI::write(int value) {
+ aquire();
+ return spi_master_write(&_spi, value);
+}
+
+#if DEVICE_SPI_ASYNCH
+
+int SPI::transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
+{
+ if (spi_active(&_spi)) {
+ return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, bit_width, callback, event);
+ }
+ start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, bit_width, callback, event);
+ return 0;
+}
+
+void SPI::abort_transfer()
+{
+ spi_abort_asynch(&_spi);
+#if TRANSACTION_QUEUE_SIZE_SPI
+ dequeue_transaction();
+#endif
+}
+
+
+void SPI::clear_transfer_buffer()
+{
+#if TRANSACTION_QUEUE_SIZE_SPI
+ _transaction_buffer.reset();
+#endif
+}
+
+void SPI::abort_all_transfers()
+{
+ clear_transfer_buffer();
+ abort_transfer();
+}
+
+int SPI::set_dma_usage(DMAUsage usage)
+{
+ if (spi_active(&_spi)) {
+ return -1;
+ }
+ _usage = usage;
+ return 0;
+}
+
+int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
+{
+#if TRANSACTION_QUEUE_SIZE_SPI
+ transaction_t t;
+
+ t.tx_buffer = const_cast<void *>(tx_buffer);
+ t.tx_length = tx_length;
+ t.rx_buffer = rx_buffer;
+ t.rx_length = rx_length;
+ t.event = event;
+ t.callback = callback;
+ t.width = bit_width;
+ Transaction<SPI> transaction(this, t);
+ if (_transaction_buffer.full()) {
+ return -1; // the buffer is full
+ } else {
+ _transaction_buffer.push(transaction);
+ return 0;
+ }
+#else
+ return -1;
+#endif
+}
+
+void SPI::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event)
+{
+ aquire();
+ _callback = callback;
+ _irq.callback(&SPI::irq_handler_asynch);
+ spi_master_transfer(&_spi, tx_buffer, tx_length, rx_buffer, rx_length, bit_width, _irq.entry(), event , _usage);
+}
+
+#if TRANSACTION_QUEUE_SIZE_SPI
+
+void SPI::start_transaction(transaction_t *data)
+{
+ start_transfer(data->tx_buffer, data->tx_length, data->rx_buffer, data->rx_length, data->width, data->callback, data->event);
+}
+
+void SPI::dequeue_transaction()
+{
+ Transaction<SPI> t;
+ if (_transaction_buffer.pop(t)) {
+ SPI* obj = t.get_object();
+ transaction_t* data = t.get_transaction();
+ obj->start_transaction(data);
+ }
+}
+
+#endif
+
+void SPI::irq_handler_asynch(void)
+{
+ int event = spi_irq_handler_asynch(&_spi);
+ if (_callback && (event & SPI_EVENT_ALL)) {
+ _callback.call(event & SPI_EVENT_ALL);
+ }
+#if TRANSACTION_QUEUE_SIZE_SPI
+ if (event & (SPI_EVENT_ALL | SPI_EVENT_INTERNAL_TRANSFER_COMPLETE)) {
+ // SPI peripheral is free (event happend), dequeue transaction
+ dequeue_transaction();
+ }
+#endif
+}
+
+#endif
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/SPISlave.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,58 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "SPISlave.h"
+
+#if DEVICE_SPISLAVE
+
+namespace mbed {
+
+SPISlave::SPISlave(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
+ _spi(),
+ _bits(8),
+ _mode(0),
+ _hz(1000000)
+ {
+ spi_init(&_spi, mosi, miso, sclk, ssel);
+ spi_format(&_spi, _bits, _mode, 1);
+ spi_frequency(&_spi, _hz);
+}
+
+void SPISlave::format(int bits, int mode) {
+ _bits = bits;
+ _mode = mode;
+ spi_format(&_spi, _bits, _mode, 1);
+}
+
+void SPISlave::frequency(int hz) {
+ _hz = hz;
+ spi_frequency(&_spi, _hz);
+}
+
+int SPISlave::receive(void) {
+ return(spi_slave_receive(&_spi));
+}
+
+int SPISlave::read(void) {
+ return(spi_slave_read(&_spi));
+}
+
+void SPISlave::reply(int value) {
+ spi_slave_write(&_spi, value);
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Serial.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,36 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Serial.h"
+#include "wait_api.h"
+
+#if DEVICE_SERIAL
+
+namespace mbed {
+
+Serial::Serial(PinName tx, PinName rx, const char *name) : SerialBase(tx, rx), Stream(name) {
+}
+
+int Serial::_getc() {
+ return _base_getc();
+}
+
+int Serial::_putc(int c) {
+ return _base_putc(c);
+}
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/SerialBase.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,212 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "SerialBase.h"
+#include "wait_api.h"
+
+#if DEVICE_SERIAL
+
+namespace mbed {
+
+SerialBase::SerialBase(PinName tx, PinName rx) :
+#if DEVICE_SERIAL_ASYNCH
+ _thunk_irq(this), _tx_usage(DMA_USAGE_NEVER),
+ _rx_usage(DMA_USAGE_NEVER),
+#endif
+ _serial(), _baud(9600) {
+ serial_init(&_serial, tx, rx);
+ serial_irq_handler(&_serial, SerialBase::_irq_handler, (uint32_t)this);
+}
+
+void SerialBase::baud(int baudrate) {
+ serial_baud(&_serial, baudrate);
+ _baud = baudrate;
+}
+
+void SerialBase::format(int bits, Parity parity, int stop_bits) {
+ serial_format(&_serial, bits, (SerialParity)parity, stop_bits);
+}
+
+int SerialBase::readable() {
+ return serial_readable(&_serial);
+}
+
+
+int SerialBase::writeable() {
+ return serial_writable(&_serial);
+}
+
+void SerialBase::attach(void (*fptr)(void), IrqType type) {
+ if (fptr) {
+ _irq[type].attach(fptr);
+ serial_irq_set(&_serial, (SerialIrq)type, 1);
+ } else {
+ serial_irq_set(&_serial, (SerialIrq)type, 0);
+ }
+}
+
+void SerialBase::_irq_handler(uint32_t id, SerialIrq irq_type) {
+ SerialBase *handler = (SerialBase*)id;
+ handler->_irq[irq_type].call();
+}
+
+int SerialBase::_base_getc() {
+ return serial_getc(&_serial);
+}
+
+int SerialBase::_base_putc(int c) {
+ serial_putc(&_serial, c);
+ return c;
+}
+
+void SerialBase::send_break() {
+ // Wait for 1.5 frames before clearing the break condition
+ // This will have different effects on our platforms, but should
+ // ensure that we keep the break active for at least one frame.
+ // We consider a full frame (1 start bit + 8 data bits bits +
+ // 1 parity bit + 2 stop bits = 12 bits) for computation.
+ // One bit time (in us) = 1000000/_baud
+ // Twelve bits: 12000000/baud delay
+ // 1.5 frames: 18000000/baud delay
+ serial_break_set(&_serial);
+ wait_us(18000000/_baud);
+ serial_break_clear(&_serial);
+}
+
+#if DEVICE_SERIAL_FC
+void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) {
+ FlowControl flow_type = (FlowControl)type;
+ switch(type) {
+ case RTS:
+ serial_set_flow_control(&_serial, flow_type, flow1, NC);
+ break;
+
+ case CTS:
+ serial_set_flow_control(&_serial, flow_type, NC, flow1);
+ break;
+
+ case RTSCTS:
+ case Disabled:
+ serial_set_flow_control(&_serial, flow_type, flow1, flow2);
+ break;
+
+ default:
+ break;
+ }
+}
+#endif
+
+#if DEVICE_SERIAL_ASYNCH
+
+int SerialBase::write(const uint8_t *buffer, int length, const event_callback_t& callback, int event)
+{
+ if (serial_tx_active(&_serial)) {
+ return -1; // transaction ongoing
+ }
+ start_write((void *)buffer, length, 8, callback, event);
+ return 0;
+}
+
+int SerialBase::write(const uint16_t *buffer, int length, const event_callback_t& callback, int event)
+{
+ if (serial_tx_active(&_serial)) {
+ return -1; // transaction ongoing
+ }
+ start_write((void *)buffer, length, 16, callback, event);
+ return 0;
+}
+
+void SerialBase::start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event)
+{
+ _tx_callback = callback;
+
+ _thunk_irq.callback(&SerialBase::interrupt_handler_asynch);
+ serial_tx_asynch(&_serial, buffer, buffer_size, buffer_width, _thunk_irq.entry(), event, _tx_usage);
+}
+
+void SerialBase::abort_write(void)
+{
+ serial_tx_abort_asynch(&_serial);
+}
+
+void SerialBase::abort_read(void)
+{
+ serial_rx_abort_asynch(&_serial);
+}
+
+int SerialBase::set_dma_usage_tx(DMAUsage usage)
+{
+ if (serial_tx_active(&_serial)) {
+ return -1;
+ }
+ _tx_usage = usage;
+ return 0;
+}
+
+int SerialBase::set_dma_usage_rx(DMAUsage usage)
+{
+ if (serial_tx_active(&_serial)) {
+ return -1;
+ }
+ _rx_usage = usage;
+ return 0;
+}
+
+int SerialBase::read(uint8_t *buffer, int length, const event_callback_t& callback, int event, unsigned char char_match)
+{
+ if (serial_rx_active(&_serial)) {
+ return -1; // transaction ongoing
+ }
+ start_read((void*)buffer, length, 8, callback, event, char_match);
+ return 0;
+}
+
+
+int SerialBase::read(uint16_t *buffer, int length, const event_callback_t& callback, int event, unsigned char char_match)
+{
+ if (serial_rx_active(&_serial)) {
+ return -1; // transaction ongoing
+ }
+ start_read((void*)buffer, length, 16, callback, event, char_match);
+ return 0;
+}
+
+
+void SerialBase::start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event, unsigned char char_match)
+{
+ _rx_callback = callback;
+ _thunk_irq.callback(&SerialBase::interrupt_handler_asynch);
+ serial_rx_asynch(&_serial, buffer, buffer_size, buffer_width, _thunk_irq.entry(), event, char_match, _rx_usage);
+}
+
+void SerialBase::interrupt_handler_asynch(void)
+{
+ int event = serial_irq_handler_asynch(&_serial);
+ int rx_event = event & SERIAL_EVENT_RX_MASK;
+ if (_rx_callback && rx_event) {
+ _rx_callback.call(rx_event);
+ }
+
+ int tx_event = event & SERIAL_EVENT_TX_MASK;
+ if (_tx_callback && tx_event) {
+ _tx_callback.call(tx_event);
+ }
+}
+
+#endif
+
+} // namespace mbed
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Stream.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,111 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Stream.h"
+
+#include <cstdarg>
+
+namespace mbed {
+
+Stream::Stream(const char *name) : FileLike(name), _file(NULL) {
+ /* open ourselves */
+ char buf[12]; /* :0x12345678 + null byte */
+ std::sprintf(buf, ":%p", this);
+ _file = std::fopen(buf, "w+");
+ mbed_set_unbuffered_stream(_file);
+}
+
+Stream::~Stream() {
+ fclose(_file);
+}
+
+int Stream::putc(int c) {
+ fflush(_file);
+ return std::fputc(c, _file);
+}
+int Stream::puts(const char *s) {
+ fflush(_file);
+ return std::fputs(s, _file);
+}
+int Stream::getc() {
+ fflush(_file);
+ return mbed_getc(_file);
+}
+char* Stream::gets(char *s, int size) {
+ fflush(_file);
+ return mbed_gets(s,size,_file);
+}
+
+int Stream::close() {
+ return 0;
+}
+
+ssize_t Stream::write(const void* buffer, size_t length) {
+ const char* ptr = (const char*)buffer;
+ const char* end = ptr + length;
+ while (ptr != end) {
+ if (_putc(*ptr++) == EOF) {
+ break;
+ }
+ }
+ return ptr - (const char*)buffer;
+}
+
+ssize_t Stream::read(void* buffer, size_t length) {
+ char* ptr = (char*)buffer;
+ char* end = ptr + length;
+ while (ptr != end) {
+ int c = _getc();
+ if (c==EOF) break;
+ *ptr++ = c;
+ }
+ return ptr - (const char*)buffer;
+}
+
+off_t Stream::lseek(off_t offset, int whence) {
+ return 0;
+}
+
+int Stream::isatty() {
+ return 0;
+}
+
+int Stream::fsync() {
+ return 0;
+}
+
+off_t Stream::flen() {
+ return 0;
+}
+
+int Stream::printf(const char* format, ...) {
+ std::va_list arg;
+ va_start(arg, format);
+ fflush(_file);
+ int r = vfprintf(_file, format, arg);
+ va_end(arg);
+ return r;
+}
+
+int Stream::scanf(const char* format, ...) {
+ std::va_list arg;
+ va_start(arg, format);
+ fflush(_file);
+ int r = vfscanf(_file, format, arg);
+ va_end(arg);
+ return r;
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Ticker.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,40 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Ticker.h"
+
+#include "TimerEvent.h"
+#include "FunctionPointer.h"
+#include "ticker_api.h"
+
+namespace mbed {
+
+void Ticker::detach() {
+ remove();
+ _function.attach(0);
+}
+
+void Ticker::setup(timestamp_t t) {
+ remove();
+ _delay = t;
+ insert(_delay + ticker_read(_ticker_data));
+}
+
+void Ticker::handler() {
+ insert(event.timestamp + _delay);
+ _function.call();
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Timeout.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,24 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Timeout.h"
+
+namespace mbed {
+
+void Timeout::handler() {
+ _function.call();
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/Timer.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,73 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "Timer.h"
+#include "ticker_api.h"
+#include "us_ticker_api.h"
+
+namespace mbed {
+
+Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data()) {
+ reset();
+}
+
+Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data) {
+ reset();
+}
+
+void Timer::start() {
+ if (!_running) {
+ _start = ticker_read(_ticker_data);
+ _running = 1;
+ }
+}
+
+void Timer::stop() {
+ _time += slicetime();
+ _running = 0;
+}
+
+int Timer::read_us() {
+ return _time + slicetime();
+}
+
+float Timer::read() {
+ return (float)read_us() / 1000000.0f;
+}
+
+int Timer::read_ms() {
+ return read_us() / 1000;
+}
+
+int Timer::slicetime() {
+ if (_running) {
+ return ticker_read(_ticker_data) - _start;
+ } else {
+ return 0;
+ }
+}
+
+void Timer::reset() {
+ _start = ticker_read(_ticker_data);
+ _time = 0;
+}
+
+#ifdef MBED_OPERATORS
+Timer::operator float() {
+ return read();
+}
+#endif
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/TimerEvent.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,51 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "TimerEvent.h"
+#include "cmsis.h"
+
+#include <stddef.h>
+#include "ticker_api.h"
+#include "us_ticker_api.h"
+
+namespace mbed {
+
+TimerEvent::TimerEvent() : event(), _ticker_data(get_us_ticker_data()) {
+ ticker_set_handler(_ticker_data, (&TimerEvent::irq));
+}
+
+TimerEvent::TimerEvent(const ticker_data_t *data) : event(), _ticker_data(data) {
+ ticker_set_handler(_ticker_data, (&TimerEvent::irq));
+}
+
+void TimerEvent::irq(uint32_t id) {
+ TimerEvent *timer_event = (TimerEvent*)id;
+ timer_event->handler();
+}
+
+TimerEvent::~TimerEvent() {
+ remove();
+}
+
+// insert in to linked list
+void TimerEvent::insert(timestamp_t timestamp) {
+ ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this);
+}
+
+void TimerEvent::remove() {
+ ticker_remove_event(_ticker_data, &event);
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/assert.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,22 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include "mbed_error.h"
+
+void mbed_assert_internal(const char *expr, const char *file, int line)
+{
+ error("mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/board.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,59 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "gpio_api.h"
+#include "wait_api.h"
+#include "toolchain.h"
+#include "mbed_interface.h"
+
+WEAK void mbed_die(void) {
+#if !defined (NRF51_H) && !defined(TARGET_EFM32)
+ __disable_irq(); // dont allow interrupts to disturb the flash pattern
+#endif
+#if (DEVICE_ERROR_RED == 1)
+ gpio_t led_red; gpio_init_out(&led_red, LED_RED);
+#elif (DEVICE_ERROR_PATTERN == 1)
+ gpio_t led_1; gpio_init_out(&led_1, LED1);
+ gpio_t led_2; gpio_init_out(&led_2, LED2);
+ gpio_t led_3; gpio_init_out(&led_3, LED3);
+ gpio_t led_4; gpio_init_out(&led_4, LED4);
+#endif
+
+ while (1) {
+#if (DEVICE_ERROR_RED == 1)
+ gpio_write(&led_red, 1);
+
+#elif (DEVICE_ERROR_PATTERN == 1)
+ gpio_write(&led_1, 1);
+ gpio_write(&led_2, 0);
+ gpio_write(&led_3, 0);
+ gpio_write(&led_4, 1);
+#endif
+
+ wait_ms(150);
+
+#if (DEVICE_ERROR_RED == 1)
+ gpio_write(&led_red, 0);
+
+#elif (DEVICE_ERROR_PATTERN == 1)
+ gpio_write(&led_1, 0);
+ gpio_write(&led_2, 1);
+ gpio_write(&led_3, 1);
+ gpio_write(&led_4, 0);
+#endif
+
+ wait_ms(150);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/error.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,33 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 <stdlib.h>
+#include <stdarg.h>
+#include "device.h"
+#include "toolchain.h"
+#include "mbed_error.h"
+#if DEVICE_STDIO_MESSAGES
+#include <stdio.h>
+#endif
+
+WEAK void error(const char* format, ...) {
+#if DEVICE_STDIO_MESSAGES
+ va_list arg;
+ va_start(arg, format);
+ vfprintf(stderr, format, arg);
+ va_end(arg);
+#endif
+ exit(1);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/gpio.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,61 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "gpio_api.h"
+
+static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
+{
+ gpio_init(gpio, pin);
+ if (pin != NC) {
+ gpio_dir(gpio, PIN_INPUT);
+ gpio_mode(gpio, mode);
+ }
+}
+
+static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value)
+{
+ gpio_init(gpio, pin);
+ if (pin != NC) {
+ gpio_write(gpio, value);
+ gpio_dir(gpio, PIN_OUTPUT);
+ gpio_mode(gpio, mode);
+ }
+}
+
+void gpio_init_in(gpio_t* gpio, PinName pin) {
+ gpio_init_in_ex(gpio, pin, PullDefault);
+}
+
+void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode) {
+ _gpio_init_in(gpio, pin, mode);
+}
+
+void gpio_init_out(gpio_t* gpio, PinName pin) {
+ gpio_init_out_ex(gpio, pin, 0);
+}
+
+void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value) {
+ _gpio_init_out(gpio, pin, PullNone, value);
+}
+
+void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value) {
+ if (direction == PIN_INPUT) {
+ _gpio_init_in(gpio, pin, mode);
+ if (pin != NC)
+ gpio_write(gpio, value); // we prepare the value in case it is switched later
+ } else {
+ _gpio_init_out(gpio, pin, mode, value);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/lp_ticker_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,45 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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 "lp_ticker_api.h"
+
+#if DEVICE_LOWPOWERTIMER
+
+static ticker_event_queue_t events;
+
+static const ticker_interface_t lp_interface = {
+ .init = lp_ticker_init,
+ .read = lp_ticker_read,
+ .disable_interrupt = lp_ticker_disable_interrupt,
+ .clear_interrupt = lp_ticker_clear_interrupt,
+ .set_interrupt = lp_ticker_set_interrupt,
+};
+
+static const ticker_data_t lp_data = {
+ .interface = &lp_interface,
+ .queue = &events,
+};
+
+const ticker_data_t* get_lp_ticker_data(void)
+{
+ return &lp_data;
+}
+
+void lp_ticker_irq_handler(void)
+{
+ ticker_irq_handler(&lp_data);
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/mbed_interface.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,113 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 <stdio.h>
+#include "mbed_interface.h"
+
+#include "gpio_api.h"
+#include "wait_api.h"
+#include "semihost_api.h"
+#include "mbed_error.h"
+#include "toolchain.h"
+
+#if DEVICE_SEMIHOST
+
+// return true if a debugger is attached, indicating mbed interface is connected
+int mbed_interface_connected(void) {
+ return semihost_connected();
+}
+
+int mbed_interface_reset(void) {
+ if (mbed_interface_connected()) {
+ semihost_reset();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+WEAK int mbed_interface_uid(char *uid) {
+ if (mbed_interface_connected()) {
+ return semihost_uid(uid); // Returns 0 if successful, -1 on failure
+ } else {
+ uid[0] = 0;
+ return -1;
+ }
+}
+
+int mbed_interface_disconnect(void) {
+ int res;
+ if (mbed_interface_connected()) {
+ if ((res = semihost_disabledebug()) != 0)
+ return res;
+ while (mbed_interface_connected());
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+int mbed_interface_powerdown(void) {
+ int res;
+ if (mbed_interface_connected()) {
+ if ((res = semihost_powerdown()) != 0)
+ return res;
+ while (mbed_interface_connected());
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+// for backward compatibility
+void mbed_reset(void) {
+ mbed_interface_reset();
+}
+
+WEAK int mbed_uid(char *uid) {
+ return mbed_interface_uid(uid);
+}
+#endif
+
+WEAK void mbed_mac_address(char *mac) {
+#if DEVICE_SEMIHOST
+ char uid[DEVICE_ID_LENGTH + 1];
+ int i;
+
+ // if we have a UID, extract the MAC
+ if (mbed_interface_uid(uid) == 0) {
+ char *p = uid;
+#if defined(DEVICE_MAC_OFFSET)
+ p += DEVICE_MAC_OFFSET;
+#endif
+ for (i=0; i<6; i++) {
+ int byte;
+ sscanf(p, "%2x", &byte);
+ mac[i] = byte;
+ p += 2;
+ }
+ mac[0] &= ~0x01; // reset the IG bit in the address; see IEE 802.3-2002, Section 3.2.3(b)
+ } else { // else return a default MAC
+#endif
+ mac[0] = 0x00;
+ mac[1] = 0x02;
+ mac[2] = 0xF7;
+ mac[3] = 0xF0;
+ mac[4] = 0x00;
+ mac[5] = 0x00;
+#if DEVICE_SEMIHOST
+ }
+#endif
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/pinmap_common.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,89 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "pinmap.h"
+#include "mbed_error.h"
+
+void pinmap_pinout(PinName pin, const PinMap *map) {
+ if (pin == NC)
+ return;
+
+ while (map->pin != NC) {
+ if (map->pin == pin) {
+ pin_function(pin, map->function);
+
+ pin_mode(pin, PullNone);
+ return;
+ }
+ map++;
+ }
+ error("could not pinout");
+}
+
+uint32_t pinmap_merge(uint32_t a, uint32_t b) {
+ // both are the same (inc both NC)
+ if (a == b)
+ return a;
+
+ // one (or both) is not connected
+ if (a == (uint32_t)NC)
+ return b;
+ if (b == (uint32_t)NC)
+ return a;
+
+ // mis-match error case
+ error("pinmap mis-match");
+ return (uint32_t)NC;
+}
+
+uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map) {
+ while (map->pin != NC) {
+ if (map->pin == pin)
+ return map->peripheral;
+ map++;
+ }
+ return (uint32_t)NC;
+}
+
+uint32_t pinmap_peripheral(PinName pin, const PinMap* map) {
+ uint32_t peripheral = (uint32_t)NC;
+
+ if (pin == (PinName)NC)
+ return (uint32_t)NC;
+ peripheral = pinmap_find_peripheral(pin, map);
+ if ((uint32_t)NC == peripheral) // no mapping available
+ error("pinmap not found for peripheral");
+ return peripheral;
+}
+
+uint32_t pinmap_find_function(PinName pin, const PinMap* map) {
+ while (map->pin != NC) {
+ if (map->pin == pin)
+ return map->function;
+ map++;
+ }
+ return (uint32_t)NC;
+}
+
+uint32_t pinmap_function(PinName pin, const PinMap* map) {
+ uint32_t function = (uint32_t)NC;
+
+ if (pin == (PinName)NC)
+ return (uint32_t)NC;
+ function = pinmap_find_function(pin, map);
+ if ((uint32_t)NC == function) // no mapping available
+ error("pinmap not found for function");
+ return function;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/retarget.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,569 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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 "platform.h"
+#include "FileHandle.h"
+#include "FileSystemLike.h"
+#include "FilePath.h"
+#include "serial_api.h"
+#include "toolchain.h"
+#include "semihost_api.h"
+#include "mbed_interface.h"
+#if DEVICE_STDIO_MESSAGES
+#include <stdio.h>
+#endif
+#include <errno.h>
+
+#if defined(__ARMCC_VERSION)
+# include <rt_sys.h>
+# define PREFIX(x) _sys##x
+# define OPEN_MAX _SYS_OPEN
+# ifdef __MICROLIB
+# pragma import(__use_full_stdio)
+# endif
+
+#elif defined(__ICCARM__)
+# include <yfuns.h>
+# define PREFIX(x) _##x
+# define OPEN_MAX 16
+
+# define STDIN_FILENO 0
+# define STDOUT_FILENO 1
+# define STDERR_FILENO 2
+
+#else
+# include <sys/stat.h>
+# include <sys/unistd.h>
+# include <sys/syslimits.h>
+# define PREFIX(x) x
+#endif
+
+using namespace mbed;
+
+#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
+// Before version 5.03, we were using a patched version of microlib with proper names
+extern const char __stdin_name[] = ":tt";
+extern const char __stdout_name[] = ":tt";
+extern const char __stderr_name[] = ":tt";
+
+#else
+extern const char __stdin_name[] = "/stdin";
+extern const char __stdout_name[] = "/stdout";
+extern const char __stderr_name[] = "/stderr";
+#endif
+
+/* newlib has the filehandle field in the FILE struct as a short, so
+ * we can't just return a Filehandle* from _open and instead have to
+ * put it in a filehandles array and return the index into that array
+ * (or rather index+3, as filehandles 0-2 are stdin/out/err).
+ */
+static FileHandle *filehandles[OPEN_MAX];
+
+FileHandle::~FileHandle() {
+ /* Remove all open filehandles for this */
+ for (unsigned int fh_i = 0; fh_i < sizeof(filehandles)/sizeof(*filehandles); fh_i++) {
+ if (filehandles[fh_i] == this) {
+ filehandles[fh_i] = NULL;
+ }
+ }
+}
+
+#if DEVICE_SERIAL
+extern int stdio_uart_inited;
+extern serial_t stdio_uart;
+#endif
+
+static void init_serial() {
+#if DEVICE_SERIAL
+ if (stdio_uart_inited) return;
+ serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
+#endif
+}
+
+static inline int openmode_to_posix(int openmode) {
+ int posix = openmode;
+#ifdef __ARMCC_VERSION
+ if (openmode & OPEN_PLUS) {
+ posix = O_RDWR;
+ } else if(openmode & OPEN_W) {
+ posix = O_WRONLY;
+ } else if(openmode & OPEN_A) {
+ posix = O_WRONLY|O_APPEND;
+ } else {
+ posix = O_RDONLY;
+ }
+ /* a, w, a+, w+ all create if file does not already exist */
+ if (openmode & (OPEN_A|OPEN_W)) {
+ posix |= O_CREAT;
+ }
+ /* w and w+ truncate */
+ if (openmode & OPEN_W) {
+ posix |= O_TRUNC;
+ }
+#elif defined(__ICCARM__)
+ switch (openmode & _LLIO_RDWRMASK) {
+ case _LLIO_RDONLY: posix = O_RDONLY; break;
+ case _LLIO_WRONLY: posix = O_WRONLY; break;
+ case _LLIO_RDWR : posix = O_RDWR ; break;
+ }
+ if (openmode & _LLIO_CREAT ) posix |= O_CREAT;
+ if (openmode & _LLIO_APPEND) posix |= O_APPEND;
+ if (openmode & _LLIO_TRUNC ) posix |= O_TRUNC;
+#endif
+ return posix;
+}
+
+extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
+ #if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
+ // Before version 5.03, we were using a patched version of microlib with proper names
+ // This is the workaround that the microlib author suggested us
+ static int n = 0;
+ if (!std::strcmp(name, ":tt")) return n++;
+
+ #else
+ /* Use the posix convention that stdin,out,err are filehandles 0,1,2.
+ */
+ if (std::strcmp(name, __stdin_name) == 0) {
+ init_serial();
+ return 0;
+ } else if (std::strcmp(name, __stdout_name) == 0) {
+ init_serial();
+ return 1;
+ } else if (std::strcmp(name, __stderr_name) == 0) {
+ init_serial();
+ return 2;
+ }
+ #endif
+
+ // find the first empty slot in filehandles
+ unsigned int fh_i;
+ for (fh_i = 0; fh_i < sizeof(filehandles)/sizeof(*filehandles); fh_i++) {
+ if (filehandles[fh_i] == NULL) break;
+ }
+ if (fh_i >= sizeof(filehandles)/sizeof(*filehandles)) {
+ return -1;
+ }
+
+ FileHandle *res;
+
+ /* FILENAME: ":0x12345678" describes a FileLike* */
+ if (name[0] == ':') {
+ void *p;
+ sscanf(name, ":%p", &p);
+ res = (FileHandle*)p;
+
+ /* FILENAME: "/file_system/file_name" */
+ } else {
+ FilePath path(name);
+
+ if (!path.exists())
+ return -1;
+ else if (path.isFile()) {
+ res = path.file();
+ } else {
+ FileSystemLike *fs = path.fileSystem();
+ if (fs == NULL) return -1;
+ int posix_mode = openmode_to_posix(openmode);
+ res = fs->open(path.fileName(), posix_mode); /* NULL if fails */
+ }
+ }
+
+ if (res == NULL) return -1;
+ filehandles[fh_i] = res;
+
+ return fh_i + 3; // +3 as filehandles 0-2 are stdin/out/err
+}
+
+extern "C" int PREFIX(_close)(FILEHANDLE fh) {
+ if (fh < 3) return 0;
+
+ FileHandle* fhc = filehandles[fh-3];
+ filehandles[fh-3] = NULL;
+ if (fhc == NULL) return -1;
+
+ return fhc->close();
+}
+
+#if defined(__ICCARM__)
+extern "C" size_t __write (int fh, const unsigned char *buffer, size_t length) {
+#else
+extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsigned int length, int mode) {
+#endif
+ int n; // n is the number of bytes written
+ if (fh < 3) {
+#if DEVICE_SERIAL
+ if (!stdio_uart_inited) init_serial();
+ for (unsigned int i = 0; i < length; i++) {
+ serial_putc(&stdio_uart, buffer[i]);
+ }
+#endif
+ n = length;
+ } else {
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+ n = fhc->write(buffer, length);
+ }
+#ifdef __ARMCC_VERSION
+ return length-n;
+#else
+ return n;
+#endif
+}
+
+#if defined(__ICCARM__)
+extern "C" size_t __read (int fh, unsigned char *buffer, size_t length) {
+#else
+extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode) {
+#endif
+ int n; // n is the number of bytes read
+ if (fh < 3) {
+ // only read a character at a time from stdin
+#if DEVICE_SERIAL
+ if (!stdio_uart_inited) init_serial();
+ *buffer = serial_getc(&stdio_uart);
+#endif
+ n = 1;
+ } else {
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+ n = fhc->read(buffer, length);
+ }
+#ifdef __ARMCC_VERSION
+ return length-n;
+#else
+ return n;
+#endif
+}
+
+#ifdef __ARMCC_VERSION
+extern "C" int PREFIX(_istty)(FILEHANDLE fh)
+#else
+extern "C" int _isatty(FILEHANDLE fh)
+#endif
+{
+ /* stdin, stdout and stderr should be tty */
+ if (fh < 3) return 1;
+
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+ return fhc->isatty();
+}
+
+extern "C"
+#if defined(__ARMCC_VERSION)
+int _sys_seek(FILEHANDLE fh, long position)
+#elif defined(__ICCARM__)
+long __lseek(int fh, long offset, int whence)
+#else
+int _lseek(FILEHANDLE fh, int offset, int whence)
+#endif
+{
+ if (fh < 3) return 0;
+
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+#if defined(__ARMCC_VERSION)
+ return fhc->lseek(position, SEEK_SET);
+#else
+ return fhc->lseek(offset, whence);
+#endif
+}
+
+#ifdef __ARMCC_VERSION
+extern "C" int PREFIX(_ensure)(FILEHANDLE fh) {
+ if (fh < 3) return 0;
+
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+ return fhc->fsync();
+}
+
+extern "C" long PREFIX(_flen)(FILEHANDLE fh) {
+ if (fh < 3) return 0;
+
+ FileHandle* fhc = filehandles[fh-3];
+ if (fhc == NULL) return -1;
+
+ return fhc->flen();
+}
+#endif
+
+
+#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__)
+extern "C" int _fstat(int fd, struct stat *st) {
+ if ((STDOUT_FILENO == fd) || (STDERR_FILENO == fd) || (STDIN_FILENO == fd)) {
+ st->st_mode = S_IFCHR;
+ return 0;
+ }
+
+ errno = EBADF;
+ return -1;
+}
+#endif
+
+namespace std {
+extern "C" int remove(const char *path) {
+ FilePath fp(path);
+ FileSystemLike *fs = fp.fileSystem();
+ if (fs == NULL) return -1;
+
+ return fs->remove(fp.fileName());
+}
+
+extern "C" int rename(const char *oldname, const char *newname) {
+ FilePath fpOld(oldname);
+ FilePath fpNew(newname);
+ FileSystemLike *fsOld = fpOld.fileSystem();
+ FileSystemLike *fsNew = fpNew.fileSystem();
+
+ /* rename only if both files are on the same FS */
+ if (fsOld != fsNew || fsOld == NULL) return -1;
+
+ return fsOld->rename(fpOld.fileName(), fpNew.fileName());
+}
+
+extern "C" char *tmpnam(char *s) {
+ return NULL;
+}
+
+extern "C" FILE *tmpfile() {
+ return NULL;
+}
+} // namespace std
+
+#ifdef __ARMCC_VERSION
+extern "C" char *_sys_command_string(char *cmd, int len) {
+ return NULL;
+}
+#endif
+
+extern "C" DIR *opendir(const char *path) {
+ /* root dir is FileSystemLike */
+ if (path[0] == '/' && path[1] == 0) {
+ return FileSystemLike::opendir();
+ }
+
+ FilePath fp(path);
+ FileSystemLike* fs = fp.fileSystem();
+ if (fs == NULL) return NULL;
+
+ return fs->opendir(fp.fileName());
+}
+
+extern "C" struct dirent *readdir(DIR *dir) {
+ return dir->readdir();
+}
+
+extern "C" int closedir(DIR *dir) {
+ return dir->closedir();
+}
+
+extern "C" void rewinddir(DIR *dir) {
+ dir->rewinddir();
+}
+
+extern "C" off_t telldir(DIR *dir) {
+ return dir->telldir();
+}
+
+extern "C" void seekdir(DIR *dir, off_t off) {
+ dir->seekdir(off);
+}
+
+extern "C" int mkdir(const char *path, mode_t mode) {
+ FilePath fp(path);
+ FileSystemLike *fs = fp.fileSystem();
+ if (fs == NULL) return -1;
+
+ return fs->mkdir(fp.fileName(), mode);
+}
+
+#if defined(TOOLCHAIN_GCC)
+/* prevents the exception handling name demangling code getting pulled in */
+#include "mbed_error.h"
+namespace __gnu_cxx {
+ void __verbose_terminate_handler() {
+ error("Exception");
+ }
+}
+extern "C" WEAK void __cxa_pure_virtual(void);
+extern "C" WEAK void __cxa_pure_virtual(void) {
+ exit(1);
+}
+
+#endif
+
+// ****************************************************************************
+// mbed_main is a function that is called before main()
+// mbed_sdk_init() is also a function that is called before main(), but unlike
+// mbed_main(), it is not meant for user code, but for the SDK itself to perform
+// initializations before main() is called.
+
+extern "C" WEAK void mbed_main(void);
+extern "C" WEAK void mbed_main(void) {
+}
+
+extern "C" WEAK void mbed_sdk_init(void);
+extern "C" WEAK void mbed_sdk_init(void) {
+}
+
+#if defined(TOOLCHAIN_ARM)
+extern "C" int $Super$$main(void);
+
+extern "C" int $Sub$$main(void) {
+ mbed_sdk_init();
+ mbed_main();
+ return $Super$$main();
+}
+#elif defined(TOOLCHAIN_GCC)
+extern "C" int __real_main(void);
+
+extern "C" int __wrap_main(void) {
+ mbed_sdk_init();
+ mbed_main();
+ return __real_main();
+}
+#elif defined(TOOLCHAIN_IAR)
+// IAR doesn't have the $Super/$Sub mechanism of armcc, nor something equivalent
+// to ld's --wrap. It does have a --redirect, but that doesn't help, since redirecting
+// 'main' to another symbol looses the original 'main' symbol. However, its startup
+// code will call a function to setup argc and argv (__iar_argc_argv) if it is defined.
+// Since mbed doesn't use argc/argv, we use this function to call our mbed_main.
+extern "C" void __iar_argc_argv() {
+ mbed_sdk_init();
+ mbed_main();
+}
+#endif
+
+// Provide implementation of _sbrk (low-level dynamic memory allocation
+// routine) for GCC_ARM which compares new heap pointer with MSP instead of
+// SP. This make it compatible with RTX RTOS thread stacks.
+#if defined(TOOLCHAIN_GCC_ARM)
+// Linker defined symbol used by _sbrk to indicate where heap should start.
+extern "C" int __end__;
+
+#if defined(TARGET_CORTEX_A)
+extern "C" uint32_t __HeapLimit;
+#endif
+
+// Turn off the errno macro and use actual global variable instead.
+#undef errno
+extern "C" int errno;
+
+// For ARM7 only
+register unsigned char * stack_ptr __asm ("sp");
+
+// Dynamic memory allocation related syscall.
+extern "C" caddr_t _sbrk(int incr) {
+ static unsigned char* heap = (unsigned char*)&__end__;
+ unsigned char* prev_heap = heap;
+ unsigned char* new_heap = heap + incr;
+
+#if defined(TARGET_ARM7)
+ if (new_heap >= stack_ptr) {
+#elif defined(TARGET_CORTEX_A)
+ if (new_heap >= (unsigned char*)&__HeapLimit) { /* __HeapLimit is end of heap section */
+#else
+ if (new_heap >= (unsigned char*)__get_MSP()) {
+#endif
+ errno = ENOMEM;
+ return (caddr_t)-1;
+ }
+
+ heap = new_heap;
+ return (caddr_t) prev_heap;
+}
+#endif
+
+
+#ifdef TOOLCHAIN_GCC_CW
+// TODO: Ideally, we would like to define directly "_ExitProcess"
+extern "C" void mbed_exit(int return_code) {
+#elif defined TOOLCHAIN_GCC_ARM
+extern "C" void _exit(int return_code) {
+#else
+namespace std {
+extern "C" void exit(int return_code) {
+#endif
+
+#if DEVICE_STDIO_MESSAGES
+ fflush(stdout);
+ fflush(stderr);
+#endif
+
+#if DEVICE_SEMIHOST
+ if (mbed_interface_connected()) {
+ semihost_exit();
+ }
+#endif
+ if (return_code) {
+ mbed_die();
+ }
+
+ while (1);
+}
+
+#if !defined(TOOLCHAIN_GCC_ARM) && !defined(TOOLCHAIN_GCC_CW)
+} //namespace std
+#endif
+
+
+namespace mbed {
+
+void mbed_set_unbuffered_stream(FILE *_file) {
+#if defined (__ICCARM__)
+ char buf[2];
+ std::setvbuf(_file,buf,_IONBF,NULL);
+#else
+ setbuf(_file, NULL);
+#endif
+}
+
+int mbed_getc(FILE *_file){
+#if defined (__ICCARM__)
+ /*This is only valid for unbuffered streams*/
+ int res = std::fgetc(_file);
+ if (res>=0){
+ _file->_Mode = (unsigned short)(_file->_Mode & ~ 0x1000);/* Unset read mode */
+ _file->_Rend = _file->_Wend;
+ _file->_Next = _file->_Wend;
+ }
+ return res;
+#else
+ return std::fgetc(_file);
+#endif
+}
+
+char* mbed_gets(char*s, int size, FILE *_file){
+#if defined (__ICCARM__)
+ /*This is only valid for unbuffered streams*/
+ char *str = fgets(s,size,_file);
+ if (str!=NULL){
+ _file->_Mode = (unsigned short)(_file->_Mode & ~ 0x1000);/* Unset read mode */
+ _file->_Rend = _file->_Wend;
+ _file->_Next = _file->_Wend;
+ }
+ return str;
+#else
+ return std::fgets(s,size,_file);
+#endif
+}
+
+} // namespace mbed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/rtc_time.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,89 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "rtc_api.h"
+
+#include <time.h>
+#include "rtc_time.h"
+#include "us_ticker_api.h"
+
+#if DEVICE_RTC
+static void (*_rtc_init)(void) = rtc_init;
+static int (*_rtc_isenabled)(void) = rtc_isenabled;
+static time_t (*_rtc_read)(void) = rtc_read;
+static void (*_rtc_write)(time_t t) = rtc_write;
+#else
+static void (*_rtc_init)(void) = NULL;
+static int (*_rtc_isenabled)(void) = NULL;
+static time_t (*_rtc_read)(void) = NULL;
+static void (*_rtc_write)(time_t t) = NULL;
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if defined (__ICCARM__)
+time_t __time32(time_t *timer)
+#else
+time_t time(time_t *timer)
+#endif
+
+{
+ if (_rtc_isenabled != NULL) {
+ if (!(_rtc_isenabled())) {
+ set_time(0);
+ }
+ }
+
+ time_t t = 0;
+ if (_rtc_read != NULL) {
+ t = _rtc_read();
+ }
+
+ if (timer != NULL) {
+ *timer = t;
+ }
+ return t;
+}
+
+void set_time(time_t t) {
+ if (_rtc_init != NULL) {
+ _rtc_init();
+ }
+ if (_rtc_write != NULL) {
+ _rtc_write(t);
+ }
+}
+
+clock_t clock() {
+ clock_t t = us_ticker_read();
+ t /= 1000000 / CLOCKS_PER_SEC; // convert to processor time
+ return t;
+}
+
+void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void)) {
+ __disable_irq();
+ _rtc_read = read_rtc;
+ _rtc_write = write_rtc;
+ _rtc_init = init_rtc;
+ _rtc_isenabled = isenabled_rtc;
+ __enable_irq();
+}
+
+
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/semihost_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,162 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "cmsis.h"
+#include "semihost_api.h"
+
+#include <stdint.h>
+#include <string.h>
+
+#if DEVICE_SEMIHOST
+
+// ARM Semihosting Commands
+#define SYS_OPEN (0x1)
+#define SYS_CLOSE (0x2)
+#define SYS_WRITE (0x5)
+#define SYS_READ (0x6)
+#define SYS_ISTTY (0x9)
+#define SYS_SEEK (0xa)
+#define SYS_ENSURE (0xb)
+#define SYS_FLEN (0xc)
+#define SYS_REMOVE (0xe)
+#define SYS_RENAME (0xf)
+#define SYS_EXIT (0x18)
+
+// mbed Semihosting Commands
+#define RESERVED_FOR_USER_APPLICATIONS (0x100) // 0x100 - 0x1ff
+#define USR_XFFIND (RESERVED_FOR_USER_APPLICATIONS + 0)
+#define USR_UID (RESERVED_FOR_USER_APPLICATIONS + 1)
+#define USR_RESET (RESERVED_FOR_USER_APPLICATIONS + 2)
+#define USR_VBUS (RESERVED_FOR_USER_APPLICATIONS + 3)
+#define USR_POWERDOWN (RESERVED_FOR_USER_APPLICATIONS + 4)
+#define USR_DISABLEDEBUG (RESERVED_FOR_USER_APPLICATIONS + 5)
+
+#if DEVICE_LOCALFILESYSTEM
+FILEHANDLE semihost_open(const char* name, int openmode) {
+ uint32_t args[3];
+ args[0] = (uint32_t)name;
+ args[1] = (uint32_t)openmode;
+ args[2] = (uint32_t)strlen(name);
+ return __semihost(SYS_OPEN, args);
+}
+
+int semihost_close(FILEHANDLE fh) {
+ return __semihost(SYS_CLOSE, &fh);
+}
+
+int semihost_write(FILEHANDLE fh, const unsigned char* buffer, unsigned int length, int mode) {
+ if (length == 0) return 0;
+
+ uint32_t args[3];
+ args[0] = (uint32_t)fh;
+ args[1] = (uint32_t)buffer;
+ args[2] = (uint32_t)length;
+ return __semihost(SYS_WRITE, args);
+}
+
+int semihost_read(FILEHANDLE fh, unsigned char* buffer, unsigned int length, int mode) {
+ uint32_t args[3];
+ args[0] = (uint32_t)fh;
+ args[1] = (uint32_t)buffer;
+ args[2] = (uint32_t)length;
+ return __semihost(SYS_READ, args);
+}
+
+int semihost_istty(FILEHANDLE fh) {
+ return __semihost(SYS_ISTTY, &fh);
+}
+
+int semihost_seek(FILEHANDLE fh, long position) {
+ uint32_t args[2];
+ args[0] = (uint32_t)fh;
+ args[1] = (uint32_t)position;
+ return __semihost(SYS_SEEK, args);
+}
+
+int semihost_ensure(FILEHANDLE fh) {
+ return __semihost(SYS_ENSURE, &fh);
+}
+
+long semihost_flen(FILEHANDLE fh) {
+ return __semihost(SYS_FLEN, &fh);
+}
+
+int semihost_remove(const char *name) {
+ uint32_t args[2];
+ args[0] = (uint32_t)name;
+ args[1] = (uint32_t)strlen(name);
+ return __semihost(SYS_REMOVE, args);
+}
+
+int semihost_rename(const char *old_name, const char *new_name) {
+ uint32_t args[4];
+ args[0] = (uint32_t)old_name;
+ args[1] = (uint32_t)strlen(old_name);
+ args[0] = (uint32_t)new_name;
+ args[1] = (uint32_t)strlen(new_name);
+ return __semihost(SYS_RENAME, args);
+}
+#endif
+
+int semihost_exit(void) {
+ uint32_t args[4];
+ return __semihost(SYS_EXIT, args);
+}
+
+int semihost_uid(char *uid) {
+ uint32_t args[2];
+ args[0] = (uint32_t)uid;
+ args[1] = DEVICE_ID_LENGTH + 1;
+ return __semihost(USR_UID, &args);
+}
+
+int semihost_reset(void) {
+ // Does not normally return, however if used with older firmware versions
+ // that do not support this call it will return -1.
+ return __semihost(USR_RESET, NULL);
+}
+
+int semihost_vbus(void) {
+ return __semihost(USR_VBUS, NULL);
+}
+
+int semihost_powerdown(void) {
+ return __semihost(USR_POWERDOWN, NULL);
+}
+
+#if DEVICE_DEBUG_AWARENESS
+
+int semihost_connected(void) {
+ return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0;
+}
+
+#else
+// These processors cannot know if the interface is connect, assume so:
+static int is_debugger_attached = 1;
+
+int semihost_connected(void) {
+ return is_debugger_attached;
+}
+#endif
+
+int semihost_disabledebug(void) {
+#if !(DEVICE_DEBUG_AWARENESS)
+ is_debugger_attached = 0;
+#endif
+ return __semihost(USR_DISABLEDEBUG, NULL);
+}
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/ticker_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,135 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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 <stddef.h>
+#include "ticker_api.h"
+#include "cmsis.h"
+
+void ticker_set_handler(const ticker_data_t *const data, ticker_event_handler handler) {
+ data->interface->init();
+
+ data->queue->event_handler = handler;
+}
+
+void ticker_irq_handler(const ticker_data_t *const data) {
+ data->interface->clear_interrupt();
+
+ /* Go through all the pending TimerEvents */
+ while (1) {
+ if (data->queue->head == NULL) {
+ // There are no more TimerEvents left, so disable matches.
+ data->interface->disable_interrupt();
+ return;
+ }
+
+ if ((int)(data->queue->head->timestamp - data->interface->read()) <= 0) {
+ // This event was in the past:
+ // point to the following one and execute its handler
+ ticker_event_t *p = data->queue->head;
+ data->queue->head = data->queue->head->next;
+ if (data->queue->event_handler != NULL) {
+ (*data->queue->event_handler)(p->id); // NOTE: the handler can set new events
+ }
+ /* Note: We continue back to examining the head because calling the
+ * event handler may have altered the chain of pending events. */
+ } else {
+ // This event and the following ones in the list are in the future:
+ // set it as next interrupt and return
+ data->interface->set_interrupt(data->queue->head->timestamp);
+ return;
+ }
+ }
+}
+
+void ticker_insert_event(const ticker_data_t *const data, ticker_event_t *obj, timestamp_t timestamp, uint32_t id) {
+ /* disable interrupts for the duration of the function */
+ __disable_irq();
+
+ // initialise our data
+ obj->timestamp = timestamp;
+ obj->id = id;
+
+ /* Go through the list until we either reach the end, or find
+ an element this should come before (which is possibly the
+ head). */
+ ticker_event_t *prev = NULL, *p = data->queue->head;
+ while (p != NULL) {
+ /* check if we come before p */
+ if ((int)(timestamp - p->timestamp) < 0) {
+ break;
+ }
+ /* go to the next element */
+ prev = p;
+ p = p->next;
+ }
+ /* if prev is NULL we're at the head */
+ if (prev == NULL) {
+ data->queue->head = obj;
+ data->interface->set_interrupt(timestamp);
+ } else {
+ prev->next = obj;
+ }
+ /* if we're at the end p will be NULL, which is correct */
+ obj->next = p;
+
+ __enable_irq();
+}
+
+void ticker_remove_event(const ticker_data_t *const data, ticker_event_t *obj) {
+ __disable_irq();
+
+ // remove this object from the list
+ if (data->queue->head == obj) {
+ // first in the list, so just drop me
+ data->queue->head = obj->next;
+ if (data->queue->head == NULL) {
+ data->interface->disable_interrupt();
+ } else {
+ data->interface->set_interrupt(data->queue->head->timestamp);
+ }
+ } else {
+ // find the object before me, then drop me
+ ticker_event_t* p = data->queue->head;
+ while (p != NULL) {
+ if (p->next == obj) {
+ p->next = obj->next;
+ break;
+ }
+ p = p->next;
+ }
+ }
+
+ __enable_irq();
+}
+
+timestamp_t ticker_read(const ticker_data_t *const data)
+{
+ return data->interface->read();
+}
+
+int ticker_get_next_timestamp(const ticker_data_t *const data, timestamp_t *timestamp)
+{
+ int ret = 0;
+
+ /* if head is NULL, there are no pending events */
+ __disable_irq();
+ if (data->queue->head != NULL) {
+ *timestamp = data->queue->head->timestamp;
+ ret = 1;
+ }
+ __enable_irq();
+
+ return ret;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/us_ticker_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,41 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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 "us_ticker_api.h"
+
+static ticker_event_queue_t events;
+
+static const ticker_interface_t us_interface = {
+ .init = us_ticker_init,
+ .read = us_ticker_read,
+ .disable_interrupt = us_ticker_disable_interrupt,
+ .clear_interrupt = us_ticker_clear_interrupt,
+ .set_interrupt = us_ticker_set_interrupt,
+};
+
+static const ticker_data_t us_data = {
+ .interface = &us_interface,
+ .queue = &events,
+};
+
+const ticker_data_t* get_us_ticker_data(void)
+{
+ return &us_data;
+}
+
+void us_ticker_irq_handler(void)
+{
+ ticker_irq_handler(&us_data);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/common/wait_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,30 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "wait_api.h"
+#include "us_ticker_api.h"
+
+void wait(float s) {
+ wait_us(s * 1000000.0f);
+}
+
+void wait_ms(int ms) {
+ wait_us(ms * 1000);
+}
+
+void wait_us(int us) {
+ uint32_t start = us_ticker_read();
+ while ((us_ticker_read() - start) < (uint32_t)us);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/analogin_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,39 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ANALOGIN_API_H
+#define MBED_ANALOGIN_API_H
+
+#include "device.h"
+
+#if DEVICE_ANALOGIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct analogin_s analogin_t;
+
+void analogin_init (analogin_t *obj, PinName pin);
+float analogin_read (analogin_t *obj);
+uint16_t analogin_read_u16(analogin_t *obj);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/analogout_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,42 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ANALOGOUT_API_H
+#define MBED_ANALOGOUT_API_H
+
+#include "device.h"
+
+#if DEVICE_ANALOGOUT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct dac_s dac_t;
+
+void analogout_init (dac_t *obj, PinName pin);
+void analogout_free (dac_t *obj);
+void analogout_write (dac_t *obj, float value);
+void analogout_write_u16(dac_t *obj, uint16_t value);
+float analogout_read (dac_t *obj);
+uint16_t analogout_read_u16 (dac_t *obj);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/buffer.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,30 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2014-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_BUFFER_H
+#define MBED_BUFFER_H
+
+#include <stddef.h>
+
+/** Generic buffer structure
+ */
+typedef struct buffer_s {
+ void *buffer; /**< the pointer to a buffer */
+ size_t length; /**< the buffer length */
+ size_t pos; /**< actual buffer position */
+ uint8_t width; /**< The buffer unit width (8, 16, 32, 64), used for proper *buffer casting */
+} buffer_t;
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/can_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,80 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_CAN_API_H
+#define MBED_CAN_API_H
+
+#include "device.h"
+
+#if DEVICE_CAN
+
+#include "PinNames.h"
+#include "PeripheralNames.h"
+#include "can_helper.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ IRQ_RX,
+ IRQ_TX,
+ IRQ_ERROR,
+ IRQ_OVERRUN,
+ IRQ_WAKEUP,
+ IRQ_PASSIVE,
+ IRQ_ARB,
+ IRQ_BUS,
+ IRQ_READY
+} CanIrqType;
+
+
+typedef enum {
+ MODE_RESET,
+ MODE_NORMAL,
+ MODE_SILENT,
+ MODE_TEST_LOCAL,
+ MODE_TEST_GLOBAL,
+ MODE_TEST_SILENT
+} CanMode;
+
+typedef void (*can_irq_handler)(uint32_t id, CanIrqType type);
+
+typedef struct can_s can_t;
+
+void can_init (can_t *obj, PinName rd, PinName td);
+void can_free (can_t *obj);
+int can_frequency(can_t *obj, int hz);
+
+void can_irq_init (can_t *obj, can_irq_handler handler, uint32_t id);
+void can_irq_free (can_t *obj);
+void can_irq_set (can_t *obj, CanIrqType irq, uint32_t enable);
+
+int can_write (can_t *obj, CAN_Message, int cc);
+int can_read (can_t *obj, CAN_Message *msg, int handle);
+int can_mode (can_t *obj, CanMode mode);
+int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle);
+void can_reset (can_t *obj);
+unsigned char can_rderror (can_t *obj);
+unsigned char can_tderror (can_t *obj);
+void can_monitor (can_t *obj, int silent);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif // MBED_CAN_API_H
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/dma_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,45 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2014-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_DMA_API_H
+#define MBED_DMA_API_H
+
+#include <stdint.h>
+
+#define DMA_ERROR_OUT_OF_CHANNELS (-1)
+
+typedef enum {
+ DMA_USAGE_NEVER,
+ DMA_USAGE_OPPORTUNISTIC,
+ DMA_USAGE_ALWAYS,
+ DMA_USAGE_TEMPORARY_ALLOCATED,
+ DMA_USAGE_ALLOCATED
+} DMAUsage;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dma_init(void);
+
+int dma_channel_allocate(uint32_t capabilities);
+
+int dma_channel_free(int channelid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/ethernet_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,63 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_ETHERNET_API_H
+#define MBED_ETHERNET_API_H
+
+#include "device.h"
+
+#if DEVICE_ETHERNET
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Connection constants
+
+int ethernet_init(void);
+void ethernet_free(void);
+
+// write size bytes from data to ethernet buffer
+// return num bytes written
+// or -1 if size is too big
+int ethernet_write(const char *data, int size);
+
+// send ethernet write buffer, returning the packet size sent
+int ethernet_send(void);
+
+// recieve from ethernet buffer, returning packet size, or 0 if no packet
+int ethernet_receive(void);
+
+// read size bytes in to data, return actual num bytes read (0..size)
+// if data == NULL, throw the bytes away
+int ethernet_read(char *data, int size);
+
+// get the ethernet address
+void ethernet_address(char *mac);
+
+// see if the link is up
+int ethernet_link(void);
+
+// force link settings
+void ethernet_set_link(int speed, int duplex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/gpio_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,57 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_GPIO_API_H
+#define MBED_GPIO_API_H
+
+#include "device.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Set the given pin as GPIO
+ * @param pin The pin to be set as GPIO
+ * @return The GPIO port mask for this pin
+ **/
+uint32_t gpio_set(PinName pin);
+
+/* Checks if gpio object is connected (pin was not initialized with NC)
+ * @param pin The pin to be set as GPIO
+ * @return 0 if port is initialized with NC
+ **/
+int gpio_is_connected(const gpio_t *obj);
+
+/* GPIO object */
+void gpio_init(gpio_t *obj, PinName pin);
+
+void gpio_mode (gpio_t *obj, PinMode mode);
+void gpio_dir (gpio_t *obj, PinDirection direction);
+
+void gpio_write(gpio_t *obj, int value);
+int gpio_read (gpio_t *obj);
+
+// the following set of functions are generic and are implemented in the common gpio.c file
+void gpio_init_in(gpio_t* gpio, PinName pin);
+void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode);
+void gpio_init_out(gpio_t* gpio, PinName pin);
+void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value);
+void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/gpio_irq_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,49 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_GPIO_IRQ_API_H
+#define MBED_GPIO_IRQ_API_H
+
+#include "device.h"
+
+#if DEVICE_INTERRUPTIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ IRQ_NONE,
+ IRQ_RISE,
+ IRQ_FALL
+} gpio_irq_event;
+
+typedef struct gpio_irq_s gpio_irq_t;
+
+typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event);
+
+int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id);
+void gpio_irq_free(gpio_irq_t *obj);
+void gpio_irq_set (gpio_irq_t *obj, gpio_irq_event event, uint32_t enable);
+void gpio_irq_enable(gpio_irq_t *obj);
+void gpio_irq_disable(gpio_irq_t *obj);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/i2c_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,223 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_I2C_API_H
+#define MBED_I2C_API_H
+
+#include "device.h"
+#include "buffer.h"
+
+#if DEVICE_I2C
+
+/**
+ * @defgroup I2CEvents I2C Events Macros
+ *
+ * @{
+ */
+#define I2C_EVENT_ERROR (1 << 1)
+#define I2C_EVENT_ERROR_NO_SLAVE (1 << 2)
+#define I2C_EVENT_TRANSFER_COMPLETE (1 << 3)
+#define I2C_EVENT_TRANSFER_EARLY_NACK (1 << 4)
+#define I2C_EVENT_ALL (I2C_EVENT_ERROR | I2C_EVENT_TRANSFER_COMPLETE | I2C_EVENT_ERROR_NO_SLAVE | I2C_EVENT_TRANSFER_EARLY_NACK)
+
+/**@}*/
+
+#if DEVICE_I2C_ASYNCH
+/** Asynch i2c hal structure
+ */
+typedef struct {
+ struct i2c_s i2c; /**< Target specific i2c structure */
+ struct buffer_s tx_buff; /**< Tx buffer */
+ struct buffer_s rx_buff; /**< Rx buffer */
+} i2c_t;
+
+#else
+/** Non-asynch i2c hal structure
+ */
+typedef struct i2c_s i2c_t;
+
+#endif
+
+enum {
+ I2C_ERROR_NO_SLAVE = -1,
+ I2C_ERROR_BUS_BUSY = -2
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup GeneralI2C I2C Configuration Functions
+ * @{
+ */
+
+/** Initialize the I2C peripheral. It sets the default parameters for I2C
+ * peripheral, and configure its specifieds pins.
+ * @param obj The i2c object
+ * @param sda The sda pin
+ * @param scl The scl pin
+ */
+void i2c_init(i2c_t *obj, PinName sda, PinName scl);
+
+/** Configure the I2C frequency.
+ * @param obj The i2c object
+ * @param hz Frequency in Hz
+ */
+void i2c_frequency(i2c_t *obj, int hz);
+
+/** Send START command.
+ * @param obj The i2c object
+ */
+int i2c_start(i2c_t *obj);
+
+/** Send STOP command.
+ * @param obj The i2c object
+ */
+int i2c_stop(i2c_t *obj);
+
+/** Blocking reading data.
+ * @param obj The i2c object
+ * @param address 7-bit address (last bit is 1)
+ * @param data The buffer for receiving
+ * @param length Number of bytes to read
+ * @param stop Stop to be generated after the transfer is done
+ * @return Number of read bytes
+ */
+int i2c_read(i2c_t *obj, int address, char *data, int length, int stop);
+
+/** Blocking sending data.
+ * @param obj The i2c object
+ * @param address 7-bit address (last bit is 0)
+ * @param data The buffer for sending
+ * @param length Number of bytes to wrte
+ * @param stop Stop to be generated after the transfer is done
+ * @return Number of written bytes
+ */
+int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop);
+
+/** Reset I2C peripheral. TODO: The action here. Most of the implementation sends stop().
+ * @param obj The i2c object
+ */
+void i2c_reset(i2c_t *obj);
+
+/** Read one byte.
+ * @param obj The i2c object
+ * @param last Acknoledge
+ * @return The read byte
+ */
+int i2c_byte_read(i2c_t *obj, int last);
+
+/** Write one byte.
+ * @param obj The i2c object
+ * @param data Byte to be written
+ * @return 1 if NAK was received, 0 if ACK was received, 2 for timeout.
+ */
+int i2c_byte_write(i2c_t *obj, int data);
+
+/**@}*/
+
+#if DEVICE_I2CSLAVE
+
+/**
+ * \defgroup SynchI2C Synchronous I2C Hardware Abstraction Layer for slave
+ * @{
+ */
+
+/** Configure I2C as slave or master.
+ * @param obj The I2C object
+ * @return non-zero if a value is available
+ */
+void i2c_slave_mode(i2c_t *obj, int enable_slave);
+
+/** Check to see if the I2C slave has been addressed.
+ * @param obj The I2C object
+ * @return The status - 1 - read addresses, 2 - write to all slaves,
+ * 3 write addressed, 0 - the slave has not been addressed
+ */
+int i2c_slave_receive(i2c_t *obj);
+
+/** Configure I2C as slave or master.
+ * @param obj The I2C object
+ * @return non-zero if a value is available
+ */
+int i2c_slave_read(i2c_t *obj, char *data, int length);
+
+/** Configure I2C as slave or master.
+ * @param obj The I2C object
+ * @return non-zero if a value is available
+ */
+int i2c_slave_write(i2c_t *obj, const char *data, int length);
+
+/** Configure I2C address.
+ * @param obj The I2C object
+ * @param idx Currently not used
+ * @param address The address to be set
+ * @param mask Currently not used
+ */
+void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask);
+
+#endif
+
+/**@}*/
+
+#if DEVICE_I2C_ASYNCH
+
+/**
+ * \defgroup AsynchI2C Asynchronous I2C Hardware Abstraction Layer
+ * @{
+ */
+
+/** Start i2c asynchronous transfer.
+ * @param obj The I2C object
+ * @param tx The buffer to send
+ * @param tx_length The number of words to transmit
+ * @param rx The buffer to receive
+ * @param rx_length The number of words to receive
+ * @param address The address to be set - 7bit or 9 bit
+ * @param stop If true, stop will be generated after the transfer is done
+ * @param handler The I2C IRQ handler to be set
+ * @param hint DMA hint usage
+ */
+void i2c_transfer_asynch(i2c_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint32_t address, uint32_t stop, uint32_t handler, uint32_t event, DMAUsage hint);
+
+/** The asynchronous IRQ handler
+ * @param obj The I2C object which holds the transfer information
+ * @return event flags if a transfer termination condition was met or 0 otherwise.
+ */
+uint32_t i2c_irq_handler_asynch(i2c_t *obj);
+
+/** Attempts to determine if I2C peripheral is already in use.
+ * @param obj The I2C object
+ * @return non-zero if the I2C module is active or zero if it is not
+ */
+uint8_t i2c_active(i2c_t *obj);
+
+/** Abort ongoing asynchronous transaction.
+ * @param obj The I2C object
+ */
+void i2c_abort_asynch(i2c_t *obj);
+
+#endif
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/lp_ticker_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,82 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_LPTICKER_API_H
+#define MBED_LPTICKER_API_H
+
+#include "device.h"
+
+#if DEVICE_LOWPOWERTIMER
+
+#include "ticker_api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup LpTicker Low Power Ticker Functions
+ * @{
+ */
+
+/** Get low power ticker's data
+ *
+ * @return The low power ticker data
+ */
+const ticker_data_t* get_lp_ticker_data(void);
+
+/** The wrapper for ticker_irq_handler, to pass lp ticker's data
+ *
+ */
+void lp_ticker_irq_handler(void);
+
+/* HAL lp ticker */
+
+/** Initialize the low power ticker
+ *
+ */
+void lp_ticker_init(void);
+
+/** Read the current counter
+ *
+ * @return The current timer's counter value in microseconds
+ */
+uint32_t lp_ticker_read(void);
+
+/** Set interrupt for specified timestamp
+ *
+ * @param timestamp The time in microseconds to be set
+ */
+void lp_ticker_set_interrupt(timestamp_t timestamp);
+
+/** Disable low power ticker interrupt
+ *
+ */
+void lp_ticker_disable_interrupt(void);
+
+/** Clear the low power ticker interrupt
+ *
+ */
+void lp_ticker_clear_interrupt(void);
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/pinmap.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,45 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PINMAP_H
+#define MBED_PINMAP_H
+
+#include "PinNames.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ PinName pin;
+ int peripheral;
+ int function;
+} PinMap;
+
+void pin_function(PinName pin, int function);
+void pin_mode (PinName pin, PinMode mode);
+
+uint32_t pinmap_peripheral(PinName pin, const PinMap* map);
+uint32_t pinmap_function(PinName pin, const PinMap* map);
+uint32_t pinmap_merge (uint32_t a, uint32_t b);
+void pinmap_pinout (PinName pin, const PinMap *map);
+uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map);
+uint32_t pinmap_find_function(PinName pin, const PinMap* map);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/port_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,42 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PORTMAP_H
+#define MBED_PORTMAP_H
+
+#include "device.h"
+
+#if DEVICE_PORTIN || DEVICE_PORTOUT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct port_s port_t;
+
+PinName port_pin(PortName port, int pin_n);
+
+void port_init (port_t *obj, PortName port, int mask, PinDirection dir);
+void port_mode (port_t *obj, PinMode mode);
+void port_dir (port_t *obj, PinDirection dir);
+void port_write(port_t *obj, int value);
+int port_read (port_t *obj);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/pwmout_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,49 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PWMOUT_API_H
+#define MBED_PWMOUT_API_H
+
+#include "device.h"
+
+#if DEVICE_PWMOUT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct pwmout_s pwmout_t;
+
+void pwmout_init (pwmout_t* obj, PinName pin);
+void pwmout_free (pwmout_t* obj);
+
+void pwmout_write (pwmout_t* obj, float percent);
+float pwmout_read (pwmout_t* obj);
+
+void pwmout_period (pwmout_t* obj, float seconds);
+void pwmout_period_ms (pwmout_t* obj, int ms);
+void pwmout_period_us (pwmout_t* obj, int us);
+
+void pwmout_pulsewidth (pwmout_t* obj, float seconds);
+void pwmout_pulsewidth_ms(pwmout_t* obj, int ms);
+void pwmout_pulsewidth_us(pwmout_t* obj, int us);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/rtc_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,42 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_RTC_API_H
+#define MBED_RTC_API_H
+
+#include "device.h"
+
+#if DEVICE_RTC
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void rtc_init(void);
+void rtc_free(void);
+int rtc_isenabled(void);
+
+time_t rtc_read(void);
+void rtc_write(time_t t);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/serial_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,302 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SERIAL_API_H
+#define MBED_SERIAL_API_H
+
+#include "device.h"
+#include "buffer.h"
+#include "dma_api.h"
+
+#if DEVICE_SERIAL
+
+#define SERIAL_EVENT_TX_SHIFT (2)
+#define SERIAL_EVENT_RX_SHIFT (8)
+
+#define SERIAL_EVENT_TX_MASK (0x00FC)
+#define SERIAL_EVENT_RX_MASK (0x3F00)
+
+#define SERIAL_EVENT_ERROR (1 << 1)
+
+/**
+ * @defgroup SerialTXEvents Serial TX Events Macros
+ *
+ * @{
+ */
+#define SERIAL_EVENT_TX_COMPLETE (1 << (SERIAL_EVENT_TX_SHIFT + 0))
+#define SERIAL_EVENT_TX_ALL (SERIAL_EVENT_TX_COMPLETE)
+/**@}*/
+
+/**
+ * @defgroup SerialRXEvents Serial RX Events Macros
+ *
+ * @{
+ */
+#define SERIAL_EVENT_RX_COMPLETE (1 << (SERIAL_EVENT_RX_SHIFT + 0))
+#define SERIAL_EVENT_RX_OVERRUN_ERROR (1 << (SERIAL_EVENT_RX_SHIFT + 1))
+#define SERIAL_EVENT_RX_FRAMING_ERROR (1 << (SERIAL_EVENT_RX_SHIFT + 2))
+#define SERIAL_EVENT_RX_PARITY_ERROR (1 << (SERIAL_EVENT_RX_SHIFT + 3))
+#define SERIAL_EVENT_RX_OVERFLOW (1 << (SERIAL_EVENT_RX_SHIFT + 4))
+#define SERIAL_EVENT_RX_CHARACTER_MATCH (1 << (SERIAL_EVENT_RX_SHIFT + 5))
+#define SERIAL_EVENT_RX_ALL (SERIAL_EVENT_RX_OVERFLOW | SERIAL_EVENT_RX_PARITY_ERROR | \
+ SERIAL_EVENT_RX_FRAMING_ERROR | SERIAL_EVENT_RX_OVERRUN_ERROR | \
+ SERIAL_EVENT_RX_COMPLETE | SERIAL_EVENT_RX_CHARACTER_MATCH)
+/**@}*/
+
+#define SERIAL_RESERVED_CHAR_MATCH (255)
+
+typedef enum {
+ ParityNone = 0,
+ ParityOdd = 1,
+ ParityEven = 2,
+ ParityForced1 = 3,
+ ParityForced0 = 4
+} SerialParity;
+
+typedef enum {
+ RxIrq,
+ TxIrq
+} SerialIrq;
+
+typedef enum {
+ FlowControlNone,
+ FlowControlRTS,
+ FlowControlCTS,
+ FlowControlRTSCTS
+} FlowControl;
+
+typedef void (*uart_irq_handler)(uint32_t id, SerialIrq event);
+
+#if DEVICE_SERIAL_ASYNCH
+/** Asynch serial hal structure
+ */
+typedef struct {
+ struct serial_s serial; /**< Target specific serial structure */
+ struct buffer_s tx_buff; /**< Tx buffer */
+ struct buffer_s rx_buff; /**< Rx buffer */
+ uint8_t char_match; /**< Character to be matched */
+ uint8_t char_found; /**< State of the matched character */
+} serial_t;
+
+#else
+/** Non-asynch serial hal structure
+ */
+typedef struct serial_s serial_t;
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup GeneralSerial Serial Configuration Functions
+ * @{
+ */
+
+/** Initialize the serial peripheral. It sets the default parameters for serial
+ * peripheral, and configure its specifieds pins.
+ *
+ * @param obj The serial object
+ * @param tx The TX pin
+ * @param rx The RX pin
+ */
+void serial_init(serial_t *obj, PinName tx, PinName rx);
+
+/** Release the serial peripheral, not currently invoked. It requires further
+ * resource management.
+ *
+ * @param obj The serial object
+ */
+void serial_free(serial_t *obj);
+
+/** Configure the baud rate
+ *
+ * @param obj The serial object
+ * @param baudrate The baud rate to be configured
+ */
+void serial_baud(serial_t *obj, int baudrate);
+
+/** Configure the format. Set the number of bits, parity and the number of stop bits
+ *
+ * @param obj The serial object
+ * @param data_bits The number of data bits
+ * @param parity The parity
+ * @param stop_bits The number of stop bits
+ */
+void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits);
+
+/** The serial interrupt handler registration.
+ *
+ * @param obj The serial object
+ * @param handler The interrupt handler which will be invoked when interrupt fires.
+ * @param id The SerialBase object
+ */
+void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id);
+
+/** Configure serial interrupt. This function is used for word-approach
+ *
+ * @param obj The serial object
+ * @param irq The serial IRQ type (RX or TX)
+ * @param enable Set to non-zero to enable events, or zero to disable them
+ */
+void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable);
+
+/** Get character. This is a blocking call, waiting for a character
+ *
+ * @param obj The serial object
+ */
+int serial_getc(serial_t *obj);
+
+/** Put a character. This is a blocking call, waiting for a peripheral to be available
+ * for writing
+ *
+ * @param obj The serial object
+ * @param c The character to be sent
+ */
+void serial_putc(serial_t *obj, int c);
+
+/** Check if the serial peripheral is readable
+ *
+ * @param obj The serial object
+ * @return Non-zero value if a character can be read, 0 if nothing to read.
+ */
+int serial_readable(serial_t *obj);
+
+/** Check if the serial peripheral is writable
+ *
+ * @param obj The serial object
+ * @return Non-zero value if a character can be written, 0 otherwise.
+ */
+int serial_writable(serial_t *obj);
+
+/** Clear the serial peripheral
+ *
+ * @param obj The serial object
+ */
+void serial_clear(serial_t *obj);
+
+/** Set the break
+ *
+ * @param obj The serial object
+ */
+void serial_break_set(serial_t *obj);
+
+/** Clear the break
+ *
+ * @param obj The serial object
+ */
+void serial_break_clear(serial_t *obj);
+
+/** Configure the TX pin for UART function.
+ *
+ * @param tx The pin used for TX
+ */
+void serial_pinout_tx(PinName tx);
+
+/** Configure the serial for the flow control. It sets flow control in the hardware
+ * if a serial peripheral supports it, otherwise software emulation is used.
+ *
+ * @param obj The serial object
+ * @param type The type of the flow control. Look at the available FlowControl types.
+ * @param rxflow The tx pin
+ * @param txflow The rx pin
+ */
+void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow);
+
+#if DEVICE_SERIAL_ASYNCH
+
+/**@}*/
+
+/**
+ * \defgroup AsynchSerial Asynchronous Serial Hardware Abstraction Layer
+ * @{
+ */
+
+/** Begin asynchronous TX transfer. The used buffer is specified in the serial object,
+ * tx_buff
+ *
+ * @param obj The serial object
+ * @param tx The buffer for sending
+ * @param tx_length The number of words to transmit
+ * @param tx_width The bit width of buffer word
+ * @param handler The serial handler
+ * @param event The logical OR of events to be registered
+ * @param hint A suggestion for how to use DMA with this transfer
+ * @return Returns number of data transfered, or 0 otherwise
+ */
+int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint);
+
+/** Begin asynchronous RX transfer (enable interrupt for data collecting)
+ * The used buffer is specified in the serial object - rx_buff
+ *
+ * @param obj The serial object
+ * @param rx The buffer for sending
+ * @param rx_length The number of words to transmit
+ * @param rx_width The bit width of buffer word
+ * @param handler The serial handler
+ * @param event The logical OR of events to be registered
+ * @param handler The serial handler
+ * @param char_match A character in range 0-254 to be matched
+ * @param hint A suggestion for how to use DMA with this transfer
+ */
+void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_width, uint32_t handler, uint32_t event, uint8_t char_match, DMAUsage hint);
+
+/** Attempts to determine if the serial peripheral is already in use for TX
+ *
+ * @param obj The serial object
+ * @return Non-zero if the RX transaction is ongoing, 0 otherwise
+ */
+uint8_t serial_tx_active(serial_t *obj);
+
+/** Attempts to determine if the serial peripheral is already in use for RX
+ *
+ * @param obj The serial object
+ * @return Non-zero if the RX transaction is ongoing, 0 otherwise
+ */
+uint8_t serial_rx_active(serial_t *obj);
+
+/** The asynchronous TX and RX handler.
+ *
+ * @param obj The serial object
+ * @return Returns event flags if a RX transfer termination condition was met or 0 otherwise
+ */
+int serial_irq_handler_asynch(serial_t *obj);
+
+/** Abort the ongoing TX transaction. It disables the enabled interupt for TX and
+ * flush TX hardware buffer if TX FIFO is used
+ *
+ * @param obj The serial object
+ */
+void serial_tx_abort_asynch(serial_t *obj);
+
+/** Abort the ongoing RX transaction It disables the enabled interrupt for RX and
+ * flush RX hardware buffer if RX FIFO is used
+ *
+ * @param obj The serial object
+ */
+void serial_rx_abort_asynch(serial_t *obj);
+
+/**@}*/
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/sleep_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,64 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SLEEP_API_H
+#define MBED_SLEEP_API_H
+
+#include "device.h"
+
+#if DEVICE_SLEEP
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Send the microcontroller to sleep
+ *
+ * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the
+ * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
+ * dynamic power used by the processor, memory systems and buses. The processor, peripheral and
+ * memory state are maintained, and the peripherals continue to work and can generate interrupts.
+ *
+ * The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
+ *
+ * @note
+ * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
+ * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
+ * able to access the LocalFileSystem
+ */
+void sleep(void);
+
+/** Send the microcontroller to deep sleep
+ *
+ * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
+ * has the same sleep features as sleep plus it powers down peripherals and clocks. All state
+ * is still maintained.
+ *
+ * The processor can only be woken up by an external interrupt on a pin or a watchdog timer.
+ *
+ * @note
+ * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
+ * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
+ * able to access the LocalFileSystem
+ */
+void deepsleep(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/spi_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,213 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_SPI_API_H
+#define MBED_SPI_API_H
+
+#include "device.h"
+#include "dma_api.h"
+#include "buffer.h"
+
+#if DEVICE_SPI
+
+#define SPI_EVENT_ERROR (1 << 1)
+#define SPI_EVENT_COMPLETE (1 << 2)
+#define SPI_EVENT_RX_OVERFLOW (1 << 3)
+#define SPI_EVENT_ALL (SPI_EVENT_ERROR | SPI_EVENT_COMPLETE | SPI_EVENT_RX_OVERFLOW)
+
+#define SPI_EVENT_INTERNAL_TRANSFER_COMPLETE (1 << 30) // internal flag to report an event occurred
+
+#define SPI_FILL_WORD (0xFFFF)
+
+#if DEVICE_SPI_ASYNCH
+/** Asynch spi hal structure
+ */
+typedef struct {
+ struct spi_s spi; /**< Target specific spi structure */
+ struct buffer_s tx_buff; /**< Tx buffer */
+ struct buffer_s rx_buff; /**< Rx buffer */
+} spi_t;
+
+#else
+/** Non-asynch spi hal structure
+ */
+typedef struct spi_s spi_t;
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup GeneralSPI SPI Configuration Functions
+ * @{
+ */
+
+/** Initialize the SPI peripheral
+ *
+ * Configures the pins used by SPI, sets a default format and frequency, and enables the peripheral
+ * @param[out] obj The SPI object to initialize
+ * @param[in] mosi The pin to use for MOSI
+ * @param[in] miso The pin to use for MISO
+ * @param[in] sclk The pin to use for SCLK
+ * @param[in] ssel The pin to use for SSEL
+ */
+void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel);
+
+/** Release a SPI object
+ *
+ * TODO: spi_free is currently unimplemented
+ * This will require reference counting at the C++ level to be safe
+ *
+ * Return the pins owned by the SPI object to their reset state
+ * Disable the SPI peripheral
+ * Disable the SPI clock
+ * @param[in] obj The SPI object to deinitialize
+ */
+void spi_free(spi_t *obj);
+
+/** Configure the SPI format
+ *
+ * Set the number of bits per frame, configure clock polarity and phase, shift order and master/slave mode
+ * @param[in,out] obj The SPI object to configure
+ * @param[in] bits The number of bits per frame
+ * @param[in] mode The SPI mode (clock polarity, phase, and shift direction)
+ * @param[in] slave Zero for master mode or non-zero for slave mode
+ */
+void spi_format(spi_t *obj, int bits, int mode, int slave);
+
+/** Set the SPI baud rate
+ *
+ * Actual frequency may differ from the desired frequency due to available dividers and bus clock
+ * Configures the SPI peripheral's baud rate
+ * @param[in,out] obj The SPI object to configure
+ * @param[in] hz The baud rate in Hz
+ */
+void spi_frequency(spi_t *obj, int hz);
+
+/**@}*/
+/**
+ * \defgroup SynchSPI Synchronous SPI Hardware Abstraction Layer
+ * @{
+ */
+
+/** Write a byte out in master mode and receive a value
+ *
+ * @param[in] obj The SPI peripheral to use for sending
+ * @param[in] value The value to send
+ * @return Returns the value received during send
+ */
+int spi_master_write(spi_t *obj, int value);
+
+/** Check if a value is available to read
+ *
+ * @param[in] obj The SPI peripheral to check
+ * @return non-zero if a value is available
+ */
+int spi_slave_receive(spi_t *obj);
+
+/** Get a received value out of the SPI receive buffer in slave mode
+ *
+ * Blocks until a value is available
+ * @param[in] obj The SPI peripheral to read
+ * @return The value received
+ */
+int spi_slave_read(spi_t *obj);
+
+/** Write a value to the SPI peripheral in slave mode
+ *
+ * Blocks until the SPI peripheral can be written to
+ * @param[in] obj The SPI peripheral to write
+ * @param[in] value The value to write
+ */
+void spi_slave_write(spi_t *obj, int value);
+
+/** Checks if the specified SPI peripheral is in use
+ *
+ * @param[in] obj The SPI peripheral to check
+ * @return non-zero if the peripheral is currently transmitting
+ */
+int spi_busy(spi_t *obj);
+
+/** Get the module number
+ *
+ * @param[in] obj The SPI peripheral to check
+ * @return The module number
+ */
+uint8_t spi_get_module(spi_t *obj);
+
+/**@}*/
+
+#if DEVICE_SPI_ASYNCH
+/**
+ * \defgroup AsynchSPI Asynchronous SPI Hardware Abstraction Layer
+ * @{
+ */
+
+/** Begin the SPI transfer. Buffer pointers and lengths are specified in tx_buff and rx_buff
+ *
+ * @param[in] obj The SPI object which holds the transfer information
+ * @param[in] tx The buffer to send
+ * @param[in] tx_length The number of words to transmit
+ * @param[in] rx The buffer to receive
+ * @param[in] rx_length The number of words to receive
+ * @param[in] bit_width The bit width of buffer words
+ * @param[in] event The logical OR of events to be registered
+ * @param[in] handler SPI interrupt handler
+ * @param[in] hint A suggestion for how to use DMA with this transfer
+ */
+void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx, size_t rx_length, uint8_t bit_width, uint32_t handler, uint32_t event, DMAUsage hint);
+
+/** The asynchronous IRQ handler
+ *
+ * Reads the received values out of the RX FIFO, writes values into the TX FIFO and checks for transfer termination
+ * conditions, such as buffer overflows or transfer complete.
+ * @param[in] obj The SPI object which holds the transfer information
+ * @return event flags if a transfer termination condition was met or 0 otherwise.
+ */
+uint32_t spi_irq_handler_asynch(spi_t *obj);
+
+/** Attempts to determine if the SPI peripheral is already in use.
+ *
+ * If a temporary DMA channel has been allocated, peripheral is in use.
+ * If a permanent DMA channel has been allocated, check if the DMA channel is in use. If not, proceed as though no DMA
+ * channel were allocated.
+ * If no DMA channel is allocated, check whether tx and rx buffers have been assigned. For each assigned buffer, check
+ * if the corresponding buffer position is less than the buffer length. If buffers do not indicate activity, check if
+ * there are any bytes in the FIFOs.
+ * @param[in] obj The SPI object to check for activity
+ * @return non-zero if the SPI port is active or zero if it is not.
+ */
+uint8_t spi_active(spi_t *obj);
+
+/** Abort an SPI transfer
+ *
+ * @param obj The SPI peripheral to stop
+ */
+void spi_abort_asynch(spi_t *obj);
+
+
+#endif
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // SPI_DEVICE
+
+#endif // MBED_SPI_API_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/ticker_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,108 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_TICKER_API_H
+#define MBED_TICKER_API_H
+
+#include "device.h"
+
+typedef uint32_t timestamp_t;
+
+/** Ticker's event structure
+ */
+typedef struct ticker_event_s {
+ timestamp_t timestamp; /**< Event's timestamp */
+ uint32_t id; /**< TimerEvent object */
+ struct ticker_event_s *next; /**< Next event in the queue */
+} ticker_event_t;
+
+typedef void (*ticker_event_handler)(uint32_t id);
+
+/** Ticker's interface structure - required API for a ticker
+ */
+typedef struct {
+ void (*init)(void); /**< Init function */
+ uint32_t (*read)(void); /**< Read function */
+ void (*disable_interrupt)(void); /**< Disable interrupt function */
+ void (*clear_interrupt)(void); /**< Clear interrupt function */
+ void (*set_interrupt)(timestamp_t timestamp); /**< Set interrupt function */
+} ticker_interface_t;
+
+/** Tickers events queue structure
+ */
+typedef struct {
+ ticker_event_handler event_handler; /**< Event handler */
+ ticker_event_t *head; /**< A pointer to head */
+} ticker_event_queue_t;
+
+/** Tickers data structure
+ */
+typedef struct {
+ const ticker_interface_t *interface; /**< Ticker's interface */
+ ticker_event_queue_t *queue; /**< Ticker's events queue */
+} ticker_data_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Initialize a ticker and sets the event handler
+ *
+ * @param data The ticker's data
+ * @param handler A handler to be set
+ */
+void ticker_set_handler(const ticker_data_t *const data, ticker_event_handler handler);
+
+/** Irq handler which goes through the events to trigger events in the past.
+ *
+ * @param data The ticker's data
+ */
+void ticker_irq_handler(const ticker_data_t *const data);
+
+/** Remove an event from the queue
+ *
+ * @param data The ticker's data
+ * @param obj The event's queue to be removed
+ */
+void ticker_remove_event(const ticker_data_t *const data, ticker_event_t *obj);
+
+/** Insert an event from the queue
+ *
+ * @param data The ticker's data
+ * @param obj The event's queue to be removed
+ * @param timestamp The event's timestamp
+ * @param id The event object
+ */
+void ticker_insert_event(const ticker_data_t *const data, ticker_event_t *obj, timestamp_t timestamp, uint32_t id);
+
+/** Read the current ticker's timestamp
+ *
+ * @param data The ticker's data
+ * @return The current timestamp
+ */
+timestamp_t ticker_read(const ticker_data_t *const data);
+
+/** Read the next event's timestamp
+ *
+ * @param data The ticker's data
+ * @return 1 if timestamp is pending event, 0 if there's no event pending
+ */
+int ticker_get_next_timestamp(const ticker_data_t *const data, timestamp_t *timestamp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/hal/us_ticker_api.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,78 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2015 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_US_TICKER_API_H
+#define MBED_US_TICKER_API_H
+
+#include <stdint.h>
+#include "ticker_api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup UsTicker Microseconds Ticker Functions
+ * @{
+ */
+
+/** Get ticker's data
+ *
+ * @return The low power ticker data
+ */
+const ticker_data_t* get_us_ticker_data(void);
+
+
+/** The wrapper for ticker_irq_handler, to pass us ticker's data
+ *
+ */
+void us_ticker_irq_handler(void);
+
+/* HAL us ticker */
+
+/** Initialize the ticker
+ *
+ */
+void us_ticker_init(void);
+
+/** Read the current counter
+ *
+ * @return The current timer's counter value in microseconds
+ */
+uint32_t us_ticker_read(void);
+
+/** Set interrupt for specified timestamp
+ *
+ * @param timestamp The time in microseconds to be set
+ */
+void us_ticker_set_interrupt(timestamp_t timestamp);
+
+/** Disable us ticker interrupt
+ *
+ */
+void us_ticker_disable_interrupt(void);
+
+/** Clear us ticker interrupt
+ *
+ */
+void us_ticker_clear_interrupt(void);
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/module.json Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,30 @@
+{
+ "name": "mbed-classic",
+ "version": "0.0.1",
+ "description": "mbed core SDK (for mbed 2.0, *not* mbedOS)",
+ "keywords": [
+ "mbed"
+ ],
+ "author": "Bogdan Marinescu <bogdan.marinescu@arm.com>",
+ "repository": {
+ "url": "git@github.com:mbedmicro/mbed.git",
+ "type": "git"
+ },
+ "homepage": "https://github.com/mbedmicro/mbed",
+ "licenses": [
+ {
+ "url": "https://spdx.org/licenses/Apache-2.0",
+ "type": "Apache-2.0"
+ }
+ ],
+ "extraIncludes": [
+ "api",
+ "hal",
+ "targets/hal",
+ "targets/cmsis"
+ ],
+ "dependencies": {
+ },
+ "targetDependencies": {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/LPC11U6x.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,1247 @@
+
+/****************************************************************************************************//**
+ * @file LPC11U6x.h
+ *
+ * @brief CMSIS Cortex-M0PLUS Peripheral Access Layer Header File for
+ * LPC11U6x from .
+ *
+ * @version V0.4
+ * @date 22. October 2013
+ *
+ * @note Generated with SVDConv V2.81a
+ * from CMSIS SVD File 'LPC11U6x.svd' Version 0.4,
+ *
+ * modified by Keil
+ *******************************************************************************************************/
+
+
+
+/** @addtogroup (null)
+ * @{
+ */
+
+/** @addtogroup LPC11U6x
+ * @{
+ */
+
+#ifndef LPC11U6X_H
+#define LPC11U6X_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* ------------------------- Interrupt Number Definition ------------------------ */
+
+typedef enum {
+/* ----------------- Cortex-M0PLUS Processor Exceptions Numbers ----------------- */
+ Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
+ NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
+ HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */
+
+
+
+ SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
+
+
+ PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
+ SysTick_IRQn = -1, /*!< 15 System Tick Timer */
+/* --------------------- LPC11U6x Specific Interrupt Numbers -------------------- */
+ PIN_INT0_IRQn = 0, /*!< 0 PIN_INT0 */
+ PIN_INT1_IRQn = 1, /*!< 1 PIN_INT1 */
+ PIN_INT2_IRQn = 2, /*!< 2 PIN_INT2 */
+ PIN_INT3_IRQn = 3, /*!< 3 PIN_INT3 */
+ PIN_INT4_IRQn = 4, /*!< 4 PIN_INT4 */
+ PIN_INT5_IRQn = 5, /*!< 5 PIN_INT5 */
+ PIN_INT6_IRQn = 6, /*!< 6 PIN_INT6 */
+ PIN_INT7_IRQn = 7, /*!< 7 PIN_INT7 */
+ GINT0_IRQn = 8, /*!< 8 GINT0 */
+ GINT1_IRQn = 9, /*!< 9 GINT1 */
+ I2C1_IRQn = 10, /*!< 10 I2C1 */
+ USART1_4_IRQn = 11, /*!< 11 USART1_4 */
+ USART2_3_IRQn = 12, /*!< 12 USART2_3 */
+ SCT0_1_IRQn = 13, /*!< 13 SCT0_1 */
+ SSP1_IRQn = 14, /*!< 14 SSP1 */
+ I2C0_IRQn = 15, /*!< 15 I2C0 */
+ CT16B0_IRQn = 16, /*!< 16 CT16B0 */
+ CT16B1_IRQn = 17, /*!< 17 CT16B1 */
+ CT32B0_IRQn = 18, /*!< 18 CT32B0 */
+ CT32B1_IRQn = 19, /*!< 19 CT32B1 */
+ SSP0_IRQn = 20, /*!< 20 SSP0 */
+ USART0_IRQn = 21, /*!< 21 USART0 */
+ USB_IRQn = 22, /*!< 22 USB */
+ USB_FIQ_IRQn = 23, /*!< 23 USB_FIQ */
+ ADC_A_IRQn = 24, /*!< 24 ADC_A */
+ RTC_IRQn = 25, /*!< 25 RTC */
+ BOD_WDT_IRQn = 26, /*!< 26 BOD_WDT */
+ FLASH_IRQn = 27, /*!< 27 FLASH */
+ DMA_IRQn = 28, /*!< 28 DMA */
+ ADC_B_IRQn = 29, /*!< 29 ADC_B */
+ USBWAKEUP_IRQn = 30 /*!< 30 USBWAKEUP */
+} IRQn_Type;
+
+
+/** @addtogroup Configuration_of_CMSIS
+ * @{
+ */
+
+
+/* ================================================================================ */
+/* ================ Processor and Core Peripheral Section ================ */
+/* ================================================================================ */
+
+/* ----------------Configuration of the Cortex-M0PLUS Processor and Core Peripherals---------------- */
+#define __CM0PLUS_REV 0x0000 /*!< Cortex-M0PLUS Core Revision */
+#define __MPU_PRESENT 0 /*!< MPU present or not */
+#define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
+#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
+#define __VTOR_PRESENT 1 /*!< Set to 1 if CPU supports Vector Table Offset Register */
+/** @} */ /* End of group Configuration_of_CMSIS */
+
+#include "core_cm0plus.h" /*!< Cortex-M0PLUS processor and core peripherals */
+#include "system_LPC11U6x.h" /*!< LPC11U6x System */
+
+
+/* ================================================================================ */
+/* ================ Device Specific Peripheral Section ================ */
+/* ================================================================================ */
+
+
+/** @addtogroup Device_Peripheral_Registers
+ * @{
+ */
+
+
+/* ------------------- Start of section using anonymous unions ------------------ */
+#if defined(__CC_ARM)
+ #pragma push
+ #pragma anon_unions
+#elif defined(__ICCARM__)
+ #pragma language=extended
+#elif defined(__GNUC__)
+ /* anonymous unions are enabled by default */
+#elif defined(__TMS470__)
+/* anonymous unions are enabled by default */
+#elif defined(__TASKING__)
+ #pragma warning 586
+#else
+ #warning Not supported compiler type
+#endif
+
+
+
+/* ================================================================================ */
+/* ================ I2C0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief I2C-bus controller (I2C0)
+ */
+
+typedef struct { /*!< I2C0 Structure */
+ __IO uint32_t CONSET; /*!< I2C Control Set Register. When a one is written to a bit of
+ this register, the corresponding bit in the I2C control register
+ is set. Writing a zero has no effect on the corresponding bit
+ in the I2C control register. */
+ __I uint32_t STAT; /*!< I2C Status Register. During I2C operation, this register provides
+ detailed status codes that allow software to determine the next
+ action needed. */
+ __IO uint32_t DAT; /*!< I2C Data Register. During master or slave transmit mode, data
+ to be transmitted is written to this register. During master
+ or slave receive mode, data that has been received may be read
+ from this register. */
+ __IO uint32_t ADR0; /*!< I2C Slave Address Register 0. Contains the 7-bit slave address
+ for operation of the I2C interface in slave mode, and is not
+ used in master mode. The least significant bit determines whether
+ a slave responds to the General Call address. */
+ __IO uint32_t SCLH; /*!< SCH Duty Cycle Register High Half Word. Determines the high
+ time of the I2C clock. */
+ __IO uint32_t SCLL; /*!< SCL Duty Cycle Register Low Half Word. Determines the low time
+ of the I2C clock. I2nSCLL and I2nSCLH together determine the
+ clock frequency generated by an I2C master and certain times
+ used in slave mode. */
+ __O uint32_t CONCLR; /*!< I2C Control Clear Register. When a one is written to a bit of
+ this register, the corresponding bit in the I2C control register
+ is cleared. Writing a zero has no effect on the corresponding
+ bit in the I2C control register. */
+ __IO uint32_t MMCTRL; /*!< Monitor mode control register. */
+ __IO uint32_t ADR1; /*!< I2C Slave Address Register. Contains the 7-bit slave address
+ for operation of the I2C interface in slave mode, and is not
+ used in master mode. The least significant bit determines whether
+ a slave responds to the General Call address. */
+ __IO uint32_t ADR2; /*!< I2C Slave Address Register. Contains the 7-bit slave address
+ for operation of the I2C interface in slave mode, and is not
+ used in master mode. The least significant bit determines whether
+ a slave responds to the General Call address. */
+ __IO uint32_t ADR3; /*!< I2C Slave Address Register. Contains the 7-bit slave address
+ for operation of the I2C interface in slave mode, and is not
+ used in master mode. The least significant bit determines whether
+ a slave responds to the General Call address. */
+ __I uint32_t DATA_BUFFER; /*!< Data buffer register. The contents of the 8 MSBs of the I2DAT
+ shift register will be transferred to the DATA_BUFFER automatically
+ after every nine bits (8 bits of data plus ACK or NACK) has
+ been received on the bus. */
+ __IO uint32_t MASK0; /*!< I2C Slave address mask register. This mask register is associated
+ with I2ADR0 to determine an address match. The mask register
+ has no effect when comparing to the General Call address (0000000). */
+ __IO uint32_t MASK1; /*!< I2C Slave address mask register. This mask register is associated
+ with I2ADR0 to determine an address match. The mask register
+ has no effect when comparing to the General Call address (0000000). */
+ __IO uint32_t MASK2; /*!< I2C Slave address mask register. This mask register is associated
+ with I2ADR0 to determine an address match. The mask register
+ has no effect when comparing to the General Call address (0000000). */
+ __IO uint32_t MASK3; /*!< I2C Slave address mask register. This mask register is associated
+ with I2ADR0 to determine an address match. The mask register
+ has no effect when comparing to the General Call address (0000000). */
+} LPC_I2C0_Type;
+
+
+/* ================================================================================ */
+/* ================ WWDT ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Windowed Watchdog Timer (WWDT) (WWDT)
+ */
+
+typedef struct { /*!< WWDT Structure */
+ __IO uint32_t MOD; /*!< Watchdog mode register. This register contains the basic mode
+ and status of the Watchdog Timer. */
+ __IO uint32_t TC; /*!< Watchdog timer constant register. This 24-bit register determines
+ the time-out value. */
+ __O uint32_t FEED; /*!< Watchdog feed sequence register. Writing 0xAA followed by 0x55
+ to this register reloads the Watchdog timer with the value contained
+ in WDTC. */
+ __I uint32_t TV; /*!< Watchdog timer value register. This 24-bit register reads out
+ the current value of the Watchdog timer. */
+ __IO uint32_t CLKSEL; /*!< Watchdog clock select register. */
+ __IO uint32_t WARNINT; /*!< Watchdog Warning Interrupt compare value. */
+ __IO uint32_t WINDOW; /*!< Watchdog Window compare value. */
+} LPC_WWDT_Type;
+
+
+/* ================================================================================ */
+/* ================ USART0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief USART0 (USART0)
+ */
+
+typedef struct { /*!< USART0 Structure */
+
+ union {
+ __IO uint32_t DLL; /*!< Divisor Latch LSB. Least significant byte of the baud rate divisor
+ value. The full divisor is used to generate a baud rate from
+ the fractional rate divider. (DLAB=1) */
+ __O uint32_t THR; /*!< Transmit Holding Register. The next character to be transmitted
+ is written here. (DLAB=0) */
+ __I uint32_t RBR; /*!< Receiver Buffer Register. Contains the next received character
+ to be read. (DLAB=0) */
+ };
+
+ union {
+ __IO uint32_t IER; /*!< Interrupt Enable Register. Contains individual interrupt enable
+ bits for the 7 potential USART interrupts. (DLAB=0) */
+ __IO uint32_t DLM; /*!< Divisor Latch MSB. Most significant byte of the baud rate divisor
+ value. The full divisor is used to generate a baud rate from
+ the fractional rate divider. (DLAB=1) */
+ };
+
+ union {
+ __O uint32_t FCR; /*!< FIFO Control Register. Controls USART FIFO usage and modes. */
+ __I uint32_t IIR; /*!< Interrupt ID Register. Identifies which interrupt(s) are pending. */
+ };
+ __IO uint32_t LCR; /*!< Line Control Register. Contains controls for frame formatting
+ and break generation. */
+ __IO uint32_t MCR; /*!< Modem Control Register. */
+ __I uint32_t LSR; /*!< Line Status Register. Contains flags for transmit and receive
+ status, including line errors. */
+ __I uint32_t MSR; /*!< Modem Status Register. */
+ __IO uint32_t SCR; /*!< Scratch Pad Register. Eight-bit temporary storage for software. */
+ __IO uint32_t ACR; /*!< Auto-baud Control Register. Contains controls for the auto-baud
+ feature. */
+ __IO uint32_t ICR; /*!< IrDA Control Register. Enables and configures the IrDA (remote
+ control) mode. */
+ __IO uint32_t FDR; /*!< Fractional Divider Register. Generates a clock input for the
+ baud rate divider. */
+ __IO uint32_t OSR; /*!< Oversampling Register. Controls the degree of oversampling during
+ each bit time. */
+ __IO uint32_t TER; /*!< Transmit Enable Register. Turns off USART transmitter for use
+ with software flow control. */
+ __I uint32_t RESERVED0[3];
+ __IO uint32_t HDEN; /*!< Half duplex enable register. */
+ __I uint32_t RESERVED1;
+ __IO uint32_t SCICTRL; /*!< Smart Card Interface Control register. Enables and configures
+ the Smart Card Interface feature. */
+ __IO uint32_t RS485CTRL; /*!< RS-485/EIA-485 Control. Contains controls to configure various
+ aspects of RS-485/EIA-485 modes. */
+ __IO uint32_t RS485ADRMATCH; /*!< RS-485/EIA-485 address match. Contains the address match value
+ for RS-485/EIA-485 mode. */
+ __IO uint32_t RS485DLY; /*!< RS-485/EIA-485 direction control delay. */
+ __IO uint32_t SYNCCTRL; /*!< Synchronous mode control register. */
+} LPC_USART0_Type;
+
+
+/* ================================================================================ */
+/* ================ CT16B0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief 16-bit counter/timers CT16B0 (CT16B0)
+ */
+
+typedef struct { /*!< CT16B0 Structure */
+ __IO uint32_t IR; /*!< Interrupt Register. The IR can be written to clear interrupts.
+ The IR can be read to identify which of eight possible interrupt
+ sources are pending. */
+ __IO uint32_t TCR; /*!< Timer Control Register. The TCR is used to control the Timer
+ Counter functions. The Timer Counter can be disabled or reset
+ through the TCR. */
+ __IO uint32_t TC; /*!< Timer Counter. The 16-bit TC is incremented every PR+1 cycles
+ of PCLK. The TC is controlled through the TCR. */
+ __IO uint32_t PR; /*!< Prescale Register. When the Prescale Counter (below) is equal
+ to this value, the next clock increments the TC and clears the
+ PC. */
+ __IO uint32_t PC; /*!< Prescale Counter. The 16-bit PC is a counter which is incremented
+ to the value stored in PR. When the value in PR is reached,
+ the TC is incremented and the PC is cleared. The PC is observable
+ and controllable through the bus interface. */
+ __IO uint32_t MCR; /*!< Match Control Register. The MCR is used to control if an interrupt
+ is generated and if the TC is reset when a Match occurs. */
+ __IO uint32_t MR0; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR1; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR2; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR3; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t CCR; /*!< Capture Control Register. The CCR controls which edges of the
+ capture inputs are used to load the Capture Registers and whether
+ or not an interrupt is generated when a capture takes place. */
+ __I uint32_t CR0; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t CR1; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t CR2; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t RESERVED0;
+ __IO uint32_t EMR; /*!< External Match Register. The EMR controls the match function
+ and the external match pins CT16B0_MAT[1:0] and CT16B1_MAT[1:0]. */
+ __I uint32_t RESERVED1[12];
+ __IO uint32_t CTCR; /*!< Count Control Register. The CTCR selects between Timer and Counter
+ mode, and in Counter mode selects the signal and edge(s) for
+ counting. */
+ __IO uint32_t PWMC; /*!< PWM Control Register. The PWMCON enables PWM mode for the external
+ match pins CT16B0_MAT[1:0] and CT16B1_MAT[1:0]. */
+} LPC_CT16B0_Type;
+
+
+/* ================================================================================ */
+/* ================ CT32B0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief 32-bit counter/timers CT32B0 (CT32B0)
+ */
+
+typedef struct { /*!< CT32B0 Structure */
+ __IO uint32_t IR; /*!< Interrupt Register. The IR can be written to clear interrupts.
+ The IR can be read to identify which of eight possible interrupt
+ sources are pending. */
+ __IO uint32_t TCR; /*!< Timer Control Register. The TCR is used to control the Timer
+ Counter functions. The Timer Counter can be disabled or reset
+ through the TCR. */
+ __IO uint32_t TC; /*!< Timer Counter. The 32-bit TC is incremented every PR+1 cycles
+ of PCLK. The TC is controlled through the TCR. */
+ __IO uint32_t PR; /*!< Prescale Register. When the Prescale Counter (below) is equal
+ to this value, the next clock increments the TC and clears the
+ PC. */
+ __IO uint32_t PC; /*!< Prescale Counter. The 32-bit PC is a counter which is incremented
+ to the value stored in PR. When the value in PR is reached,
+ the TC is incremented and the PC is cleared. The PC is observable
+ and controllable through the bus interface. */
+ __IO uint32_t MCR; /*!< Match Control Register. The MCR is used to control if an interrupt
+ is generated and if the TC is reset when a Match occurs. */
+ __IO uint32_t MR0; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR1; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR2; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t MR3; /*!< Match Register. MR can be enabled through the MCR to reset the
+ TC, stop both the TC and PC, and/or generate an interrupt every
+ time MR0 matches the TC. */
+ __IO uint32_t CCR; /*!< Capture Control Register. The CCR controls which edges of the
+ capture inputs are used to load the Capture Registers and whether
+ or not an interrupt is generated when a capture takes place. */
+ __I uint32_t CR0; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t CR1; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t CR2; /*!< Capture Register. CR is loaded with the value of TC when there
+ is an event on the CAP input. */
+ __I uint32_t RESERVED0;
+ __IO uint32_t EMR; /*!< External Match Register. The EMR controls the match function
+ and the external match pins CT32Bn_MAT[3:0]. */
+ __I uint32_t RESERVED1[12];
+ __IO uint32_t CTCR; /*!< Count Control Register. The CTCR selects between Timer and Counter
+ mode, and in Counter mode selects the signal and edge(s) for
+ counting. */
+ __IO uint32_t PWMC; /*!< PWM Control Register. The PWMCON enables PWM mode for the external
+ match pins CT32Bn_MAT[3:0]. */
+} LPC_CT32B0_Type;
+
+
+/* ================================================================================ */
+/* ================ ADC ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=Kylin12-bit Analog-to-Digital Converter (ADC) Modification date=5/13/2013 Major revision=0 Minor revision=1 (ADC)
+ */
+
+typedef struct { /*!< ADC Structure */
+ __IO uint32_t CTRL; /*!< A/D Control Register. Contains the clock divide value, enable
+ bits for each sequence and the A/D power-down bit. */
+ __I uint32_t RESERVED0;
+ __IO uint32_t SEQA_CTRL; /*!< A/D Conversion Sequence-A control Register: Controls triggering
+ and channel selection for conversion sequence-A. Also specifies
+ interrupt mode for sequence-A. */
+ __IO uint32_t SEQB_CTRL; /*!< A/D Conversion Sequence-B Control Register: Controls triggering
+ and channel selection for conversion sequence-B. Also specifies
+ interrupt mode for sequence-B. */
+ __IO uint32_t SEQA_GDAT; /*!< A/D Sequence-A Global Data Register. This register contains
+ the result of the most recent A/D conversion performed under
+ sequence-A */
+ __IO uint32_t SEQB_GDAT; /*!< A/D Sequence-B Global Data Register. This register contains
+ the result of the most recent A/D conversion performed under
+ sequence-B */
+ __I uint32_t RESERVED1[2];
+ __I uint32_t DAT[12]; /*!< A/D Channel 0 Data Register. This register contains the result
+ of the most recent conversion completed on channel 0. */
+ __IO uint32_t THR0_LOW; /*!< A/D Low Compare Threshold Register 0 : Contains the lower threshold
+ level for automatic threshold comparison for any channels linked
+ to threshold pair 0. */
+ __IO uint32_t THR1_LOW; /*!< A/D Low Compare Threshold Register 1: Contains the lower threshold
+ level for automatic threshold comparison for any channels linked
+ to threshold pair 1. */
+ __IO uint32_t THR0_HIGH; /*!< A/D High Compare Threshold Register 0: Contains the upper threshold
+ level for automatic threshold comparison for any channels linked
+ to threshold pair 0. */
+ __IO uint32_t THR1_HIGH; /*!< A/D High Compare Threshold Register 1: Contains the upper threshold
+ level for automatic threshold comparison for any channels linked
+ to threshold pair 1. */
+ __I uint32_t CHAN_THRSEL; /*!< A/D Channel-Threshold Select Register. Specifies which set of
+ threshold compare registers are to be used for each channel */
+ __IO uint32_t INTEN; /*!< A/D Interrupt Enable Register. This register contains enable
+ bits that enable the sequence-A, sequence-B, threshold compare
+ and data overrun interrupts to be generated. */
+ __I uint32_t FLAGS; /*!< A/D Flags Register. Contains the four interrupt request flags
+ and the individual component overrun and threshold-compare flags.
+ (The overrun bits replicate information stored in the result
+ registers). */
+ __IO uint32_t TRM; /*!< ADC trim register. */
+} LPC_ADC_Type;
+
+
+/* ================================================================================ */
+/* ================ RTC ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Real-Time Clock (RTC) (RTC)
+ */
+
+typedef struct { /*!< RTC Structure */
+ __IO uint32_t CTRL; /*!< RTC control register */
+ __IO uint32_t MATCH; /*!< RTC match register */
+ __IO uint32_t COUNT; /*!< RTC counter register */
+ __IO uint32_t WAKE; /*!< RTC high-resolution/wake-up timer control register */
+} LPC_RTC_Type;
+
+
+/* ================================================================================ */
+/* ================ DMATRIGMUX ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinDMA controller Modification date=5/13/2013 Major revision=0 Minor revision=1 (DMATRIGMUX)
+ */
+
+typedef struct { /*!< DMATRIGMUX Structure */
+ __IO uint32_t DMA_ITRIG_PINMUX[16]; /*!< Trigger input select register for DMA channel 0. */
+} LPC_DMATRIGMUX_Type;
+
+
+/* ================================================================================ */
+/* ================ PMU ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinPower Management Unit (PMU) Modification date=5/13/2013 Major revision=0 Minor revision=1 (PMU)
+ */
+
+typedef struct { /*!< PMU Structure */
+ __IO uint32_t PCON; /*!< Power control register */
+ __IO uint32_t GPREG0; /*!< General purpose register 0 */
+ __IO uint32_t GPREG1; /*!< General purpose register 0 */
+ __IO uint32_t GPREG2; /*!< General purpose register 0 */
+ __IO uint32_t GPREG3; /*!< General purpose register 0 */
+ __IO uint32_t DPDCTRL; /*!< Deep power down control register */
+} LPC_PMU_Type;
+
+
+/* ================================================================================ */
+/* ================ FLASHCTRL ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Flash controller (FLASHCTRL)
+ */
+
+typedef struct { /*!< FLASHCTRL Structure */
+ __I uint32_t RESERVED0[4];
+ __IO uint32_t FLASHCFG; /*!< Flash configuration register */
+ __I uint32_t RESERVED1[3];
+ __IO uint32_t FMSSTART; /*!< Signature start address register */
+ __IO uint32_t FMSSTOP; /*!< Signature stop-address register */
+ __I uint32_t RESERVED2;
+ __I uint32_t FMSW0; /*!< Signature Word */
+} LPC_FLASHCTRL_Type;
+
+
+/* ================================================================================ */
+/* ================ SSP0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief SSP/SPI (SSP0)
+ */
+
+typedef struct { /*!< SSP0 Structure */
+ __IO uint32_t CR0; /*!< Control Register 0. Selects the serial clock rate, bus type,
+ and data size. */
+ __IO uint32_t CR1; /*!< Control Register 1. Selects master/slave and other modes. */
+ __IO uint32_t DR; /*!< Data Register. Writes fill the transmit FIFO, and reads empty
+ the receive FIFO. */
+ __I uint32_t SR; /*!< Status Register */
+ __IO uint32_t CPSR; /*!< Clock Prescale Register */
+ __IO uint32_t IMSC; /*!< Interrupt Mask Set and Clear Register */
+ __I uint32_t RIS; /*!< Raw Interrupt Status Register */
+ __I uint32_t MIS; /*!< Masked Interrupt Status Register */
+ __O uint32_t ICR; /*!< SSPICR Interrupt Clear Register */
+} LPC_SSP0_Type;
+
+
+/* ================================================================================ */
+/* ================ IOCON ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinI/O control (IOCON) Modification date=5/13/2013 Major revision=0 Minor revision=1 (IOCON)
+ */
+
+typedef struct { /*!< IOCON Structure */
+ __IO uint32_t PIO0_0; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_1; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_2; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_3; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_4; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_5; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_6; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_7; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_8; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_9; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_10; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_11; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_12; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_13; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_14; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_15; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_16; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_17; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_18; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_19; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_20; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_21; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_22; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO0_23; /*!< I/O configuration for port PIO0 */
+ __IO uint32_t PIO1_0; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_1; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_2; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_3; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_4; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_5; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_6; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_7; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_8; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_9; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_10; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_11; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_12; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_13; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_14; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_15; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_16; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_17; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_18; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_19; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_20; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_21; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_22; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_23; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_24; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_25; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_26; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_27; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_28; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_29; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_30; /*!< I/O configuration for port PIO1 */
+ __IO uint32_t PIO1_31; /*!< I/O configuration for port PIO1 */
+ __I uint32_t RESERVED0[4];
+ __IO uint32_t PIO2_0; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_1; /*!< I/O configuration for port PIO2 */
+ __I uint32_t RESERVED1;
+ __IO uint32_t PIO2_2; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_3; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_4; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_5; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_6; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_7; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_8; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_9; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_10; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_11; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_12; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_13; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_14; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_15; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_16; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_17; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_18; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_19; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_20; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_21; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_22; /*!< I/O configuration for port PIO2 */
+ __IO uint32_t PIO2_23; /*!< I/O configuration for port PIO2 */
+} LPC_IOCON_Type;
+
+
+/* ================================================================================ */
+/* ================ SYSCON ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinSystem configuration (SYSCON) Modification date=5/13/2013 Major revision=0 Minor revision=1 (SYSCON)
+ */
+
+typedef struct { /*!< SYSCON Structure */
+ __IO uint32_t SYSMEMREMAP; /*!< System memory remap */
+ __IO uint32_t PRESETCTRL; /*!< Peripheral reset control */
+ __IO uint32_t SYSPLLCTRL; /*!< System PLL control */
+ __I uint32_t SYSPLLSTAT; /*!< System PLL status */
+ __IO uint32_t USBPLLCTRL; /*!< USB PLL control */
+ __I uint32_t USBPLLSTAT; /*!< USB PLL status */
+ __I uint32_t RESERVED0;
+ __IO uint32_t RTCOSCCTRL; /*!< RTC oscillator 32 kHz output control */
+ __IO uint32_t SYSOSCCTRL; /*!< System oscillator control */
+ __IO uint32_t WDTOSCCTRL; /*!< Watchdog oscillator control */
+ __I uint32_t RESERVED1[2];
+ __IO uint32_t SYSRSTSTAT; /*!< System reset status register */
+ __I uint32_t RESERVED2[3];
+ __IO uint32_t SYSPLLCLKSEL; /*!< System PLL clock source select */
+ __IO uint32_t SYSPLLCLKUEN; /*!< System PLL clock source update enable */
+ __IO uint32_t USBPLLCLKSEL; /*!< USB PLL clock source select */
+ __IO uint32_t USBPLLCLKUEN; /*!< USB PLL clock source update enable */
+ __I uint32_t RESERVED3[8];
+ __IO uint32_t MAINCLKSEL; /*!< Main clock source select */
+ __IO uint32_t MAINCLKUEN; /*!< Main clock source update enable */
+ __IO uint32_t SYSAHBCLKDIV; /*!< System clock divider */
+ __I uint32_t RESERVED4;
+ __IO uint32_t SYSAHBCLKCTRL; /*!< System clock control */
+ __I uint32_t RESERVED5[4];
+ __IO uint32_t SSP0CLKDIV; /*!< SSP0 clock divider */
+ __IO uint32_t USART0CLKDIV; /*!< USART0 clock divider */
+ __IO uint32_t SSP1CLKDIV; /*!< SSP1 clock divider */
+ __IO uint32_t FRGCLKDIV; /*!< Clock divider for the common fractional baud rate generator
+ of USART1 to USART4 */
+ __I uint32_t RESERVED6[7];
+ __IO uint32_t USBCLKSEL; /*!< USB clock source select */
+ __IO uint32_t USBCLKUEN; /*!< USB clock source update enable */
+ __IO uint32_t USBCLKDIV; /*!< USB clock source divider */
+ __I uint32_t RESERVED7[5];
+ __IO uint32_t CLKOUTSEL; /*!< CLKOUT clock source select */
+ __IO uint32_t CLKOUTUEN; /*!< CLKOUT clock source update enable */
+ __IO uint32_t CLKOUTDIV; /*!< CLKOUT clock divider */
+ __I uint32_t RESERVED8;
+ __IO uint32_t UARTFRGDIV; /*!< USART fractional generator divider value */
+ __IO uint32_t UARTFRGMULT; /*!< USART fractional generator multiplier value */
+ __I uint32_t RESERVED9;
+ __IO uint32_t EXTTRACECMD; /*!< External trace buffer command register */
+ __I uint32_t PIOPORCAP0; /*!< POR captured PIO status 0 */
+ __I uint32_t PIOPORCAP1; /*!< POR captured PIO status 1 */
+ __I uint32_t PIOPORCAP2; /*!< POR captured PIO status 1 */
+ __I uint32_t RESERVED10[10];
+ __IO uint32_t IOCONCLKDIV6; /*!< Peripheral clock 6 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV5; /*!< Peripheral clock 5 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV4; /*!< Peripheral clock 4 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV3; /*!< Peripheral clock 3 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV2; /*!< Peripheral clock 2 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV1; /*!< Peripheral clock 1 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t IOCONCLKDIV0; /*!< Peripheral clock 0 to the IOCON block for programmable glitch
+ filter */
+ __IO uint32_t BODCTRL; /*!< Brown-Out Detect */
+ __IO uint32_t SYSTCKCAL; /*!< System tick counter calibration */
+ __IO uint32_t AHBMATRIXPRIO; /*!< AHB matrix priority configuration */
+ __I uint32_t RESERVED11[5];
+ __IO uint32_t IRQLATENCY; /*!< IRQ delay. Allows trade-off between interrupt latency and determinism. */
+ __IO uint32_t NMISRC; /*!< NMI Source Control */
+ union {
+ __IO uint32_t PINTSEL[8];
+ struct {
+ __IO uint32_t PINTSEL0; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL1; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL2; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL3; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL4; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL5; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL6; /*!< GPIO Pin Interrupt Select register 0 */
+ __IO uint32_t PINTSEL7; /*!< GPIO Pin Interrupt Select register 0 */
+ };
+ };
+ __IO uint32_t USBCLKCTRL; /*!< USB clock control */
+ __I uint32_t USBCLKST; /*!< USB clock status */
+ __I uint32_t RESERVED12[25];
+ __IO uint32_t STARTERP0; /*!< Start logic 0 interrupt wake-up enable register 0 */
+ __I uint32_t RESERVED13[3];
+ __IO uint32_t STARTERP1; /*!< Start logic 1 interrupt wake-up enable register 1 */
+ __I uint32_t RESERVED14[6];
+ __IO uint32_t PDSLEEPCFG; /*!< Power-down states in deep-sleep mode */
+ __IO uint32_t PDAWAKECFG; /*!< Power-down states for wake-up from deep-sleep */
+ __IO uint32_t PDRUNCFG; /*!< Power configuration register */
+ __I uint32_t RESERVED15[110];
+ __I uint32_t DEVICE_ID; /*!< Device ID */
+} LPC_SYSCON_Type;
+
+
+/* ================================================================================ */
+/* ================ USART4 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief USART4 (USART4)
+ */
+
+typedef struct { /*!< USART4 Structure */
+ __IO uint32_t CFG; /*!< USART Configuration register. Basic USART configuration settings
+ that typically are not changed during operation. */
+ __IO uint32_t CTL; /*!< USART Control register. USART control settings that are more
+ likely to change during operation. */
+ __IO uint32_t STAT; /*!< USART Status register. The complete status value can be read
+ here. Writing ones clears some bits in the register. Some bits
+ can be cleared by writing a 1 to them. */
+ __IO uint32_t INTENSET; /*!< Interrupt Enable read and Set register. Contains an individual
+ interrupt enable bit for each potential USART interrupt. A complete
+ value may be read from this register. Writing a 1 to any implemented
+ bit position causes that bit to be set. */
+ __O uint32_t INTENCLR; /*!< Interrupt Enable Clear register. Allows clearing any combination
+ of bits in the INTENSET register. Writing a 1 to any implemented
+ bit position causes the corresponding bit to be cleared. */
+ __I uint32_t RXDAT; /*!< Receiver Data register. Contains the last character received. */
+ __I uint32_t RXDATSTAT; /*!< Receiver Data with Status register. Combines the last character
+ received with the current USART receive status. Allows DMA or
+ software to recover incoming data and status together. */
+ __IO uint32_t TXDAT; /*!< Transmit Data register. Data to be transmitted is written here. */
+ __IO uint32_t BRG; /*!< Baud Rate Generator register. 16-bit integer baud rate divisor
+ value. */
+ __I uint32_t INTSTAT; /*!< Interrupt status register. Reflects interrupts that are currently
+ enabled. */
+ __IO uint32_t OSR; /*!< Oversample selection register for asynchronous communication. */
+ __IO uint32_t ADDR; /*!< Address register for automatic address matching. */
+} LPC_USART4_Type;
+
+
+/* ================================================================================ */
+/* ================ GINT0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief GPIO group interrupt 0 (GINT0)
+ */
+
+typedef struct { /*!< GINT0 Structure */
+ __IO uint32_t CTRL; /*!< GPIO grouped interrupt control register */
+ __I uint32_t RESERVED0[7];
+ __IO uint32_t PORT_POL[3]; /*!< GPIO grouped interrupt port 0 polarity register */
+ __I uint32_t RESERVED1[5];
+ __IO uint32_t PORT_ENA[3]; /*!< GPIO grouped interrupt port enable register */
+} LPC_GINT0_Type;
+
+
+/* ================================================================================ */
+/* ================ USB ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief USB device controller (USB)
+ */
+
+typedef struct { /*!< USB Structure */
+ __IO uint32_t DEVCMDSTAT; /*!< USB Device Command/Status register */
+ __IO uint32_t INFO; /*!< USB Info register */
+ __IO uint32_t EPLISTSTART; /*!< USB EP Command/Status List start address */
+ __IO uint32_t DATABUFSTART; /*!< USB Data buffer start address */
+ __IO uint32_t LPM; /*!< Link Power Management register */
+ __IO uint32_t EPSKIP; /*!< USB Endpoint skip */
+ __IO uint32_t EPINUSE; /*!< USB Endpoint Buffer in use */
+ __IO uint32_t EPBUFCFG; /*!< USB Endpoint Buffer Configuration register */
+ __IO uint32_t INTSTAT; /*!< USB interrupt status register */
+ __IO uint32_t INTEN; /*!< USB interrupt enable register */
+ __IO uint32_t INTSETSTAT; /*!< USB set interrupt status register */
+ __IO uint32_t INTROUTING; /*!< USB interrupt routing register */
+ __I uint32_t RESERVED0;
+ __I uint32_t EPTOGGLE; /*!< USB Endpoint toggle register */
+} LPC_USB_Type;
+
+
+/* ================================================================================ */
+/* ================ CRC ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Cyclic Redundancy Check (CRC) engine (CRC)
+ */
+
+typedef struct { /*!< CRC Structure */
+ __IO uint32_t MODE; /*!< CRC mode register */
+ __IO uint32_t SEED; /*!< CRC seed register */
+
+ union {
+ __O uint32_t WR_DATA; /*!< CRC data register */
+ __I uint32_t SUM; /*!< CRC checksum register */
+ };
+} LPC_CRC_Type;
+
+
+/* ================================================================================ */
+/* ================ DMA ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinDMA controller Modification date=5/13/2013 Major revision=0 Minor revision=1 (DMA)
+ */
+
+typedef struct { /*!< DMA Structure */
+ __IO uint32_t CTRL; /*!< DMA control. */
+ __I uint32_t INTSTAT; /*!< Interrupt status. */
+ __IO uint32_t SRAMBASE; /*!< SRAM address of the channel configuration table. */
+ __I uint32_t RESERVED0[5];
+ __IO uint32_t ENABLESET0; /*!< Channel Enable read and Set for all DMA channels. */
+ __I uint32_t RESERVED1;
+ __O uint32_t ENABLECLR0; /*!< Channel Enable Clear for all DMA channels. */
+ __I uint32_t RESERVED2;
+ __I uint32_t ACTIVE0; /*!< Channel Active status for all DMA channels. */
+ __I uint32_t RESERVED3;
+ __I uint32_t BUSY0; /*!< Channel Busy status for all DMA channels. */
+ __I uint32_t RESERVED4;
+ __IO uint32_t ERRINT0; /*!< Error Interrupt status for all DMA channels. */
+ __I uint32_t RESERVED5;
+ __IO uint32_t INTENSET0; /*!< Interrupt Enable read and Set for all DMA channels. */
+ __I uint32_t RESERVED6;
+ __O uint32_t INTENCLR0; /*!< Interrupt Enable Clear for all DMA channels. */
+ __I uint32_t RESERVED7;
+ __IO uint32_t INTA0; /*!< Interrupt A status for all DMA channels. */
+ __I uint32_t RESERVED8;
+ __IO uint32_t INTB0; /*!< Interrupt B status for all DMA channels. */
+ __I uint32_t RESERVED9;
+ __O uint32_t SETVALID0; /*!< Set ValidPending control bits for all DMA channels. */
+ __I uint32_t RESERVED10;
+ __O uint32_t SETTRIG0; /*!< Set Trigger control bits for all DMA channels. */
+ __I uint32_t RESERVED11;
+ __O uint32_t ABORT0; /*!< Channel Abort control for all DMA channels. */
+ __I uint32_t RESERVED12[225];
+ __IO uint32_t CFG0; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT0; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG0; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED13;
+ __IO uint32_t CFG1; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT1; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG1; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED14;
+ __IO uint32_t CFG2; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT2; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG2; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED15;
+ __IO uint32_t CFG3; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT3; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG3; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED16;
+ __IO uint32_t CFG4; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT4; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG4; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED17;
+ __IO uint32_t CFG5; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT5; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG5; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED18;
+ __IO uint32_t CFG6; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT6; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG6; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED19;
+ __IO uint32_t CFG7; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT7; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG7; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED20;
+ __IO uint32_t CFG8; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT8; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG8; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED21;
+ __IO uint32_t CFG9; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT9; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG9; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED22;
+ __IO uint32_t CFG10; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT10; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG10; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED23;
+ __IO uint32_t CFG11; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT11; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG11; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED24;
+ __IO uint32_t CFG12; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT12; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG12; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED25;
+ __IO uint32_t CFG13; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT13; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG13; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED26;
+ __IO uint32_t CFG14; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT14; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG14; /*!< Transfer configuration register for DMA channel 0. */
+ __I uint32_t RESERVED27;
+ __IO uint32_t CFG15; /*!< Configuration register for DMA channel 0. */
+ __I uint32_t CTLSTAT15; /*!< Control and status register for DMA channel 0. */
+ __IO uint32_t XFERCFG15; /*!< Transfer configuration register for DMA channel 0. */
+} LPC_DMA_Type;
+
+
+/* ================================================================================ */
+/* ================ SCT0 ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Product name title=Kylin UM Chapter title=KylinState Configurable Timers (SCT0/1) Modification date=5/14/2013 Major revision=0 Minor revision=1 (SCT0)
+ */
+
+typedef struct { /*!< SCT0 Structure */
+ __IO uint32_t CONFIG; /*!< SCT configuration register */
+ __IO uint32_t CTRL; /*!< SCT control register */
+ __IO uint32_t LIMIT; /*!< SCT limit register */
+ __IO uint32_t HALT; /*!< SCT halt condition register */
+ __IO uint32_t STOP; /*!< SCT stop condition register */
+ __IO uint32_t START; /*!< SCT start condition register */
+ __I uint32_t RESERVED0[10];
+ __IO uint32_t COUNT; /*!< SCT counter register */
+ __IO uint32_t STATE; /*!< SCT state register */
+ __I uint32_t INPUT; /*!< SCT input register */
+ __IO uint32_t REGMODE; /*!< SCT match/capture registers mode register */
+ __IO uint32_t OUTPUT; /*!< SCT output register */
+ __IO uint32_t OUTPUTDIRCTRL; /*!< SCT output counter direction control register */
+ __IO uint32_t RES; /*!< SCT conflict resolution register */
+ __IO uint32_t DMAREQ0; /*!< SCT DMA request 0 register */
+ __IO uint32_t DMAREQ1; /*!< SCT DMA request 1 register */
+ __I uint32_t RESERVED1[35];
+ __IO uint32_t EVEN; /*!< SCT event enable register */
+ __IO uint32_t EVFLAG; /*!< SCT event flag register */
+ __IO uint32_t CONEN; /*!< SCT conflict enable register */
+ __IO uint32_t CONFLAG; /*!< SCT conflict flag register */
+
+ union {
+ __IO uint32_t CAP0; /*!< SCT capture register of capture channel 0 to 4; REGMOD0 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCH0; /*!< SCT match value register of match channels 0 to 4; REGMOD0 to
+ REGMODE4 = 0 */
+ };
+
+ union {
+ __IO uint32_t CAP1; /*!< SCT capture register of capture channel 0 to 4; REGMOD0 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCH1; /*!< SCT match value register of match channels 0 to 4; REGMOD0 to
+ REGMODE4 = 0 */
+ };
+
+ union {
+ __IO uint32_t MATCH2; /*!< SCT match value register of match channels 0 to 4; REGMOD0 to
+ REGMODE4 = 0 */
+ __IO uint32_t CAP2; /*!< SCT capture register of capture channel 0 to 4; REGMOD0 to REGMODE4
+ = 1 */
+ };
+
+ union {
+ __IO uint32_t CAP3; /*!< SCT capture register of capture channel 0 to 4; REGMOD0 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCH3; /*!< SCT match value register of match channels 0 to 4; REGMOD0 to
+ REGMODE4 = 0 */
+ };
+
+ union {
+ __IO uint32_t CAP4; /*!< SCT capture register of capture channel 0 to 4; REGMOD0 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCH4; /*!< SCT match value register of match channels 0 to 4; REGMOD0 to
+ REGMODE4 = 0 */
+ };
+ __I uint32_t RESERVED2[59];
+
+ union {
+ __IO uint32_t CAPCTRL0; /*!< SCT capture control register 0 to 4; REGMOD0 = 1 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCHREL0; /*!< SCT match reload value register 0 to 4; REGMOD0 = 0 to REGMODE4
+ = 0 */
+ };
+
+ union {
+ __IO uint32_t MATCHREL1; /*!< SCT match reload value register 0 to 4; REGMOD0 = 0 to REGMODE4
+ = 0 */
+ __IO uint32_t CAPCTRL1; /*!< SCT capture control register 0 to 4; REGMOD0 = 1 to REGMODE4
+ = 1 */
+ };
+
+ union {
+ __IO uint32_t MATCHREL2; /*!< SCT match reload value register 0 to 4; REGMOD0 = 0 to REGMODE4
+ = 0 */
+ __IO uint32_t CAPCTRL2; /*!< SCT capture control register 0 to 4; REGMOD0 = 1 to REGMODE4
+ = 1 */
+ };
+
+ union {
+ __IO uint32_t CAPCTRL3; /*!< SCT capture control register 0 to 4; REGMOD0 = 1 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCHREL3; /*!< SCT match reload value register 0 to 4; REGMOD0 = 0 to REGMODE4
+ = 0 */
+ };
+
+ union {
+ __IO uint32_t CAPCTRL4; /*!< SCT capture control register 0 to 4; REGMOD0 = 1 to REGMODE4
+ = 1 */
+ __IO uint32_t MATCHREL4; /*!< SCT match reload value register 0 to 4; REGMOD0 = 0 to REGMODE4
+ = 0 */
+ };
+ __I uint32_t RESERVED3[59];
+ __IO uint32_t EV0_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV0_CTRL; /*!< SCT event control register 0 */
+ __IO uint32_t EV1_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV1_CTRL; /*!< SCT event control register 0 */
+ __IO uint32_t EV2_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV2_CTRL; /*!< SCT event control register 0 */
+ __IO uint32_t EV3_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV3_CTRL; /*!< SCT event control register 0 */
+ __IO uint32_t EV4_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV4_CTRL; /*!< SCT event control register 0 */
+ __IO uint32_t EV5_STATE; /*!< SCT event state register 0 */
+ __IO uint32_t EV5_CTRL; /*!< SCT event control register 0 */
+ __I uint32_t RESERVED4[116];
+ __IO uint32_t OUT0_SET; /*!< SCT output 0 set register */
+ __IO uint32_t OUT0_CLR; /*!< SCT output 0 clear register */
+ __IO uint32_t OUT1_SET; /*!< SCT output 0 set register */
+ __IO uint32_t OUT1_CLR; /*!< SCT output 0 clear register */
+ __IO uint32_t OUT2_SET; /*!< SCT output 0 set register */
+ __IO uint32_t OUT2_CLR; /*!< SCT output 0 clear register */
+ __IO uint32_t OUT3_SET; /*!< SCT output 0 set register */
+ __IO uint32_t OUT3_CLR; /*!< SCT output 0 clear register */
+} LPC_SCT0_Type;
+
+
+/* ================================================================================ */
+/* ================ GPIO_PORT ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief General Purpose I/O (GPIO) (GPIO_PORT)
+ */
+
+typedef struct { /*!< GPIO_PORT Structure */
+ __IO uint8_t B[88]; /*!< Byte pin registers */
+ __I uint32_t RESERVED0[42];
+ __IO uint32_t W[88]; /*!< Word pin registers */
+ __I uint32_t RESERVED1[1896];
+ __IO uint32_t DIR[3]; /*!< Port Direction registers */
+ __I uint32_t RESERVED2[29];
+ __IO uint32_t MASK[3]; /*!< Port Mask register */
+ __I uint32_t RESERVED3[29];
+ __IO uint32_t PIN[3]; /*!< Port pin register */
+ __I uint32_t RESERVED4[29];
+ __IO uint32_t MPIN[3]; /*!< Masked port register */
+ __I uint32_t RESERVED5[29];
+ __IO uint32_t SET[3]; /*!< Write: Set port register Read: port output bits */
+ __I uint32_t RESERVED6[29];
+ __O uint32_t CLR[3]; /*!< Clear port */
+ __I uint32_t RESERVED7[29];
+ __O uint32_t NOT[3]; /*!< Toggle port */
+} LPC_GPIO_PORT_Type;
+
+
+/* ================================================================================ */
+/* ================ PINT ================ */
+/* ================================================================================ */
+
+
+/**
+ * @brief Pin interruptand pattern match (PINT) (PINT)
+ */
+
+typedef struct { /*!< PINT Structure */
+ __IO uint32_t ISEL; /*!< Pin Interrupt Mode register */
+ __IO uint32_t IENR; /*!< Pin interrupt level or rising edge interrupt enable register */
+ __O uint32_t SIENR; /*!< Pin interrupt level or rising edge interrupt set register */
+ __O uint32_t CIENR; /*!< Pin interrupt level (rising edge interrupt) clear register */
+ __IO uint32_t IENF; /*!< Pin interrupt active level or falling edge interrupt enable
+ register */
+ __O uint32_t SIENF; /*!< Pin interrupt active level or falling edge interrupt set register */
+ __O uint32_t CIENF; /*!< Pin interrupt active level or falling edge interrupt clear register */
+ __IO uint32_t RISE; /*!< Pin interrupt rising edge register */
+ __IO uint32_t FALL; /*!< Pin interrupt falling edge register */
+ __IO uint32_t IST; /*!< Pin interrupt status register */
+ __IO uint32_t PMCTRL; /*!< Pattern match interrupt control register */
+ __IO uint32_t PMSRC; /*!< Pattern match interrupt bit-slice source register */
+ __IO uint32_t PMCFG; /*!< Pattern match interrupt bit slice configuration register */
+} LPC_PINT_Type;
+
+
+/* -------------------- End of section using anonymous unions ------------------- */
+#if defined(__CC_ARM)
+ #pragma pop
+#elif defined(__ICCARM__)
+ /* leave anonymous unions enabled */
+#elif defined(__GNUC__)
+ /* anonymous unions are enabled by default */
+#elif defined(__TMS470__)
+ /* anonymous unions are enabled by default */
+#elif defined(__TASKING__)
+ #pragma warning restore
+#else
+ #warning Not supported compiler type
+#endif
+
+
+
+
+/* ================================================================================ */
+/* ================ Peripheral memory map ================ */
+/* ================================================================================ */
+
+#define LPC_I2C0_BASE 0x40000000UL
+#define LPC_WWDT_BASE 0x40004000UL
+#define LPC_USART0_BASE 0x40008000UL
+#define LPC_CT16B0_BASE 0x4000C000UL
+#define LPC_CT16B1_BASE 0x40010000UL
+#define LPC_CT32B0_BASE 0x40014000UL
+#define LPC_CT32B1_BASE 0x40018000UL
+#define LPC_ADC_BASE 0x4001C000UL
+#define LPC_I2C1_BASE 0x40020000UL
+#define LPC_RTC_BASE 0x40024000UL
+#define LPC_DMATRIGMUX_BASE 0x40028000UL
+#define LPC_PMU_BASE 0x40038000UL
+#define LPC_FLASHCTRL_BASE 0x4003C000UL
+#define LPC_SSP0_BASE 0x40040000UL
+#define LPC_IOCON_BASE 0x40044000UL
+#define LPC_SYSCON_BASE 0x40048000UL
+#define LPC_USART4_BASE 0x4004C000UL
+#define LPC_SSP1_BASE 0x40058000UL
+#define LPC_GINT0_BASE 0x4005C000UL
+#define LPC_GINT1_BASE 0x40060000UL
+#define LPC_USART1_BASE 0x4006C000UL
+#define LPC_USART2_BASE 0x40070000UL
+#define LPC_USART3_BASE 0x40074000UL
+#define LPC_USB_BASE 0x40080000UL
+#define LPC_CRC_BASE 0x50000000UL
+#define LPC_DMA_BASE 0x50004000UL
+#define LPC_SCT0_BASE 0x5000C000UL
+#define LPC_SCT1_BASE 0x5000E000UL
+#define LPC_GPIO_PORT_BASE 0xA0000000UL
+#define LPC_PINT_BASE 0xA0004000UL
+
+
+/* ================================================================================ */
+/* ================ Peripheral declaration ================ */
+/* ================================================================================ */
+
+#define LPC_I2C0 ((LPC_I2C0_Type *) LPC_I2C0_BASE)
+#define LPC_WWDT ((LPC_WWDT_Type *) LPC_WWDT_BASE)
+#define LPC_USART0 ((LPC_USART0_Type *) LPC_USART0_BASE)
+#define LPC_CT16B0 ((LPC_CT16B0_Type *) LPC_CT16B0_BASE)
+#define LPC_CT16B1 ((LPC_CT16B0_Type *) LPC_CT16B1_BASE)
+#define LPC_CT32B0 ((LPC_CT32B0_Type *) LPC_CT32B0_BASE)
+#define LPC_CT32B1 ((LPC_CT32B0_Type *) LPC_CT32B1_BASE)
+#define LPC_ADC ((LPC_ADC_Type *) LPC_ADC_BASE)
+#define LPC_I2C1 ((LPC_I2C0_Type *) LPC_I2C1_BASE)
+#define LPC_RTC ((LPC_RTC_Type *) LPC_RTC_BASE)
+#define LPC_DMATRIGMUX ((LPC_DMATRIGMUX_Type *) LPC_DMATRIGMUX_BASE)
+#define LPC_PMU ((LPC_PMU_Type *) LPC_PMU_BASE)
+#define LPC_FLASHCTRL ((LPC_FLASHCTRL_Type *) LPC_FLASHCTRL_BASE)
+#define LPC_SSP0 ((LPC_SSP0_Type *) LPC_SSP0_BASE)
+#define LPC_IOCON ((LPC_IOCON_Type *) LPC_IOCON_BASE)
+#define LPC_SYSCON ((LPC_SYSCON_Type *) LPC_SYSCON_BASE)
+#define LPC_USART4 ((LPC_USART4_Type *) LPC_USART4_BASE)
+#define LPC_SSP1 ((LPC_SSP0_Type *) LPC_SSP1_BASE)
+#define LPC_GINT0 ((LPC_GINT0_Type *) LPC_GINT0_BASE)
+#define LPC_GINT1 ((LPC_GINT0_Type *) LPC_GINT1_BASE)
+#define LPC_USART1 ((LPC_USART4_Type *) LPC_USART1_BASE)
+#define LPC_USART2 ((LPC_USART4_Type *) LPC_USART2_BASE)
+#define LPC_USART3 ((LPC_USART4_Type *) LPC_USART3_BASE)
+#define LPC_USB ((LPC_USB_Type *) LPC_USB_BASE)
+#define LPC_CRC ((LPC_CRC_Type *) LPC_CRC_BASE)
+#define LPC_DMA ((LPC_DMA_Type *) LPC_DMA_BASE)
+#define LPC_SCT0 ((LPC_SCT0_Type *) LPC_SCT0_BASE)
+#define LPC_SCT1 ((LPC_SCT0_Type *) LPC_SCT1_BASE)
+#define LPC_GPIO_PORT ((LPC_GPIO_PORT_Type *) LPC_GPIO_PORT_BASE)
+#define LPC_PINT ((LPC_PINT_Type *) LPC_PINT_BASE)
+
+
+/** @} */ /* End of group Device_Peripheral_Registers */
+/** @} */ /* End of group LPC11U6x */
+/** @} */ /* End of group (null) */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* LPC11U6x_H */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_MICRO/TARGET_LPC11U68/LPC11U68.sct Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,14 @@
+LR_IROM1 0x00000000 0x40000 { ; load region size_region (256k)
+ ER_IROM1 0x00000000 0x40000 { ; load address = execution address
+ *.o (RESET, +First)
+ *(InRoot$$Sections)
+ .ANY (+RO)
+ ;*(.ARM.__at_0x3FFF4) ; key
+ }
+ ; 8_byte_aligned(16+47 vect * 4 bytes) = 0x100
+ ; 32kB (0x8000) - 0x100 = 0x7F00
+ RW_IRAM1 (0x10000000+0x100) (0x8000-0x100) {
+ .ANY (+RW +ZI)
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_MICRO/TARGET_LPC11U68/startup_LPC11U6x.S Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,244 @@ +;/**************************************************************************//** +; * @file startup_LPC11U6x.s +; * @brief CMSIS Cortex-M0+ Core Device Startup File for +; * NXP LPC11U6x Device Series +; * @version V1.00 +; * @date 22. October 2013 +; * +; * @note +; * Copyright (C) 2013 ARM Limited. All rights reserved. +; * +; * @par +; * ARM Limited (ARM) is supplying this software for use with Cortex-M +; * processor based microcontrollers. This file can be freely distributed +; * within development tools that are supporting such ARM based processors. +; * +; * @par +; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED +; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. +; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR +; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. +; * +; ******************************************************************************/ + +; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------ + +; <h> Stack Configuration +; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + + AREA STACK, NOINIT, READWRITE, ALIGN=3 + EXPORT __initial_sp + +__initial_sp EQU 0x10008000 ; Top of RAM from LPC1U68 + + +; <h> Heap Configuration +; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Heap_Size EQU 0x00000000 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + + AREA RESET, DATA, READONLY + EXPORT __Vectors + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD PIN_INT0_IRQHandler ; 16+ 0 GPIO pin interrupt 0 + DCD PIN_INT1_IRQHandler ; 16+ 1 GPIO pin interrupt 1 + DCD PIN_INT2_IRQHandler ; 16+ 2 GPIO pin interrupt 2 + DCD PIN_INT3_IRQHandler ; 16+ 3 GPIO pin interrupt 3 + DCD PIN_INT4_IRQHandler ; 16+ 4 GPIO pin interrupt 4 + DCD PIN_INT5_IRQHandler ; 16+ 5 GPIO pin interrupt 5 + DCD PIN_INT6_IRQHandler ; 16+ 6 GPIO pin interrupt 6 + DCD PIN_INT7_IRQHandler ; 16+ 7 GPIO pin interrupt 7 + DCD GINT0_IRQHandler ; 16+ 8 GPIO GROUP0 interrupt + DCD GINT1_IRQHandler ; 16+ 9 GPIO GROUP1 interrupt + DCD I2C1_IRQHandler ; 16+10 I2C1 interrupt + DCD USART1_4_IRQHandler ; 16+11 Combined USART1 and USART4 interrupts + DCD USART2_3_IRQHandler ; 16+12 Combined USART2 and USART3 interrupts + DCD SCT0_1_IRQHandler ; 16+13 Combined SCT0 and SCT1 interrupts + DCD SSP1_IRQHandler ; 16+14 SSP1 interrupt + DCD I2C0_IRQHandler ; 16+15 I2C0 interrupt + DCD CT16B0_IRQHandler ; 16+16 CT16B0 interrupt + DCD CT16B1_IRQHandler ; 16+17 CT16B1 interrupt + DCD CT32B0_IRQHandler ; 16+18 CT32B0 interrupt + DCD CT32B1_IRQHandler ; 16+19 CT32B1 interrupt + DCD SSP0_IRQHandler ; 16+20 SSP0 interrupt + DCD USART0_IRQHandler ; 16+21 USART0 interrupt + DCD USB_IRQHandler ; 16+22 USB interrupt + DCD USB_FIQ_IRQHandler ; 16+23 USB_FIQ interrupt + DCD ADC_A_IRQHandler ; 16+24 Combined ADC_A end-of-sequence A and threshold crossing interrupts + DCD RTC_IRQHandler ; 16+25 RTC interrupt + DCD BOD_WDT_IRQHandler ; 16+26 Combined BOD and WWDT interrupt + DCD FLASH_IRQHandler ; 16+27 Combined flash and EEPROM controller interrupts + DCD DMA_IRQHandler ; 16+28 DMA interrupt + DCD ADC_B_IRQHandler ; 16+29 Combined ADC_A end-of-sequence A and threshold crossing interrupts + DCD USBWAKEUP_IRQHandler ; 16+30 USB_WAKEUP interrupt + DCD 0 ; 16+31 Reserved + +; <h> Code Read Protection +; <o> Code Read Protection <0xFFFFFFFF=>CRP Disabled +; <0x12345678=>CRP Level 1 +; <0x87654321=>CRP Level 2 +; <0x43218765=>CRP Level 3 (ARE YOU SURE?) +; <0x4E697370=>NO ISP (ARE YOU SURE?) +; </h> + IF :LNOT::DEF:NO_CRP + AREA |.ARM.__at_0x02FC|, CODE, READONLY + DCD 0xFFFFFFFF + ENDIF + + AREA |.text|, CODE, READONLY + + +; Reset Handler + +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP +Reserved_IRQHandler PROC + EXPORT Reserved_IRQHandler [WEAK] + B . + ENDP + +Default_Handler PROC + EXPORT PIN_INT0_IRQHandler [WEAK] + EXPORT PIN_INT1_IRQHandler [WEAK] + EXPORT PIN_INT2_IRQHandler [WEAK] + EXPORT PIN_INT3_IRQHandler [WEAK] + EXPORT PIN_INT4_IRQHandler [WEAK] + EXPORT PIN_INT5_IRQHandler [WEAK] + EXPORT PIN_INT6_IRQHandler [WEAK] + EXPORT PIN_INT7_IRQHandler [WEAK] + EXPORT GINT0_IRQHandler [WEAK] + EXPORT GINT1_IRQHandler [WEAK] + EXPORT I2C1_IRQHandler [WEAK] + EXPORT USART1_4_IRQHandler [WEAK] + EXPORT USART2_3_IRQHandler [WEAK] + EXPORT SCT0_1_IRQHandler [WEAK] + EXPORT SSP1_IRQHandler [WEAK] + EXPORT I2C0_IRQHandler [WEAK] + EXPORT CT16B0_IRQHandler [WEAK] + EXPORT CT16B1_IRQHandler [WEAK] + EXPORT CT32B0_IRQHandler [WEAK] + EXPORT CT32B1_IRQHandler [WEAK] + EXPORT SSP0_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USB_IRQHandler [WEAK] + EXPORT USB_FIQ_IRQHandler [WEAK] + EXPORT ADC_A_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT BOD_WDT_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT DMA_IRQHandler [WEAK] + EXPORT ADC_B_IRQHandler [WEAK] + EXPORT USBWAKEUP_IRQHandler [WEAK] + +PIN_INT0_IRQHandler +PIN_INT1_IRQHandler +PIN_INT2_IRQHandler +PIN_INT3_IRQHandler +PIN_INT4_IRQHandler +PIN_INT5_IRQHandler +PIN_INT6_IRQHandler +PIN_INT7_IRQHandler +GINT0_IRQHandler +GINT1_IRQHandler +I2C1_IRQHandler +USART1_4_IRQHandler +USART2_3_IRQHandler +SCT0_1_IRQHandler +SSP1_IRQHandler +I2C0_IRQHandler +CT16B0_IRQHandler +CT16B1_IRQHandler +CT32B0_IRQHandler +CT32B1_IRQHandler +SSP0_IRQHandler +USART0_IRQHandler +USB_IRQHandler +USB_FIQ_IRQHandler +ADC_A_IRQHandler +RTC_IRQHandler +BOD_WDT_IRQHandler +FLASH_IRQHandler +DMA_IRQHandler +ADC_B_IRQHandler +USBWAKEUP_IRQHandler + + B . + + ENDP + + + ALIGN + + +; User Initial Stack & Heap + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + END
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_MICRO/sys.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,31 @@
+/* mbed Microcontroller Library - stackheap
+ * Copyright (C) 2009-2011 ARM Limited. All rights reserved.
+ *
+ * Setup a fixed single stack/heap memory model,
+ * between the top of the RW/ZI region and the stackpointer
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rt_misc.h>
+#include <stdint.h>
+
+extern char Image$$RW_IRAM1$$ZI$$Limit[];
+
+extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
+ uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
+ uint32_t sp_limit = __current_sp();
+
+ zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
+
+ struct __initial_stackheap r;
+ r.heap_base = zi_limit;
+ r.heap_limit = sp_limit;
+ return r;
+}
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_STD/TARGET_LPC11U68/LPC11U68.sct Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,14 @@
+LR_IROM1 0x00000000 0x40000 { ; load region size_region (256k)
+ ER_IROM1 0x00000000 0x40000 { ; load address = execution address
+ *.o (RESET, +First)
+ *(InRoot$$Sections)
+ .ANY (+RO)
+ ;*(.ARM.__at_0x3FFF4) ; key
+ }
+ ; 8_byte_aligned(16+47 vect * 4 bytes) = 0x100
+ ; 32kB (0x8000) - 0x100 = 0x7F00
+ RW_IRAM1 (0x10000000+0x100) (0x8000-0x100) {
+ .ANY (+RW +ZI)
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_STD/TARGET_LPC11U68/startup_LPC11U6x.S Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,244 @@ +;/**************************************************************************//** +; * @file startup_LPC11U6x.s +; * @brief CMSIS Cortex-M0+ Core Device Startup File for +; * NXP LPC11U6x Device Series +; * @version V1.00 +; * @date 22. October 2013 +; * +; * @note +; * Copyright (C) 2013 ARM Limited. All rights reserved. +; * +; * @par +; * ARM Limited (ARM) is supplying this software for use with Cortex-M +; * processor based microcontrollers. This file can be freely distributed +; * within development tools that are supporting such ARM based processors. +; * +; * @par +; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED +; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. +; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR +; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. +; * +; ******************************************************************************/ + +; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------ + +; <h> Stack Configuration +; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + + AREA STACK, NOINIT, READWRITE, ALIGN=3 + EXPORT __initial_sp + +__initial_sp EQU 0x10008000 ; Top of RAM from LPC1U68 + + +; <h> Heap Configuration +; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Heap_Size EQU 0x00000000 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + + AREA RESET, DATA, READONLY + EXPORT __Vectors + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD PIN_INT0_IRQHandler ; 16+ 0 GPIO pin interrupt 0 + DCD PIN_INT1_IRQHandler ; 16+ 1 GPIO pin interrupt 1 + DCD PIN_INT2_IRQHandler ; 16+ 2 GPIO pin interrupt 2 + DCD PIN_INT3_IRQHandler ; 16+ 3 GPIO pin interrupt 3 + DCD PIN_INT4_IRQHandler ; 16+ 4 GPIO pin interrupt 4 + DCD PIN_INT5_IRQHandler ; 16+ 5 GPIO pin interrupt 5 + DCD PIN_INT6_IRQHandler ; 16+ 6 GPIO pin interrupt 6 + DCD PIN_INT7_IRQHandler ; 16+ 7 GPIO pin interrupt 7 + DCD GINT0_IRQHandler ; 16+ 8 GPIO GROUP0 interrupt + DCD GINT1_IRQHandler ; 16+ 9 GPIO GROUP1 interrupt + DCD I2C1_IRQHandler ; 16+10 I2C1 interrupt + DCD USART1_4_IRQHandler ; 16+11 Combined USART1 and USART4 interrupts + DCD USART2_3_IRQHandler ; 16+12 Combined USART2 and USART3 interrupts + DCD SCT0_1_IRQHandler ; 16+13 Combined SCT0 and SCT1 interrupts + DCD SSP1_IRQHandler ; 16+14 SSP1 interrupt + DCD I2C0_IRQHandler ; 16+15 I2C0 interrupt + DCD CT16B0_IRQHandler ; 16+16 CT16B0 interrupt + DCD CT16B1_IRQHandler ; 16+17 CT16B1 interrupt + DCD CT32B0_IRQHandler ; 16+18 CT32B0 interrupt + DCD CT32B1_IRQHandler ; 16+19 CT32B1 interrupt + DCD SSP0_IRQHandler ; 16+20 SSP0 interrupt + DCD USART0_IRQHandler ; 16+21 USART0 interrupt + DCD USB_IRQHandler ; 16+22 USB interrupt + DCD USB_FIQ_IRQHandler ; 16+23 USB_FIQ interrupt + DCD ADC_A_IRQHandler ; 16+24 Combined ADC_A end-of-sequence A and threshold crossing interrupts + DCD RTC_IRQHandler ; 16+25 RTC interrupt + DCD BOD_WDT_IRQHandler ; 16+26 Combined BOD and WWDT interrupt + DCD FLASH_IRQHandler ; 16+27 Combined flash and EEPROM controller interrupts + DCD DMA_IRQHandler ; 16+28 DMA interrupt + DCD ADC_B_IRQHandler ; 16+29 Combined ADC_A end-of-sequence A and threshold crossing interrupts + DCD USBWAKEUP_IRQHandler ; 16+30 USB_WAKEUP interrupt + DCD 0 ; 16+31 Reserved + +; <h> Code Read Protection +; <o> Code Read Protection <0xFFFFFFFF=>CRP Disabled +; <0x12345678=>CRP Level 1 +; <0x87654321=>CRP Level 2 +; <0x43218765=>CRP Level 3 (ARE YOU SURE?) +; <0x4E697370=>NO ISP (ARE YOU SURE?) +; </h> + IF :LNOT::DEF:NO_CRP + AREA |.ARM.__at_0x02FC|, CODE, READONLY + DCD 0xFFFFFFFF + ENDIF + + AREA |.text|, CODE, READONLY + + +; Reset Handler + +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP +Reserved_IRQHandler PROC + EXPORT Reserved_IRQHandler [WEAK] + B . + ENDP + +Default_Handler PROC + EXPORT PIN_INT0_IRQHandler [WEAK] + EXPORT PIN_INT1_IRQHandler [WEAK] + EXPORT PIN_INT2_IRQHandler [WEAK] + EXPORT PIN_INT3_IRQHandler [WEAK] + EXPORT PIN_INT4_IRQHandler [WEAK] + EXPORT PIN_INT5_IRQHandler [WEAK] + EXPORT PIN_INT6_IRQHandler [WEAK] + EXPORT PIN_INT7_IRQHandler [WEAK] + EXPORT GINT0_IRQHandler [WEAK] + EXPORT GINT1_IRQHandler [WEAK] + EXPORT I2C1_IRQHandler [WEAK] + EXPORT USART1_4_IRQHandler [WEAK] + EXPORT USART2_3_IRQHandler [WEAK] + EXPORT SCT0_1_IRQHandler [WEAK] + EXPORT SSP1_IRQHandler [WEAK] + EXPORT I2C0_IRQHandler [WEAK] + EXPORT CT16B0_IRQHandler [WEAK] + EXPORT CT16B1_IRQHandler [WEAK] + EXPORT CT32B0_IRQHandler [WEAK] + EXPORT CT32B1_IRQHandler [WEAK] + EXPORT SSP0_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USB_IRQHandler [WEAK] + EXPORT USB_FIQ_IRQHandler [WEAK] + EXPORT ADC_A_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT BOD_WDT_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT DMA_IRQHandler [WEAK] + EXPORT ADC_B_IRQHandler [WEAK] + EXPORT USBWAKEUP_IRQHandler [WEAK] + +PIN_INT0_IRQHandler +PIN_INT1_IRQHandler +PIN_INT2_IRQHandler +PIN_INT3_IRQHandler +PIN_INT4_IRQHandler +PIN_INT5_IRQHandler +PIN_INT6_IRQHandler +PIN_INT7_IRQHandler +GINT0_IRQHandler +GINT1_IRQHandler +I2C1_IRQHandler +USART1_4_IRQHandler +USART2_3_IRQHandler +SCT0_1_IRQHandler +SSP1_IRQHandler +I2C0_IRQHandler +CT16B0_IRQHandler +CT16B1_IRQHandler +CT32B0_IRQHandler +CT32B1_IRQHandler +SSP0_IRQHandler +USART0_IRQHandler +USB_IRQHandler +USB_FIQ_IRQHandler +ADC_A_IRQHandler +RTC_IRQHandler +BOD_WDT_IRQHandler +FLASH_IRQHandler +DMA_IRQHandler +ADC_B_IRQHandler +USBWAKEUP_IRQHandler + + B . + + ENDP + + + ALIGN + + +; User Initial Stack & Heap + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + END
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_STD/sys.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,31 @@
+/* mbed Microcontroller Library - stackheap
+ * Copyright (C) 2009-2011 ARM Limited. All rights reserved.
+ *
+ * Setup a fixed single stack/heap memory model,
+ * between the top of the RW/ZI region and the stackpointer
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rt_misc.h>
+#include <stdint.h>
+
+extern char Image$$RW_IRAM1$$ZI$$Limit[];
+
+extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
+ uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
+ uint32_t sp_limit = __current_sp();
+
+ zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
+
+ struct __initial_stackheap r;
+ r.heap_base = zi_limit;
+ r.heap_limit = sp_limit;
+ return r;
+}
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/LPC11U68.ld Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,235 @@
+/*Based on following file*/
+/*
+ * GENERATED FILE - DO NOT EDIT
+ * (c) Code Red Technologies Ltd, 2008-13
+ * (c) NXP Semiconductors 2013-2014
+ * Generated linker script file for LPC11U68
+ * Created from LibIncTemplate.ld (LPCXpresso v7.2 (0 [Build 153] [2014-05-19] ))
+ * By LPCXpresso v7.2.0 [Build 153] [2014-05-19] on Sat Jun 14 15:26:54 JST 2014
+ */
+
+MEMORY
+{
+ /* Define each memory region */
+ MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x40000 /* 256K bytes */
+ Ram0_32 (rwx) : ORIGIN = 0x10000000+0x100, LENGTH = 0x8000-0x100 /* 32K bytes */
+ Ram1_2 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x800 /* 2K bytes */
+ Ram2USB_2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2K bytes */
+
+
+}
+ /* Define a symbol for the top of each memory region */
+ __top_MFlash256 = 0x0 + 0x40000;
+ __top_Ram0_32 = 0x10000000 + 0x8000;
+ __top_Ram1_2 = 0x20000000 + 0x800;
+ __top_Ram2USB_2 = 0x20004000 + 0x800;
+
+ENTRY(ResetISR)
+
+SECTIONS
+{
+
+ /* MAIN TEXT SECTION */
+ .text : ALIGN(4)
+ {
+ FILL(0xff)
+ __vectors_start__ = ABSOLUTE(.) ;
+ KEEP(*(.isr_vector))
+
+ /* Global Section Table */
+ . = ALIGN(4) ;
+ __section_table_start = .;
+ __data_section_table = .;
+ LONG(LOADADDR(.data));
+ LONG( ADDR(.data));
+ LONG( SIZEOF(.data));
+ LONG(LOADADDR(.data_RAM2));
+ LONG( ADDR(.data_RAM2));
+ LONG( SIZEOF(.data_RAM2));
+ LONG(LOADADDR(.data_RAM3));
+ LONG( ADDR(.data_RAM3));
+ LONG( SIZEOF(.data_RAM3));
+ __data_section_table_end = .;
+ __bss_section_table = .;
+ LONG( ADDR(.bss));
+ LONG( SIZEOF(.bss));
+ LONG( ADDR(.bss_RAM2));
+ LONG( SIZEOF(.bss_RAM2));
+ LONG( ADDR(.bss_RAM3));
+ LONG( SIZEOF(.bss_RAM3));
+ __bss_section_table_end = .;
+ __section_table_end = . ;
+ /* End of Global Section Table */
+
+
+ *(.after_vectors*)
+
+ *(.text*)
+ *(.rodata .rodata.*)
+ . = ALIGN(4);
+
+ /* C++ constructors etc */
+ . = ALIGN(4);
+ KEEP(*(.init))
+
+ . = ALIGN(4);
+ __preinit_array_start = .;
+ KEEP (*(.preinit_array))
+ __preinit_array_end = .;
+
+ . = ALIGN(4);
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+
+ KEEP(*(.fini));
+
+ . = ALIGN(0x4);
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*crtend.o(.ctors))
+
+ . = ALIGN(0x4);
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*crtend.o(.dtors))
+ } > MFlash256
+
+ /*
+ * for exception handling/unwind - some Newlib functions (in common
+ * with C++ and STDC++) use this.
+ */
+ .ARM.extab : ALIGN(4)
+ {
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
+ } > MFlash256
+ __exidx_start = .;
+
+ .ARM.exidx : ALIGN(4)
+ {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ } > MFlash256
+ __exidx_end = .;
+
+ _etext = .;
+
+ /* possible MTB section for Ram1_2 */
+ .mtb_buffer_RAM2 (NOLOAD) :
+ {
+ KEEP(*(.mtb.$RAM2*))
+ KEEP(*(.mtb.$RAM1_2*))
+ } > Ram1_2
+
+ /* DATA section for Ram1_2 */
+ .data_RAM2 : ALIGN(4)
+ {
+ FILL(0xff)
+ *(.ramfunc.$RAM2)
+ *(.ramfunc.$Ram1_2)
+ *(.data.$RAM2*)
+ *(.data.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2 AT>MFlash256
+ /* possible MTB section for Ram2USB_2 */
+ .mtb_buffer_RAM3 (NOLOAD) :
+ {
+ KEEP(*(.mtb.$RAM3*))
+ KEEP(*(.mtb.$RAM2USB_2*))
+ } > Ram2USB_2
+
+ /* DATA section for Ram2USB_2 */
+ .data_RAM3 : ALIGN(4)
+ {
+ FILL(0xff)
+ *(.ramfunc.$RAM3)
+ *(.ramfunc.$Ram2USB_2)
+ *(.data.$RAM3*)
+ *(.data.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2 AT>MFlash256
+
+ /* MAIN DATA SECTION */
+
+ /* Default MTB section */
+ .mtb_buffer_default (NOLOAD) :
+ {
+ KEEP(*(.mtb*))
+ } > Ram0_32
+
+ .uninit_RESERVED : ALIGN(4)
+ {
+ KEEP(*(.bss.$RESERVED*))
+ . = ALIGN(4) ;
+ _end_uninit_RESERVED = .;
+ } > Ram0_32
+
+
+ /* Main DATA section (Ram0_32) */
+ .data : ALIGN(4)
+ {
+ FILL(0xff)
+ _data = . ;
+ *(vtable)
+ *(.ramfunc*)
+ *(.data*)
+ . = ALIGN(4) ;
+ _edata = . ;
+ } > Ram0_32 AT>MFlash256
+
+ /* BSS section for Ram1_2 */
+ .bss_RAM2 : ALIGN(4)
+ {
+ *(.bss.$RAM2*)
+ *(.bss.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2
+ /* BSS section for Ram2USB_2 */
+ .bss_RAM3 : ALIGN(4)
+ {
+ *(.bss.$RAM3*)
+ *(.bss.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2
+
+ /* MAIN BSS SECTION */
+ .bss : ALIGN(4)
+ {
+ _bss = .;
+ *(.bss*)
+ *(COMMON)
+ . = ALIGN(4) ;
+ _ebss = .;
+ PROVIDE(end = .);
+ __end__ = .;
+ } > Ram0_32
+
+ /* NOINIT section for Ram1_2 */
+ .noinit_RAM2 (NOLOAD) : ALIGN(4)
+ {
+ *(.noinit.$RAM2*)
+ *(.noinit.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2
+ /* NOINIT section for Ram2USB_2 */
+ .noinit_RAM3 (NOLOAD) : ALIGN(4)
+ {
+ *(.noinit.$RAM3*)
+ *(.noinit.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2
+
+ /* DEFAULT NOINIT SECTION */
+ .noinit (NOLOAD): ALIGN(4)
+ {
+ _noinit = .;
+ *(.noinit*)
+ . = ALIGN(4) ;
+ _end_noinit = .;
+ } > Ram0_32
+
+ PROVIDE(_pvHeapStart = .);
+ PROVIDE(_vStackTop = __top_Ram0_32 - 0);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/startup_LPC11U68.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,181 @@
+extern "C" {
+
+#include "LPC11U6x.h"
+
+#define WEAK __attribute__ ((weak))
+#define ALIAS(f) __attribute__ ((weak, alias (#f)))
+#define AFTER_VECTORS __attribute__ ((section(".after_vectors")))void ResetISR(void);
+
+extern unsigned int __data_section_table;
+extern unsigned int __data_section_table_end;
+extern unsigned int __bss_section_table;
+extern unsigned int __bss_section_table_end;
+
+
+extern void __libc_init_array(void);
+extern int main(void);
+extern void _vStackTop(void);
+extern void (* const g_pfnVectors[])(void);
+
+ void ResetISR(void);
+WEAK void NMI_Handler(void);
+WEAK void HardFault_Handler(void);
+WEAK void SVC_Handler(void);
+WEAK void PendSV_Handler(void);
+WEAK void SysTick_Handler(void);
+WEAK void IntDefaultHandler(void);
+
+void PIN_INT0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT2_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT3_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT4_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT5_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT6_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT7_IRQHandler (void) ALIAS(IntDefaultHandler);
+void GINT0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void GINT1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void I2C1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART1_4_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART2_3_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SCT0_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SSP1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void I2C0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER16_0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER16_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER32_0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER32_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SSP0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USB_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USB_FIQHandler (void) ALIAS(IntDefaultHandler);
+void ADCA_IRQHandler (void) ALIAS(IntDefaultHandler);
+void RTC_IRQHandler (void) ALIAS(IntDefaultHandler);
+void BOD_WDT_IRQHandler (void) ALIAS(IntDefaultHandler);
+void FMC_IRQHandler (void) ALIAS(IntDefaultHandler);
+void DMA_IRQHandler (void) ALIAS(IntDefaultHandler);
+void ADCB_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USBWakeup_IRQHandler (void) ALIAS(IntDefaultHandler);
+
+__attribute__ ((section(".isr_vector")))
+void (* const g_pfnVectors[])(void) = {
+ // Core Level - CM0
+ &_vStackTop, // The initial stack pointer
+ ResetISR, // The reset handler
+ NMI_Handler, // The NMI handler
+ HardFault_Handler, // The hard fault handler
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ SVC_Handler, // SVCall handler
+ 0, // Reserved
+ 0, // Reserved
+ PendSV_Handler, // The PendSV handler
+ SysTick_Handler, // The SysTick handler
+
+ // Chip Level - LPC11U68
+ PIN_INT0_IRQHandler, // 0 - GPIO pin interrupt 0
+ PIN_INT1_IRQHandler, // 1 - GPIO pin interrupt 1
+ PIN_INT2_IRQHandler, // 2 - GPIO pin interrupt 2
+ PIN_INT3_IRQHandler, // 3 - GPIO pin interrupt 3
+ PIN_INT4_IRQHandler, // 4 - GPIO pin interrupt 4
+ PIN_INT5_IRQHandler, // 5 - GPIO pin interrupt 5
+ PIN_INT6_IRQHandler, // 6 - GPIO pin interrupt 6
+ PIN_INT7_IRQHandler, // 7 - GPIO pin interrupt 7
+ GINT0_IRQHandler, // 8 - GPIO GROUP0 interrupt
+ GINT1_IRQHandler, // 9 - GPIO GROUP1 interrupt
+ I2C1_IRQHandler, // 10 - I2C1
+ USART1_4_IRQHandler, // 11 - combined USART1 & 4 interrupt
+ USART2_3_IRQHandler, // 12 - combined USART2 & 3 interrupt
+ SCT0_1_IRQHandler, // 13 - combined SCT0 and 1 interrupt
+ SSP1_IRQHandler, // 14 - SPI/SSP1 Interrupt
+ I2C0_IRQHandler, // 15 - I2C0
+ TIMER16_0_IRQHandler, // 16 - CT16B0 (16-bit Timer 0)
+ TIMER16_1_IRQHandler, // 17 - CT16B1 (16-bit Timer 1)
+ TIMER32_0_IRQHandler, // 18 - CT32B0 (32-bit Timer 0)
+ TIMER32_1_IRQHandler, // 19 - CT32B1 (32-bit Timer 1)
+ SSP0_IRQHandler, // 20 - SPI/SSP0 Interrupt
+ USART0_IRQHandler, // 21 - USART0
+ USB_IRQHandler, // 22 - USB IRQ
+ USB_FIQHandler, // 23 - USB FIQ
+ ADCA_IRQHandler, // 24 - ADC A(A/D Converter)
+ RTC_IRQHandler, // 25 - Real Time CLock interrpt
+ BOD_WDT_IRQHandler, // 25 - Combined Brownout/Watchdog interrupt
+ FMC_IRQHandler, // 27 - IP2111 Flash Memory Controller
+ DMA_IRQHandler, // 28 - DMA interrupt
+ ADCB_IRQHandler, // 24 - ADC B (A/D Converter)
+ USBWakeup_IRQHandler, // 30 - USB wake-up interrupt
+ 0, // 31 - Reserved
+};
+/* End Vector */
+
+AFTER_VECTORS void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
+ unsigned int *pulDest = (unsigned int*) start;
+ unsigned int *pulSrc = (unsigned int*) romstart;
+ unsigned int loop;
+ for (loop = 0; loop < len; loop = loop + 4) *pulDest++ = *pulSrc++;
+}
+
+AFTER_VECTORS void bss_init(unsigned int start, unsigned int len) {
+ unsigned int *pulDest = (unsigned int*) start;
+ unsigned int loop;
+ for (loop = 0; loop < len; loop = loop + 4) *pulDest++ = 0;
+}
+
+
+/* Reset entry point*/
+extern "C" void software_init_hook(void) __attribute__((weak));
+
+AFTER_VECTORS void ResetISR(void) {
+ unsigned int LoadAddr, ExeAddr, SectionLen;
+ unsigned int *SectionTableAddr;
+
+ SectionTableAddr = &__data_section_table;
+
+ while (SectionTableAddr < &__data_section_table_end) {
+ LoadAddr = *SectionTableAddr++;
+ ExeAddr = *SectionTableAddr++;
+ SectionLen = *SectionTableAddr++;
+ data_init(LoadAddr, ExeAddr, SectionLen);
+ }
+ while (SectionTableAddr < &__bss_section_table_end) {
+ ExeAddr = *SectionTableAddr++;
+ SectionLen = *SectionTableAddr++;
+ bss_init(ExeAddr, SectionLen);
+ }
+
+ SystemInit();
+ if (software_init_hook)
+ software_init_hook();
+ else {
+ __libc_init_array();
+ main();
+ }
+ while (1) {;}
+}
+
+AFTER_VECTORS void NMI_Handler (void) {}
+AFTER_VECTORS void HardFault_Handler (void) {}
+AFTER_VECTORS void MemManage_Handler (void) {}
+AFTER_VECTORS void BusFault_Handler (void) {}
+AFTER_VECTORS void UsageFault_Handler(void) {}
+AFTER_VECTORS void SVC_Handler (void) {}
+AFTER_VECTORS void DebugMon_Handler (void) {}
+AFTER_VECTORS void PendSV_Handler (void) {}
+AFTER_VECTORS void SysTick_Handler (void) {}
+AFTER_VECTORS void IntDefaultHandler (void) {}
+
+int __aeabi_atexit(void *object, void (*destructor)(void *), void *dso_handle) {return 0;}
+}
+
+#include <stdlib.h>
+
+void *operator new(size_t size) {return malloc(size);}
+void *operator new[](size_t size){return malloc(size);}
+
+void operator delete(void *p) {free(p);}
+void operator delete[](void *p) {free(p);}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_CR/TARGET_LPC11U68/LPC11U68.ld Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,237 @@
+/*Based on following file*/
+/*
+ * GENERATED FILE - DO NOT EDIT
+ * (c) Code Red Technologies Ltd, 2008-13
+ * (c) NXP Semiconductors 2013-2014
+ * Generated linker script file for LPC11U68
+ * Created from LibIncTemplate.ld (LPCXpresso v7.2 (0 [Build 153] [2014-05-19] ))
+ * By LPCXpresso v7.2.0 [Build 153] [2014-05-19] on Sat Jun 14 15:26:54 JST 2014
+ */
+GROUP(libgcc.a libc.a libstdc++.a libm.a libcr_newlib_nohost.a crti.o crtn.o crtbegin.o crtend.o)
+
+MEMORY
+{
+ /* Define each memory region */
+ MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x40000 /* 256K bytes */
+ Ram0_32 (rwx) : ORIGIN = 0x10000000+0x100, LENGTH = 0x8000-0x100 /* 32K bytes */
+ Ram1_2 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x800 /* 2K bytes */
+ Ram2USB_2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2K bytes */
+
+
+}
+ /* Define a symbol for the top of each memory region */
+ __top_MFlash256 = 0x0 + 0x40000;
+ __top_Ram0_32 = 0x10000000+0x100 + 0x8000-0x100;
+ __top_Ram1_2 = 0x20000000 + 0x800;
+ __top_Ram2USB_2 = 0x20004000 + 0x800;
+
+ENTRY(ResetISR)
+
+SECTIONS
+{
+
+ /* MAIN TEXT SECTION */
+ .text : ALIGN(4)
+ {
+ FILL(0xff)
+ KEEP(*(.isr_vector))
+ *(.text.ResetISR)
+ *(.text.SystemInit)
+
+ /* Global Section Table */
+ . = ALIGN(4) ;
+ __section_table_start = .;
+ __data_section_table = .;
+ LONG(LOADADDR(.data));
+ LONG( ADDR(.data));
+ LONG( SIZEOF(.data));
+ LONG(LOADADDR(.data_RAM2));
+ LONG( ADDR(.data_RAM2));
+ LONG( SIZEOF(.data_RAM2));
+ LONG(LOADADDR(.data_RAM3));
+ LONG( ADDR(.data_RAM3));
+ LONG( SIZEOF(.data_RAM3));
+ __data_section_table_end = .;
+ __bss_section_table = .;
+ LONG( ADDR(.bss));
+ LONG( SIZEOF(.bss));
+ LONG( ADDR(.bss_RAM2));
+ LONG( SIZEOF(.bss_RAM2));
+ LONG( ADDR(.bss_RAM3));
+ LONG( SIZEOF(.bss_RAM3));
+ __bss_section_table_end = .;
+ __section_table_end = . ;
+ /* End of Global Section Table */
+
+
+ *(.after_vectors*)
+
+ *(.text*)
+ *(.rodata .rodata.*)
+ . = ALIGN(4);
+
+ /* C++ constructors etc */
+ . = ALIGN(4);
+ KEEP(*(.init))
+
+ . = ALIGN(4);
+ __preinit_array_start = .;
+ KEEP (*(.preinit_array))
+ __preinit_array_end = .;
+
+ . = ALIGN(4);
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+
+ KEEP(*(.fini));
+
+ . = ALIGN(0x4);
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*crtend.o(.ctors))
+
+ . = ALIGN(0x4);
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*crtend.o(.dtors))
+ } > MFlash256
+
+ /*
+ * for exception handling/unwind - some Newlib functions (in common
+ * with C++ and STDC++) use this.
+ */
+ .ARM.extab : ALIGN(4)
+ {
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
+ } > MFlash256
+ __exidx_start = .;
+
+ .ARM.exidx : ALIGN(4)
+ {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ } > MFlash256
+ __exidx_end = .;
+
+ _etext = .;
+
+ /* possible MTB section for Ram1_2 */
+ .mtb_buffer_RAM2 (NOLOAD) :
+ {
+ KEEP(*(.mtb.$RAM2*))
+ KEEP(*(.mtb.$RAM1_2*))
+ } > Ram1_2
+
+ /* DATA section for Ram1_2 */
+ .data_RAM2 : ALIGN(4)
+ {
+ FILL(0xff)
+ *(.ramfunc.$RAM2)
+ *(.ramfunc.$Ram1_2)
+ *(.data.$RAM2*)
+ *(.data.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2 AT>MFlash256
+ /* possible MTB section for Ram2USB_2 */
+ .mtb_buffer_RAM3 (NOLOAD) :
+ {
+ KEEP(*(.mtb.$RAM3*))
+ KEEP(*(.mtb.$RAM2USB_2*))
+ } > Ram2USB_2
+
+ /* DATA section for Ram2USB_2 */
+ .data_RAM3 : ALIGN(4)
+ {
+ FILL(0xff)
+ *(.ramfunc.$RAM3)
+ *(.ramfunc.$Ram2USB_2)
+ *(.data.$RAM3*)
+ *(.data.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2 AT>MFlash256
+
+ /* MAIN DATA SECTION */
+
+ /* Default MTB section */
+ .mtb_buffer_default (NOLOAD) :
+ {
+ KEEP(*(.mtb*))
+ } > Ram0_32
+
+ .uninit_RESERVED : ALIGN(4)
+ {
+ KEEP(*(.bss.$RESERVED*))
+ . = ALIGN(4) ;
+ _end_uninit_RESERVED = .;
+ } > Ram0_32
+
+
+ /* Main DATA section (Ram0_32) */
+ .data : ALIGN(4)
+ {
+ FILL(0xff)
+ _data = . ;
+ *(vtable)
+ *(.ramfunc*)
+ *(.data*)
+ . = ALIGN(4) ;
+ _edata = . ;
+ } > Ram0_32 AT>MFlash256
+
+ /* BSS section for Ram1_2 */
+ .bss_RAM2 : ALIGN(4)
+ {
+ *(.bss.$RAM2*)
+ *(.bss.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2
+ /* BSS section for Ram2USB_2 */
+ .bss_RAM3 : ALIGN(4)
+ {
+ *(.bss.$RAM3*)
+ *(.bss.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2
+
+ /* MAIN BSS SECTION */
+ .bss : ALIGN(4)
+ {
+ _bss = .;
+ *(.bss*)
+ *(COMMON)
+ . = ALIGN(4) ;
+ _ebss = .;
+ PROVIDE(end = .);
+ __end__ = .;
+ } > Ram0_32
+
+ /* NOINIT section for Ram1_2 */
+ .noinit_RAM2 (NOLOAD) : ALIGN(4)
+ {
+ *(.noinit.$RAM2*)
+ *(.noinit.$Ram1_2*)
+ . = ALIGN(4) ;
+ } > Ram1_2
+ /* NOINIT section for Ram2USB_2 */
+ .noinit_RAM3 (NOLOAD) : ALIGN(4)
+ {
+ *(.noinit.$RAM3*)
+ *(.noinit.$Ram2USB_2*)
+ . = ALIGN(4) ;
+ } > Ram2USB_2
+
+ /* DEFAULT NOINIT SECTION */
+ .noinit (NOLOAD): ALIGN(4)
+ {
+ _noinit = .;
+ *(.noinit*)
+ . = ALIGN(4) ;
+ _end_noinit = .;
+ } > Ram0_32
+
+ PROVIDE(_pvHeapStart = .);
+ PROVIDE(_vStackTop = __top_Ram0_32 - 0);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_CR/TARGET_LPC11U68/aeabi_romdiv_patch.S Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,93 @@
+//*****************************************************************************
+// aeabi_romdiv_patch.s
+// - Provides "patch" versions of the aeabi integer divide functions to
+// replace the standard ones pulled in from the C library, which vector
+// integer divides onto the rom division functions contained in
+// specific NXP MCUs such as LPC11Uxx and LPC12xx.
+// - Note that this patching will only occur if "__USE_ROMDIVIDE" is
+// defined for the project build for both the compiler and assembler.
+//*****************************************************************************
+//
+// Copyright(C) NXP Semiconductors, 2013
+// All rights reserved.
+//
+// Software that is described herein is for illustrative purposes only
+// which provides customers with programming information regarding the
+// LPC products. This software is supplied "AS IS" without any warranties of
+// any kind, and NXP Semiconductors and its licensor disclaim any and
+// all warranties, express or implied, including all implied warranties of
+// merchantability, fitness for a particular purpose and non-infringement of
+// intellectual property rights. NXP Semiconductors assumes no responsibility
+// or liability for the use of the software, conveys no license or rights under any
+// patent, copyright, mask work right, or any other intellectual property rights in
+// or to any products. NXP Semiconductors reserves the right to make changes
+// in the software without notification. NXP Semiconductors also makes no
+// representation or warranty that such application will be suitable for the
+// specified use without further testing or modification.
+//
+// Permission to use, copy, modify, and distribute this software and its
+// documentation is hereby granted, under NXP Semiconductors' and its
+// licensor's relevant copyrights in the software, without fee, provided that it
+// is used in conjunction with NXP Semiconductors microcontrollers. This
+// copyright, permission, and disclaimer notice must appear in all copies of
+// this code.
+//*****************************************************************************
+#if defined(__USE_ROMDIVIDE)
+
+// Note that the romdivide "divmod" functions are not actually called from
+// the below code, as these functions are actually just wrappers to the
+// main romdivide "div" functions which push the quotient and remainder onto
+// the stack, so as to be compatible with the way that C returns structures.
+//
+// This is not needed for the aeabi "divmod" functions, as the compiler
+// automatically generates code that handles the return values being passed
+// back in registers when it generates inline calls to __aeabi_idivmod and
+// __aeabi_uidivmod routines.
+
+ .syntax unified
+ .text
+
+// ========= __aeabi_idiv & __aeabi_idivmod =========
+ .align 2
+ .section .text.__aeabi_idiv
+
+ .global __aeabi_idiv
+ .set __aeabi_idivmod, __aeabi_idiv // make __aeabi_uidivmod an alias
+ .global __aeabi_idivmod
+ .global pDivRom_idiv // pointer to the romdivide 'idiv' functione
+ .func
+ .thumb_func
+ .type __aeabi_idiv, %function
+
+__aeabi_idiv:
+ push {r4, lr}
+ ldr r3, =pDivRom_idiv
+ ldr r3, [r3, #0] // Load address of function
+ blx r3 // Call divide function
+ pop {r4, pc}
+
+ .endfunc
+
+// ======== __aeabi_uidiv & __aeabi_uidivmod ========
+ .align 2
+
+ .section .text.__aeabi_uidiv
+
+ .global __aeabi_uidiv
+ .set __aeabi_uidivmod, __aeabi_uidiv // make __aeabi_uidivmod an alias
+ .global __aeabi_uidivmod
+ .global pDivRom_uidiv // pointer to the romdivide 'uidiv' function
+ .func
+ .thumb_func
+ .type __aeabi_uidiv, %function
+
+__aeabi_uidiv:
+ push {r4, lr}
+ ldr r3, =pDivRom_uidiv
+ ldr r3, [r3, #0] // Load address of function
+ blx r3 // Call divide function
+ pop {r4, pc}
+
+ .endfunc
+
+#endif // (__USE_ROMDIVIDE)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_CR/TARGET_LPC11U68/mtb.c Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,85 @@ +//***************************************************************************** +// +--+ +// | ++----+ +// +-++ | +// | | +// +-+--+ | +// | +--+--+ +// +----+ Copyright (c) 2013 Code Red Technologies Ltd. +// +// mtb.c +// +// Optionally defines an array to be used as a buffer for Micro Trace +// Buffer (MTB) instruction trace on Cortex-M0+ parts +// +// Version : 130502 +// +// Software License Agreement +// +// The software is owned by Code Red Technologies and/or its suppliers, and is +// protected under applicable copyright laws. All rights are reserved. Any +// use in violation of the foregoing restrictions may subject the user to criminal +// sanctions under applicable laws, as well as to civil liability for the breach +// of the terms and conditions of this license. +// +// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED +// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. +// USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT +// TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH +// CODE RED TECHNOLOGIES LTD. +// +//***************************************************************************** + +/******************************************************************* + * Symbols controlling behavior of this code... + * + * __MTB_DISABLE + * If this symbol is defined, then the buffer array for the MTB + * will not be created. + * + * __MTB_BUFFER_SIZE + * Symbol specifying the sizer of the buffer array for the MTB. + * This must be a power of 2 in size, and fit into the available + * RAM. The MTB buffer will also be aligned to its 'size' + * boundary and be placed at the start of a RAM bank (which + * should ensure minimal or zero padding due to alignment). + * + * __MTB_RAM_BANK + * Allows MTB Buffer to be placed into specific RAM bank. When + * this is not defined, the "default" (first if there are + * several) RAM bank is used. + *******************************************************************/ + +// Ignore with none Code Red tools +#if defined (__CODE_RED) + +// Allow MTB to be removed by setting a define (via command line) +#if !defined (__MTB_DISABLE) + + // Allow for MTB buffer size being set by define set via command line + // Otherwise provide small default buffer + #if !defined (__MTB_BUFFER_SIZE) + #define __MTB_BUFFER_SIZE 128 + #endif + + // Check that buffer size requested is >0 bytes in size + #if (__MTB_BUFFER_SIZE > 0) + // Pull in MTB related macros + #include <cr_mtb_buffer.h> + + // Check if MYTB buffer is to be placed in specific RAM bank + #if defined(__MTB_RAM_BANK) + // Place MTB buffer into explicit bank of RAM + __CR_MTB_BUFFER_EXT(__MTB_BUFFER_SIZE,__MTB_RAM_BANK); + #else + // Place MTB buffer into 'default' bank of RAM + __CR_MTB_BUFFER(__MTB_BUFFER_SIZE); + + #endif // defined(__MTB_RAM_BANK) + + #endif // (__MTB_BUFFER_SIZE > 0) + +#endif // !defined (__MTB_DISABLE) + +#endif // defined (__CODE_RED)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_CR/TARGET_LPC11U68/startup_LPC11U68.cpp Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,201 @@
+extern "C" {
+
+#include "LPC11U6x.h"
+#define WEAK __attribute__ ((weak))
+#define ALIAS(f) __attribute__ ((weak, alias (#f)))
+#define AFTER_VECTORS __attribute__ ((section(".after_vectors")))void ResetISR(void);
+
+// Patch the AEABI integer divide functions to use MCU's romdivide library
+#ifdef __USE_ROMDIVIDE
+// Location in memory that holds the address of the ROM Driver table
+#define PTR_ROM_DRIVER_TABLE ((unsigned int *)(0x1FFF1FF8))
+// Variables to store addresses of idiv and udiv functions within MCU ROM
+unsigned int *pDivRom_idiv;
+unsigned int *pDivRom_uidiv;
+#endif
+
+
+extern unsigned int __data_section_table;
+extern unsigned int __data_section_table_end;
+extern unsigned int __bss_section_table;
+extern unsigned int __bss_section_table_end;
+
+
+extern void __libc_init_array(void);
+extern int main(void);
+extern void _vStackTop(void);
+extern void (* const g_pfnVectors[])(void);
+
+ void ResetISR(void);
+WEAK void NMI_Handler(void);
+WEAK void HardFault_Handler(void);
+WEAK void SVC_Handler(void);
+WEAK void PendSV_Handler(void);
+WEAK void SysTick_Handler(void);
+WEAK void IntDefaultHandler(void);
+
+void PIN_INT0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT2_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT3_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT4_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT5_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT6_IRQHandler (void) ALIAS(IntDefaultHandler);
+void PIN_INT7_IRQHandler (void) ALIAS(IntDefaultHandler);
+void GINT0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void GINT1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void I2C1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART1_4_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART2_3_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SCT0_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SSP1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void I2C0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER16_0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER16_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER32_0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void TIMER32_1_IRQHandler (void) ALIAS(IntDefaultHandler);
+void SSP0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USART0_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USB_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USB_FIQHandler (void) ALIAS(IntDefaultHandler);
+void ADCA_IRQHandler (void) ALIAS(IntDefaultHandler);
+void RTC_IRQHandler (void) ALIAS(IntDefaultHandler);
+void BOD_WDT_IRQHandler (void) ALIAS(IntDefaultHandler);
+void FMC_IRQHandler (void) ALIAS(IntDefaultHandler);
+void DMA_IRQHandler (void) ALIAS(IntDefaultHandler);
+void ADCB_IRQHandler (void) ALIAS(IntDefaultHandler);
+void USBWakeup_IRQHandler (void) ALIAS(IntDefaultHandler);
+
+__attribute__ ((section(".isr_vector")))
+void (* const g_pfnVectors[])(void) = {
+ // Core Level - CM0
+ &_vStackTop, // The initial stack pointer
+ ResetISR, // The reset handler
+ NMI_Handler, // The NMI handler
+ HardFault_Handler, // The hard fault handler
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ 0, // Reserved
+ SVC_Handler, // SVCall handler
+ 0, // Reserved
+ 0, // Reserved
+ PendSV_Handler, // The PendSV handler
+ SysTick_Handler, // The SysTick handler
+
+ // Chip Level - LPC11U68
+ PIN_INT0_IRQHandler, // 0 - GPIO pin interrupt 0
+ PIN_INT1_IRQHandler, // 1 - GPIO pin interrupt 1
+ PIN_INT2_IRQHandler, // 2 - GPIO pin interrupt 2
+ PIN_INT3_IRQHandler, // 3 - GPIO pin interrupt 3
+ PIN_INT4_IRQHandler, // 4 - GPIO pin interrupt 4
+ PIN_INT5_IRQHandler, // 5 - GPIO pin interrupt 5
+ PIN_INT6_IRQHandler, // 6 - GPIO pin interrupt 6
+ PIN_INT7_IRQHandler, // 7 - GPIO pin interrupt 7
+ GINT0_IRQHandler, // 8 - GPIO GROUP0 interrupt
+ GINT1_IRQHandler, // 9 - GPIO GROUP1 interrupt
+ I2C1_IRQHandler, // 10 - I2C1
+ USART1_4_IRQHandler, // 11 - combined USART1 & 4 interrupt
+ USART2_3_IRQHandler, // 12 - combined USART2 & 3 interrupt
+ SCT0_1_IRQHandler, // 13 - combined SCT0 and 1 interrupt
+ SSP1_IRQHandler, // 14 - SPI/SSP1 Interrupt
+ I2C0_IRQHandler, // 15 - I2C0
+ TIMER16_0_IRQHandler, // 16 - CT16B0 (16-bit Timer 0)
+ TIMER16_1_IRQHandler, // 17 - CT16B1 (16-bit Timer 1)
+ TIMER32_0_IRQHandler, // 18 - CT32B0 (32-bit Timer 0)
+ TIMER32_1_IRQHandler, // 19 - CT32B1 (32-bit Timer 1)
+ SSP0_IRQHandler, // 20 - SPI/SSP0 Interrupt
+ USART0_IRQHandler, // 21 - USART0
+ USB_IRQHandler, // 22 - USB IRQ
+ USB_FIQHandler, // 23 - USB FIQ
+ ADCA_IRQHandler, // 24 - ADC A(A/D Converter)
+ RTC_IRQHandler, // 25 - Real Time CLock interrpt
+ BOD_WDT_IRQHandler, // 25 - Combined Brownout/Watchdog interrupt
+ FMC_IRQHandler, // 27 - IP2111 Flash Memory Controller
+ DMA_IRQHandler, // 28 - DMA interrupt
+ ADCB_IRQHandler, // 24 - ADC B (A/D Converter)
+ USBWakeup_IRQHandler, // 30 - USB wake-up interrupt
+ 0, // 31 - Reserved
+};
+/* End Vector */
+
+AFTER_VECTORS void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
+ unsigned int *pulDest = (unsigned int*) start;
+ unsigned int *pulSrc = (unsigned int*) romstart;
+ unsigned int loop;
+ for (loop = 0; loop < len; loop = loop + 4) *pulDest++ = *pulSrc++;
+}
+
+AFTER_VECTORS void bss_init(unsigned int start, unsigned int len) {
+ unsigned int *pulDest = (unsigned int*) start;
+ unsigned int loop;
+ for (loop = 0; loop < len; loop = loop + 4) *pulDest++ = 0;
+}
+
+
+/* Reset entry point*/
+extern "C" void software_init_hook(void) __attribute__((weak));
+
+AFTER_VECTORS void ResetISR(void) {
+ unsigned int LoadAddr, ExeAddr, SectionLen;
+ unsigned int *SectionTableAddr;
+
+ SectionTableAddr = &__data_section_table;
+
+ while (SectionTableAddr < &__data_section_table_end) {
+ LoadAddr = *SectionTableAddr++;
+ ExeAddr = *SectionTableAddr++;
+ SectionLen = *SectionTableAddr++;
+ data_init(LoadAddr, ExeAddr, SectionLen);
+ }
+ while (SectionTableAddr < &__bss_section_table_end) {
+ ExeAddr = *SectionTableAddr++;
+ SectionLen = *SectionTableAddr++;
+ bss_init(ExeAddr, SectionLen);
+ }
+
+ // Patch the AEABI integer divide functions to use MCU's romdivide library
+#ifdef __USE_ROMDIVIDE
+ // Get address of Integer division routines function table in ROM
+ unsigned int *div_ptr = (unsigned int *)((unsigned int *)*(PTR_ROM_DRIVER_TABLE))[4];
+ // Get addresses of integer divide routines in ROM
+ // These address are then used by the code in aeabi_romdiv_patch.s
+ pDivRom_idiv = (unsigned int *)div_ptr[0];
+ pDivRom_uidiv = (unsigned int *)div_ptr[1];
+#endif
+
+
+ SystemInit();
+ if (software_init_hook)
+ software_init_hook();
+ else {
+ __libc_init_array();
+ main();
+ }
+ while (1) {;}
+}
+
+AFTER_VECTORS void NMI_Handler (void) {}
+AFTER_VECTORS void HardFault_Handler (void) {}
+AFTER_VECTORS void MemManage_Handler (void) {}
+AFTER_VECTORS void BusFault_Handler (void) {}
+AFTER_VECTORS void UsageFault_Handler(void) {}
+AFTER_VECTORS void SVC_Handler (void) {}
+AFTER_VECTORS void DebugMon_Handler (void) {}
+AFTER_VECTORS void PendSV_Handler (void) {}
+AFTER_VECTORS void SysTick_Handler (void) {}
+AFTER_VECTORS void IntDefaultHandler (void) {}
+
+int __aeabi_atexit(void *object, void (*destructor)(void *), void *dso_handle) {return 0;}
+}
+
+#include <stdlib.h>
+
+void *operator new(size_t size) {return malloc(size);}
+void *operator new[](size_t size){return malloc(size);}
+
+void operator delete(void *p) {free(p);}
+void operator delete[](void *p) {free(p);}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_IAR/TARGET_LPC11U68/LPC11U68.icf Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,47 @@
+/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x00000000;
+/*-Memory Regions-*/
+define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
+define symbol __ICFEDIT_region_NVIC_start__ = 0x10000000;
+define symbol __ICFEDIT_region_NVIC_end__ = 0x100000FF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x10000100;
+define symbol __ICFEDIT_region_RAM_end__ = 0x10007FDF;
+/*-Sizes-*/
+/*Heap 1/4 of ram and stack 1/8*/
+define symbol __ICFEDIT_size_cstack__ = 0x1000;
+define symbol __ICFEDIT_size_heap__ = 0x2000;
+/**** End of ICF editor section. ###ICF###*/
+
+define symbol __CRP_start__ = 0x000002FC;
+define symbol __CRP_end__ = 0x000002FF;
+
+define symbol __RAM1_start__ = 0x20000000;
+define symbol __RAM1_end__ = 0x200007FF;
+
+define symbol __RAM_USB_start__= 0x20004000;
+define symbol __RAM_USB_end__ = 0x200047FF;
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__] - mem:[from __CRP_start__ to __CRP_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+define region RAM1_region = mem:[from __RAM1_start__ to __RAM1_end__];
+define region RAM_USB_region = mem:[from __RAM_USB_start__ to __RAM_USB_end__];
+define region CRP_region = mem:[from __CRP_start__ to __CRP_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+initialize by copy { readwrite };
+do not initialize { section .noinit };
+
+place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
+place in ROM_region { readonly };
+place in RAM_region { readwrite,
+ block HEAP, block CSTACK };
+place in CRP_region { section .crp };
+place in RAM1_region { section .sram1 };
+place in RAM_USB_region { section .sram_usb };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_IAR/TARGET_LPC11U68/startup_LPC11U6X.S Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,251 @@ +;/***************************************************************************** +; * @file: startup_LPC11u6x.s +; * @purpose: CMSIS Cortex-M0PLUS Core Device Startup File +; * for the NXP LPC11u6x Device Series (manually edited) +; * @version: V1.00 +; * @date: 19. October 2009 +; *---------------------------------------------------------------------------- +; * +; * Copyright (C) 2009 ARM Limited. All rights reserved. +; * +; * ARM Limited (ARM) is supplying this software for use with Cortex-Mx +; * processor based microcontrollers. This file can be freely distributed +; * within development tools that are supporting such ARM based processors. +; * +; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED +; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. +; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR +; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. +; * +; ******************************************************************************/ + +; +; The modules in this file are included in the libraries, and may be replaced +; by any user-defined modules that define the PUBLIC symbol _program_start or +; a user defined start symbol. +; To override the cstartup defined in the library, simply add your modified +; version to the workbench project. +; +; The vector table is normally located at address 0. +; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. +; The name "__vector_table" has special meaning for C-SPY: +; it is where the SP start value is found, and the NVIC vector +; table register (VTOR) is initialized to this address if != 0. +; +; Cortex-M version +; + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + PUBLIC __vector_table_0x1c + PUBLIC __Vectors + PUBLIC __Vectors_End + PUBLIC __Vectors_Size + + DATA + +__vector_table + DCD sfe(CSTACK) + DCD Reset_Handler + + DCD NMI_Handler + DCD HardFault_Handler + DCD 0 + DCD 0 + DCD 0 +__vector_table_0x1c + DCD 0 + DCD 0 + DCD 0 + DCD 0 + DCD SVC_Handler + DCD 0 + DCD 0 + DCD PendSV_Handler + DCD SysTick_Handler + + DCD PIN_INT0_IRQHandler ; Pin interrupt 0 + DCD PIN_INT1_IRQHandler ; Pin interrupt 1 + DCD PIN_INT2_IRQHandler ; Pin interrupt 2 + DCD PIN_INT3_IRQHandler ; Pin interrupt 3 + DCD PIN_INT4_IRQHandler ; Pin interrupt 4 + DCD PIN_INT5_IRQHandler ; Pin interrupt 5 + DCD PIN_INT6_IRQHandler ; Pin interrupt 6 + DCD PIN_INT7_IRQHandler ; Pin interrupt 7 + DCD GINT0_IRQHandler ; Port interrupt group 0 + DCD GINT1_IRQHandler ; Port interrupt group 1 + DCD I2C1_IRQHandler ; I2C1 interrupt + DCD USART1_4_IRQHandler ; USARTS 1 and 4 shared interrupt + DCD USART2_3_IRQHandler ; USARTS 2 and 3 shared interrupt + DCD SCT0_1_IRQHandler ; SCT 0 and 1 shared interrupt + DCD SSP1_IRQHandler ; SSP1 interrupt + DCD I2C0_IRQHandler ; I2C0 interrupt + DCD CT16B0_IRQHandler ; CT16B0 (16-bit Timer 0) + DCD CT16B1_IRQHandler ; CT16B1 (16-bit Timer 1) + DCD CT32B0_IRQHandler ; CT32B0 (32-bit Timer 0) + DCD CT32B1_IRQHandler ; CT32B0 (32-bit Timer 1) + DCD SSP0_IRQHandler ; SSP0 interrupt interrupt + DCD USART0_IRQHandler ; USART 0 interrupt interrupt + DCD USB_IRQHandler ; USB IRQ interrupt + DCD USB_FIQ_IRQHandler ; USB FIQ interrupt + DCD ADC_A_IRQHandler ; ADC A sequence (A/D Converter) interrupt + DCD RTC_IRQHandler ; RTC interrupt + DCD BOD_WDT_IRQHandler ; Shared BOD (Brownout Detect) and WDT interrupts + DCD FLASH_IRQHandler ; Flash Memory Controller interrupt + DCD DMA_IRQHandler ; DMA Controller interrupt + DCD ADC_B_IRQHandler ; ADC B sequence interrupt + DCD USBWakeup_IRQHandler ; USB wake-up interrupt + DCD Reserved_IRQHandler + +__Vectors_End + +__Vectors EQU __vector_table +__Vectors_Size EQU __Vectors_End - __Vectors + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Default interrupt handlers. +;; + THUMB + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(2) +Reset_Handler + LDR R0, =SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:REORDER:NOROOT(1) +NMI_Handler + B . + + PUBWEAK HardFault_Handler + SECTION .text:CODE:REORDER:NOROOT(1) +HardFault_Handler + B . + + PUBWEAK SVC_Handler + SECTION .text:CODE:REORDER:NOROOT(1) +SVC_Handler + B . + + PUBWEAK PendSV_Handler + SECTION .text:CODE:REORDER:NOROOT(1) +PendSV_Handler + B . + + PUBWEAK SysTick_Handler + SECTION .text:CODE:REORDER:NOROOT(1) +SysTick_Handler + B . + + PUBWEAK Reserved_IRQHandler + SECTION .text:CODE:REORDER:NOROOT(1) +Reserved_IRQHandler + B . + + + PUBWEAK PIN_INT0_IRQHandler + PUBWEAK PIN_INT1_IRQHandler + PUBWEAK PIN_INT2_IRQHandler + PUBWEAK PIN_INT3_IRQHandler + PUBWEAK PIN_INT4_IRQHandler + PUBWEAK PIN_INT5_IRQHandler + PUBWEAK PIN_INT6_IRQHandler + PUBWEAK PIN_INT7_IRQHandler + PUBWEAK GINT0_IRQHandler + PUBWEAK GINT1_IRQHandler + PUBWEAK I2C1_IRQHandler + PUBWEAK USART1_4_IRQHandler + PUBWEAK USART2_3_IRQHandler + PUBWEAK SCT0_1_IRQHandler + PUBWEAK SSP1_IRQHandler + PUBWEAK I2C0_IRQHandler + PUBWEAK CT16B0_IRQHandler + PUBWEAK CT16B1_IRQHandler + PUBWEAK CT32B0_IRQHandler + PUBWEAK CT32B1_IRQHandler + PUBWEAK SSP0_IRQHandler + PUBWEAK USART0_IRQHandler + PUBWEAK USB_IRQHandler + PUBWEAK USB_FIQ_IRQHandler + PUBWEAK ADC_A_IRQHandler + PUBWEAK RTC_IRQHandler + PUBWEAK BOD_WDT_IRQHandler + PUBWEAK FLASH_IRQHandler + PUBWEAK DMA_IRQHandler + PUBWEAK ADC_B_IRQHandler + PUBWEAK USBWakeup_IRQHandler + + SECTION .text:CODE:REORDER:NOROOT(1) + THUMB + +PIN_INT0_IRQHandler +PIN_INT1_IRQHandler +PIN_INT2_IRQHandler +PIN_INT3_IRQHandler +PIN_INT4_IRQHandler +PIN_INT5_IRQHandler +PIN_INT6_IRQHandler +PIN_INT7_IRQHandler +GINT0_IRQHandler +GINT1_IRQHandler +I2C1_IRQHandler +USART1_4_IRQHandler +USART2_3_IRQHandler +SCT0_1_IRQHandler +SSP1_IRQHandler +I2C0_IRQHandler +CT16B0_IRQHandler +CT16B1_IRQHandler +CT32B0_IRQHandler +CT32B1_IRQHandler +SSP0_IRQHandler +USART0_IRQHandler +USB_IRQHandler +USB_FIQ_IRQHandler +ADC_A_IRQHandler +RTC_IRQHandler +BOD_WDT_IRQHandler +FLASH_IRQHandler +DMA_IRQHandler +ADC_B_IRQHandler +USBWakeup_IRQHandler +Default_Handler + B Default_Handler + + SECTION .crp:CODE:ROOT(2) + DATA +/* Code Read Protection +NO_ISP 0x4E697370 - Prevents sampling of pin PIO0_1 for entering ISP mode +CRP1 0x12345678 - Write to RAM command cannot access RAM below 0x10000300. + - Copy RAM to flash command can not write to Sector 0. + - Erase command can erase Sector 0 only when all sectors + are selected for erase. + - Compare command is disabled. + - Read Memory command is disabled. +CRP2 0x87654321 - Read Memory is disabled. + - Write to RAM is disabled. + - "Go" command is disabled. + - Copy RAM to flash is disabled. + - Compare is disabled. +CRP3 0x43218765 - Access to chip via the SWD pins is disabled. ISP entry + by pulling PIO0_1 LOW is disabled if a valid user code is + present in flash sector 0. +Caution: If CRP3 is selected, no future factory testing can be +performed on the device. +*/ + DCD 0xFFFFFFFF + + END
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/cmsis.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,13 @@ +/* mbed Microcontroller Library - CMSIS + * Copyright (C) 2009-2011 ARM Limited. All rights reserved. + * + * A generic CMSIS include header, pulling in LPC8xx specifics + */ + +#ifndef MBED_CMSIS_H +#define MBED_CMSIS_H + +#include "LPC11U6x.h" +#include "cmsis_nvic.h" + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/cmsis_nvic.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,55 @@
+/* mbed Microcontroller Library
+ * CMSIS-style functionality to support dynamic vectors
+ *******************************************************************************
+ * Copyright (c) 2011 ARM Limited. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of ARM Limited nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *******************************************************************************
+ */
+#include "cmsis_nvic.h"
+
+#define NVIC_RAM_VECTOR_ADDRESS (0x10000000) // Vectors positioned at start of RAM
+#define NVIC_FLASH_VECTOR_ADDRESS (0x0) // Initial vector position in flash
+
+void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
+ uint32_t *vectors = (uint32_t*)SCB->VTOR;
+ uint32_t i;
+
+ // Copy and switch to dynamic vectors if the first time called
+ if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) {
+ uint32_t *old_vectors = vectors;
+ vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS;
+ for (i=0; i<NVIC_NUM_VECTORS; i++) {
+ vectors[i] = old_vectors[i];
+ }
+ SCB->VTOR = (uint32_t)NVIC_RAM_VECTOR_ADDRESS;
+ }
+ vectors[IRQn + 16] = vector;
+}
+
+uint32_t NVIC_GetVector(IRQn_Type IRQn) {
+ uint32_t *vectors = (uint32_t*)SCB->VTOR;
+ return vectors[IRQn + 16];
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/cmsis_nvic.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,51 @@
+/* mbed Microcontroller Library
+ * CMSIS-style functionality to support dynamic vectors
+ *******************************************************************************
+ * Copyright (c) 2011 ARM Limited. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of ARM Limited nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *******************************************************************************
+ */
+
+#ifndef MBED_CMSIS_NVIC_H
+#define MBED_CMSIS_NVIC_H
+
+#define NVIC_NUM_VECTORS (16 + 32) // CORE + MCU Peripherals
+#define NVIC_USER_IRQ_OFFSET 16
+
+#include "cmsis.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
+uint32_t NVIC_GetVector(IRQn_Type IRQn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/system_LPC11U6x.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,574 @@
+/**************************************************************************//**
+ * @file system_LPC11U6x.c
+ * @brief CMSIS Cortex-M3 Device System Source File for
+ * NXP LPC11U6x Device Series
+ * @version V1.00
+ * @date 19. July 2013
+ *
+ * @note
+ * Copyright (C) 2013 ARM Limited. All rights reserved.
+ *
+ * @par
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M
+ * processor based microcontrollers. This file can be freely distributed
+ * within development tools that are supporting such ARM based processors.
+ *
+ * @par
+ * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ ******************************************************************************/
+
+
+#include <stdint.h>
+#include "LPC11U6x.h"
+
+/*
+//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
+*/
+
+/*- SystemCoreClock Configuration -------------------------------------------*/
+// <e0> SystemCoreClock Configuration
+#define CLOCK_SETUP 1
+//
+// <h> System Oscillator Control (SYSOSCCTRL)
+// <o.0> BYPASS: System Oscillator Bypass Enable
+// <i> If enabled then PLL input (sys_osc_clk) is fed
+// <i> directly from XTALIN and XTALOUT pins.
+// <o.1> FREQRANGE: System Oscillator Frequency Range
+// <i> Determines frequency range for Low-power oscillator.
+// <0=> 1 - 20 MHz
+// <1=> 15 - 25 MHz
+// </h>
+#define SYSOSCCTRL_Val 0x00000000 // Reset value: 0x000
+//
+// <o.0..1> System PLL Clock Source Select (SYSPLLCLKSEL)
+// <0=> IRC Oscillator
+// <1=> Crystal Oscillator (SYSOSC)
+// <3=> RTC Oscillator (32 kHz)
+#define SYSPLLCLKSEL_Val 0x00000001 // Reset value: 0x000
+//
+// <e> Clock Configuration (Manual)
+#define CLOCK_SETUP_REG 1
+//
+// <h> WD Oscillator Setting (WDTOSCCTRL)
+// <o.0..4> DIVSEL: Select Divider for Fclkana
+// <i> wd_osc_clk = Fclkana / (2 × (1 + DIVSEL))
+// <0-31>
+// <o.5..8> FREQSEL: Select WD Oscillator Analog Output Frequency (Fclkana)
+// <1=> 0.5 MHz
+// <2=> 0.8 MHz
+// <3=> 1.1 MHz
+// <4=> 1.4 MHz
+// <5=> 1.6 MHz
+// <6=> 1.8 MHz
+// <7=> 2.0 MHz
+// <8=> 2.2 MHz
+// <9=> 2.4 MHz
+// <10=> 2.6 MHz
+// <11=> 2.7 MHz
+// <12=> 2.9 MHz
+// <13=> 3.1 MHz
+// <14=> 3.2 MHz
+// <15=> 3.4 MHz
+// </h>
+#define WDTOSCCTRL_Val 0x000000A0 // Reset value: 0x0A0
+//
+// <h> System PLL Setting (SYSPLLCTRL)
+// <i> F_clkout = M * F_clkin = F_CCO / (2 * P)
+// <i> F_clkin must be in the range of 10 MHz to 25 MHz
+// <i> F_CCO must be in the range of 156 MHz to 320 MHz
+// <o.0..4> MSEL: Feedback Divider Selection
+// <i> M = MSEL + 1
+// <0-31>
+// <o.5..6> PSEL: Post Divider Selection
+// <i> Post divider ratio P. Division ratio is 2 * P
+// <0=> P = 1
+// <1=> P = 2
+// <2=> P = 4
+// <3=> P = 8
+// </h>
+#define SYSPLLCTRL_Val 0x00000023 // Reset value: 0x000
+//
+// <o.0..1> Main Clock Source Select (MAINCLKSEL)
+// <0=> IRC Oscillator
+// <1=> PLL Input
+// <2=> WD Oscillator
+// <3=> PLL Output
+#define MAINCLKSEL_Val 0x00000003 // Reset value: 0x000
+//
+// <o.0..7> System AHB Clock Divider (SYSAHBCLKDIV.DIV)
+// <i> Divides main clock to provide system clock to core, memories, and peripherals.
+// <i> 0 = is disabled
+// <0-255>
+#define SYSAHBCLKDIV_Val 0x00000001 // Reset value: 0x001
+// </e>
+//
+// <e> Clock Configuration (via ROM PLL API)
+#define CLOCK_SETUP_API 0
+//
+// <o> PLL API Mode Select
+// <0=> Exact
+// <1=> Less than or equal
+// <2=> Greater than or equal
+// <3=> As close as possible
+#define PLL_API_MODE_Val 0
+//
+// <o> CPU Frequency [Hz] <1000000-50000000:1000>
+#define PLL_API_FREQ_Val 48000000
+// </e>
+//
+// <e> USB Clock Configuration
+#define USB_CLOCK_SETUP 1
+// <h> USB PLL Control (USBPLLCTRL)
+// <i> F_clkout = M * F_clkin = F_CCO / (2 * P)
+// <i> F_clkin must be in the range of 10 MHz to 25 MHz
+// <i> F_CCO must be in the range of 156 MHz to 320 MHz
+// <o.0..4> MSEL: Feedback Divider Selection
+// <i> M = MSEL + 1
+// <0-31>
+// <o.5..6> PSEL: Post Divider Selection
+// <i> Post divider ratio P. Division ratio is 2 * P
+// <0=> P = 1
+// <1=> P = 2
+// <2=> P = 4
+// <3=> P = 8
+// </h>
+#define USBPLLCTRL_Val 0x00000023 // Reset value: 0x000
+//
+// <o.0..1> USB PLL Clock Source Select (USBPLLCLKSEL.SEL)
+// <i> USB PLL clock source must be switched to System Oscillator for correct USB operation
+// <0=> IRC Oscillator
+// <1=> System Oscillator
+#define USBPLLCLKSEL_Val 0x00000001 // Reset value: 0x000
+//
+// <o.0..1> USB Clock Source Select (USBCLKSEL.SEL)
+// <0=> USB PLL out
+// <1=> Main clock
+#define USBCLKSEL_Val 0x00000000 // Reset value: 0x000
+//
+// <o.0..7> USB Clock Divider (USBCLKDIV.DIV)
+// <i> Divides USB clock to 48 MHz.
+// <i> 0 = is disabled
+// <0-255>
+#define USBCLKDIV_Val 0x00000001 // Reset Value: 0x001
+// </e>
+//
+// </e>
+//
+// <o0>System Oscillator (XTAL) Frequency [Hz] <1000000-25000000>
+// <i> XTAL frequency must be in the range of 1 MHz to 25 MHz
+//
+#define XTAL_CLK_Val 12000000
+
+/*
+//-------- <<< end of configuration section >>> ------------------------------
+*/
+
+/*----------------------------------------------------------------------------
+ Define clocks
+ *----------------------------------------------------------------------------*/
+#define __XTAL_CLK ( XTAL_CLK_Val) /* Oscillator freq */
+#define __SYS_OSC_CLK ( __XTAL_CLK) /* System oscillator freq */
+#define __IRC_OSC_CLK ( 12000000UL) /* Internal RC oscillator freq */
+#define __RTC_OSC_CLK ( 32768UL) /* RTC oscillator freq */
+
+/*----------------------------------------------------------------------------
+ Check the register settings
+ *----------------------------------------------------------------------------*/
+#define CHECK_RANGE(val, min, max) ((val < min) || (val > max))
+#define CHECK_RSVD(val, mask) (val & mask)
+
+#if (CHECK_RSVD((SYSOSCCTRL_Val), ~0x00000003))
+ #error "SYSOSCCTRL: Invalid values of reserved bits!"
+#endif
+
+#if (CHECK_RSVD((WDTOSCCTRL_Val), ~0x000001FF))
+ #error "WDTOSCCTRL: Invalid values of reserved bits!"
+#endif
+
+#if (CHECK_RANGE((SYSPLLCLKSEL_Val), 0, 3))
+ #error "SYSPLLCLKSEL: Value out of range!"
+#endif
+
+#if (SYSPLLCLKSEL_Val == 3) // RTC Oscillator used as PLL input
+ #if (CLOCK_SETUP_API == 1)
+ #error "SYSPLLCLKSEL: RTC oscillator not allowed as PLL clock source!"
+ #endif
+ #if (CLOCK_SETUP_REG == 1) && (MAINCLKSEL_Val == 3) // RTC Oscillator used as PLL input
+ #error "SYSPLLCLKSEL: RTC oscillator not allowed as PLL clock source!"
+ #endif
+#endif
+
+#if (CHECK_RSVD((SYSPLLCTRL_Val), ~0x0000007F))
+ #error "SYSPLLCTRL: Invalid values of reserved bits!"
+#endif
+
+#if (CHECK_RSVD((MAINCLKSEL_Val), ~0x00000003))
+ #error "MAINCLKSEL: Invalid values of reserved bits!"
+#endif
+
+#if (CHECK_RANGE((SYSAHBCLKDIV_Val), 0, 255))
+ #error "SYSAHBCLKDIV: Value out of range!"
+#endif
+
+#if ( CLOCK_SETUP_REG == CLOCK_SETUP_API )
+ #error "You must select either manual or API based Clock Configuration!"
+#endif
+
+#if (CHECK_RANGE((USBPLLCLKSEL_Val), 0, 1))
+ #error "USBPLLCLKSEL: Value out of range!"
+#endif
+
+#if (CHECK_RSVD((USBPLLCTRL_Val), ~0x000007F))
+ #error "USBPLLCTRL: Invalid values of reserved bits!"
+#endif
+
+#if (CHECK_RANGE((USBCLKSEL_Val), 0, 1))
+ #error "USBCLKSEL: Value out of range!"
+#endif
+
+#if (CHECK_RANGE((USBCLKDIV_Val), 0, 255))
+ #error "USBCLKDIV: Value out of range!"
+#endif
+
+#if (CHECK_RANGE(XTAL_CLK_Val, 1000000, 25000000))
+ #error "XTAL frequency is out of bounds"
+#endif
+
+#if (CHECK_RANGE(PLL_API_MODE_Val, 0, 3))
+ #error "PLL API Mode Select not valid"
+#endif
+
+#if (CHECK_RANGE(PLL_API_FREQ_Val, 1000000, 50000000))
+ #error "CPU Frequency (API mode) not valid"
+#endif
+
+
+
+/*----------------------------------------------------------------------------
+ Calculate system core clock
+ *----------------------------------------------------------------------------*/
+#if (CLOCK_SETUP) /* Clock Setup */
+
+ /* sys_pllclkin calculation */
+ #if ((SYSPLLCLKSEL_Val & 0x03) == 0)
+ #define __SYS_PLLCLKIN (__IRC_OSC_CLK)
+ #elif ((SYSPLLCLKSEL_Val & 0x03) == 1)
+ #define __SYS_PLLCLKIN (__SYS_OSC_CLK)
+ #elif ((SYSPLLCLKSEL_Val & 0x03) == 3)
+ #define __SYS_PLLCLKIN (__RTC_OSC_CLK)
+ #else
+ #error "Oops"
+ #endif
+
+ #if (CLOCK_SETUP_REG == 1) /* Clock Setup via Register */
+
+ #define __FREQSEL ((WDTOSCCTRL_Val >> 5) & 0x0F)
+ #define __DIVSEL (((WDTOSCCTRL_Val & 0x1F) << 1) + 2)
+
+ #if (__FREQSEL == 0)
+ #error "WDTOSCCTRL.FREQSEL undefined!"
+ #elif (__FREQSEL == 1)
+ #define __OSC_CLK ( 500000 / __DIVSEL)
+ #elif (__FREQSEL == 2)
+ #define __OSC_CLK ( 800000 / __DIVSEL)
+ #elif (__FREQSEL == 3)
+ #define __OSC_CLK (1100000 / __DIVSEL)
+ #elif (__FREQSEL == 4)
+ #define __OSC_CLK (1400000 / __DIVSEL)
+ #elif (__FREQSEL == 5)
+ #define __OSC_CLK (1600000 / __DIVSEL)
+ #elif (__FREQSEL == 6)
+ #define __OSC_CLK (1800000 / __DIVSEL)
+ #elif (__FREQSEL == 7)
+ #define __OSC_CLK (2000000 / __DIVSEL)
+ #elif (__FREQSEL == 8)
+ #define __OSC_CLK (2200000 / __DIVSEL)
+ #elif (__FREQSEL == 9)
+ #define __OSC_CLK (2400000 / __DIVSEL)
+ #elif (__FREQSEL == 10)
+ #define __OSC_CLK (2600000 / __DIVSEL)
+ #elif (__FREQSEL == 11)
+ #define __OSC_CLK (2700000 / __DIVSEL)
+ #elif (__FREQSEL == 12)
+ #define __OSC_CLK (2900000 / __DIVSEL)
+ #elif (__FREQSEL == 13)
+ #define __OSC_CLK (3100000 / __DIVSEL)
+ #elif (__FREQSEL == 14)
+ #define __OSC_CLK (3200000 / __DIVSEL)
+ #else
+ #define __OSC_CLK (3400000 / __DIVSEL)
+ #endif
+
+ #define __SYS_PLLCLKOUT (__SYS_PLLCLKIN * ((SYSPLLCTRL_Val & 0x01F) + 1))
+
+ /* main clock calculation */
+ #if ((MAINCLKSEL_Val & 0x03) == 0)
+ #define __MAIN_CLOCK (__IRC_OSC_CLK)
+ #elif ((MAINCLKSEL_Val & 0x03) == 1)
+ #define __MAIN_CLOCK (__SYS_PLLCLKIN)
+ #elif ((MAINCLKSEL_Val & 0x03) == 2)
+ #define __MAIN_CLOCK (__OSC_CLK)
+ #elif ((MAINCLKSEL_Val & 0x03) == 3)
+ #define __MAIN_CLOCK (__SYS_PLLCLKOUT)
+ #else
+ #error "Oops"
+ #endif
+
+ #define __SYSTEM_CLOCK (__MAIN_CLOCK / SYSAHBCLKDIV_Val)
+ #endif /* Clock Setup via Register */
+
+ #if (CLOCK_SETUP_API == 1) /* Clock Setup via ROM API */
+ #define __SYSTEM_CLOCK (PLL_API_FREQ_Val)
+ #endif /* Clock Setup via PLL API */
+
+#else
+ #define __SYSTEM_CLOCK (__IRC_OSC_CLK)
+#endif /* CLOCK_SETUP */
+
+
+
+#if ((CLOCK_SETUP == 1) && (CLOCK_SETUP_API == 1)) /* PLL Setup via PLL API */
+#include "power_api.h"
+
+typedef struct _ROM {
+ const unsigned p_dev0;
+ const unsigned p_dev1;
+ const unsigned p_dev2;
+ const PWRD * pPWRD; /* ROM Power Management API */
+ const unsigned p_dev4;
+ const unsigned p_dev5;
+ const unsigned p_dev6;
+ const unsigned p_dev7;
+} ROM;
+
+/*----------------------------------------------------------------------------
+ PLL API Function
+ *----------------------------------------------------------------------------*/
+static void setPLL(const uint32_t pllMode, const uint32_t pllInFreq, const uint32_t reqCpuFreq)
+{
+ uint32_t cmd[5], res[5];
+ ROM ** rom = (ROM **) 0x1FFF1FF8; /* pointer to power API calls */
+
+ cmd[0] = pllInFreq; /* PLL's input freq in KHz */
+ cmd[1] = reqCpuFreq; /* requested CPU freq in KHz */
+ cmd[2] = pllMode;
+ cmd[3] = 0; /* no timeout for PLL to lock */
+
+ /* Execute API call */
+ (*rom)->pPWRD->set_pll(cmd, res); /* call API function */
+ if ((res[0] != PLL_CMD_SUCCESS)){ /* in case of an error ... */
+ while(1); /* ... stay here */
+ }
+}
+#endif
+
+
+
+
+/*----------------------------------------------------------------------------
+ Clock Variable definitions
+ *----------------------------------------------------------------------------*/
+uint32_t SystemCoreClock = __SYSTEM_CLOCK; /* System Clock Frequency */
+
+
+/*----------------------------------------------------------------------------
+ Clock functions
+ *----------------------------------------------------------------------------*/
+void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
+{
+ uint32_t oscClk = 0;
+
+ /* Determine clock frequency according to clock register values */
+ switch ((LPC_SYSCON->WDTOSCCTRL >> 5) & 0x0F) {
+ case 0: oscClk = 0; break;
+ case 1: oscClk = 500000; break;
+ case 2: oscClk = 800000; break;
+ case 3: oscClk = 1100000; break;
+ case 4: oscClk = 1400000; break;
+ case 5: oscClk = 1600000; break;
+ case 6: oscClk = 1800000; break;
+ case 7: oscClk = 2000000; break;
+ case 8: oscClk = 2200000; break;
+ case 9: oscClk = 2400000; break;
+ case 10: oscClk = 2600000; break;
+ case 11: oscClk = 2700000; break;
+ case 12: oscClk = 2900000; break;
+ case 13: oscClk = 3100000; break;
+ case 14: oscClk = 3200000; break;
+ case 15: oscClk = 3400000; break;
+ }
+ oscClk /= ((LPC_SYSCON->WDTOSCCTRL & 0x1F) << 1) + 2;
+
+ switch (LPC_SYSCON->MAINCLKSEL & 0x03) {
+ case 0: /* Internal RC oscillator */
+ SystemCoreClock = __IRC_OSC_CLK;
+ break;
+ case 1: /* Input Clock to System PLL */
+ switch (LPC_SYSCON->SYSPLLCLKSEL & 0x03) {
+ case 0: /* Internal RC oscillator */
+ SystemCoreClock = __IRC_OSC_CLK;
+ break;
+ case 1: /* System oscillator */
+ SystemCoreClock = __SYS_OSC_CLK;
+ break;
+ case 2: /* Reserved */
+ case 3: /* Reserved */
+ SystemCoreClock = 0;
+ break;
+ }
+ break;
+ case 2: /* WDT Oscillator */
+ SystemCoreClock = oscClk;
+ break;
+ case 3: /* System PLL Clock Out */
+ switch (LPC_SYSCON->SYSPLLCLKSEL & 0x03) {
+ case 0: /* Internal RC oscillator */
+ SystemCoreClock = __IRC_OSC_CLK * ((LPC_SYSCON->SYSPLLCTRL & 0x01F) + 1);
+ break;
+ case 1: /* System oscillator */
+ SystemCoreClock = __SYS_OSC_CLK * ((LPC_SYSCON->SYSPLLCTRL & 0x01F) + 1);
+ break;
+ case 2: /* Reserved */
+ case 3: /* Reserved */
+ SystemCoreClock = 0;
+ break;
+ }
+ break;
+ }
+
+ SystemCoreClock /= LPC_SYSCON->SYSAHBCLKDIV;
+
+}
+
+#define PDRUN_VALID_BITS 0x000025FFL
+#define PDRUN_RESERVED_ONE 0x0000C800L
+
+static void power_down_config(uint32_t val)
+{
+ volatile uint32_t tmp;
+ tmp = (LPC_SYSCON->PDRUNCFG & PDRUN_VALID_BITS);
+ tmp |= (val & PDRUN_VALID_BITS);
+ LPC_SYSCON->PDRUNCFG = (tmp | PDRUN_RESERVED_ONE);
+}
+
+static void power_up_config(uint32_t val)
+{
+ volatile uint32_t tmp;
+ tmp = (LPC_SYSCON->PDRUNCFG & PDRUN_VALID_BITS);
+ tmp &= ~(val & PDRUN_VALID_BITS);
+ LPC_SYSCON->PDRUNCFG = (tmp | PDRUN_RESERVED_ONE);
+}
+
+/**
+ * Initialize the system
+ *
+ * @param none
+ * @return none
+ *
+ * @brief Setup the microcontroller system.
+ */
+void SystemInit (void) {
+#if (CLOCK_SETUP)
+ volatile uint32_t i;
+#endif
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);
+ LPC_SYSCON->SYSPLLCTRL = SYSPLLCTRL_Val;
+
+#if (CLOCK_SETUP) /* Clock Setup */
+
+#if ((SYSPLLCLKSEL_Val & 0x03) == 1)
+ // Initialize XTALIN/XTALOUT pins
+ LPC_IOCON->PIO2_0 = 0x01;
+ LPC_IOCON->PIO2_1 = 0x01;
+
+ LPC_SYSCON->SYSOSCCTRL = SYSOSCCTRL_Val;
+ power_up_config(1<<5); /* Power-up sysosc */
+ for (i = 0; i < 2500; i++) __NOP(); /* Wait for osc to stabilize */
+#endif
+
+#if ((SYSPLLCLKSEL_Val & 0x03) == 3)
+ LPC_SYSCON->RTCOSCCTRL = (1 << 0); /* Enable 32 kHz output */
+ for (i = 0; i < 200; i++) __NOP(); /* Wait for osc to stabilize */
+#endif
+
+ LPC_SYSCON->SYSPLLCLKSEL = SYSPLLCLKSEL_Val; /* Select PLL Input */
+ LPC_SYSCON->SYSPLLCLKUEN = 0x01; /* Update Clock Source */
+ LPC_SYSCON->SYSPLLCLKUEN = 0x00; /* Toggle Update Register */
+ LPC_SYSCON->SYSPLLCLKUEN = 0x01;
+ while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01)); /* Wait Until Updated */
+
+#if (CLOCK_SETUP_REG == 1) /* Clock Setup via Register */
+
+#if (((MAINCLKSEL_Val & 0x03) == 2) )
+ LPC_SYSCON->WDTOSCCTRL = WDTOSCCTRL_Val;
+ LPC_SYSCON->PDRUNCFG &= ~(1 << 6); /* Power-up WDT Clock */
+ for (i = 0; i < 2000; i++) __NOP(); /* Wait for osc to stabilize */
+#endif
+
+#if ((MAINCLKSEL_Val & 0x03) == 3) /* Main Clock is PLL Out */
+ power_down_config(1<<7); /* Power-down SYSPLL */
+ LPC_SYSCON->SYSPLLCTRL = SYSPLLCTRL_Val;
+ power_up_config(1<<7); /* Power-up SYSPLL */
+ while (!(LPC_SYSCON->SYSPLLSTAT & 0x01)); /* Wait Until PLL Locked */
+#endif
+
+ LPC_SYSCON->MAINCLKSEL = MAINCLKSEL_Val; /* Select Clock Source */
+ LPC_SYSCON->MAINCLKUEN = 0x01; /* Update MCLK Clock Source */
+ LPC_SYSCON->MAINCLKUEN = 0x00; /* Toggle Update Register */
+ LPC_SYSCON->MAINCLKUEN = 0x01;
+ while (!(LPC_SYSCON->MAINCLKUEN & 0x01)); /* Wait Until Updated */
+
+ LPC_SYSCON->SYSAHBCLKDIV = SYSAHBCLKDIV_Val;
+#endif /* Clock Setup via Register */
+
+#if (CLOCK_SETUP_API == 1) /* Clock Setup via PLL API */
+// LPC_SYSCON->SYSPLLCLKSEL = 0x00; /* Use IRC */
+// LPC_SYSCON->SYSPLLCLKUEN = 0x01; /* Update Clock Source */
+// LPC_SYSCON->SYSPLLCLKUEN = 0x00; /* Toggle Update Register */
+// LPC_SYSCON->SYSPLLCLKUEN = 0x01;
+// while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01)); /* Wait Until Updated */
+
+ LPC_SYSCON->MAINCLKSEL = SYSPLLCLKSEL_Val; /* Select same as SYSPLL */
+ LPC_SYSCON->MAINCLKUEN = 0x01; /* Update MCLK Clock Source */
+ LPC_SYSCON->MAINCLKUEN = 0x00; /* Toggle Update Register */
+ LPC_SYSCON->MAINCLKUEN = 0x01;
+ while (!(LPC_SYSCON->MAINCLKUEN & 0x01)); /* Wait Until Updated */
+
+ LPC_SYSCON->SYSAHBCLKDIV = 1;
+
+ setPLL(PLL_API_MODE_Val, __SYS_PLLCLKIN / 1000, PLL_API_FREQ_Val / 1000);
+#endif /* Clock Setup via PLL API */
+
+#if (USB_CLOCK_SETUP == 1) /* USB clock is used */
+ LPC_SYSCON->PDRUNCFG &= ~(1 << 10); /* Power-up USB PHY */
+
+#if ((USBCLKSEL_Val & 0x003) == 0) /* USB clock is USB PLL out */
+ LPC_SYSCON->PDRUNCFG &= ~(1 << 8); /* Power-up USB PLL */
+ LPC_SYSCON->USBPLLCLKSEL = USBPLLCLKSEL_Val; /* Select PLL Input */
+ LPC_SYSCON->USBPLLCLKUEN = 0x01; /* Update Clock Source */
+ LPC_SYSCON->USBPLLCLKUEN = 0x00; /* Toggle Update Register */
+ LPC_SYSCON->USBPLLCLKUEN = 0x01;
+ while (!(LPC_SYSCON->USBPLLCLKUEN & 0x01)); /* Wait Until Updated */
+
+ LPC_SYSCON->USBPLLCTRL = USBPLLCTRL_Val;
+ while (!(LPC_SYSCON->USBPLLSTAT & 0x01)); /* Wait Until PLL Locked */
+
+ LPC_SYSCON->USBCLKSEL = 0x00; /* Select USB PLL */
+#endif
+
+ LPC_SYSCON->USBCLKSEL = USBCLKSEL_Val; /* Select USB Clock */
+ LPC_SYSCON->USBCLKDIV = USBCLKDIV_Val; /* Set USB clock divider */
+
+#else /* USB clock is not used */
+ LPC_SYSCON->PDRUNCFG |= (1 << 10); /* Power-down USB PHY */
+ LPC_SYSCON->PDRUNCFG |= (1 << 8); /* Power-down USB PLL */
+#endif
+
+#endif /* Clock Setup */
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/system_LPC11U6x.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,64 @@
+/**************************************************************************//**
+ * @file system_LPC11U6x.h
+ * @brief CMSIS Cortex-M3 Device System Header File for
+ * NXP LPC11U6x Device Series
+ * @version V1.00
+ * @date 19. July 2013
+ *
+ * @note
+ * Copyright (C) 2013 ARM Limited. All rights reserved.
+ *
+ * @par
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M
+ * processor based microcontrollers. This file can be freely distributed
+ * within development tools that are supporting such ARM based processors.
+ *
+ * @par
+ * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ ******************************************************************************/
+
+
+#ifndef __SYSTEM_LPC11U6x_H
+#define __SYSTEM_LPC11U6x_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
+
+
+/**
+ * Initialize the system
+ *
+ * @param none
+ * @return none
+ *
+ * @brief Setup the microcontroller system.
+ * Initialize the System and update the SystemCoreClock variable.
+ */
+extern void SystemInit (void);
+
+/**
+ * Update SystemCoreClock variable
+ *
+ * @param none
+ * @return none
+ *
+ * @brief Updates the SystemCoreClock with current core Clock
+ * retrieved from cpu registers.
+ */
+extern void SystemCoreClockUpdate (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SYSTEM_LPC11U6x_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/TOOLCHAIN_GCC/TARGET_CORTEX_A/cache.S Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,94 @@
+/* Copyright (c) 2009 - 2012 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+ * Functions
+ *---------------------------------------------------------------------------*/
+ .text
+ .global __v7_all_cache
+/*
+ * __STATIC_ASM void __v7_all_cache(uint32_t op) {
+ */
+__v7_all_cache:
+ .arm
+
+ PUSH {R4-R11}
+
+ MRC p15, 1, R6, c0, c0, 1 /* Read CLIDR */
+ ANDS R3, R6, #0x07000000 /* Extract coherency level */
+ MOV R3, R3, LSR #23 /* Total cache levels << 1 */
+ BEQ Finished /* If 0, no need to clean */
+
+ MOV R10, #0 /* R10 holds current cache level << 1 */
+Loop1: ADD R2, R10, R10, LSR #1 /* R2 holds cache "Set" position */
+ MOV R1, R6, LSR R2 /* Bottom 3 bits are the Cache-type for this level */
+ AND R1, R1, #7 /* Isolate those lower 3 bits */
+ CMP R1, #2
+ BLT Skip /* No cache or only instruction cache at this level */
+
+ MCR p15, 2, R10, c0, c0, 0 /* Write the Cache Size selection register */
+ ISB /* ISB to sync the change to the CacheSizeID reg */
+ MRC p15, 1, R1, c0, c0, 0 /* Reads current Cache Size ID register */
+ AND R2, R1, #7 /* Extract the line length field */
+ ADD R2, R2, #4 /* Add 4 for the line length offset (log2 16 bytes) */
+ LDR R4, =0x3FF
+ ANDS R4, R4, R1, LSR #3 /* R4 is the max number on the way size (right aligned) */
+ CLZ R5, R4 /* R5 is the bit position of the way size increment */
+ LDR R7, =0x7FFF
+ ANDS R7, R7, R1, LSR #13 /* R7 is the max number of the index size (right aligned) */
+
+Loop2: MOV R9, R4 /* R9 working copy of the max way size (right aligned) */
+
+Loop3: ORR R11, R10, R9, LSL R5 /* Factor in the Way number and cache number into R11 */
+ ORR R11, R11, R7, LSL R2 /* Factor in the Set number */
+ CMP R0, #0
+ BNE Dccsw
+ MCR p15, 0, R11, c7, c6, 2 /* DCISW. Invalidate by Set/Way */
+ B cont
+Dccsw: CMP R0, #1
+ BNE Dccisw
+ MCR p15, 0, R11, c7, c10, 2 /* DCCSW. Clean by Set/Way */
+ B cont
+Dccisw: MCR p15, 0, R11, c7, c14, 2 /* DCCISW, Clean and Invalidate by Set/Way */
+cont: SUBS R9, R9, #1 /* Decrement the Way number */
+ BGE Loop3
+ SUBS R7, R7, #1 /* Decrement the Set number */
+ BGE Loop2
+Skip: ADD R10, R10, #2 /* increment the cache number */
+ CMP R3, R10
+ BGT Loop1
+
+Finished:
+ DSB
+ POP {R4-R11}
+ BX lr
+
+
+ .END
+/*----------------------------------------------------------------------------
+ * end of file
+ *---------------------------------------------------------------------------*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_ca9.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,271 @@
+/**************************************************************************//**
+ * @file core_ca9.h
+ * @brief CMSIS Cortex-A9 Core Peripheral Access Layer Header File
+ * @version
+ * @date 25 March 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2012 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CA9_H_GENERIC
+#define __CORE_CA9_H_GENERIC
+
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex_A9
+ @{
+ */
+
+/* CMSIS CA9 definitions */
+#define __CA9_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
+#define __CA9_CMSIS_VERSION_SUB (0x10) /*!< [15:0] CMSIS HAL sub version */
+#define __CA9_CMSIS_VERSION ((__CA9_CMSIS_VERSION_MAIN << 16) | \
+ __CA9_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
+
+#define __CORTEX_A (0x09) /*!< Cortex-A Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+ #define __STATIC_ASM static __asm
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+ #define __STATIC_ASM static __asm
+
+#elif defined ( __TMS470__ )
+ #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
+ #define __STATIC_INLINE static inline
+ #define __STATIC_ASM static __asm
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+ #define __STATIC_ASM static __asm
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+ #define __STATIC_ASM static __asm
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
+*/
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TMS470__ )
+ #if defined __TI_VFP_SUPPORT__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+#endif
+
+#include <stdint.h> /*!< standard types definitions */
+#include "core_caInstr.h" /*!< Core Instruction Access */
+#include "core_caFunc.h" /*!< Core Function Access */
+#include "core_cm4_simd.h" /*!< Compiler specific SIMD Intrinsics */
+
+#endif /* __CORE_CA9_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CA9_H_DEPENDANT
+#define __CORE_CA9_H_DEPENDANT
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CA9_REV
+ #define __CA9_REV 0x0000
+ #warning "__CA9_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __FPU_PRESENT
+ #define __FPU_PRESENT 1
+ #warning "__FPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 1
+ #endif
+
+ #if __Vendor_SysTickConfig == 0
+ #error "__Vendor_SysTickConfig set to 0, but vendor systick timer must be supplied for Cortex-A9"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex_A9 */
+
+
+/*******************************************************************************
+ * Register Abstraction
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-A processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t reserved1:7; /*!< bit: 20..23 Reserved */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+
+/*@} end of group CMSIS_CORE */
+
+/*@} end of CMSIS_Core_FPUFunctions */
+
+
+#endif /* __CORE_CA9_H_GENERIC */
+
+#endif /* __CMSIS_GENERIC */
+
+#ifdef __cplusplus
+}
+
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_caFunc.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,1177 @@
+/**************************************************************************//**
+ * @file core_caFunc.h
+ * @brief CMSIS Cortex-A Core Function Access Header File
+ * @version V3.10
+ * @date 30 Oct 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#ifndef __CORE_CAFUNC_H__
+#define __CORE_CAFUNC_H__
+
+
+/* ########################### Core Function Access ########################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
+ @{
+ */
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+#if (__ARMCC_VERSION < 400677)
+ #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
+#endif
+
+#define MODE_USR 0x10
+#define MODE_FIQ 0x11
+#define MODE_IRQ 0x12
+#define MODE_SVC 0x13
+#define MODE_MON 0x16
+#define MODE_ABT 0x17
+#define MODE_HYP 0x1A
+#define MODE_UND 0x1B
+#define MODE_SYS 0x1F
+
+/** \brief Get APSR Register
+
+ This function returns the content of the APSR Register.
+
+ \return APSR Register value
+ */
+__STATIC_INLINE uint32_t __get_APSR(void)
+{
+ register uint32_t __regAPSR __ASM("apsr");
+ return(__regAPSR);
+}
+
+
+/** \brief Get CPSR Register
+
+ This function returns the content of the CPSR Register.
+
+ \return CPSR Register value
+ */
+__STATIC_INLINE uint32_t __get_CPSR(void)
+{
+ register uint32_t __regCPSR __ASM("cpsr");
+ return(__regCPSR);
+}
+
+/** \brief Set Stack Pointer
+
+ This function assigns the given value to the current stack pointer.
+
+ \param [in] topOfStack Stack Pointer value to set
+ */
+register uint32_t __regSP __ASM("sp");
+__STATIC_INLINE void __set_SP(uint32_t topOfStack)
+{
+ __regSP = topOfStack;
+}
+
+
+/** \brief Get link register
+
+ This function returns the value of the link register
+
+ \return Value of link register
+ */
+register uint32_t __reglr __ASM("lr");
+__STATIC_INLINE uint32_t __get_LR(void)
+{
+ return(__reglr);
+}
+
+/** \brief Set link register
+
+ This function sets the value of the link register
+
+ \param [in] lr LR value to set
+ */
+__STATIC_INLINE void __set_LR(uint32_t lr)
+{
+ __reglr = lr;
+}
+
+/** \brief Set Process Stack Pointer
+
+ This function assigns the given value to the USR/SYS Stack Pointer (PSP).
+
+ \param [in] topOfProcStack USR/SYS Stack Pointer value to set
+ */
+__STATIC_ASM void __set_PSP(uint32_t topOfProcStack)
+{
+ ARM
+ PRESERVE8
+
+ BIC R0, R0, #7 ;ensure stack is 8-byte aligned
+ MRS R1, CPSR
+ CPS #MODE_SYS ;no effect in USR mode
+ MOV SP, R0
+ MSR CPSR_c, R1 ;no effect in USR mode
+ ISB
+ BX LR
+
+}
+
+/** \brief Set User Mode
+
+ This function changes the processor state to User Mode
+ */
+__STATIC_ASM void __set_CPS_USR(void)
+{
+ ARM
+
+ CPS #MODE_USR
+ BX LR
+}
+
+
+/** \brief Enable FIQ
+
+ This function enables FIQ interrupts by clearing the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __enable_fault_irq __enable_fiq
+
+
+/** \brief Disable FIQ
+
+ This function disables FIQ interrupts by setting the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __disable_fault_irq __disable_fiq
+
+
+/** \brief Get FPSCR
+
+ This function returns the current value of the Floating Point Status/Control register.
+
+ \return Floating Point Status/Control register value
+ */
+__STATIC_INLINE uint32_t __get_FPSCR(void)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ register uint32_t __regfpscr __ASM("fpscr");
+ return(__regfpscr);
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPSCR
+
+ This function assigns the given value to the Floating Point Status/Control register.
+
+ \param [in] fpscr Floating Point Status/Control value to set
+ */
+__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ register uint32_t __regfpscr __ASM("fpscr");
+ __regfpscr = (fpscr);
+#endif
+}
+
+/** \brief Get FPEXC
+
+ This function returns the current value of the Floating Point Exception Control register.
+
+ \return Floating Point Exception Control register value
+ */
+__STATIC_INLINE uint32_t __get_FPEXC(void)
+{
+#if (__FPU_PRESENT == 1)
+ register uint32_t __regfpexc __ASM("fpexc");
+ return(__regfpexc);
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPEXC
+
+ This function assigns the given value to the Floating Point Exception Control register.
+
+ \param [in] fpscr Floating Point Exception Control value to set
+ */
+__STATIC_INLINE void __set_FPEXC(uint32_t fpexc)
+{
+#if (__FPU_PRESENT == 1)
+ register uint32_t __regfpexc __ASM("fpexc");
+ __regfpexc = (fpexc);
+#endif
+}
+
+/** \brief Get CPACR
+
+ This function returns the current value of the Coprocessor Access Control register.
+
+ \return Coprocessor Access Control register value
+ */
+__STATIC_INLINE uint32_t __get_CPACR(void)
+{
+ register uint32_t __regCPACR __ASM("cp15:0:c1:c0:2");
+ return __regCPACR;
+}
+
+/** \brief Set CPACR
+
+ This function assigns the given value to the Coprocessor Access Control register.
+
+ \param [in] cpacr Coprocessor Acccess Control value to set
+ */
+__STATIC_INLINE void __set_CPACR(uint32_t cpacr)
+{
+ register uint32_t __regCPACR __ASM("cp15:0:c1:c0:2");
+ __regCPACR = cpacr;
+ __ISB();
+}
+
+/** \brief Get CBAR
+
+ This function returns the value of the Configuration Base Address register.
+
+ \return Configuration Base Address register value
+ */
+__STATIC_INLINE uint32_t __get_CBAR() {
+ register uint32_t __regCBAR __ASM("cp15:4:c15:c0:0");
+ return(__regCBAR);
+}
+
+/** \brief Get TTBR0
+
+ This function returns the value of the Translation Table Base Register 0.
+
+ \return Translation Table Base Register 0 value
+ */
+__STATIC_INLINE uint32_t __get_TTBR0() {
+ register uint32_t __regTTBR0 __ASM("cp15:0:c2:c0:0");
+ return(__regTTBR0);
+}
+
+/** \brief Set TTBR0
+
+ This function assigns the given value to the Translation Table Base Register 0.
+
+ \param [in] ttbr0 Translation Table Base Register 0 value to set
+ */
+__STATIC_INLINE void __set_TTBR0(uint32_t ttbr0) {
+ register uint32_t __regTTBR0 __ASM("cp15:0:c2:c0:0");
+ __regTTBR0 = ttbr0;
+ __ISB();
+}
+
+/** \brief Get DACR
+
+ This function returns the value of the Domain Access Control Register.
+
+ \return Domain Access Control Register value
+ */
+__STATIC_INLINE uint32_t __get_DACR() {
+ register uint32_t __regDACR __ASM("cp15:0:c3:c0:0");
+ return(__regDACR);
+}
+
+/** \brief Set DACR
+
+ This function assigns the given value to the Domain Access Control Register.
+
+ \param [in] dacr Domain Access Control Register value to set
+ */
+__STATIC_INLINE void __set_DACR(uint32_t dacr) {
+ register uint32_t __regDACR __ASM("cp15:0:c3:c0:0");
+ __regDACR = dacr;
+ __ISB();
+}
+
+/******************************** Cache and BTAC enable ****************************************************/
+
+/** \brief Set SCTLR
+
+ This function assigns the given value to the System Control Register.
+
+ \param [in] sctlr System Control Register value to set
+ */
+__STATIC_INLINE void __set_SCTLR(uint32_t sctlr)
+{
+ register uint32_t __regSCTLR __ASM("cp15:0:c1:c0:0");
+ __regSCTLR = sctlr;
+}
+
+/** \brief Get SCTLR
+
+ This function returns the value of the System Control Register.
+
+ \return System Control Register value
+ */
+__STATIC_INLINE uint32_t __get_SCTLR() {
+ register uint32_t __regSCTLR __ASM("cp15:0:c1:c0:0");
+ return(__regSCTLR);
+}
+
+/** \brief Enable Caches
+
+ Enable Caches
+ */
+__STATIC_INLINE void __enable_caches(void) {
+ // Set I bit 12 to enable I Cache
+ // Set C bit 2 to enable D Cache
+ __set_SCTLR( __get_SCTLR() | (1 << 12) | (1 << 2));
+}
+
+/** \brief Disable Caches
+
+ Disable Caches
+ */
+__STATIC_INLINE void __disable_caches(void) {
+ // Clear I bit 12 to disable I Cache
+ // Clear C bit 2 to disable D Cache
+ __set_SCTLR( __get_SCTLR() & ~(1 << 12) & ~(1 << 2));
+ __ISB();
+}
+
+/** \brief Enable BTAC
+
+ Enable BTAC
+ */
+__STATIC_INLINE void __enable_btac(void) {
+ // Set Z bit 11 to enable branch prediction
+ __set_SCTLR( __get_SCTLR() | (1 << 11));
+ __ISB();
+}
+
+/** \brief Disable BTAC
+
+ Disable BTAC
+ */
+__STATIC_INLINE void __disable_btac(void) {
+ // Clear Z bit 11 to disable branch prediction
+ __set_SCTLR( __get_SCTLR() & ~(1 << 11));
+}
+
+
+/** \brief Enable MMU
+
+ Enable MMU
+ */
+__STATIC_INLINE void __enable_mmu(void) {
+ // Set M bit 0 to enable the MMU
+ // Set AFE bit to enable simplified access permissions model
+ // Clear TRE bit to disable TEX remap and A bit to disable strict alignment fault checking
+ __set_SCTLR( (__get_SCTLR() & ~(1 << 28) & ~(1 << 1)) | 1 | (1 << 29));
+ __ISB();
+}
+
+/** \brief Disable MMU
+
+ Disable MMU
+ */
+__STATIC_INLINE void __disable_mmu(void) {
+ // Clear M bit 0 to disable the MMU
+ __set_SCTLR( __get_SCTLR() & ~1);
+ __ISB();
+}
+
+/******************************** TLB maintenance operations ************************************************/
+/** \brief Invalidate the whole tlb
+
+ TLBIALL. Invalidate the whole tlb
+ */
+
+__STATIC_INLINE void __ca9u_inv_tlb_all(void) {
+ register uint32_t __TLBIALL __ASM("cp15:0:c8:c7:0");
+ __TLBIALL = 0;
+ __DSB();
+ __ISB();
+}
+
+/******************************** BTB maintenance operations ************************************************/
+/** \brief Invalidate entire branch predictor array
+
+ BPIALL. Branch Predictor Invalidate All.
+ */
+
+__STATIC_INLINE void __v7_inv_btac(void) {
+ register uint32_t __BPIALL __ASM("cp15:0:c7:c5:6");
+ __BPIALL = 0;
+ __DSB(); //ensure completion of the invalidation
+ __ISB(); //ensure instruction fetch path sees new state
+}
+
+
+/******************************** L1 cache operations ******************************************************/
+
+/** \brief Invalidate the whole I$
+
+ ICIALLU. Instruction Cache Invalidate All to PoU
+ */
+__STATIC_INLINE void __v7_inv_icache_all(void) {
+ register uint32_t __ICIALLU __ASM("cp15:0:c7:c5:0");
+ __ICIALLU = 0;
+ __DSB(); //ensure completion of the invalidation
+ __ISB(); //ensure instruction fetch path sees new I cache state
+}
+
+/** \brief Clean D$ by MVA
+
+ DCCMVAC. Data cache clean by MVA to PoC
+ */
+__STATIC_INLINE void __v7_clean_dcache_mva(void *va) {
+ register uint32_t __DCCMVAC __ASM("cp15:0:c7:c10:1");
+ __DCCMVAC = (uint32_t)va;
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Invalidate D$ by MVA
+
+ DCIMVAC. Data cache invalidate by MVA to PoC
+ */
+__STATIC_INLINE void __v7_inv_dcache_mva(void *va) {
+ register uint32_t __DCIMVAC __ASM("cp15:0:c7:c6:1");
+ __DCIMVAC = (uint32_t)va;
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Clean and Invalidate D$ by MVA
+
+ DCCIMVAC. Data cache clean and invalidate by MVA to PoC
+ */
+__STATIC_INLINE void __v7_clean_inv_dcache_mva(void *va) {
+ register uint32_t __DCCIMVAC __ASM("cp15:0:c7:c14:1");
+ __DCCIMVAC = (uint32_t)va;
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Clean and Invalidate the entire data or unified cache
+
+ Generic mechanism for cleaning/invalidating the entire data or unified cache to the point of coherency.
+ */
+#pragma push
+#pragma arm
+__STATIC_ASM void __v7_all_cache(uint32_t op) {
+ ARM
+
+ PUSH {R4-R11}
+
+ MRC p15, 1, R6, c0, c0, 1 // Read CLIDR
+ ANDS R3, R6, #0x07000000 // Extract coherency level
+ MOV R3, R3, LSR #23 // Total cache levels << 1
+ BEQ Finished // If 0, no need to clean
+
+ MOV R10, #0 // R10 holds current cache level << 1
+Loop1 ADD R2, R10, R10, LSR #1 // R2 holds cache "Set" position
+ MOV R1, R6, LSR R2 // Bottom 3 bits are the Cache-type for this level
+ AND R1, R1, #7 // Isolate those lower 3 bits
+ CMP R1, #2
+ BLT Skip // No cache or only instruction cache at this level
+
+ MCR p15, 2, R10, c0, c0, 0 // Write the Cache Size selection register
+ ISB // ISB to sync the change to the CacheSizeID reg
+ MRC p15, 1, R1, c0, c0, 0 // Reads current Cache Size ID register
+ AND R2, R1, #7 // Extract the line length field
+ ADD R2, R2, #4 // Add 4 for the line length offset (log2 16 bytes)
+ LDR R4, =0x3FF
+ ANDS R4, R4, R1, LSR #3 // R4 is the max number on the way size (right aligned)
+ CLZ R5, R4 // R5 is the bit position of the way size increment
+ LDR R7, =0x7FFF
+ ANDS R7, R7, R1, LSR #13 // R7 is the max number of the index size (right aligned)
+
+Loop2 MOV R9, R4 // R9 working copy of the max way size (right aligned)
+
+Loop3 ORR R11, R10, R9, LSL R5 // Factor in the Way number and cache number into R11
+ ORR R11, R11, R7, LSL R2 // Factor in the Set number
+ CMP R0, #0
+ BNE Dccsw
+ MCR p15, 0, R11, c7, c6, 2 // DCISW. Invalidate by Set/Way
+ B cont
+Dccsw CMP R0, #1
+ BNE Dccisw
+ MCR p15, 0, R11, c7, c10, 2 // DCCSW. Clean by Set/Way
+ B cont
+Dccisw MCR p15, 0, R11, c7, c14, 2 // DCCISW. Clean and Invalidate by Set/Way
+cont SUBS R9, R9, #1 // Decrement the Way number
+ BGE Loop3
+ SUBS R7, R7, #1 // Decrement the Set number
+ BGE Loop2
+Skip ADD R10, R10, #2 // Increment the cache number
+ CMP R3, R10
+ BGT Loop1
+
+Finished
+ DSB
+ POP {R4-R11}
+ BX lr
+
+}
+#pragma pop
+
+
+/** \brief Invalidate the whole D$
+
+ DCISW. Invalidate by Set/Way
+ */
+
+__STATIC_INLINE void __v7_inv_dcache_all(void) {
+ __v7_all_cache(0);
+}
+
+/** \brief Clean the whole D$
+
+ DCCSW. Clean by Set/Way
+ */
+
+__STATIC_INLINE void __v7_clean_dcache_all(void) {
+ __v7_all_cache(1);
+}
+
+/** \brief Clean and invalidate the whole D$
+
+ DCCISW. Clean and Invalidate by Set/Way
+ */
+
+__STATIC_INLINE void __v7_clean_inv_dcache_all(void) {
+ __v7_all_cache(2);
+}
+
+#include "core_ca_mmu.h"
+
+#elif (defined (__ICCARM__)) /*---------------- ICC Compiler ---------------------*/
+
+#error IAR Compiler support not implemented for Cortex-A
+
+#elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+#define MODE_USR 0x10
+#define MODE_FIQ 0x11
+#define MODE_IRQ 0x12
+#define MODE_SVC 0x13
+#define MODE_MON 0x16
+#define MODE_ABT 0x17
+#define MODE_HYP 0x1A
+#define MODE_UND 0x1B
+#define MODE_SYS 0x1F
+
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void)
+{
+ __ASM volatile ("cpsie i");
+}
+
+/** \brief Disable IRQ Interrupts
+
+ This function disables IRQ interrupts by setting the I-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __disable_irq(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("mrs %0, cpsr" : "=r" (result));
+ __ASM volatile ("cpsid i");
+ return(result & 0x80);
+}
+
+
+/** \brief Get APSR Register
+
+ This function returns the content of the APSR Register.
+
+ \return APSR Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
+{
+#if 1
+ register uint32_t __regAPSR;
+ __ASM volatile ("mrs %0, apsr" : "=r" (__regAPSR) );
+#else
+ register uint32_t __regAPSR __ASM("apsr");
+#endif
+ return(__regAPSR);
+}
+
+
+/** \brief Get CPSR Register
+
+ This function returns the content of the CPSR Register.
+
+ \return CPSR Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CPSR(void)
+{
+#if 1
+ register uint32_t __regCPSR;
+ __ASM volatile ("mrs %0, cpsr" : "=r" (__regCPSR));
+#else
+ register uint32_t __regCPSR __ASM("cpsr");
+#endif
+ return(__regCPSR);
+}
+
+#if 0
+/** \brief Set Stack Pointer
+
+ This function assigns the given value to the current stack pointer.
+
+ \param [in] topOfStack Stack Pointer value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_SP(uint32_t topOfStack)
+{
+ register uint32_t __regSP __ASM("sp");
+ __regSP = topOfStack;
+}
+#endif
+
+/** \brief Get link register
+
+ This function returns the value of the link register
+
+ \return Value of link register
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_LR(void)
+{
+ register uint32_t __reglr __ASM("lr");
+ return(__reglr);
+}
+
+#if 0
+/** \brief Set link register
+
+ This function sets the value of the link register
+
+ \param [in] lr LR value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_LR(uint32_t lr)
+{
+ register uint32_t __reglr __ASM("lr");
+ __reglr = lr;
+}
+#endif
+
+/** \brief Set Process Stack Pointer
+
+ This function assigns the given value to the USR/SYS Stack Pointer (PSP).
+
+ \param [in] topOfProcStack USR/SYS Stack Pointer value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
+{
+ __asm__ volatile (
+ ".ARM;"
+ ".eabi_attribute Tag_ABI_align8_preserved,1;"
+
+ "BIC R0, R0, #7;" /* ;ensure stack is 8-byte aligned */
+ "MRS R1, CPSR;"
+ "CPS %0;" /* ;no effect in USR mode */
+ "MOV SP, R0;"
+ "MSR CPSR_c, R1;" /* ;no effect in USR mode */
+ "ISB;"
+ //"BX LR;"
+ :
+ : "i"(MODE_SYS)
+ : "r0", "r1");
+ return;
+}
+
+/** \brief Set User Mode
+
+ This function changes the processor state to User Mode
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CPS_USR(void)
+{
+ __asm__ volatile (
+ ".ARM;"
+
+ "CPS %0;"
+ //"BX LR;"
+ :
+ : "i"(MODE_USR)
+ : );
+ return;
+}
+
+
+/** \brief Enable FIQ
+
+ This function enables FIQ interrupts by clearing the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __enable_fault_irq() __asm__ volatile ("cpsie f")
+
+
+/** \brief Disable FIQ
+
+ This function disables FIQ interrupts by setting the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __disable_fault_irq() __asm__ volatile ("cpsid f")
+
+
+/** \brief Get FPSCR
+
+ This function returns the current value of the Floating Point Status/Control register.
+
+ \return Floating Point Status/Control register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+#if 1
+ uint32_t result;
+
+ __ASM volatile ("vmrs %0, fpscr" : "=r" (result) );
+ return (result);
+#else
+ register uint32_t __regfpscr __ASM("fpscr");
+ return(__regfpscr);
+#endif
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPSCR
+
+ This function assigns the given value to the Floating Point Status/Control register.
+
+ \param [in] fpscr Floating Point Status/Control value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+#if 1
+ __ASM volatile ("vmsr fpscr, %0" : : "r" (fpscr) );
+#else
+ register uint32_t __regfpscr __ASM("fpscr");
+ __regfpscr = (fpscr);
+#endif
+#endif
+}
+
+/** \brief Get FPEXC
+
+ This function returns the current value of the Floating Point Exception Control register.
+
+ \return Floating Point Exception Control register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPEXC(void)
+{
+#if (__FPU_PRESENT == 1)
+#if 1
+ uint32_t result;
+
+ __ASM volatile ("vmrs %0, fpexc" : "=r" (result));
+ return (result);
+#else
+ register uint32_t __regfpexc __ASM("fpexc");
+ return(__regfpexc);
+#endif
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPEXC
+
+ This function assigns the given value to the Floating Point Exception Control register.
+
+ \param [in] fpscr Floating Point Exception Control value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPEXC(uint32_t fpexc)
+{
+#if (__FPU_PRESENT == 1)
+#if 1
+ __ASM volatile ("vmsr fpexc, %0" : : "r" (fpexc));
+#else
+ register uint32_t __regfpexc __ASM("fpexc");
+ __regfpexc = (fpexc);
+#endif
+#endif
+}
+
+/** \brief Get CPACR
+
+ This function returns the current value of the Coprocessor Access Control register.
+
+ \return Coprocessor Access Control register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CPACR(void)
+{
+#if 1
+ register uint32_t __regCPACR;
+ __ASM volatile ("mrc p15, 0, %0, c1, c0, 2" : "=r" (__regCPACR));
+#else
+ register uint32_t __regCPACR __ASM("cp15:0:c1:c0:2");
+#endif
+ return __regCPACR;
+}
+
+/** \brief Set CPACR
+
+ This function assigns the given value to the Coprocessor Access Control register.
+
+ \param [in] cpacr Coprocessor Acccess Control value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CPACR(uint32_t cpacr)
+{
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c1, c0, 2" : : "r" (cpacr));
+#else
+ register uint32_t __regCPACR __ASM("cp15:0:c1:c0:2");
+ __regCPACR = cpacr;
+#endif
+ __ISB();
+}
+
+/** \brief Get CBAR
+
+ This function returns the value of the Configuration Base Address register.
+
+ \return Configuration Base Address register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CBAR() {
+#if 1
+ register uint32_t __regCBAR;
+ __ASM volatile ("mrc p15, 4, %0, c15, c0, 0" : "=r" (__regCBAR));
+#else
+ register uint32_t __regCBAR __ASM("cp15:4:c15:c0:0");
+#endif
+ return(__regCBAR);
+}
+
+/** \brief Get TTBR0
+
+ This function returns the value of the Translation Table Base Register 0.
+
+ \return Translation Table Base Register 0 value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_TTBR0() {
+#if 1
+ register uint32_t __regTTBR0;
+ __ASM volatile ("mrc p15, 0, %0, c2, c0, 0" : "=r" (__regTTBR0));
+#else
+ register uint32_t __regTTBR0 __ASM("cp15:0:c2:c0:0");
+#endif
+ return(__regTTBR0);
+}
+
+/** \brief Set TTBR0
+
+ This function assigns the given value to the Translation Table Base Register 0.
+
+ \param [in] ttbr0 Translation Table Base Register 0 value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_TTBR0(uint32_t ttbr0) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c2, c0, 0" : : "r" (ttbr0));
+#else
+ register uint32_t __regTTBR0 __ASM("cp15:0:c2:c0:0");
+ __regTTBR0 = ttbr0;
+#endif
+ __ISB();
+}
+
+/** \brief Get DACR
+
+ This function returns the value of the Domain Access Control Register.
+
+ \return Domain Access Control Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_DACR() {
+#if 1
+ register uint32_t __regDACR;
+ __ASM volatile ("mrc p15, 0, %0, c3, c0, 0" : "=r" (__regDACR));
+#else
+ register uint32_t __regDACR __ASM("cp15:0:c3:c0:0");
+#endif
+ return(__regDACR);
+}
+
+/** \brief Set DACR
+
+ This function assigns the given value to the Domain Access Control Register.
+
+ \param [in] dacr Domain Access Control Register value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_DACR(uint32_t dacr) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c3, c0, 0" : : "r" (dacr));
+#else
+ register uint32_t __regDACR __ASM("cp15:0:c3:c0:0");
+ __regDACR = dacr;
+#endif
+ __ISB();
+}
+
+/******************************** Cache and BTAC enable ****************************************************/
+
+/** \brief Set SCTLR
+
+ This function assigns the given value to the System Control Register.
+
+ \param [in] sctlr System Control Register value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_SCTLR(uint32_t sctlr)
+{
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c1, c0, 0" : : "r" (sctlr));
+#else
+ register uint32_t __regSCTLR __ASM("cp15:0:c1:c0:0");
+ __regSCTLR = sctlr;
+#endif
+}
+
+/** \brief Get SCTLR
+
+ This function returns the value of the System Control Register.
+
+ \return System Control Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_SCTLR() {
+#if 1
+ register uint32_t __regSCTLR;
+ __ASM volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (__regSCTLR));
+#else
+ register uint32_t __regSCTLR __ASM("cp15:0:c1:c0:0");
+#endif
+ return(__regSCTLR);
+}
+
+/** \brief Enable Caches
+
+ Enable Caches
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_caches(void) {
+ // Set I bit 12 to enable I Cache
+ // Set C bit 2 to enable D Cache
+ __set_SCTLR( __get_SCTLR() | (1 << 12) | (1 << 2));
+}
+
+/** \brief Disable Caches
+
+ Disable Caches
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_caches(void) {
+ // Clear I bit 12 to disable I Cache
+ // Clear C bit 2 to disable D Cache
+ __set_SCTLR( __get_SCTLR() & ~(1 << 12) & ~(1 << 2));
+ __ISB();
+}
+
+/** \brief Enable BTAC
+
+ Enable BTAC
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_btac(void) {
+ // Set Z bit 11 to enable branch prediction
+ __set_SCTLR( __get_SCTLR() | (1 << 11));
+ __ISB();
+}
+
+/** \brief Disable BTAC
+
+ Disable BTAC
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_btac(void) {
+ // Clear Z bit 11 to disable branch prediction
+ __set_SCTLR( __get_SCTLR() & ~(1 << 11));
+}
+
+
+/** \brief Enable MMU
+
+ Enable MMU
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_mmu(void) {
+ // Set M bit 0 to enable the MMU
+ // Set AFE bit to enable simplified access permissions model
+ // Clear TRE bit to disable TEX remap and A bit to disable strict alignment fault checking
+ __set_SCTLR( (__get_SCTLR() & ~(1 << 28) & ~(1 << 1)) | 1 | (1 << 29));
+ __ISB();
+}
+
+/** \brief Disable MMU
+
+ Disable MMU
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_mmu(void) {
+ // Clear M bit 0 to disable the MMU
+ __set_SCTLR( __get_SCTLR() & ~1);
+ __ISB();
+}
+
+/******************************** TLB maintenance operations ************************************************/
+/** \brief Invalidate the whole tlb
+
+ TLBIALL. Invalidate the whole tlb
+ */
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __ca9u_inv_tlb_all(void) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c8, c7, 0" : : "r" (0));
+#else
+ register uint32_t __TLBIALL __ASM("cp15:0:c8:c7:0");
+ __TLBIALL = 0;
+#endif
+ __DSB();
+ __ISB();
+}
+
+/******************************** BTB maintenance operations ************************************************/
+/** \brief Invalidate entire branch predictor array
+
+ BPIALL. Branch Predictor Invalidate All.
+ */
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_inv_btac(void) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c7, c5, 6" : : "r" (0));
+#else
+ register uint32_t __BPIALL __ASM("cp15:0:c7:c5:6");
+ __BPIALL = 0;
+#endif
+ __DSB(); //ensure completion of the invalidation
+ __ISB(); //ensure instruction fetch path sees new state
+}
+
+
+/******************************** L1 cache operations ******************************************************/
+
+/** \brief Invalidate the whole I$
+
+ ICIALLU. Instruction Cache Invalidate All to PoU
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_inv_icache_all(void) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c7, c5, 0" : : "r" (0));
+#else
+ register uint32_t __ICIALLU __ASM("cp15:0:c7:c5:0");
+ __ICIALLU = 0;
+#endif
+ __DSB(); //ensure completion of the invalidation
+ __ISB(); //ensure instruction fetch path sees new I cache state
+}
+
+/** \brief Clean D$ by MVA
+
+ DCCMVAC. Data cache clean by MVA to PoC
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_clean_dcache_mva(void *va) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c7, c10, 1" : : "r" ((uint32_t)va));
+#else
+ register uint32_t __DCCMVAC __ASM("cp15:0:c7:c10:1");
+ __DCCMVAC = (uint32_t)va;
+#endif
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Invalidate D$ by MVA
+
+ DCIMVAC. Data cache invalidate by MVA to PoC
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_inv_dcache_mva(void *va) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" ((uint32_t)va));
+#else
+ register uint32_t __DCIMVAC __ASM("cp15:0:c7:c6:1");
+ __DCIMVAC = (uint32_t)va;
+#endif
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Clean and Invalidate D$ by MVA
+
+ DCCIMVAC. Data cache clean and invalidate by MVA to PoC
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_clean_inv_dcache_mva(void *va) {
+#if 1
+ __ASM volatile ("mcr p15, 0, %0, c7, c14, 1" : : "r" ((uint32_t)va));
+#else
+ register uint32_t __DCCIMVAC __ASM("cp15:0:c7:c14:1");
+ __DCCIMVAC = (uint32_t)va;
+#endif
+ __DMB(); //ensure the ordering of data cache maintenance operations and their effects
+}
+
+/** \brief Clean and Invalidate the entire data or unified cache
+
+ Generic mechanism for cleaning/invalidating the entire data or unified cache to the point of coherency.
+ */
+extern void __v7_all_cache(uint32_t op);
+
+
+/** \brief Invalidate the whole D$
+
+ DCISW. Invalidate by Set/Way
+ */
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_inv_dcache_all(void) {
+ __v7_all_cache(0);
+}
+
+/** \brief Clean the whole D$
+
+ DCCSW. Clean by Set/Way
+ */
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_clean_dcache_all(void) {
+ __v7_all_cache(1);
+}
+
+/** \brief Clean and invalidate the whole D$
+
+ DCCISW. Clean and Invalidate by Set/Way
+ */
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __v7_clean_inv_dcache_all(void) {
+ __v7_all_cache(2);
+}
+
+#include "core_ca_mmu.h"
+
+#elif (defined (__TASKING__)) /*--------------- TASKING Compiler -----------------*/
+
+#error TASKING Compiler support not implemented for Cortex-A
+
+#endif
+
+/*@} end of CMSIS_Core_RegAccFunctions */
+
+
+#endif /* __CORE_CAFUNC_H__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/cmsis/core_caInstr.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,45 @@ +/**************************************************************************//** + * @file core_caInstr.h + * @brief CMSIS Cortex-A9 Core Peripheral Access Layer Header File + * @version + * @date 04. December 2012 + * + * @note + * + ******************************************************************************/ +/* Copyright (c) 2009 - 2012 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + +#ifndef __CORE_CAINSTR_H__ +#define __CORE_CAINSTR_H__ + +#define __CORTEX_M 0x3 +#include "core_cmInstr.h" +#undef __CORTEX_M + +#endif +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_ca_mmu.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,847 @@
+;/**************************************************************************//**
+; * @file core_ca_mmu.h
+; * @brief MMU Startup File for A9_MP Device Series
+; * @version V1.01
+; * @date 10 Sept 2014
+; *
+; * @note
+; *
+; ******************************************************************************/
+;/* Copyright (c) 2012-2014 ARM LIMITED
+;
+; All rights reserved.
+; Redistribution and use in source and binary forms, with or without
+; modification, are permitted provided that the following conditions are met:
+; - Redistributions of source code must retain the above copyright
+; notice, this list of conditions and the following disclaimer.
+; - Redistributions in binary form must reproduce the above copyright
+; notice, this list of conditions and the following disclaimer in the
+; documentation and/or other materials provided with the distribution.
+; - Neither the name of ARM nor the names of its contributors may be used
+; to endorse or promote products derived from this software without
+; specific prior written permission.
+; *
+; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+; POSSIBILITY OF SUCH DAMAGE.
+; ---------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef _MMU_FUNC_H
+#define _MMU_FUNC_H
+
+#define SECTION_DESCRIPTOR (0x2)
+#define SECTION_MASK (0xFFFFFFFC)
+
+#define SECTION_TEXCB_MASK (0xFFFF8FF3)
+#define SECTION_B_SHIFT (2)
+#define SECTION_C_SHIFT (3)
+#define SECTION_TEX0_SHIFT (12)
+#define SECTION_TEX1_SHIFT (13)
+#define SECTION_TEX2_SHIFT (14)
+
+#define SECTION_XN_MASK (0xFFFFFFEF)
+#define SECTION_XN_SHIFT (4)
+
+#define SECTION_DOMAIN_MASK (0xFFFFFE1F)
+#define SECTION_DOMAIN_SHIFT (5)
+
+#define SECTION_P_MASK (0xFFFFFDFF)
+#define SECTION_P_SHIFT (9)
+
+#define SECTION_AP_MASK (0xFFFF73FF)
+#define SECTION_AP_SHIFT (10)
+#define SECTION_AP2_SHIFT (15)
+
+#define SECTION_S_MASK (0xFFFEFFFF)
+#define SECTION_S_SHIFT (16)
+
+#define SECTION_NG_MASK (0xFFFDFFFF)
+#define SECTION_NG_SHIFT (17)
+
+#define SECTION_NS_MASK (0xFFF7FFFF)
+#define SECTION_NS_SHIFT (19)
+
+
+#define PAGE_L1_DESCRIPTOR (0x1)
+#define PAGE_L1_MASK (0xFFFFFFFC)
+
+#define PAGE_L2_4K_DESC (0x2)
+#define PAGE_L2_4K_MASK (0xFFFFFFFD)
+
+#define PAGE_L2_64K_DESC (0x1)
+#define PAGE_L2_64K_MASK (0xFFFFFFFC)
+
+#define PAGE_4K_TEXCB_MASK (0xFFFFFE33)
+#define PAGE_4K_B_SHIFT (2)
+#define PAGE_4K_C_SHIFT (3)
+#define PAGE_4K_TEX0_SHIFT (6)
+#define PAGE_4K_TEX1_SHIFT (7)
+#define PAGE_4K_TEX2_SHIFT (8)
+
+#define PAGE_64K_TEXCB_MASK (0xFFFF8FF3)
+#define PAGE_64K_B_SHIFT (2)
+#define PAGE_64K_C_SHIFT (3)
+#define PAGE_64K_TEX0_SHIFT (12)
+#define PAGE_64K_TEX1_SHIFT (13)
+#define PAGE_64K_TEX2_SHIFT (14)
+
+#define PAGE_TEXCB_MASK (0xFFFF8FF3)
+#define PAGE_B_SHIFT (2)
+#define PAGE_C_SHIFT (3)
+#define PAGE_TEX_SHIFT (12)
+
+#define PAGE_XN_4K_MASK (0xFFFFFFFE)
+#define PAGE_XN_4K_SHIFT (0)
+#define PAGE_XN_64K_MASK (0xFFFF7FFF)
+#define PAGE_XN_64K_SHIFT (15)
+
+
+#define PAGE_DOMAIN_MASK (0xFFFFFE1F)
+#define PAGE_DOMAIN_SHIFT (5)
+
+#define PAGE_P_MASK (0xFFFFFDFF)
+#define PAGE_P_SHIFT (9)
+
+#define PAGE_AP_MASK (0xFFFFFDCF)
+#define PAGE_AP_SHIFT (4)
+#define PAGE_AP2_SHIFT (9)
+
+#define PAGE_S_MASK (0xFFFFFBFF)
+#define PAGE_S_SHIFT (10)
+
+#define PAGE_NG_MASK (0xFFFFF7FF)
+#define PAGE_NG_SHIFT (11)
+
+#define PAGE_NS_MASK (0xFFFFFFF7)
+#define PAGE_NS_SHIFT (3)
+
+#define OFFSET_1M (0x00100000)
+#define OFFSET_64K (0x00010000)
+#define OFFSET_4K (0x00001000)
+
+#define DESCRIPTOR_FAULT (0x00000000)
+
+/* ########################### MMU Function Access ########################### */
+/** \ingroup MMU_FunctionInterface
+ \defgroup MMU_Functions MMU Functions Interface
+ @{
+ */
+
+/* Attributes enumerations */
+
+/* Region size attributes */
+typedef enum
+{
+ SECTION,
+ PAGE_4k,
+ PAGE_64k,
+} mmu_region_size_Type;
+
+/* Region type attributes */
+typedef enum
+{
+ NORMAL,
+ DEVICE,
+ SHARED_DEVICE,
+ NON_SHARED_DEVICE,
+ STRONGLY_ORDERED
+} mmu_memory_Type;
+
+/* Region cacheability attributes */
+typedef enum
+{
+ NON_CACHEABLE,
+ WB_WA,
+ WT,
+ WB_NO_WA,
+} mmu_cacheability_Type;
+
+/* Region parity check attributes */
+typedef enum
+{
+ ECC_DISABLED,
+ ECC_ENABLED,
+} mmu_ecc_check_Type;
+
+/* Region execution attributes */
+typedef enum
+{
+ EXECUTE,
+ NON_EXECUTE,
+} mmu_execute_Type;
+
+/* Region global attributes */
+typedef enum
+{
+ GLOBAL,
+ NON_GLOBAL,
+} mmu_global_Type;
+
+/* Region shareability attributes */
+typedef enum
+{
+ NON_SHARED,
+ SHARED,
+} mmu_shared_Type;
+
+/* Region security attributes */
+typedef enum
+{
+ SECURE,
+ NON_SECURE,
+} mmu_secure_Type;
+
+/* Region access attributes */
+typedef enum
+{
+ NO_ACCESS,
+ RW,
+ READ,
+} mmu_access_Type;
+
+/* Memory Region definition */
+typedef struct RegionStruct {
+ mmu_region_size_Type rg_t;
+ mmu_memory_Type mem_t;
+ uint8_t domain;
+ mmu_cacheability_Type inner_norm_t;
+ mmu_cacheability_Type outer_norm_t;
+ mmu_ecc_check_Type e_t;
+ mmu_execute_Type xn_t;
+ mmu_global_Type g_t;
+ mmu_secure_Type sec_t;
+ mmu_access_Type priv_t;
+ mmu_access_Type user_t;
+ mmu_shared_Type sh_t;
+
+} mmu_region_attributes_Type;
+
+/** \brief Set section execution-never attribute
+
+ The function sets section execution-never attribute
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] xn Section execution-never attribute : EXECUTE , NON_EXECUTE.
+
+ \return 0
+ */
+__STATIC_INLINE int __xn_section(uint32_t *descriptor_l1, mmu_execute_Type xn)
+{
+ *descriptor_l1 &= SECTION_XN_MASK;
+ *descriptor_l1 |= ((xn & 0x1) << SECTION_XN_SHIFT);
+ return 0;
+}
+
+/** \brief Set section domain
+
+ The function sets section domain
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] domain Section domain
+
+ \return 0
+ */
+__STATIC_INLINE int __domain_section(uint32_t *descriptor_l1, uint8_t domain)
+{
+ *descriptor_l1 &= SECTION_DOMAIN_MASK;
+ *descriptor_l1 |= ((domain & 0xF) << SECTION_DOMAIN_SHIFT);
+ return 0;
+}
+
+/** \brief Set section parity check
+
+ The function sets section parity check
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] p_bit Parity check: ECC_DISABLED, ECC_ENABLED
+
+ \return 0
+ */
+__STATIC_INLINE int __p_section(uint32_t *descriptor_l1, mmu_ecc_check_Type p_bit)
+{
+ *descriptor_l1 &= SECTION_P_MASK;
+ *descriptor_l1 |= ((p_bit & 0x1) << SECTION_P_SHIFT);
+ return 0;
+}
+
+/** \brief Set section access privileges
+
+ The function sets section access privileges
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] user User Level Access: NO_ACCESS, RW, READ
+ \param [in] priv Privilege Level Access: NO_ACCESS, RW, READ
+ \param [in] afe Access flag enable
+
+ \return 0
+ */
+__STATIC_INLINE int __ap_section(uint32_t *descriptor_l1, mmu_access_Type user, mmu_access_Type priv, uint32_t afe)
+{
+ uint32_t ap = 0;
+
+ if (afe == 0) { //full access
+ if ((priv == NO_ACCESS) && (user == NO_ACCESS)) { ap = 0x0; }
+ else if ((priv == RW) && (user == NO_ACCESS)) { ap = 0x1; }
+ else if ((priv == RW) && (user == READ)) { ap = 0x2; }
+ else if ((priv == RW) && (user == RW)) { ap = 0x3; }
+ else if ((priv == READ) && (user == NO_ACCESS)) { ap = 0x5; }
+ else if ((priv == READ) && (user == READ)) { ap = 0x7; }
+ }
+
+ else { //Simplified access
+ if ((priv == RW) && (user == NO_ACCESS)) { ap = 0x1; }
+ else if ((priv == RW) && (user == RW)) { ap = 0x3; }
+ else if ((priv == READ) && (user == NO_ACCESS)) { ap = 0x5; }
+ else if ((priv == READ) && (user == READ)) { ap = 0x7; }
+ }
+
+ *descriptor_l1 &= SECTION_AP_MASK;
+ *descriptor_l1 |= (ap & 0x3) << SECTION_AP_SHIFT;
+ *descriptor_l1 |= ((ap & 0x4)>>2) << SECTION_AP2_SHIFT;
+
+ return 0;
+}
+
+/** \brief Set section shareability
+
+ The function sets section shareability
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] s_bit Section shareability: NON_SHARED, SHARED
+
+ \return 0
+ */
+__STATIC_INLINE int __shared_section(uint32_t *descriptor_l1, mmu_shared_Type s_bit)
+{
+ *descriptor_l1 &= SECTION_S_MASK;
+ *descriptor_l1 |= ((s_bit & 0x1) << SECTION_S_SHIFT);
+ return 0;
+}
+
+/** \brief Set section Global attribute
+
+ The function sets section Global attribute
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] g_bit Section attribute: GLOBAL, NON_GLOBAL
+
+ \return 0
+ */
+__STATIC_INLINE int __global_section(uint32_t *descriptor_l1, mmu_global_Type g_bit)
+{
+ *descriptor_l1 &= SECTION_NG_MASK;
+ *descriptor_l1 |= ((g_bit & 0x1) << SECTION_NG_SHIFT);
+ return 0;
+}
+
+/** \brief Set section Security attribute
+
+ The function sets section Global attribute
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] s_bit Section Security attribute: SECURE, NON_SECURE
+
+ \return 0
+ */
+__STATIC_INLINE int __secure_section(uint32_t *descriptor_l1, mmu_secure_Type s_bit)
+{
+ *descriptor_l1 &= SECTION_NS_MASK;
+ *descriptor_l1 |= ((s_bit & 0x1) << SECTION_NS_SHIFT);
+ return 0;
+}
+
+/* Page 4k or 64k */
+/** \brief Set 4k/64k page execution-never attribute
+
+ The function sets 4k/64k page execution-never attribute
+
+ \param [out] descriptor_l2 L2 descriptor.
+ \param [in] xn Page execution-never attribute : EXECUTE , NON_EXECUTE.
+ \param [in] page Page size: PAGE_4k, PAGE_64k,
+
+ \return 0
+ */
+__STATIC_INLINE int __xn_page(uint32_t *descriptor_l2, mmu_execute_Type xn, mmu_region_size_Type page)
+{
+ if (page == PAGE_4k)
+ {
+ *descriptor_l2 &= PAGE_XN_4K_MASK;
+ *descriptor_l2 |= ((xn & 0x1) << PAGE_XN_4K_SHIFT);
+ }
+ else
+ {
+ *descriptor_l2 &= PAGE_XN_64K_MASK;
+ *descriptor_l2 |= ((xn & 0x1) << PAGE_XN_64K_SHIFT);
+ }
+ return 0;
+}
+
+/** \brief Set 4k/64k page domain
+
+ The function sets 4k/64k page domain
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] domain Page domain
+
+ \return 0
+ */
+__STATIC_INLINE int __domain_page(uint32_t *descriptor_l1, uint8_t domain)
+{
+ *descriptor_l1 &= PAGE_DOMAIN_MASK;
+ *descriptor_l1 |= ((domain & 0xf) << PAGE_DOMAIN_SHIFT);
+ return 0;
+}
+
+/** \brief Set 4k/64k page parity check
+
+ The function sets 4k/64k page parity check
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] p_bit Parity check: ECC_DISABLED, ECC_ENABLED
+
+ \return 0
+ */
+__STATIC_INLINE int __p_page(uint32_t *descriptor_l1, mmu_ecc_check_Type p_bit)
+{
+ *descriptor_l1 &= SECTION_P_MASK;
+ *descriptor_l1 |= ((p_bit & 0x1) << SECTION_P_SHIFT);
+ return 0;
+}
+
+/** \brief Set 4k/64k page access privileges
+
+ The function sets 4k/64k page access privileges
+
+ \param [out] descriptor_l2 L2 descriptor.
+ \param [in] user User Level Access: NO_ACCESS, RW, READ
+ \param [in] priv Privilege Level Access: NO_ACCESS, RW, READ
+ \param [in] afe Access flag enable
+
+ \return 0
+ */
+__STATIC_INLINE int __ap_page(uint32_t *descriptor_l2, mmu_access_Type user, mmu_access_Type priv, uint32_t afe)
+{
+ uint32_t ap = 0;
+
+ if (afe == 0) { //full access
+ if ((priv == NO_ACCESS) && (user == NO_ACCESS)) { ap = 0x0; }
+ else if ((priv == RW) && (user == NO_ACCESS)) { ap = 0x1; }
+ else if ((priv == RW) && (user == READ)) { ap = 0x2; }
+ else if ((priv == RW) && (user == RW)) { ap = 0x3; }
+ else if ((priv == READ) && (user == NO_ACCESS)) { ap = 0x5; }
+ else if ((priv == READ) && (user == READ)) { ap = 0x6; }
+ }
+
+ else { //Simplified access
+ if ((priv == RW) && (user == NO_ACCESS)) { ap = 0x1; }
+ else if ((priv == RW) && (user == RW)) { ap = 0x3; }
+ else if ((priv == READ) && (user == NO_ACCESS)) { ap = 0x5; }
+ else if ((priv == READ) && (user == READ)) { ap = 0x7; }
+ }
+
+ *descriptor_l2 &= PAGE_AP_MASK;
+ *descriptor_l2 |= (ap & 0x3) << PAGE_AP_SHIFT;
+ *descriptor_l2 |= ((ap & 0x4)>>2) << PAGE_AP2_SHIFT;
+
+ return 0;
+}
+
+/** \brief Set 4k/64k page shareability
+
+ The function sets 4k/64k page shareability
+
+ \param [out] descriptor_l2 L2 descriptor.
+ \param [in] s_bit 4k/64k page shareability: NON_SHARED, SHARED
+
+ \return 0
+ */
+__STATIC_INLINE int __shared_page(uint32_t *descriptor_l2, mmu_shared_Type s_bit)
+{
+ *descriptor_l2 &= PAGE_S_MASK;
+ *descriptor_l2 |= ((s_bit & 0x1) << PAGE_S_SHIFT);
+ return 0;
+}
+
+/** \brief Set 4k/64k page Global attribute
+
+ The function sets 4k/64k page Global attribute
+
+ \param [out] descriptor_l2 L2 descriptor.
+ \param [in] g_bit 4k/64k page attribute: GLOBAL, NON_GLOBAL
+
+ \return 0
+ */
+__STATIC_INLINE int __global_page(uint32_t *descriptor_l2, mmu_global_Type g_bit)
+{
+ *descriptor_l2 &= PAGE_NG_MASK;
+ *descriptor_l2 |= ((g_bit & 0x1) << PAGE_NG_SHIFT);
+ return 0;
+}
+
+/** \brief Set 4k/64k page Security attribute
+
+ The function sets 4k/64k page Global attribute
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] s_bit 4k/64k page Security attribute: SECURE, NON_SECURE
+
+ \return 0
+ */
+__STATIC_INLINE int __secure_page(uint32_t *descriptor_l1, mmu_secure_Type s_bit)
+{
+ *descriptor_l1 &= PAGE_NS_MASK;
+ *descriptor_l1 |= ((s_bit & 0x1) << PAGE_NS_SHIFT);
+ return 0;
+}
+
+
+/** \brief Set Section memory attributes
+
+ The function sets section memory attributes
+
+ \param [out] descriptor_l1 L1 descriptor.
+ \param [in] mem Section memory type: NORMAL, DEVICE, SHARED_DEVICE, NON_SHARED_DEVICE, STRONGLY_ORDERED
+ \param [in] outer Outer cacheability: NON_CACHEABLE, WB_WA, WT, WB_NO_WA,
+ \param [in] inner Inner cacheability: NON_CACHEABLE, WB_WA, WT, WB_NO_WA,
+
+ \return 0
+ */
+__STATIC_INLINE int __memory_section(uint32_t *descriptor_l1, mmu_memory_Type mem, mmu_cacheability_Type outer, mmu_cacheability_Type inner)
+{
+ *descriptor_l1 &= SECTION_TEXCB_MASK;
+
+ if (STRONGLY_ORDERED == mem)
+ {
+ return 0;
+ }
+ else if (SHARED_DEVICE == mem)
+ {
+ *descriptor_l1 |= (1 << SECTION_B_SHIFT);
+ }
+ else if (NON_SHARED_DEVICE == mem)
+ {
+ *descriptor_l1 |= (1 << SECTION_TEX1_SHIFT);
+ }
+ else if (NORMAL == mem)
+ {
+ *descriptor_l1 |= 1 << SECTION_TEX2_SHIFT;
+ switch(inner)
+ {
+ case NON_CACHEABLE:
+ break;
+ case WB_WA:
+ *descriptor_l1 |= (1 << SECTION_B_SHIFT);
+ break;
+ case WT:
+ *descriptor_l1 |= 1 << SECTION_C_SHIFT;
+ break;
+ case WB_NO_WA:
+ *descriptor_l1 |= (1 << SECTION_B_SHIFT) | (1 << SECTION_C_SHIFT);
+ break;
+ }
+ switch(outer)
+ {
+ case NON_CACHEABLE:
+ break;
+ case WB_WA:
+ *descriptor_l1 |= (1 << SECTION_TEX0_SHIFT);
+ break;
+ case WT:
+ *descriptor_l1 |= 1 << SECTION_TEX1_SHIFT;
+ break;
+ case WB_NO_WA:
+ *descriptor_l1 |= (1 << SECTION_TEX0_SHIFT) | (1 << SECTION_TEX0_SHIFT);
+ break;
+ }
+ }
+
+ return 0;
+}
+
+/** \brief Set 4k/64k page memory attributes
+
+ The function sets 4k/64k page memory attributes
+
+ \param [out] descriptor_l2 L2 descriptor.
+ \param [in] mem 4k/64k page memory type: NORMAL, DEVICE, SHARED_DEVICE, NON_SHARED_DEVICE, STRONGLY_ORDERED
+ \param [in] outer Outer cacheability: NON_CACHEABLE, WB_WA, WT, WB_NO_WA,
+ \param [in] inner Inner cacheability: NON_CACHEABLE, WB_WA, WT, WB_NO_WA,
+
+ \return 0
+ */
+__STATIC_INLINE int __memory_page(uint32_t *descriptor_l2, mmu_memory_Type mem, mmu_cacheability_Type outer, mmu_cacheability_Type inner, mmu_region_size_Type page)
+{
+ *descriptor_l2 &= PAGE_4K_TEXCB_MASK;
+
+ if (page == PAGE_64k)
+ {
+ //same as section
+ __memory_section(descriptor_l2, mem, outer, inner);
+ }
+ else
+ {
+ if (STRONGLY_ORDERED == mem)
+ {
+ return 0;
+ }
+ else if (SHARED_DEVICE == mem)
+ {
+ *descriptor_l2 |= (1 << PAGE_4K_B_SHIFT);
+ }
+ else if (NON_SHARED_DEVICE == mem)
+ {
+ *descriptor_l2 |= (1 << PAGE_4K_TEX1_SHIFT);
+ }
+ else if (NORMAL == mem)
+ {
+ *descriptor_l2 |= 1 << PAGE_4K_TEX2_SHIFT;
+ switch(inner)
+ {
+ case NON_CACHEABLE:
+ break;
+ case WB_WA:
+ *descriptor_l2 |= (1 << PAGE_4K_B_SHIFT);
+ break;
+ case WT:
+ *descriptor_l2 |= 1 << PAGE_4K_C_SHIFT;
+ break;
+ case WB_NO_WA:
+ *descriptor_l2 |= (1 << PAGE_4K_B_SHIFT) | (1 << PAGE_4K_C_SHIFT);
+ break;
+ }
+ switch(outer)
+ {
+ case NON_CACHEABLE:
+ break;
+ case WB_WA:
+ *descriptor_l2 |= (1 << PAGE_4K_TEX0_SHIFT);
+ break;
+ case WT:
+ *descriptor_l2 |= 1 << PAGE_4K_TEX1_SHIFT;
+ break;
+ case WB_NO_WA:
+ *descriptor_l2 |= (1 << PAGE_4K_TEX0_SHIFT) | (1 << PAGE_4K_TEX0_SHIFT);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+/** \brief Create a L1 section descriptor
+
+ The function creates a section descriptor.
+
+ Assumptions:
+ - 16MB super sections not supported
+ - TEX remap disabled, so memory type and attributes are described directly by bits in the descriptor
+ - Functions always return 0
+
+ \param [out] descriptor L1 descriptor
+ \param [out] descriptor2 L2 descriptor
+ \param [in] reg Section attributes
+
+ \return 0
+ */
+__STATIC_INLINE int __get_section_descriptor(uint32_t *descriptor, mmu_region_attributes_Type reg)
+{
+ *descriptor = 0;
+
+ __memory_section(descriptor, reg.mem_t, reg.outer_norm_t, reg.inner_norm_t);
+ __xn_section(descriptor,reg.xn_t);
+ __domain_section(descriptor, reg.domain);
+ __p_section(descriptor, reg.e_t);
+ __ap_section(descriptor, reg.priv_t, reg.user_t, 1);
+ __shared_section(descriptor,reg.sh_t);
+ __global_section(descriptor,reg.g_t);
+ __secure_section(descriptor,reg.sec_t);
+ *descriptor &= SECTION_MASK;
+ *descriptor |= SECTION_DESCRIPTOR;
+
+ return 0;
+
+}
+
+
+/** \brief Create a L1 and L2 4k/64k page descriptor
+
+ The function creates a 4k/64k page descriptor.
+ Assumptions:
+ - TEX remap disabled, so memory type and attributes are described directly by bits in the descriptor
+ - Functions always return 0
+
+ \param [out] descriptor L1 descriptor
+ \param [out] descriptor2 L2 descriptor
+ \param [in] reg 4k/64k page attributes
+
+ \return 0
+ */
+__STATIC_INLINE int __get_page_descriptor(uint32_t *descriptor, uint32_t *descriptor2, mmu_region_attributes_Type reg)
+{
+ *descriptor = 0;
+ *descriptor2 = 0;
+
+ switch (reg.rg_t)
+ {
+ case PAGE_4k:
+ __memory_page(descriptor2, reg.mem_t, reg.outer_norm_t, reg.inner_norm_t, PAGE_4k);
+ __xn_page(descriptor2, reg.xn_t, PAGE_4k);
+ __domain_page(descriptor, reg.domain);
+ __p_page(descriptor, reg.e_t);
+ __ap_page(descriptor2, reg.priv_t, reg.user_t, 1);
+ __shared_page(descriptor2,reg.sh_t);
+ __global_page(descriptor2,reg.g_t);
+ __secure_page(descriptor,reg.sec_t);
+ *descriptor &= PAGE_L1_MASK;
+ *descriptor |= PAGE_L1_DESCRIPTOR;
+ *descriptor2 &= PAGE_L2_4K_MASK;
+ *descriptor2 |= PAGE_L2_4K_DESC;
+ break;
+
+ case PAGE_64k:
+ __memory_page(descriptor2, reg.mem_t, reg.outer_norm_t, reg.inner_norm_t, PAGE_64k);
+ __xn_page(descriptor2, reg.xn_t, PAGE_64k);
+ __domain_page(descriptor, reg.domain);
+ __p_page(descriptor, reg.e_t);
+ __ap_page(descriptor2, reg.priv_t, reg.user_t, 1);
+ __shared_page(descriptor2,reg.sh_t);
+ __global_page(descriptor2,reg.g_t);
+ __secure_page(descriptor,reg.sec_t);
+ *descriptor &= PAGE_L1_MASK;
+ *descriptor |= PAGE_L1_DESCRIPTOR;
+ *descriptor2 &= PAGE_L2_64K_MASK;
+ *descriptor2 |= PAGE_L2_64K_DESC;
+ break;
+
+ case SECTION:
+ //error
+ break;
+
+ }
+
+ return 0;
+
+}
+
+/** \brief Create a 1MB Section
+
+ \param [in] ttb Translation table base address
+ \param [in] base_address Section base address
+ \param [in] count Number of sections to create
+ \param [in] descriptor_l1 L1 descriptor (region attributes)
+
+ */
+__STATIC_INLINE void __TTSection(uint32_t *ttb, uint32_t base_address, uint32_t count, uint32_t descriptor_l1)
+{
+ uint32_t offset;
+ uint32_t entry;
+ uint32_t i;
+
+ offset = base_address >> 20;
+ entry = (base_address & 0xFFF00000) | descriptor_l1;
+
+ //4 bytes aligned
+ ttb = ttb + offset;
+
+ for (i = 0; i < count; i++ )
+ {
+ //4 bytes aligned
+ *ttb++ = entry;
+ entry += OFFSET_1M;
+ }
+}
+
+/** \brief Create a 4k page entry
+
+ \param [in] ttb L1 table base address
+ \param [in] base_address 4k base address
+ \param [in] count Number of 4k pages to create
+ \param [in] descriptor_l1 L1 descriptor (region attributes)
+ \param [in] ttb_l2 L2 table base address
+ \param [in] descriptor_l2 L2 descriptor (region attributes)
+
+ */
+__STATIC_INLINE void __TTPage_4k(uint32_t *ttb, uint32_t base_address, uint32_t count, uint32_t descriptor_l1, uint32_t *ttb_l2, uint32_t descriptor_l2 )
+{
+
+ uint32_t offset, offset2;
+ uint32_t entry, entry2;
+ uint32_t i;
+
+
+ offset = base_address >> 20;
+ entry = ((int)ttb_l2 & 0xFFFFFC00) | descriptor_l1;
+
+ //4 bytes aligned
+ ttb += offset;
+ //create l1_entry
+ *ttb = entry;
+
+ offset2 = (base_address & 0xff000) >> 12;
+ ttb_l2 += offset2;
+ entry2 = (base_address & 0xFFFFF000) | descriptor_l2;
+ for (i = 0; i < count; i++ )
+ {
+ //4 bytes aligned
+ *ttb_l2++ = entry2;
+ entry2 += OFFSET_4K;
+ }
+}
+
+/** \brief Create a 64k page entry
+
+ \param [in] ttb L1 table base address
+ \param [in] base_address 64k base address
+ \param [in] count Number of 64k pages to create
+ \param [in] descriptor_l1 L1 descriptor (region attributes)
+ \param [in] ttb_l2 L2 table base address
+ \param [in] descriptor_l2 L2 descriptor (region attributes)
+
+ */
+__STATIC_INLINE void __TTPage_64k(uint32_t *ttb, uint32_t base_address, uint32_t count, uint32_t descriptor_l1, uint32_t *ttb_l2, uint32_t descriptor_l2 )
+{
+ uint32_t offset, offset2;
+ uint32_t entry, entry2;
+ uint32_t i,j;
+
+
+ offset = base_address >> 20;
+ entry = ((int)ttb_l2 & 0xFFFFFC00) | descriptor_l1;
+
+ //4 bytes aligned
+ ttb += offset;
+ //create l1_entry
+ *ttb = entry;
+
+ offset2 = (base_address & 0xff000) >> 12;
+ ttb_l2 += offset2;
+ entry2 = (base_address & 0xFFFF0000) | descriptor_l2;
+ for (i = 0; i < count; i++ )
+ {
+ //create 16 entries
+ for (j = 0; j < 16; j++)
+ //4 bytes aligned
+ *ttb_l2++ = entry2;
+ entry2 += OFFSET_64K;
+ }
+}
+
+/*@} end of MMU_Functions */
+#endif
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm0.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,682 @@
+/**************************************************************************//**
+ * @file core_cm0.h
+ * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CM0_H_GENERIC
+#define __CORE_CM0_H_GENERIC
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex_M0
+ @{
+ */
+
+/* CMSIS CM0 definitions */
+#define __CM0_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
+#define __CM0_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */
+#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | \
+ __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x00) /*!< Cortex-M Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not. This core does not support an FPU at all
+*/
+#define __FPU_USED 0
+
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+#endif
+
+#include <stdint.h> /* standard types definitions */
+#include <core_cmInstr.h> /* Core Instruction Access */
+#include <core_cmFunc.h> /* Core Function Access */
+
+#endif /* __CORE_CM0_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CM0_H_DEPENDANT
+#define __CORE_CM0_H_DEPENDANT
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CM0_REV
+ #define __CM0_REV 0x0000
+ #warning "__CM0_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 2
+ #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 0
+ #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex_M0 */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ Core Register contain:
+ - Core Register
+ - Core NVIC Register
+ - Core SCB Register
+ - Core SysTick Register
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-M processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */
+#else
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
+#endif
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+
+/** \brief Union type to access the Interrupt Program Status Register (IPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} IPSR_Type;
+
+
+/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
+#else
+ uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
+#endif
+ uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
+ uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} xPSR_Type;
+
+
+/** \brief Union type to access the Control Registers (CONTROL).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
+ uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
+ uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
+ uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} CONTROL_Type;
+
+/*@} end of group CMSIS_CORE */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
+ \brief Type definitions for the NVIC Registers
+ @{
+ */
+
+/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
+ */
+typedef struct
+{
+ __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
+ uint32_t RESERVED0[31];
+ __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
+ uint32_t RSERVED1[31];
+ __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
+ uint32_t RESERVED2[31];
+ __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
+ uint32_t RESERVED3[31];
+ uint32_t RESERVED4[64];
+ __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
+} NVIC_Type;
+
+/*@} end of group CMSIS_NVIC */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCB System Control Block (SCB)
+ \brief Type definitions for the System Control Block Registers
+ @{
+ */
+
+/** \brief Structure type to access the System Control Block (SCB).
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
+ uint32_t RESERVED0;
+ __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
+ uint32_t RESERVED1;
+ __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
+ __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
+#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+/*@} end of group CMSIS_SCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SysTick System Tick Timer (SysTick)
+ \brief Type definitions for the System Timer Registers.
+ @{
+ */
+
+/** \brief Structure type to access the System Timer (SysTick).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
+
+/*@} end of group CMSIS_SysTick */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
+ \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR)
+ are only accessible over DAP and not via processor. Therefore
+ they are not covered by the Cortex-M0 header file.
+ @{
+ */
+/*@} end of group CMSIS_CoreDebug */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_core_base Core Definitions
+ \brief Definitions for base addresses, unions, and structures.
+ @{
+ */
+
+/* Memory mapping of Cortex-M0 Hardware */
+#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
+
+#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
+
+
+/*@} */
+
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ Core Function Interface contains:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Register Access Functions
+ ******************************************************************************/
+/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
+*/
+
+
+
+/* ########################## NVIC functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_NVICFunctions NVIC Functions
+ \brief Functions that manage interrupts and exceptions via the NVIC.
+ @{
+ */
+
+/* Interrupt Priorities are WORD accessible only under ARMv6M */
+/* The following MACROS handle generation of the register offset and byte masks */
+#define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
+#define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
+#define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
+
+
+/** \brief Enable External Interrupt
+
+ The function enables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Disable External Interrupt
+
+ The function disables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Get Pending Interrupt
+
+ The function reads the pending register in the NVIC and returns the pending bit
+ for the specified interrupt.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not pending.
+ \return 1 Interrupt status is pending.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t) ((NVIC->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
+}
+
+
+/** \brief Set Pending Interrupt
+
+ The function sets the pending bit of an external interrupt.
+
+ \param [in] IRQn Interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Clear Pending Interrupt
+
+ The function clears the pending bit of an external interrupt.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
+}
+
+
+/** \brief Set Interrupt Priority
+
+ The function sets the priority of an interrupt.
+
+ \note The priority cannot be set for every core interrupt.
+
+ \param [in] IRQn Interrupt number.
+ \param [in] priority Priority to set.
+ */
+__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if(IRQn < 0) {
+ SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
+ (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
+ else {
+ NVIC->IP[_IP_IDX(IRQn)] = (NVIC->IP[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
+ (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
+}
+
+
+/** \brief Get Interrupt Priority
+
+ The function reads the priority of an interrupt. The interrupt
+ number can be positive to specify an external (device specific)
+ interrupt, or negative to specify an internal (core) interrupt.
+
+
+ \param [in] IRQn Interrupt number.
+ \return Interrupt Priority. Value is aligned automatically to the implemented
+ priority bits of the microcontroller.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if(IRQn < 0) {
+ return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & 0xFF) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M0 system interrupts */
+ else {
+ return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & 0xFF) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
+}
+
+
+/** \brief System Reset
+
+ The function initiates a system reset request to reset the MCU.
+ */
+__STATIC_INLINE void NVIC_SystemReset(void)
+{
+ __DSB(); /* Ensure all outstanding memory accesses included
+ buffered write are completed before reset */
+ SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ SCB_AIRCR_SYSRESETREQ_Msk);
+ __DSB(); /* Ensure completion of memory access */
+ while(1); /* wait until reset */
+}
+
+/*@} end of CMSIS_Core_NVICFunctions */
+
+
+
+/* ################################## SysTick function ############################################ */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
+ \brief Functions that configure the System.
+ @{
+ */
+
+#if (__Vendor_SysTickConfig == 0)
+
+/** \brief System Tick Configuration
+
+ The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
+ Counter is in free running mode to generate periodic interrupts.
+
+ \param [in] ticks Number of ticks between two interrupts.
+
+ \return 0 Function succeeded.
+ \return 1 Function failed.
+
+ \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
+ function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
+ must contain a vendor-specific implementation of this function.
+
+ */
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
+
+ SysTick->LOAD = ticks - 1; /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
+ SysTick->VAL = 0; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0); /* Function successful */
+}
+
+#endif
+
+/*@} end of CMSIS_Core_SysTickFunctions */
+
+
+
+
+#endif /* __CORE_CM0_H_DEPENDANT */
+
+#endif /* __CMSIS_GENERIC */
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm0plus.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,793 @@
+/**************************************************************************//**
+ * @file core_cm0plus.h
+ * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CM0PLUS_H_GENERIC
+#define __CORE_CM0PLUS_H_GENERIC
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex-M0+
+ @{
+ */
+
+/* CMSIS CM0P definitions */
+#define __CM0PLUS_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
+#define __CM0PLUS_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */
+#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16) | \
+ __CM0PLUS_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x00) /*!< Cortex-M Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not. This core does not support an FPU at all
+*/
+#define __FPU_USED 0
+
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+#endif
+
+#include <stdint.h> /* standard types definitions */
+#include <core_cmInstr.h> /* Core Instruction Access */
+#include <core_cmFunc.h> /* Core Function Access */
+
+#endif /* __CORE_CM0PLUS_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CM0PLUS_H_DEPENDANT
+#define __CORE_CM0PLUS_H_DEPENDANT
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CM0PLUS_REV
+ #define __CM0PLUS_REV 0x0000
+ #warning "__CM0PLUS_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __MPU_PRESENT
+ #define __MPU_PRESENT 0
+ #warning "__MPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __VTOR_PRESENT
+ #define __VTOR_PRESENT 0
+ #warning "__VTOR_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 2
+ #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 0
+ #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex-M0+ */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ Core Register contain:
+ - Core Register
+ - Core NVIC Register
+ - Core SCB Register
+ - Core SysTick Register
+ - Core MPU Register
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-M processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */
+#else
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
+#endif
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+
+/** \brief Union type to access the Interrupt Program Status Register (IPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} IPSR_Type;
+
+
+/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
+#else
+ uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
+#endif
+ uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
+ uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} xPSR_Type;
+
+
+/** \brief Union type to access the Control Registers (CONTROL).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
+ uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
+ uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
+ uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} CONTROL_Type;
+
+/*@} end of group CMSIS_CORE */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
+ \brief Type definitions for the NVIC Registers
+ @{
+ */
+
+/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
+ */
+typedef struct
+{
+ __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
+ uint32_t RESERVED0[31];
+ __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
+ uint32_t RSERVED1[31];
+ __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
+ uint32_t RESERVED2[31];
+ __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
+ uint32_t RESERVED3[31];
+ uint32_t RESERVED4[64];
+ __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
+} NVIC_Type;
+
+/*@} end of group CMSIS_NVIC */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCB System Control Block (SCB)
+ \brief Type definitions for the System Control Block Registers
+ @{
+ */
+
+/** \brief Structure type to access the System Control Block (SCB).
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
+#if (__VTOR_PRESENT == 1)
+ __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
+#else
+ uint32_t RESERVED0;
+#endif
+ __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
+ uint32_t RESERVED1;
+ __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
+ __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
+#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
+
+#if (__VTOR_PRESENT == 1)
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_VTOR_TBLOFF_Pos 8 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+#endif
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+/*@} end of group CMSIS_SCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SysTick System Tick Timer (SysTick)
+ \brief Type definitions for the System Timer Registers.
+ @{
+ */
+
+/** \brief Structure type to access the System Timer (SysTick).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
+
+/*@} end of group CMSIS_SysTick */
+
+#if (__MPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_MPU Memory Protection Unit (MPU)
+ \brief Type definitions for the Memory Protection Unit (MPU)
+ @{
+ */
+
+/** \brief Structure type to access the Memory Protection Unit (MPU).
+ */
+typedef struct
+{
+ __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
+ __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
+ __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
+ __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
+ __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
+} MPU_Type;
+
+/* MPU Type Register */
+#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
+#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
+
+#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
+#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
+
+#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
+#define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */
+
+/* MPU Control Register */
+#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
+#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
+
+#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
+#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
+
+#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
+#define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */
+
+/* MPU Region Number Register */
+#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
+#define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */
+
+/* MPU Region Base Address Register */
+#define MPU_RBAR_ADDR_Pos 8 /*!< MPU RBAR: ADDR Position */
+#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
+
+#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
+#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
+
+#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
+#define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */
+
+/* MPU Region Attribute and Size Register */
+#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */
+#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
+
+#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */
+#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */
+
+#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */
+#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */
+
+#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */
+#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */
+
+#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */
+#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */
+
+#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */
+#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */
+
+#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */
+#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */
+
+#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
+#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
+
+#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
+#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
+
+#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */
+#define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) /*!< MPU RASR: Region enable bit Disable Mask */
+
+/*@} end of group CMSIS_MPU */
+#endif
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
+ \brief Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR)
+ are only accessible over DAP and not via processor. Therefore
+ they are not covered by the Cortex-M0 header file.
+ @{
+ */
+/*@} end of group CMSIS_CoreDebug */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_core_base Core Definitions
+ \brief Definitions for base addresses, unions, and structures.
+ @{
+ */
+
+/* Memory mapping of Cortex-M0+ Hardware */
+#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
+
+#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
+
+#if (__MPU_PRESENT == 1)
+ #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
+ #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
+#endif
+
+/*@} */
+
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ Core Function Interface contains:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Register Access Functions
+ ******************************************************************************/
+/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
+*/
+
+
+
+/* ########################## NVIC functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_NVICFunctions NVIC Functions
+ \brief Functions that manage interrupts and exceptions via the NVIC.
+ @{
+ */
+
+/* Interrupt Priorities are WORD accessible only under ARMv6M */
+/* The following MACROS handle generation of the register offset and byte masks */
+#define _BIT_SHIFT(IRQn) ( (((uint32_t)(IRQn) ) & 0x03) * 8 )
+#define _SHP_IDX(IRQn) ( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )
+#define _IP_IDX(IRQn) ( ((uint32_t)(IRQn) >> 2) )
+
+
+/** \brief Enable External Interrupt
+
+ The function enables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Disable External Interrupt
+
+ The function disables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Get Pending Interrupt
+
+ The function reads the pending register in the NVIC and returns the pending bit
+ for the specified interrupt.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not pending.
+ \return 1 Interrupt status is pending.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t) ((NVIC->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
+}
+
+
+/** \brief Set Pending Interrupt
+
+ The function sets the pending bit of an external interrupt.
+
+ \param [in] IRQn Interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
+}
+
+
+/** \brief Clear Pending Interrupt
+
+ The function clears the pending bit of an external interrupt.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
+}
+
+
+/** \brief Set Interrupt Priority
+
+ The function sets the priority of an interrupt.
+
+ \note The priority cannot be set for every core interrupt.
+
+ \param [in] IRQn Interrupt number.
+ \param [in] priority Priority to set.
+ */
+__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if(IRQn < 0) {
+ SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
+ (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
+ else {
+ NVIC->IP[_IP_IDX(IRQn)] = (NVIC->IP[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
+ (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
+}
+
+
+/** \brief Get Interrupt Priority
+
+ The function reads the priority of an interrupt. The interrupt
+ number can be positive to specify an external (device specific)
+ interrupt, or negative to specify an internal (core) interrupt.
+
+
+ \param [in] IRQn Interrupt number.
+ \return Interrupt Priority. Value is aligned automatically to the implemented
+ priority bits of the microcontroller.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if(IRQn < 0) {
+ return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & 0xFF) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M0 system interrupts */
+ else {
+ return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & 0xFF) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
+}
+
+
+/** \brief System Reset
+
+ The function initiates a system reset request to reset the MCU.
+ */
+__STATIC_INLINE void NVIC_SystemReset(void)
+{
+ __DSB(); /* Ensure all outstanding memory accesses included
+ buffered write are completed before reset */
+ SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ SCB_AIRCR_SYSRESETREQ_Msk);
+ __DSB(); /* Ensure completion of memory access */
+ while(1); /* wait until reset */
+}
+
+/*@} end of CMSIS_Core_NVICFunctions */
+
+
+
+/* ################################## SysTick function ############################################ */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
+ \brief Functions that configure the System.
+ @{
+ */
+
+#if (__Vendor_SysTickConfig == 0)
+
+/** \brief System Tick Configuration
+
+ The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
+ Counter is in free running mode to generate periodic interrupts.
+
+ \param [in] ticks Number of ticks between two interrupts.
+
+ \return 0 Function succeeded.
+ \return 1 Function failed.
+
+ \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
+ function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
+ must contain a vendor-specific implementation of this function.
+
+ */
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
+
+ SysTick->LOAD = ticks - 1; /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
+ SysTick->VAL = 0; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0); /* Function successful */
+}
+
+#endif
+
+/*@} end of CMSIS_Core_SysTickFunctions */
+
+
+
+
+#endif /* __CORE_CM0PLUS_H_DEPENDANT */
+
+#endif /* __CMSIS_GENERIC */
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm3.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,1627 @@
+/**************************************************************************//**
+ * @file core_cm3.h
+ * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CM3_H_GENERIC
+#define __CORE_CM3_H_GENERIC
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex_M3
+ @{
+ */
+
+/* CMSIS CM3 definitions */
+#define __CM3_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
+#define __CM3_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */
+#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | \
+ __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x03) /*!< Cortex-M Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TMS470__ )
+ #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not. This core does not support an FPU at all
+*/
+#define __FPU_USED 0
+
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __TMS470__ )
+ #if defined __TI__VFP_SUPPORT____
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #endif
+#endif
+
+#include <stdint.h> /* standard types definitions */
+#include <core_cmInstr.h> /* Core Instruction Access */
+#include <core_cmFunc.h> /* Core Function Access */
+
+#endif /* __CORE_CM3_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CM3_H_DEPENDANT
+#define __CORE_CM3_H_DEPENDANT
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CM3_REV
+ #define __CM3_REV 0x0200
+ #warning "__CM3_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __MPU_PRESENT
+ #define __MPU_PRESENT 0
+ #warning "__MPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 4
+ #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 0
+ #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex_M3 */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ Core Register contain:
+ - Core Register
+ - Core NVIC Register
+ - Core SCB Register
+ - Core SysTick Register
+ - Core Debug Register
+ - Core MPU Register
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-M processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */
+#else
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
+#endif
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+
+/** \brief Union type to access the Interrupt Program Status Register (IPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} IPSR_Type;
+
+
+/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
+#else
+ uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
+#endif
+ uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
+ uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} xPSR_Type;
+
+
+/** \brief Union type to access the Control Registers (CONTROL).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
+ uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
+ uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
+ uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} CONTROL_Type;
+
+/*@} end of group CMSIS_CORE */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
+ \brief Type definitions for the NVIC Registers
+ @{
+ */
+
+/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
+ */
+typedef struct
+{
+ __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
+ uint32_t RESERVED0[24];
+ __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
+ uint32_t RSERVED1[24];
+ __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
+ uint32_t RESERVED2[24];
+ __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
+ uint32_t RESERVED3[24];
+ __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
+ uint32_t RESERVED4[56];
+ __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
+ uint32_t RESERVED5[644];
+ __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
+} NVIC_Type;
+
+/* Software Triggered Interrupt Register Definitions */
+#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */
+#define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) /*!< STIR: INTLINESNUM Mask */
+
+/*@} end of group CMSIS_NVIC */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCB System Control Block (SCB)
+ \brief Type definitions for the System Control Block Registers
+ @{
+ */
+
+/** \brief Structure type to access the System Control Block (SCB).
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
+ __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
+ __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
+ __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
+ __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
+ __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
+ __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
+ __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
+ __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
+ __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
+ __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
+ __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
+ __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
+ __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
+ __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
+ __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
+ uint32_t RESERVED0[5];
+ __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
+#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */
+#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
+
+/* SCB Vector Table Offset Register Definitions */
+#if (__CM3_REV < 0x0201) /* core r2p1 */
+#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
+#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */
+
+#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+#else
+#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+#endif
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
+#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */
+#define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */
+#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
+
+#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */
+#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */
+#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
+
+#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */
+#define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */
+#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
+
+#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */
+#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
+
+#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */
+#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
+
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */
+#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
+
+#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */
+#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
+
+#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */
+#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
+
+#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */
+#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
+
+#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */
+#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
+
+#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */
+#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
+
+#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */
+#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
+
+#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */
+#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
+
+#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */
+#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
+
+#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */
+#define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */
+
+/* SCB Configurable Fault Status Registers Definitions */
+#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */
+#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
+
+#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */
+#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
+
+#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */
+#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
+
+/* SCB Hard Fault Status Registers Definitions */
+#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */
+#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
+
+#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */
+#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
+
+#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */
+#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
+
+/* SCB Debug Fault Status Register Definitions */
+#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
+#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
+
+#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
+#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
+
+#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
+#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
+
+#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
+#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
+
+#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
+#define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
+
+/*@} end of group CMSIS_SCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
+ \brief Type definitions for the System Control and ID Register not in the SCB
+ @{
+ */
+
+/** \brief Structure type to access the System Control and ID Register not in the SCB.
+ */
+typedef struct
+{
+ uint32_t RESERVED0[1];
+ __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
+#if ((defined __CM3_REV) && (__CM3_REV >= 0x200))
+ __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
+#else
+ uint32_t RESERVED1[1];
+#endif
+} SCnSCB_Type;
+
+/* Interrupt Controller Type Register Definitions */
+#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */
+#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) /*!< ICTR: INTLINESNUM Mask */
+
+/* Auxiliary Control Register Definitions */
+
+#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */
+#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
+
+#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */
+#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */
+
+#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */
+#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) /*!< ACTLR: DISMCYCINT Mask */
+
+/*@} end of group CMSIS_SCnotSCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SysTick System Tick Timer (SysTick)
+ \brief Type definitions for the System Timer Registers.
+ @{
+ */
+
+/** \brief Structure type to access the System Timer (SysTick).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
+
+/*@} end of group CMSIS_SysTick */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM)
+ \brief Type definitions for the Instrumentation Trace Macrocell (ITM)
+ @{
+ */
+
+/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
+ */
+typedef struct
+{
+ __O union
+ {
+ __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
+ __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
+ __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
+ } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
+ uint32_t RESERVED0[864];
+ __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
+ uint32_t RESERVED1[15];
+ __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
+ uint32_t RESERVED2[15];
+ __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
+ uint32_t RESERVED3[29];
+ __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */
+ __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */
+ __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */
+ uint32_t RESERVED4[43];
+ __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */
+ __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */
+ uint32_t RESERVED5[6];
+ __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */
+ __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */
+ __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */
+ __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */
+ __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */
+ __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */
+ __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */
+ __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */
+ __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */
+ __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */
+ __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */
+ __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */
+} ITM_Type;
+
+/* ITM Trace Privilege Register Definitions */
+#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */
+#define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */
+
+/* ITM Trace Control Register Definitions */
+#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */
+#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
+
+#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */
+#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */
+
+#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */
+#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
+
+#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */
+#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
+
+#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */
+#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
+
+#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */
+#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
+
+#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */
+#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
+
+#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */
+#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
+
+#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */
+#define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */
+
+/* ITM Integration Write Register Definitions */
+#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */
+#define ITM_IWR_ATVALIDM_Msk (1UL << ITM_IWR_ATVALIDM_Pos) /*!< ITM IWR: ATVALIDM Mask */
+
+/* ITM Integration Read Register Definitions */
+#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */
+#define ITM_IRR_ATREADYM_Msk (1UL << ITM_IRR_ATREADYM_Pos) /*!< ITM IRR: ATREADYM Mask */
+
+/* ITM Integration Mode Control Register Definitions */
+#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */
+#define ITM_IMCR_INTEGRATION_Msk (1UL << ITM_IMCR_INTEGRATION_Pos) /*!< ITM IMCR: INTEGRATION Mask */
+
+/* ITM Lock Status Register Definitions */
+#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */
+#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
+
+#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */
+#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
+
+#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */
+#define ITM_LSR_Present_Msk (1UL << ITM_LSR_Present_Pos) /*!< ITM LSR: Present Mask */
+
+/*@}*/ /* end of group CMSIS_ITM */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
+ \brief Type definitions for the Data Watchpoint and Trace (DWT)
+ @{
+ */
+
+/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
+ __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
+ __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
+ __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
+ __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
+ __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
+ __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
+ __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
+ __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
+ __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */
+ __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
+ uint32_t RESERVED0[1];
+ __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
+ __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */
+ __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
+ uint32_t RESERVED1[1];
+ __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
+ __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */
+ __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
+ uint32_t RESERVED2[1];
+ __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
+ __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */
+ __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
+} DWT_Type;
+
+/* DWT Control Register Definitions */
+#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */
+#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
+
+#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */
+#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
+
+#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */
+#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
+
+#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */
+#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
+
+#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */
+#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
+
+#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */
+#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */
+
+#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */
+#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */
+
+#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */
+#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */
+
+#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */
+#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */
+
+#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */
+#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */
+
+#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */
+#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */
+
+#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */
+#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */
+
+#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */
+#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */
+
+#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */
+#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */
+
+#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */
+#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */
+
+#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */
+#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */
+
+#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */
+#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */
+
+#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */
+#define DWT_CTRL_CYCCNTENA_Msk (0x1UL << DWT_CTRL_CYCCNTENA_Pos) /*!< DWT CTRL: CYCCNTENA Mask */
+
+/* DWT CPI Count Register Definitions */
+#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */
+#define DWT_CPICNT_CPICNT_Msk (0xFFUL << DWT_CPICNT_CPICNT_Pos) /*!< DWT CPICNT: CPICNT Mask */
+
+/* DWT Exception Overhead Count Register Definitions */
+#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */
+#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL << DWT_EXCCNT_EXCCNT_Pos) /*!< DWT EXCCNT: EXCCNT Mask */
+
+/* DWT Sleep Count Register Definitions */
+#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */
+#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL << DWT_SLEEPCNT_SLEEPCNT_Pos) /*!< DWT SLEEPCNT: SLEEPCNT Mask */
+
+/* DWT LSU Count Register Definitions */
+#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */
+#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL << DWT_LSUCNT_LSUCNT_Pos) /*!< DWT LSUCNT: LSUCNT Mask */
+
+/* DWT Folded-instruction Count Register Definitions */
+#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */
+#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL << DWT_FOLDCNT_FOLDCNT_Pos) /*!< DWT FOLDCNT: FOLDCNT Mask */
+
+/* DWT Comparator Mask Register Definitions */
+#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */
+#define DWT_MASK_MASK_Msk (0x1FUL << DWT_MASK_MASK_Pos) /*!< DWT MASK: MASK Mask */
+
+/* DWT Comparator Function Register Definitions */
+#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */
+#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
+
+#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */
+#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */
+
+#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */
+#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */
+
+#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */
+#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
+
+#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */
+#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */
+
+#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */
+#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */
+
+#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */
+#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */
+
+#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */
+#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */
+
+#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */
+#define DWT_FUNCTION_FUNCTION_Msk (0xFUL << DWT_FUNCTION_FUNCTION_Pos) /*!< DWT FUNCTION: FUNCTION Mask */
+
+/*@}*/ /* end of group CMSIS_DWT */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_TPI Trace Port Interface (TPI)
+ \brief Type definitions for the Trace Port Interface (TPI)
+ @{
+ */
+
+/** \brief Structure type to access the Trace Port Interface Register (TPI).
+ */
+typedef struct
+{
+ __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */
+ __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */
+ uint32_t RESERVED0[2];
+ __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
+ uint32_t RESERVED1[55];
+ __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
+ uint32_t RESERVED2[131];
+ __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
+ __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
+ __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */
+ uint32_t RESERVED3[759];
+ __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */
+ __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */
+ __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */
+ uint32_t RESERVED4[1];
+ __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */
+ __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */
+ __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */
+ uint32_t RESERVED5[39];
+ __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */
+ __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */
+ uint32_t RESERVED7[8];
+ __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */
+ __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */
+} TPI_Type;
+
+/* TPI Asynchronous Clock Prescaler Register Definitions */
+#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */
+#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL << TPI_ACPR_PRESCALER_Pos) /*!< TPI ACPR: PRESCALER Mask */
+
+/* TPI Selected Pin Protocol Register Definitions */
+#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */
+#define TPI_SPPR_TXMODE_Msk (0x3UL << TPI_SPPR_TXMODE_Pos) /*!< TPI SPPR: TXMODE Mask */
+
+/* TPI Formatter and Flush Status Register Definitions */
+#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */
+#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
+
+#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */
+#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
+
+#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */
+#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
+
+#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */
+#define TPI_FFSR_FlInProg_Msk (0x1UL << TPI_FFSR_FlInProg_Pos) /*!< TPI FFSR: FlInProg Mask */
+
+/* TPI Formatter and Flush Control Register Definitions */
+#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */
+#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
+
+#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */
+#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
+
+/* TPI TRIGGER Register Definitions */
+#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */
+#define TPI_TRIGGER_TRIGGER_Msk (0x1UL << TPI_TRIGGER_TRIGGER_Pos) /*!< TPI TRIGGER: TRIGGER Mask */
+
+/* TPI Integration ETM Data Register Definitions (FIFO0) */
+#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */
+#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */
+
+#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */
+#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */
+
+#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */
+#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */
+
+#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */
+#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */
+
+#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */
+#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */
+
+#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */
+#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */
+
+#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */
+#define TPI_FIFO0_ETM0_Msk (0xFFUL << TPI_FIFO0_ETM0_Pos) /*!< TPI FIFO0: ETM0 Mask */
+
+/* TPI ITATBCTR2 Register Definitions */
+#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */
+#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL << TPI_ITATBCTR2_ATREADY_Pos) /*!< TPI ITATBCTR2: ATREADY Mask */
+
+/* TPI Integration ITM Data Register Definitions (FIFO1) */
+#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */
+#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */
+
+#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */
+#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */
+
+#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */
+#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */
+
+#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */
+#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */
+
+#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */
+#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */
+
+#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */
+#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */
+
+#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */
+#define TPI_FIFO1_ITM0_Msk (0xFFUL << TPI_FIFO1_ITM0_Pos) /*!< TPI FIFO1: ITM0 Mask */
+
+/* TPI ITATBCTR0 Register Definitions */
+#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */
+#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL << TPI_ITATBCTR0_ATREADY_Pos) /*!< TPI ITATBCTR0: ATREADY Mask */
+
+/* TPI Integration Mode Control Register Definitions */
+#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */
+#define TPI_ITCTRL_Mode_Msk (0x1UL << TPI_ITCTRL_Mode_Pos) /*!< TPI ITCTRL: Mode Mask */
+
+/* TPI DEVID Register Definitions */
+#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */
+#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
+
+#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */
+#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
+
+#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */
+#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
+
+#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */
+#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */
+
+#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */
+#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */
+
+#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */
+#define TPI_DEVID_NrTraceInput_Msk (0x1FUL << TPI_DEVID_NrTraceInput_Pos) /*!< TPI DEVID: NrTraceInput Mask */
+
+/* TPI DEVTYPE Register Definitions */
+#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */
+#define TPI_DEVTYPE_SubType_Msk (0xFUL << TPI_DEVTYPE_SubType_Pos) /*!< TPI DEVTYPE: SubType Mask */
+
+#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */
+#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
+
+/*@}*/ /* end of group CMSIS_TPI */
+
+
+#if (__MPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_MPU Memory Protection Unit (MPU)
+ \brief Type definitions for the Memory Protection Unit (MPU)
+ @{
+ */
+
+/** \brief Structure type to access the Memory Protection Unit (MPU).
+ */
+typedef struct
+{
+ __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
+ __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
+ __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
+ __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
+ __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
+ __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */
+ __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */
+ __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */
+ __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */
+} MPU_Type;
+
+/* MPU Type Register */
+#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
+#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
+
+#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
+#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
+
+#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
+#define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */
+
+/* MPU Control Register */
+#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
+#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
+
+#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
+#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
+
+#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
+#define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */
+
+/* MPU Region Number Register */
+#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
+#define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */
+
+/* MPU Region Base Address Register */
+#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */
+#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
+
+#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
+#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
+
+#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
+#define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */
+
+/* MPU Region Attribute and Size Register */
+#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */
+#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
+
+#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */
+#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */
+
+#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */
+#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */
+
+#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */
+#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */
+
+#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */
+#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */
+
+#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */
+#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */
+
+#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */
+#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */
+
+#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
+#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
+
+#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
+#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
+
+#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */
+#define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) /*!< MPU RASR: Region enable bit Disable Mask */
+
+/*@} end of group CMSIS_MPU */
+#endif
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
+ \brief Type definitions for the Core Debug Registers
+ @{
+ */
+
+/** \brief Structure type to access the Core Debug Register (CoreDebug).
+ */
+typedef struct
+{
+ __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
+ __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
+ __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
+ __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
+} CoreDebug_Type;
+
+/* Debug Halting Control and Status Register */
+#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
+#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
+
+#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
+#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
+
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
+
+#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
+#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
+
+#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
+#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
+
+#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
+#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
+
+#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
+#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
+
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
+
+#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
+#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
+
+#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
+#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
+
+#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
+#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
+
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
+
+/* Debug Core Register Selector Register */
+#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
+#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
+
+#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
+#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
+
+/* Debug Exception and Monitor Control Register */
+#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
+#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
+
+#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */
+#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
+
+#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */
+#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
+
+#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */
+#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
+
+#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */
+#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
+
+#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
+#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
+
+#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */
+#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
+
+#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */
+#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
+
+#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */
+#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
+
+#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */
+#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
+
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
+
+#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */
+#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
+
+#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
+#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
+
+/*@} end of group CMSIS_CoreDebug */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_core_base Core Definitions
+ \brief Definitions for base addresses, unions, and structures.
+ @{
+ */
+
+/* Memory mapping of Cortex-M3 Hardware */
+#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
+#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
+#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
+#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
+#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
+
+#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
+#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
+#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
+#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
+#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
+#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
+
+#if (__MPU_PRESENT == 1)
+ #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
+ #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
+#endif
+
+/*@} */
+
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ Core Function Interface contains:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Debug Functions
+ - Core Register Access Functions
+ ******************************************************************************/
+/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
+*/
+
+
+
+/* ########################## NVIC functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_NVICFunctions NVIC Functions
+ \brief Functions that manage interrupts and exceptions via the NVIC.
+ @{
+ */
+
+/** \brief Set Priority Grouping
+
+ The function sets the priority grouping field using the required unlock sequence.
+ The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
+ Only values from 0..7 are used.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
+
+ \param [in] PriorityGroup Priority grouping field.
+ */
+__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
+{
+ uint32_t reg_value;
+ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */
+
+ reg_value = SCB->AIRCR; /* read old register configuration */
+ reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */
+ reg_value = (reg_value |
+ ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (PriorityGroupTmp << 8)); /* Insert write key and priorty group */
+ SCB->AIRCR = reg_value;
+}
+
+
+/** \brief Get Priority Grouping
+
+ The function reads the priority grouping field from the NVIC Interrupt Controller.
+
+ \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
+{
+ return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */
+}
+
+
+/** \brief Enable External Interrupt
+
+ The function enables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
+}
+
+
+/** \brief Disable External Interrupt
+
+ The function disables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
+}
+
+
+/** \brief Get Pending Interrupt
+
+ The function reads the pending register in the NVIC and returns the pending bit
+ for the specified interrupt.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not pending.
+ \return 1 Interrupt status is pending.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
+}
+
+
+/** \brief Set Pending Interrupt
+
+ The function sets the pending bit of an external interrupt.
+
+ \param [in] IRQn Interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
+}
+
+
+/** \brief Clear Pending Interrupt
+
+ The function clears the pending bit of an external interrupt.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
+}
+
+
+/** \brief Get Active Interrupt
+
+ The function reads the active register in NVIC and returns the active bit.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not active.
+ \return 1 Interrupt status is active.
+ */
+__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
+{
+ return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */
+}
+
+
+/** \brief Set Interrupt Priority
+
+ The function sets the priority of an interrupt.
+
+ \note The priority cannot be set for every core interrupt.
+
+ \param [in] IRQn Interrupt number.
+ \param [in] priority Priority to set.
+ */
+__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if(IRQn < 0) {
+ SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
+ else {
+ NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
+}
+
+
+/** \brief Get Interrupt Priority
+
+ The function reads the priority of an interrupt. The interrupt
+ number can be positive to specify an external (device specific)
+ interrupt, or negative to specify an internal (core) interrupt.
+
+
+ \param [in] IRQn Interrupt number.
+ \return Interrupt Priority. Value is aligned automatically to the implemented
+ priority bits of the microcontroller.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if(IRQn < 0) {
+ return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M system interrupts */
+ else {
+ return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
+}
+
+
+/** \brief Encode Priority
+
+ The function encodes the priority for an interrupt with the given priority group,
+ preemptive priority value, and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the samllest possible priority group is set.
+
+ \param [in] PriorityGroup Used priority group.
+ \param [in] PreemptPriority Preemptive priority value (starting from 0).
+ \param [in] SubPriority Subpriority value (starting from 0).
+ \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
+ */
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ return (
+ ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
+ ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
+ );
+}
+
+
+/** \brief Decode Priority
+
+ The function decodes an interrupt priority value with a given priority group to
+ preemptive priority value and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
+
+ \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
+ \param [in] PriorityGroup Used priority group.
+ \param [out] pPreemptPriority Preemptive priority value (starting from 0).
+ \param [out] pSubPriority Subpriority value (starting from 0).
+ */
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
+ *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
+}
+
+
+/** \brief System Reset
+
+ The function initiates a system reset request to reset the MCU.
+ */
+__STATIC_INLINE void NVIC_SystemReset(void)
+{
+ __DSB(); /* Ensure all outstanding memory accesses included
+ buffered write are completed before reset */
+ SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
+ SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */
+ __DSB(); /* Ensure completion of memory access */
+ while(1); /* wait until reset */
+}
+
+/*@} end of CMSIS_Core_NVICFunctions */
+
+
+
+/* ################################## SysTick function ############################################ */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
+ \brief Functions that configure the System.
+ @{
+ */
+
+#if (__Vendor_SysTickConfig == 0)
+
+/** \brief System Tick Configuration
+
+ The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
+ Counter is in free running mode to generate periodic interrupts.
+
+ \param [in] ticks Number of ticks between two interrupts.
+
+ \return 0 Function succeeded.
+ \return 1 Function failed.
+
+ \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
+ function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
+ must contain a vendor-specific implementation of this function.
+
+ */
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
+
+ SysTick->LOAD = ticks - 1; /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
+ SysTick->VAL = 0; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0); /* Function successful */
+}
+
+#endif
+
+/*@} end of CMSIS_Core_SysTickFunctions */
+
+
+
+/* ##################################### Debug In/Output function ########################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_core_DebugFunctions ITM Functions
+ \brief Functions that access the ITM debug interface.
+ @{
+ */
+
+extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */
+#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
+
+
+/** \brief ITM Send Character
+
+ The function transmits a character via the ITM channel 0, and
+ \li Just returns when no debugger is connected that has booked the output.
+ \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.
+
+ \param [in] ch Character to transmit.
+
+ \returns Character to transmit.
+ */
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
+{
+ if ((ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */
+ (ITM->TER & (1UL << 0) ) ) /* ITM Port #0 enabled */
+ {
+ while (ITM->PORT[0].u32 == 0);
+ ITM->PORT[0].u8 = (uint8_t) ch;
+ }
+ return (ch);
+}
+
+
+/** \brief ITM Receive Character
+
+ The function inputs a character via the external variable \ref ITM_RxBuffer.
+
+ \return Received character.
+ \return -1 No character pending.
+ */
+__STATIC_INLINE int32_t ITM_ReceiveChar (void) {
+ int32_t ch = -1; /* no character available */
+
+ if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
+ ch = ITM_RxBuffer;
+ ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
+ }
+
+ return (ch);
+}
+
+
+/** \brief ITM Check Character
+
+ The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.
+
+ \return 0 No character available.
+ \return 1 Character available.
+ */
+__STATIC_INLINE int32_t ITM_CheckChar (void) {
+
+ if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
+ return (0); /* no character available */
+ } else {
+ return (1); /* character available */
+ }
+}
+
+/*@} end of CMSIS_core_DebugFunctions */
+
+#endif /* __CORE_CM3_H_DEPENDANT */
+
+#endif /* __CMSIS_GENERIC */
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm4.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,1772 @@
+/**************************************************************************//**
+ * @file core_cm4.h
+ * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CM4_H_GENERIC
+#define __CORE_CM4_H_GENERIC
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex_M4
+ @{
+ */
+
+/* CMSIS CM4 definitions */
+#define __CM4_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
+#define __CM4_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */
+#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | \
+ __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x04) /*!< Cortex-M Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TMS470__ )
+ #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
+*/
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TMS470__ )
+ #if defined __TI_VFP_SUPPORT__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+#endif
+
+#include <stdint.h> /* standard types definitions */
+#include <core_cmInstr.h> /* Core Instruction Access */
+#include <core_cmFunc.h> /* Core Function Access */
+#include <core_cm4_simd.h> /* Compiler specific SIMD Intrinsics */
+
+#endif /* __CORE_CM4_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CM4_H_DEPENDANT
+#define __CORE_CM4_H_DEPENDANT
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CM4_REV
+ #define __CM4_REV 0x0000
+ #warning "__CM4_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __FPU_PRESENT
+ #define __FPU_PRESENT 0
+ #warning "__FPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __MPU_PRESENT
+ #define __MPU_PRESENT 0
+ #warning "__MPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 4
+ #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 0
+ #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex_M4 */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ Core Register contain:
+ - Core Register
+ - Core NVIC Register
+ - Core SCB Register
+ - Core SysTick Register
+ - Core Debug Register
+ - Core MPU Register
+ - Core FPU Register
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-M processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */
+#else
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
+#endif
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+
+/** \brief Union type to access the Interrupt Program Status Register (IPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} IPSR_Type;
+
+
+/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+#if (__CORTEX_M != 0x04)
+ uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
+#else
+ uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
+#endif
+ uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
+ uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} xPSR_Type;
+
+
+/** \brief Union type to access the Control Registers (CONTROL).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
+ uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
+ uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
+ uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} CONTROL_Type;
+
+/*@} end of group CMSIS_CORE */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
+ \brief Type definitions for the NVIC Registers
+ @{
+ */
+
+/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
+ */
+typedef struct
+{
+ __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
+ uint32_t RESERVED0[24];
+ __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
+ uint32_t RSERVED1[24];
+ __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
+ uint32_t RESERVED2[24];
+ __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
+ uint32_t RESERVED3[24];
+ __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
+ uint32_t RESERVED4[56];
+ __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
+ uint32_t RESERVED5[644];
+ __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
+} NVIC_Type;
+
+/* Software Triggered Interrupt Register Definitions */
+#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */
+#define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) /*!< STIR: INTLINESNUM Mask */
+
+/*@} end of group CMSIS_NVIC */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCB System Control Block (SCB)
+ \brief Type definitions for the System Control Block Registers
+ @{
+ */
+
+/** \brief Structure type to access the System Control Block (SCB).
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
+ __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
+ __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
+ __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
+ __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
+ __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
+ __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
+ __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
+ __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
+ __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
+ __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
+ __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
+ __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
+ __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
+ __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
+ __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
+ uint32_t RESERVED0[5];
+ __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
+#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */
+#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
+
+/* SCB Vector Table Offset Register Definitions */
+#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
+#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */
+#define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */
+#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
+
+#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */
+#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */
+#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
+
+#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */
+#define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */
+#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
+
+#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */
+#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
+
+#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */
+#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
+
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */
+#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
+
+#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */
+#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
+
+#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */
+#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
+
+#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */
+#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
+
+#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */
+#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
+
+#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */
+#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
+
+#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */
+#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
+
+#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */
+#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
+
+#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */
+#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
+
+#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */
+#define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */
+
+/* SCB Configurable Fault Status Registers Definitions */
+#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */
+#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
+
+#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */
+#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
+
+#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */
+#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
+
+/* SCB Hard Fault Status Registers Definitions */
+#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */
+#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
+
+#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */
+#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
+
+#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */
+#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
+
+/* SCB Debug Fault Status Register Definitions */
+#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
+#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
+
+#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
+#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
+
+#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
+#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
+
+#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
+#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
+
+#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
+#define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
+
+/*@} end of group CMSIS_SCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
+ \brief Type definitions for the System Control and ID Register not in the SCB
+ @{
+ */
+
+/** \brief Structure type to access the System Control and ID Register not in the SCB.
+ */
+typedef struct
+{
+ uint32_t RESERVED0[1];
+ __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
+ __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
+} SCnSCB_Type;
+
+/* Interrupt Controller Type Register Definitions */
+#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */
+#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) /*!< ICTR: INTLINESNUM Mask */
+
+/* Auxiliary Control Register Definitions */
+#define SCnSCB_ACTLR_DISOOFP_Pos 9 /*!< ACTLR: DISOOFP Position */
+#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */
+
+#define SCnSCB_ACTLR_DISFPCA_Pos 8 /*!< ACTLR: DISFPCA Position */
+#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */
+
+#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */
+#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
+
+#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */
+#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */
+
+#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */
+#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) /*!< ACTLR: DISMCYCINT Mask */
+
+/*@} end of group CMSIS_SCnotSCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SysTick System Tick Timer (SysTick)
+ \brief Type definitions for the System Timer Registers.
+ @{
+ */
+
+/** \brief Structure type to access the System Timer (SysTick).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
+
+/*@} end of group CMSIS_SysTick */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM)
+ \brief Type definitions for the Instrumentation Trace Macrocell (ITM)
+ @{
+ */
+
+/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
+ */
+typedef struct
+{
+ __O union
+ {
+ __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
+ __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
+ __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
+ } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
+ uint32_t RESERVED0[864];
+ __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
+ uint32_t RESERVED1[15];
+ __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
+ uint32_t RESERVED2[15];
+ __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
+ uint32_t RESERVED3[29];
+ __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */
+ __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */
+ __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */
+ uint32_t RESERVED4[43];
+ __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */
+ __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */
+ uint32_t RESERVED5[6];
+ __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */
+ __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */
+ __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */
+ __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */
+ __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */
+ __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */
+ __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */
+ __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */
+ __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */
+ __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */
+ __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */
+ __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */
+} ITM_Type;
+
+/* ITM Trace Privilege Register Definitions */
+#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */
+#define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */
+
+/* ITM Trace Control Register Definitions */
+#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */
+#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
+
+#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */
+#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */
+
+#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */
+#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
+
+#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */
+#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
+
+#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */
+#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
+
+#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */
+#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
+
+#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */
+#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
+
+#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */
+#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
+
+#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */
+#define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */
+
+/* ITM Integration Write Register Definitions */
+#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */
+#define ITM_IWR_ATVALIDM_Msk (1UL << ITM_IWR_ATVALIDM_Pos) /*!< ITM IWR: ATVALIDM Mask */
+
+/* ITM Integration Read Register Definitions */
+#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */
+#define ITM_IRR_ATREADYM_Msk (1UL << ITM_IRR_ATREADYM_Pos) /*!< ITM IRR: ATREADYM Mask */
+
+/* ITM Integration Mode Control Register Definitions */
+#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */
+#define ITM_IMCR_INTEGRATION_Msk (1UL << ITM_IMCR_INTEGRATION_Pos) /*!< ITM IMCR: INTEGRATION Mask */
+
+/* ITM Lock Status Register Definitions */
+#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */
+#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
+
+#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */
+#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
+
+#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */
+#define ITM_LSR_Present_Msk (1UL << ITM_LSR_Present_Pos) /*!< ITM LSR: Present Mask */
+
+/*@}*/ /* end of group CMSIS_ITM */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
+ \brief Type definitions for the Data Watchpoint and Trace (DWT)
+ @{
+ */
+
+/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
+ __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
+ __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
+ __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
+ __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
+ __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
+ __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
+ __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
+ __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
+ __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */
+ __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
+ uint32_t RESERVED0[1];
+ __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
+ __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */
+ __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
+ uint32_t RESERVED1[1];
+ __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
+ __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */
+ __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
+ uint32_t RESERVED2[1];
+ __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
+ __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */
+ __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
+} DWT_Type;
+
+/* DWT Control Register Definitions */
+#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */
+#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
+
+#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */
+#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
+
+#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */
+#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
+
+#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */
+#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
+
+#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */
+#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
+
+#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */
+#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */
+
+#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */
+#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */
+
+#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */
+#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */
+
+#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */
+#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */
+
+#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */
+#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */
+
+#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */
+#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */
+
+#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */
+#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */
+
+#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */
+#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */
+
+#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */
+#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */
+
+#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */
+#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */
+
+#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */
+#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */
+
+#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */
+#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */
+
+#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */
+#define DWT_CTRL_CYCCNTENA_Msk (0x1UL << DWT_CTRL_CYCCNTENA_Pos) /*!< DWT CTRL: CYCCNTENA Mask */
+
+/* DWT CPI Count Register Definitions */
+#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */
+#define DWT_CPICNT_CPICNT_Msk (0xFFUL << DWT_CPICNT_CPICNT_Pos) /*!< DWT CPICNT: CPICNT Mask */
+
+/* DWT Exception Overhead Count Register Definitions */
+#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */
+#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL << DWT_EXCCNT_EXCCNT_Pos) /*!< DWT EXCCNT: EXCCNT Mask */
+
+/* DWT Sleep Count Register Definitions */
+#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */
+#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL << DWT_SLEEPCNT_SLEEPCNT_Pos) /*!< DWT SLEEPCNT: SLEEPCNT Mask */
+
+/* DWT LSU Count Register Definitions */
+#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */
+#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL << DWT_LSUCNT_LSUCNT_Pos) /*!< DWT LSUCNT: LSUCNT Mask */
+
+/* DWT Folded-instruction Count Register Definitions */
+#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */
+#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL << DWT_FOLDCNT_FOLDCNT_Pos) /*!< DWT FOLDCNT: FOLDCNT Mask */
+
+/* DWT Comparator Mask Register Definitions */
+#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */
+#define DWT_MASK_MASK_Msk (0x1FUL << DWT_MASK_MASK_Pos) /*!< DWT MASK: MASK Mask */
+
+/* DWT Comparator Function Register Definitions */
+#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */
+#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
+
+#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */
+#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */
+
+#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */
+#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */
+
+#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */
+#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
+
+#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */
+#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */
+
+#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */
+#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */
+
+#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */
+#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */
+
+#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */
+#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */
+
+#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */
+#define DWT_FUNCTION_FUNCTION_Msk (0xFUL << DWT_FUNCTION_FUNCTION_Pos) /*!< DWT FUNCTION: FUNCTION Mask */
+
+/*@}*/ /* end of group CMSIS_DWT */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_TPI Trace Port Interface (TPI)
+ \brief Type definitions for the Trace Port Interface (TPI)
+ @{
+ */
+
+/** \brief Structure type to access the Trace Port Interface Register (TPI).
+ */
+typedef struct
+{
+ __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */
+ __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */
+ uint32_t RESERVED0[2];
+ __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
+ uint32_t RESERVED1[55];
+ __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
+ uint32_t RESERVED2[131];
+ __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
+ __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
+ __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */
+ uint32_t RESERVED3[759];
+ __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */
+ __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */
+ __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */
+ uint32_t RESERVED4[1];
+ __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */
+ __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */
+ __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */
+ uint32_t RESERVED5[39];
+ __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */
+ __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */
+ uint32_t RESERVED7[8];
+ __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */
+ __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */
+} TPI_Type;
+
+/* TPI Asynchronous Clock Prescaler Register Definitions */
+#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */
+#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL << TPI_ACPR_PRESCALER_Pos) /*!< TPI ACPR: PRESCALER Mask */
+
+/* TPI Selected Pin Protocol Register Definitions */
+#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */
+#define TPI_SPPR_TXMODE_Msk (0x3UL << TPI_SPPR_TXMODE_Pos) /*!< TPI SPPR: TXMODE Mask */
+
+/* TPI Formatter and Flush Status Register Definitions */
+#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */
+#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
+
+#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */
+#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
+
+#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */
+#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
+
+#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */
+#define TPI_FFSR_FlInProg_Msk (0x1UL << TPI_FFSR_FlInProg_Pos) /*!< TPI FFSR: FlInProg Mask */
+
+/* TPI Formatter and Flush Control Register Definitions */
+#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */
+#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
+
+#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */
+#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
+
+/* TPI TRIGGER Register Definitions */
+#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */
+#define TPI_TRIGGER_TRIGGER_Msk (0x1UL << TPI_TRIGGER_TRIGGER_Pos) /*!< TPI TRIGGER: TRIGGER Mask */
+
+/* TPI Integration ETM Data Register Definitions (FIFO0) */
+#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */
+#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */
+
+#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */
+#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */
+
+#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */
+#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */
+
+#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */
+#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */
+
+#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */
+#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */
+
+#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */
+#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */
+
+#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */
+#define TPI_FIFO0_ETM0_Msk (0xFFUL << TPI_FIFO0_ETM0_Pos) /*!< TPI FIFO0: ETM0 Mask */
+
+/* TPI ITATBCTR2 Register Definitions */
+#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */
+#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL << TPI_ITATBCTR2_ATREADY_Pos) /*!< TPI ITATBCTR2: ATREADY Mask */
+
+/* TPI Integration ITM Data Register Definitions (FIFO1) */
+#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */
+#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */
+
+#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */
+#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */
+
+#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */
+#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */
+
+#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */
+#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */
+
+#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */
+#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */
+
+#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */
+#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */
+
+#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */
+#define TPI_FIFO1_ITM0_Msk (0xFFUL << TPI_FIFO1_ITM0_Pos) /*!< TPI FIFO1: ITM0 Mask */
+
+/* TPI ITATBCTR0 Register Definitions */
+#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */
+#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL << TPI_ITATBCTR0_ATREADY_Pos) /*!< TPI ITATBCTR0: ATREADY Mask */
+
+/* TPI Integration Mode Control Register Definitions */
+#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */
+#define TPI_ITCTRL_Mode_Msk (0x1UL << TPI_ITCTRL_Mode_Pos) /*!< TPI ITCTRL: Mode Mask */
+
+/* TPI DEVID Register Definitions */
+#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */
+#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
+
+#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */
+#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
+
+#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */
+#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
+
+#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */
+#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */
+
+#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */
+#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */
+
+#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */
+#define TPI_DEVID_NrTraceInput_Msk (0x1FUL << TPI_DEVID_NrTraceInput_Pos) /*!< TPI DEVID: NrTraceInput Mask */
+
+/* TPI DEVTYPE Register Definitions */
+#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */
+#define TPI_DEVTYPE_SubType_Msk (0xFUL << TPI_DEVTYPE_SubType_Pos) /*!< TPI DEVTYPE: SubType Mask */
+
+#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */
+#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
+
+/*@}*/ /* end of group CMSIS_TPI */
+
+
+#if (__MPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_MPU Memory Protection Unit (MPU)
+ \brief Type definitions for the Memory Protection Unit (MPU)
+ @{
+ */
+
+/** \brief Structure type to access the Memory Protection Unit (MPU).
+ */
+typedef struct
+{
+ __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
+ __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
+ __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
+ __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
+ __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
+ __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */
+ __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */
+ __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */
+ __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */
+} MPU_Type;
+
+/* MPU Type Register */
+#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
+#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
+
+#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
+#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
+
+#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
+#define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */
+
+/* MPU Control Register */
+#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
+#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
+
+#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
+#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
+
+#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
+#define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */
+
+/* MPU Region Number Register */
+#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
+#define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */
+
+/* MPU Region Base Address Register */
+#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */
+#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
+
+#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
+#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
+
+#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
+#define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */
+
+/* MPU Region Attribute and Size Register */
+#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */
+#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
+
+#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */
+#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */
+
+#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */
+#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */
+
+#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */
+#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */
+
+#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */
+#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */
+
+#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */
+#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */
+
+#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */
+#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */
+
+#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
+#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
+
+#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
+#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
+
+#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */
+#define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) /*!< MPU RASR: Region enable bit Disable Mask */
+
+/*@} end of group CMSIS_MPU */
+#endif
+
+
+#if (__FPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_FPU Floating Point Unit (FPU)
+ \brief Type definitions for the Floating Point Unit (FPU)
+ @{
+ */
+
+/** \brief Structure type to access the Floating Point Unit (FPU).
+ */
+typedef struct
+{
+ uint32_t RESERVED0[1];
+ __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */
+ __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */
+ __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */
+ __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */
+ __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */
+} FPU_Type;
+
+/* Floating-Point Context Control Register */
+#define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */
+#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */
+
+#define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */
+#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */
+
+#define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */
+#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */
+
+#define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */
+#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */
+
+#define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */
+#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */
+
+#define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */
+#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */
+
+#define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */
+#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */
+
+#define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */
+#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */
+
+#define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */
+#define FPU_FPCCR_LSPACT_Msk (1UL << FPU_FPCCR_LSPACT_Pos) /*!< FPCCR: Lazy state preservation active bit Mask */
+
+/* Floating-Point Context Address Register */
+#define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */
+#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */
+
+/* Floating-Point Default Status Control Register */
+#define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */
+#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */
+
+#define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */
+#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */
+
+#define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */
+#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */
+
+#define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */
+#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */
+
+/* Media and FP Feature Register 0 */
+#define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */
+#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */
+
+#define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */
+#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */
+
+#define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */
+#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */
+
+#define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */
+#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */
+
+#define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */
+#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */
+
+#define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */
+#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */
+
+#define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */
+#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */
+
+#define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */
+#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL << FPU_MVFR0_A_SIMD_registers_Pos) /*!< MVFR0: A_SIMD registers bits Mask */
+
+/* Media and FP Feature Register 1 */
+#define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */
+#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */
+
+#define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */
+#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */
+
+#define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */
+#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */
+
+#define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */
+#define FPU_MVFR1_FtZ_mode_Msk (0xFUL << FPU_MVFR1_FtZ_mode_Pos) /*!< MVFR1: FtZ mode bits Mask */
+
+/*@} end of group CMSIS_FPU */
+#endif
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
+ \brief Type definitions for the Core Debug Registers
+ @{
+ */
+
+/** \brief Structure type to access the Core Debug Register (CoreDebug).
+ */
+typedef struct
+{
+ __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
+ __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
+ __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
+ __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
+} CoreDebug_Type;
+
+/* Debug Halting Control and Status Register */
+#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
+#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
+
+#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
+#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
+
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
+
+#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
+#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
+
+#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
+#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
+
+#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
+#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
+
+#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
+#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
+
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
+
+#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
+#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
+
+#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
+#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
+
+#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
+#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
+
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
+
+/* Debug Core Register Selector Register */
+#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
+#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
+
+#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
+#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
+
+/* Debug Exception and Monitor Control Register */
+#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
+#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
+
+#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */
+#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
+
+#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */
+#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
+
+#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */
+#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
+
+#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */
+#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
+
+#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
+#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
+
+#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */
+#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
+
+#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */
+#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
+
+#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */
+#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
+
+#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */
+#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
+
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
+
+#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */
+#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
+
+#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
+#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
+
+/*@} end of group CMSIS_CoreDebug */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_core_base Core Definitions
+ \brief Definitions for base addresses, unions, and structures.
+ @{
+ */
+
+/* Memory mapping of Cortex-M4 Hardware */
+#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
+#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
+#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
+#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
+#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
+
+#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
+#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
+#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
+#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
+#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
+#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
+
+#if (__MPU_PRESENT == 1)
+ #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
+ #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
+#endif
+
+#if (__FPU_PRESENT == 1)
+ #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
+ #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
+#endif
+
+/*@} */
+
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ Core Function Interface contains:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Debug Functions
+ - Core Register Access Functions
+ ******************************************************************************/
+/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
+*/
+
+
+
+/* ########################## NVIC functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_NVICFunctions NVIC Functions
+ \brief Functions that manage interrupts and exceptions via the NVIC.
+ @{
+ */
+
+/** \brief Set Priority Grouping
+
+ The function sets the priority grouping field using the required unlock sequence.
+ The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
+ Only values from 0..7 are used.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
+
+ \param [in] PriorityGroup Priority grouping field.
+ */
+__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
+{
+ uint32_t reg_value;
+ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */
+
+ reg_value = SCB->AIRCR; /* read old register configuration */
+ reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */
+ reg_value = (reg_value |
+ ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (PriorityGroupTmp << 8)); /* Insert write key and priorty group */
+ SCB->AIRCR = reg_value;
+}
+
+
+/** \brief Get Priority Grouping
+
+ The function reads the priority grouping field from the NVIC Interrupt Controller.
+
+ \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
+{
+ return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */
+}
+
+
+/** \brief Enable External Interrupt
+
+ The function enables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+/* NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); enable interrupt */
+ NVIC->ISER[(uint32_t)((int32_t)IRQn) >> 5] = (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F)); /* enable interrupt */
+}
+
+
+/** \brief Disable External Interrupt
+
+ The function disables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
+}
+
+
+/** \brief Get Pending Interrupt
+
+ The function reads the pending register in the NVIC and returns the pending bit
+ for the specified interrupt.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not pending.
+ \return 1 Interrupt status is pending.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
+}
+
+
+/** \brief Set Pending Interrupt
+
+ The function sets the pending bit of an external interrupt.
+
+ \param [in] IRQn Interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
+}
+
+
+/** \brief Clear Pending Interrupt
+
+ The function clears the pending bit of an external interrupt.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
+}
+
+
+/** \brief Get Active Interrupt
+
+ The function reads the active register in NVIC and returns the active bit.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not active.
+ \return 1 Interrupt status is active.
+ */
+__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
+{
+ return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */
+}
+
+
+/** \brief Set Interrupt Priority
+
+ The function sets the priority of an interrupt.
+
+ \note The priority cannot be set for every core interrupt.
+
+ \param [in] IRQn Interrupt number.
+ \param [in] priority Priority to set.
+ */
+__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if(IRQn < 0) {
+ SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
+ else {
+ NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
+}
+
+
+/** \brief Get Interrupt Priority
+
+ The function reads the priority of an interrupt. The interrupt
+ number can be positive to specify an external (device specific)
+ interrupt, or negative to specify an internal (core) interrupt.
+
+
+ \param [in] IRQn Interrupt number.
+ \return Interrupt Priority. Value is aligned automatically to the implemented
+ priority bits of the microcontroller.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if(IRQn < 0) {
+ return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M system interrupts */
+ else {
+ return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
+}
+
+
+/** \brief Encode Priority
+
+ The function encodes the priority for an interrupt with the given priority group,
+ preemptive priority value, and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the samllest possible priority group is set.
+
+ \param [in] PriorityGroup Used priority group.
+ \param [in] PreemptPriority Preemptive priority value (starting from 0).
+ \param [in] SubPriority Subpriority value (starting from 0).
+ \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
+ */
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ return (
+ ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
+ ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
+ );
+}
+
+
+/** \brief Decode Priority
+
+ The function decodes an interrupt priority value with a given priority group to
+ preemptive priority value and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
+
+ \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
+ \param [in] PriorityGroup Used priority group.
+ \param [out] pPreemptPriority Preemptive priority value (starting from 0).
+ \param [out] pSubPriority Subpriority value (starting from 0).
+ */
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
+ *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
+}
+
+
+/** \brief System Reset
+
+ The function initiates a system reset request to reset the MCU.
+ */
+__STATIC_INLINE void NVIC_SystemReset(void)
+{
+ __DSB(); /* Ensure all outstanding memory accesses included
+ buffered write are completed before reset */
+ SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
+ SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */
+ __DSB(); /* Ensure completion of memory access */
+ while(1); /* wait until reset */
+}
+
+/*@} end of CMSIS_Core_NVICFunctions */
+
+
+
+/* ################################## SysTick function ############################################ */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
+ \brief Functions that configure the System.
+ @{
+ */
+
+#if (__Vendor_SysTickConfig == 0)
+
+/** \brief System Tick Configuration
+
+ The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
+ Counter is in free running mode to generate periodic interrupts.
+
+ \param [in] ticks Number of ticks between two interrupts.
+
+ \return 0 Function succeeded.
+ \return 1 Function failed.
+
+ \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
+ function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
+ must contain a vendor-specific implementation of this function.
+
+ */
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
+
+ SysTick->LOAD = ticks - 1; /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
+ SysTick->VAL = 0; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0); /* Function successful */
+}
+
+#endif
+
+/*@} end of CMSIS_Core_SysTickFunctions */
+
+
+
+/* ##################################### Debug In/Output function ########################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_core_DebugFunctions ITM Functions
+ \brief Functions that access the ITM debug interface.
+ @{
+ */
+
+extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */
+#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
+
+
+/** \brief ITM Send Character
+
+ The function transmits a character via the ITM channel 0, and
+ \li Just returns when no debugger is connected that has booked the output.
+ \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.
+
+ \param [in] ch Character to transmit.
+
+ \returns Character to transmit.
+ */
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
+{
+ if ((ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */
+ (ITM->TER & (1UL << 0) ) ) /* ITM Port #0 enabled */
+ {
+ while (ITM->PORT[0].u32 == 0);
+ ITM->PORT[0].u8 = (uint8_t) ch;
+ }
+ return (ch);
+}
+
+
+/** \brief ITM Receive Character
+
+ The function inputs a character via the external variable \ref ITM_RxBuffer.
+
+ \return Received character.
+ \return -1 No character pending.
+ */
+__STATIC_INLINE int32_t ITM_ReceiveChar (void) {
+ int32_t ch = -1; /* no character available */
+
+ if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
+ ch = ITM_RxBuffer;
+ ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
+ }
+
+ return (ch);
+}
+
+
+/** \brief ITM Check Character
+
+ The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.
+
+ \return 0 No character available.
+ \return 1 Character available.
+ */
+__STATIC_INLINE int32_t ITM_CheckChar (void) {
+
+ if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
+ return (0); /* no character available */
+ } else {
+ return (1); /* character available */
+ }
+}
+
+/*@} end of CMSIS_core_DebugFunctions */
+
+#endif /* __CORE_CM4_H_DEPENDANT */
+
+#endif /* __CMSIS_GENERIC */
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm4_simd.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,673 @@
+/**************************************************************************//**
+ * @file core_cm4_simd.h
+ * @brief CMSIS Cortex-M4 SIMD Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifndef __CORE_CM4_SIMD_H
+#define __CORE_CM4_SIMD_H
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ ******************************************************************************/
+
+
+/* ################### Compiler specific Intrinsics ########################### */
+/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
+ Access to dedicated SIMD instructions
+ @{
+*/
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
+#define __SADD8 __sadd8
+#define __QADD8 __qadd8
+#define __SHADD8 __shadd8
+#define __UADD8 __uadd8
+#define __UQADD8 __uqadd8
+#define __UHADD8 __uhadd8
+#define __SSUB8 __ssub8
+#define __QSUB8 __qsub8
+#define __SHSUB8 __shsub8
+#define __USUB8 __usub8
+#define __UQSUB8 __uqsub8
+#define __UHSUB8 __uhsub8
+#define __SADD16 __sadd16
+#define __QADD16 __qadd16
+#define __SHADD16 __shadd16
+#define __UADD16 __uadd16
+#define __UQADD16 __uqadd16
+#define __UHADD16 __uhadd16
+#define __SSUB16 __ssub16
+#define __QSUB16 __qsub16
+#define __SHSUB16 __shsub16
+#define __USUB16 __usub16
+#define __UQSUB16 __uqsub16
+#define __UHSUB16 __uhsub16
+#define __SASX __sasx
+#define __QASX __qasx
+#define __SHASX __shasx
+#define __UASX __uasx
+#define __UQASX __uqasx
+#define __UHASX __uhasx
+#define __SSAX __ssax
+#define __QSAX __qsax
+#define __SHSAX __shsax
+#define __USAX __usax
+#define __UQSAX __uqsax
+#define __UHSAX __uhsax
+#define __USAD8 __usad8
+#define __USADA8 __usada8
+#define __SSAT16 __ssat16
+#define __USAT16 __usat16
+#define __UXTB16 __uxtb16
+#define __UXTAB16 __uxtab16
+#define __SXTB16 __sxtb16
+#define __SXTAB16 __sxtab16
+#define __SMUAD __smuad
+#define __SMUADX __smuadx
+#define __SMLAD __smlad
+#define __SMLADX __smladx
+#define __SMLALD __smlald
+#define __SMLALDX __smlaldx
+#define __SMUSD __smusd
+#define __SMUSDX __smusdx
+#define __SMLSD __smlsd
+#define __SMLSDX __smlsdx
+#define __SMLSLD __smlsld
+#define __SMLSLDX __smlsldx
+#define __SEL __sel
+#define __QADD __qadd
+#define __QSUB __qsub
+
+#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
+ ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
+
+#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
+ ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
+
+#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
+ ((int64_t)(ARG3) << 32) ) >> 32))
+
+/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
+
+
+
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+
+/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
+#include <cmsis_iar.h>
+
+/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
+
+
+
+#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
+/* TI CCS specific functions */
+
+/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
+#include <cmsis_ccs.h>
+
+/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
+
+
+
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+#define __SSAT16(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+#define __USAT16(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
+{
+ uint32_t result;
+
+ __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
+{
+ uint32_t result;
+
+ __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+#define __SMLALD(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
+ __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
+ (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
+ })
+
+#define __SMLALDX(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
+ __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
+ (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+#define __SMLSLD(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
+ __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
+ (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
+ })
+
+#define __SMLSLDX(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
+ __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
+ (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+#define __PKHBT(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
+ __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
+ __RES; \
+ })
+
+#define __PKHTB(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
+ if (ARG3 == 0) \
+ __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \
+ else \
+ __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
+ __RES; \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
+{
+ int32_t result;
+
+ __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
+
+
+
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
+/* TASKING carm specific functions */
+
+
+/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
+/* not yet supported */
+/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
+
+
+#endif
+
+/*@} end of group CMSIS_SIMD_intrinsics */
+
+
+#endif /* __CORE_CM4_SIMD_H */
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cm7.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,2397 @@
+/**************************************************************************//**
+ * @file core_cm7.h
+ * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File
+ * @version V4.10
+ * @date 18. March 2015
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2015 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifndef __CORE_CM7_H_GENERIC
+#define __CORE_CM7_H_GENERIC
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
+ CMSIS violates the following MISRA-C:2004 rules:
+
+ \li Required Rule 8.5, object/function definition in header file.<br>
+ Function definitions in header files are used to allow 'inlining'.
+
+ \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
+ Unions are used for effective representation of core registers.
+
+ \li Advisory Rule 19.7, Function-like macro defined.<br>
+ Function-like macros are used to allow more efficient code.
+ */
+
+
+/*******************************************************************************
+ * CMSIS definitions
+ ******************************************************************************/
+/** \ingroup Cortex_M7
+ @{
+ */
+
+/* CMSIS CM7 definitions */
+#define __CM7_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */
+#define __CM7_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */
+#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16) | \
+ __CM7_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x07) /*!< Cortex-M Core */
+
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+ #define __STATIC_INLINE static __inline
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TMS470__ )
+ #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+ #define __STATIC_INLINE static inline
+
+#elif defined ( __CSMC__ )
+ #define __packed
+ #define __ASM _asm /*!< asm keyword for COSMIC Compiler */
+ #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */
+ #define __STATIC_INLINE static inline
+
+#endif
+
+/** __FPU_USED indicates whether an FPU is used or not.
+ For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
+*/
+#if defined ( __CC_ARM )
+ #if defined __TARGET_FPU_VFP
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __GNUC__ )
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __ICCARM__ )
+ #if defined __ARMVFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TMS470__ )
+ #if defined __TI_VFP_SUPPORT__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __TASKING__ )
+ #if defined __FPU_VFP__
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+
+#elif defined ( __CSMC__ ) /* Cosmic */
+ #if ( __CSMC__ & 0x400) // FPU present for parser
+ #if (__FPU_PRESENT == 1)
+ #define __FPU_USED 1
+ #else
+ #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
+ #define __FPU_USED 0
+ #endif
+ #else
+ #define __FPU_USED 0
+ #endif
+#endif
+
+#include <stdint.h> /* standard types definitions */
+#include <core_cmInstr.h> /* Core Instruction Access */
+#include <core_cmFunc.h> /* Core Function Access */
+#include <core_cmSimd.h> /* Compiler specific SIMD Intrinsics */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CORE_CM7_H_GENERIC */
+
+#ifndef __CMSIS_GENERIC
+
+#ifndef __CORE_CM7_H_DEPENDANT
+#define __CORE_CM7_H_DEPENDANT
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* check device defines and use defaults */
+#if defined __CHECK_DEVICE_DEFINES
+ #ifndef __CM7_REV
+ #define __CM7_REV 0x0000
+ #warning "__CM7_REV not defined in device header file; using default!"
+ #endif
+
+ #ifndef __FPU_PRESENT
+ #define __FPU_PRESENT 0
+ #warning "__FPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __MPU_PRESENT
+ #define __MPU_PRESENT 0
+ #warning "__MPU_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __ICACHE_PRESENT
+ #define __ICACHE_PRESENT 0
+ #warning "__ICACHE_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __DCACHE_PRESENT
+ #define __DCACHE_PRESENT 0
+ #warning "__DCACHE_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __DTCM_PRESENT
+ #define __DTCM_PRESENT 0
+ #warning "__DTCM_PRESENT not defined in device header file; using default!"
+ #endif
+
+ #ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 3
+ #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
+ #endif
+
+ #ifndef __Vendor_SysTickConfig
+ #define __Vendor_SysTickConfig 0
+ #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
+ #endif
+#endif
+
+/* IO definitions (access restrictions to peripheral registers) */
+/**
+ \defgroup CMSIS_glob_defs CMSIS Global Defines
+
+ <strong>IO Type Qualifiers</strong> are used
+ \li to specify the access to peripheral variables.
+ \li for automatic generation of peripheral register debug information.
+*/
+#ifdef __cplusplus
+ #define __I volatile /*!< Defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< Defines 'read only' permissions */
+#endif
+#define __O volatile /*!< Defines 'write only' permissions */
+#define __IO volatile /*!< Defines 'read / write' permissions */
+
+/*@} end of group Cortex_M7 */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ Core Register contain:
+ - Core Register
+ - Core NVIC Register
+ - Core SCB Register
+ - Core SysTick Register
+ - Core Debug Register
+ - Core MPU Register
+ - Core FPU Register
+ ******************************************************************************/
+/** \defgroup CMSIS_core_register Defines and Type Definitions
+ \brief Type definitions and defines for Cortex-M processor based devices.
+*/
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CORE Status and Control Registers
+ \brief Core Register type definitions.
+ @{
+ */
+
+/** \brief Union type to access the Application Program Status Register (APSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} APSR_Type;
+
+/* APSR Register Definitions */
+#define APSR_N_Pos 31 /*!< APSR: N Position */
+#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
+
+#define APSR_Z_Pos 30 /*!< APSR: Z Position */
+#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
+
+#define APSR_C_Pos 29 /*!< APSR: C Position */
+#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
+
+#define APSR_V_Pos 28 /*!< APSR: V Position */
+#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
+
+#define APSR_Q_Pos 27 /*!< APSR: Q Position */
+#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */
+
+#define APSR_GE_Pos 16 /*!< APSR: GE Position */
+#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */
+
+
+/** \brief Union type to access the Interrupt Program Status Register (IPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} IPSR_Type;
+
+/* IPSR Register Definitions */
+#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */
+#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
+
+
+/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
+ uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */
+ uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
+ uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
+ uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
+ uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */
+ uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
+ uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
+ uint32_t C:1; /*!< bit: 29 Carry condition code flag */
+ uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
+ uint32_t N:1; /*!< bit: 31 Negative condition code flag */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} xPSR_Type;
+
+/* xPSR Register Definitions */
+#define xPSR_N_Pos 31 /*!< xPSR: N Position */
+#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
+
+#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */
+#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
+
+#define xPSR_C_Pos 29 /*!< xPSR: C Position */
+#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
+
+#define xPSR_V_Pos 28 /*!< xPSR: V Position */
+#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
+
+#define xPSR_Q_Pos 27 /*!< xPSR: Q Position */
+#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */
+
+#define xPSR_IT_Pos 25 /*!< xPSR: IT Position */
+#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */
+
+#define xPSR_T_Pos 24 /*!< xPSR: T Position */
+#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
+
+#define xPSR_GE_Pos 16 /*!< xPSR: GE Position */
+#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */
+
+#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */
+#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
+
+
+/** \brief Union type to access the Control Registers (CONTROL).
+ */
+typedef union
+{
+ struct
+ {
+ uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
+ uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
+ uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
+ uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
+ } b; /*!< Structure used for bit access */
+ uint32_t w; /*!< Type used for word access */
+} CONTROL_Type;
+
+/* CONTROL Register Definitions */
+#define CONTROL_FPCA_Pos 2 /*!< CONTROL: FPCA Position */
+#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */
+
+#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */
+#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
+
+#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */
+#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */
+
+/*@} end of group CMSIS_CORE */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
+ \brief Type definitions for the NVIC Registers
+ @{
+ */
+
+/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
+ */
+typedef struct
+{
+ __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
+ uint32_t RESERVED0[24];
+ __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
+ uint32_t RSERVED1[24];
+ __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
+ uint32_t RESERVED2[24];
+ __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
+ uint32_t RESERVED3[24];
+ __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
+ uint32_t RESERVED4[56];
+ __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
+ uint32_t RESERVED5[644];
+ __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
+} NVIC_Type;
+
+/* Software Triggered Interrupt Register Definitions */
+#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */
+#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */
+
+/*@} end of group CMSIS_NVIC */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCB System Control Block (SCB)
+ \brief Type definitions for the System Control Block Registers
+ @{
+ */
+
+/** \brief Structure type to access the System Control Block (SCB).
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
+ __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
+ __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
+ __IO uint8_t SHPR[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
+ __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
+ __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
+ __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
+ __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
+ __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
+ __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
+ __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
+ __I uint32_t ID_PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
+ __I uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
+ __I uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
+ __I uint32_t ID_MFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
+ __I uint32_t ID_ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
+ uint32_t RESERVED0[1];
+ __I uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */
+ __I uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */
+ __I uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */
+ __IO uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */
+ __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
+ uint32_t RESERVED3[93];
+ __O uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */
+ uint32_t RESERVED4[15];
+ __I uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */
+ __I uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */
+ __I uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 1 */
+ uint32_t RESERVED5[1];
+ __O uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */
+ uint32_t RESERVED6[1];
+ __O uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */
+ __O uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */
+ __O uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */
+ __O uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */
+ __O uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */
+ __O uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */
+ __O uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */
+ __O uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */
+ uint32_t RESERVED7[6];
+ __IO uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */
+ __IO uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */
+ __IO uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */
+ __IO uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */
+ __IO uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */
+ uint32_t RESERVED8[1];
+ __IO uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
+#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */
+#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
+
+/* SCB Vector Table Offset Register Definitions */
+#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
+#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */
+#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_BP_Pos 18 /*!< SCB CCR: Branch prediction enable bit Position */
+#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: Branch prediction enable bit Mask */
+
+#define SCB_CCR_IC_Pos 17 /*!< SCB CCR: Instruction cache enable bit Position */
+#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: Instruction cache enable bit Mask */
+
+#define SCB_CCR_DC_Pos 16 /*!< SCB CCR: Cache enable bit Position */
+#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: Cache enable bit Mask */
+
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */
+#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
+
+#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */
+#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */
+#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
+
+#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */
+#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */
+#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
+
+#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */
+#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
+
+#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */
+#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
+
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */
+#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
+
+#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */
+#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
+
+#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */
+#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
+
+#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */
+#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
+
+#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */
+#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
+
+#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */
+#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
+
+#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */
+#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
+
+#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */
+#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
+
+#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */
+#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
+
+#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */
+#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */
+
+/* SCB Configurable Fault Status Registers Definitions */
+#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */
+#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
+
+#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */
+#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
+
+#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */
+#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
+
+/* SCB Hard Fault Status Registers Definitions */
+#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */
+#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
+
+#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */
+#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
+
+#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */
+#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
+
+/* SCB Debug Fault Status Register Definitions */
+#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
+#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
+
+#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
+#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
+
+#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
+#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
+
+#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
+#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
+
+#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
+#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */
+
+/* Cache Level ID register */
+#define SCB_CLIDR_LOUU_Pos 27 /*!< SCB CLIDR: LoUU Position */
+#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */
+
+#define SCB_CLIDR_LOC_Pos 24 /*!< SCB CLIDR: LoC Position */
+#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_FORMAT_Pos) /*!< SCB CLIDR: LoC Mask */
+
+/* Cache Type register */
+#define SCB_CTR_FORMAT_Pos 29 /*!< SCB CTR: Format Position */
+#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */
+
+#define SCB_CTR_CWG_Pos 24 /*!< SCB CTR: CWG Position */
+#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */
+
+#define SCB_CTR_ERG_Pos 20 /*!< SCB CTR: ERG Position */
+#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */
+
+#define SCB_CTR_DMINLINE_Pos 16 /*!< SCB CTR: DminLine Position */
+#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */
+
+#define SCB_CTR_IMINLINE_Pos 0 /*!< SCB CTR: ImInLine Position */
+#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */
+
+/* Cache Size ID Register */
+#define SCB_CCSIDR_WT_Pos 31 /*!< SCB CCSIDR: WT Position */
+#define SCB_CCSIDR_WT_Msk (7UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */
+
+#define SCB_CCSIDR_WB_Pos 30 /*!< SCB CCSIDR: WB Position */
+#define SCB_CCSIDR_WB_Msk (7UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */
+
+#define SCB_CCSIDR_RA_Pos 29 /*!< SCB CCSIDR: RA Position */
+#define SCB_CCSIDR_RA_Msk (7UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */
+
+#define SCB_CCSIDR_WA_Pos 28 /*!< SCB CCSIDR: WA Position */
+#define SCB_CCSIDR_WA_Msk (7UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */
+
+#define SCB_CCSIDR_NUMSETS_Pos 13 /*!< SCB CCSIDR: NumSets Position */
+#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */
+
+#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3 /*!< SCB CCSIDR: Associativity Position */
+#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */
+
+#define SCB_CCSIDR_LINESIZE_Pos 0 /*!< SCB CCSIDR: LineSize Position */
+#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */
+
+/* Cache Size Selection Register */
+#define SCB_CSSELR_LEVEL_Pos 1 /*!< SCB CSSELR: Level Position */
+#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */
+
+#define SCB_CSSELR_IND_Pos 0 /*!< SCB CSSELR: InD Position */
+#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */
+
+/* SCB Software Triggered Interrupt Register */
+#define SCB_STIR_INTID_Pos 0 /*!< SCB STIR: INTID Position */
+#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */
+
+/* Instruction Tightly-Coupled Memory Control Register*/
+#define SCB_ITCMCR_SZ_Pos 3 /*!< SCB ITCMCR: SZ Position */
+#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */
+
+#define SCB_ITCMCR_RETEN_Pos 2 /*!< SCB ITCMCR: RETEN Position */
+#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */
+
+#define SCB_ITCMCR_RMW_Pos 1 /*!< SCB ITCMCR: RMW Position */
+#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */
+
+#define SCB_ITCMCR_EN_Pos 0 /*!< SCB ITCMCR: EN Position */
+#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */
+
+/* Data Tightly-Coupled Memory Control Registers */
+#define SCB_DTCMCR_SZ_Pos 3 /*!< SCB DTCMCR: SZ Position */
+#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */
+
+#define SCB_DTCMCR_RETEN_Pos 2 /*!< SCB DTCMCR: RETEN Position */
+#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */
+
+#define SCB_DTCMCR_RMW_Pos 1 /*!< SCB DTCMCR: RMW Position */
+#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */
+
+#define SCB_DTCMCR_EN_Pos 0 /*!< SCB DTCMCR: EN Position */
+#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */
+
+/* AHBP Control Register */
+#define SCB_AHBPCR_SZ_Pos 1 /*!< SCB AHBPCR: SZ Position */
+#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */
+
+#define SCB_AHBPCR_EN_Pos 0 /*!< SCB AHBPCR: EN Position */
+#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */
+
+/* L1 Cache Control Register */
+#define SCB_CACR_FORCEWT_Pos 2 /*!< SCB CACR: FORCEWT Position */
+#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */
+
+#define SCB_CACR_ECCEN_Pos 1 /*!< SCB CACR: ECCEN Position */
+#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */
+
+#define SCB_CACR_SIWT_Pos 0 /*!< SCB CACR: SIWT Position */
+#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */
+
+/* AHBS control register */
+#define SCB_AHBSCR_INITCOUNT_Pos 11 /*!< SCB AHBSCR: INITCOUNT Position */
+#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */
+
+#define SCB_AHBSCR_TPRI_Pos 2 /*!< SCB AHBSCR: TPRI Position */
+#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */
+
+#define SCB_AHBSCR_CTL_Pos 0 /*!< SCB AHBSCR: CTL Position*/
+#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */
+
+/* Auxiliary Bus Fault Status Register */
+#define SCB_ABFSR_AXIMTYPE_Pos 8 /*!< SCB ABFSR: AXIMTYPE Position*/
+#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */
+
+#define SCB_ABFSR_EPPB_Pos 4 /*!< SCB ABFSR: EPPB Position*/
+#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */
+
+#define SCB_ABFSR_AXIM_Pos 3 /*!< SCB ABFSR: AXIM Position*/
+#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */
+
+#define SCB_ABFSR_AHBP_Pos 2 /*!< SCB ABFSR: AHBP Position*/
+#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */
+
+#define SCB_ABFSR_DTCM_Pos 1 /*!< SCB ABFSR: DTCM Position*/
+#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */
+
+#define SCB_ABFSR_ITCM_Pos 0 /*!< SCB ABFSR: ITCM Position*/
+#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */
+
+/*@} end of group CMSIS_SCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
+ \brief Type definitions for the System Control and ID Register not in the SCB
+ @{
+ */
+
+/** \brief Structure type to access the System Control and ID Register not in the SCB.
+ */
+typedef struct
+{
+ uint32_t RESERVED0[1];
+ __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
+ __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
+} SCnSCB_Type;
+
+/* Interrupt Controller Type Register Definitions */
+#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */
+#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */
+
+/* Auxiliary Control Register Definitions */
+#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12 /*!< ACTLR: DISITMATBFLUSH Position */
+#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */
+
+#define SCnSCB_ACTLR_DISRAMODE_Pos 11 /*!< ACTLR: DISRAMODE Position */
+#define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos) /*!< ACTLR: DISRAMODE Mask */
+
+#define SCnSCB_ACTLR_FPEXCODIS_Pos 10 /*!< ACTLR: FPEXCODIS Position */
+#define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */
+
+#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */
+#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
+
+#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */
+#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */
+
+/*@} end of group CMSIS_SCnotSCB */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_SysTick System Tick Timer (SysTick)
+ \brief Type definitions for the System Timer Registers.
+ @{
+ */
+
+/** \brief Structure type to access the System Timer (SysTick).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
+
+/*@} end of group CMSIS_SysTick */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM)
+ \brief Type definitions for the Instrumentation Trace Macrocell (ITM)
+ @{
+ */
+
+/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
+ */
+typedef struct
+{
+ __O union
+ {
+ __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
+ __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
+ __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
+ } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
+ uint32_t RESERVED0[864];
+ __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
+ uint32_t RESERVED1[15];
+ __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
+ uint32_t RESERVED2[15];
+ __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
+ uint32_t RESERVED3[29];
+ __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */
+ __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */
+ __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */
+ uint32_t RESERVED4[43];
+ __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */
+ __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */
+ uint32_t RESERVED5[6];
+ __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */
+ __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */
+ __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */
+ __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */
+ __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */
+ __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */
+ __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */
+ __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */
+ __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */
+ __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */
+ __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */
+ __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */
+} ITM_Type;
+
+/* ITM Trace Privilege Register Definitions */
+#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */
+#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */
+
+/* ITM Trace Control Register Definitions */
+#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */
+#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
+
+#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */
+#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */
+
+#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */
+#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
+
+#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */
+#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
+
+#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */
+#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
+
+#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */
+#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
+
+#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */
+#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
+
+#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */
+#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
+
+#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */
+#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */
+
+/* ITM Integration Write Register Definitions */
+#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */
+#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */
+
+/* ITM Integration Read Register Definitions */
+#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */
+#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */
+
+/* ITM Integration Mode Control Register Definitions */
+#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */
+#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */
+
+/* ITM Lock Status Register Definitions */
+#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */
+#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
+
+#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */
+#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
+
+#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */
+#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */
+
+/*@}*/ /* end of group CMSIS_ITM */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
+ \brief Type definitions for the Data Watchpoint and Trace (DWT)
+ @{
+ */
+
+/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT).
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
+ __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
+ __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
+ __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
+ __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
+ __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
+ __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
+ __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
+ __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
+ __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */
+ __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
+ uint32_t RESERVED0[1];
+ __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
+ __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */
+ __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
+ uint32_t RESERVED1[1];
+ __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
+ __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */
+ __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
+ uint32_t RESERVED2[1];
+ __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
+ __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */
+ __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
+ uint32_t RESERVED3[981];
+ __O uint32_t LAR; /*!< Offset: 0xFB0 ( W) Lock Access Register */
+ __I uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */
+} DWT_Type;
+
+/* DWT Control Register Definitions */
+#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */
+#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
+
+#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */
+#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
+
+#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */
+#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
+
+#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */
+#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
+
+#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */
+#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
+
+#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */
+#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */
+
+#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */
+#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */
+
+#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */
+#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */
+
+#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */
+#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */
+
+#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */
+#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */
+
+#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */
+#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */
+
+#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */
+#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */
+
+#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */
+#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */
+
+#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */
+#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */
+
+#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */
+#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */
+
+#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */
+#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */
+
+#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */
+#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */
+
+#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */
+#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */
+
+/* DWT CPI Count Register Definitions */
+#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */
+#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */
+
+/* DWT Exception Overhead Count Register Definitions */
+#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */
+#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */
+
+/* DWT Sleep Count Register Definitions */
+#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */
+#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */
+
+/* DWT LSU Count Register Definitions */
+#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */
+#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */
+
+/* DWT Folded-instruction Count Register Definitions */
+#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */
+#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */
+
+/* DWT Comparator Mask Register Definitions */
+#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */
+#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */
+
+/* DWT Comparator Function Register Definitions */
+#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */
+#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
+
+#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */
+#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */
+
+#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */
+#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */
+
+#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */
+#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
+
+#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */
+#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */
+
+#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */
+#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */
+
+#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */
+#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */
+
+#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */
+#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */
+
+#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */
+#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */
+
+/*@}*/ /* end of group CMSIS_DWT */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_TPI Trace Port Interface (TPI)
+ \brief Type definitions for the Trace Port Interface (TPI)
+ @{
+ */
+
+/** \brief Structure type to access the Trace Port Interface Register (TPI).
+ */
+typedef struct
+{
+ __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */
+ __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */
+ uint32_t RESERVED0[2];
+ __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
+ uint32_t RESERVED1[55];
+ __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
+ uint32_t RESERVED2[131];
+ __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
+ __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
+ __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */
+ uint32_t RESERVED3[759];
+ __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */
+ __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */
+ __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */
+ uint32_t RESERVED4[1];
+ __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */
+ __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */
+ __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */
+ uint32_t RESERVED5[39];
+ __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */
+ __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */
+ uint32_t RESERVED7[8];
+ __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */
+ __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */
+} TPI_Type;
+
+/* TPI Asynchronous Clock Prescaler Register Definitions */
+#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */
+#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */
+
+/* TPI Selected Pin Protocol Register Definitions */
+#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */
+#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */
+
+/* TPI Formatter and Flush Status Register Definitions */
+#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */
+#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
+
+#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */
+#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
+
+#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */
+#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
+
+#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */
+#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */
+
+/* TPI Formatter and Flush Control Register Definitions */
+#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */
+#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
+
+#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */
+#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
+
+/* TPI TRIGGER Register Definitions */
+#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */
+#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */
+
+/* TPI Integration ETM Data Register Definitions (FIFO0) */
+#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */
+#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */
+
+#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */
+#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */
+
+#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */
+#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */
+
+#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */
+#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */
+
+#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */
+#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */
+
+#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */
+#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */
+
+#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */
+#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */
+
+/* TPI ITATBCTR2 Register Definitions */
+#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */
+#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */
+
+/* TPI Integration ITM Data Register Definitions (FIFO1) */
+#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */
+#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */
+
+#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */
+#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */
+
+#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */
+#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */
+
+#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */
+#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */
+
+#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */
+#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */
+
+#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */
+#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */
+
+#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */
+#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */
+
+/* TPI ITATBCTR0 Register Definitions */
+#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */
+#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */
+
+/* TPI Integration Mode Control Register Definitions */
+#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */
+#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */
+
+/* TPI DEVID Register Definitions */
+#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */
+#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
+
+#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */
+#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
+
+#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */
+#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
+
+#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */
+#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */
+
+#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */
+#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */
+
+#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */
+#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */
+
+/* TPI DEVTYPE Register Definitions */
+#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */
+#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
+
+#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */
+#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */
+
+/*@}*/ /* end of group CMSIS_TPI */
+
+
+#if (__MPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_MPU Memory Protection Unit (MPU)
+ \brief Type definitions for the Memory Protection Unit (MPU)
+ @{
+ */
+
+/** \brief Structure type to access the Memory Protection Unit (MPU).
+ */
+typedef struct
+{
+ __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
+ __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
+ __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
+ __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
+ __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
+ __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */
+ __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */
+ __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */
+ __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */
+} MPU_Type;
+
+/* MPU Type Register */
+#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
+#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
+
+#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
+#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
+
+#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
+#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */
+
+/* MPU Control Register */
+#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
+#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
+
+#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
+#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
+
+#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
+#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */
+
+/* MPU Region Number Register */
+#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
+#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */
+
+/* MPU Region Base Address Register */
+#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */
+#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
+
+#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
+#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
+
+#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
+#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */
+
+/* MPU Region Attribute and Size Register */
+#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */
+#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
+
+#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */
+#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */
+
+#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */
+#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */
+
+#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */
+#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */
+
+#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */
+#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */
+
+#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */
+#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */
+
+#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */
+#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */
+
+#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
+#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
+
+#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
+#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
+
+#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */
+#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */
+
+/*@} end of group CMSIS_MPU */
+#endif
+
+
+#if (__FPU_PRESENT == 1)
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_FPU Floating Point Unit (FPU)
+ \brief Type definitions for the Floating Point Unit (FPU)
+ @{
+ */
+
+/** \brief Structure type to access the Floating Point Unit (FPU).
+ */
+typedef struct
+{
+ uint32_t RESERVED0[1];
+ __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */
+ __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */
+ __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */
+ __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */
+ __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */
+ __I uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */
+} FPU_Type;
+
+/* Floating-Point Context Control Register */
+#define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */
+#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */
+
+#define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */
+#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */
+
+#define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */
+#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */
+
+#define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */
+#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */
+
+#define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */
+#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */
+
+#define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */
+#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */
+
+#define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */
+#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */
+
+#define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */
+#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */
+
+#define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */
+#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */
+
+/* Floating-Point Context Address Register */
+#define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */
+#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */
+
+/* Floating-Point Default Status Control Register */
+#define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */
+#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */
+
+#define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */
+#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */
+
+#define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */
+#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */
+
+#define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */
+#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */
+
+/* Media and FP Feature Register 0 */
+#define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */
+#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */
+
+#define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */
+#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */
+
+#define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */
+#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */
+
+#define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */
+#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */
+
+#define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */
+#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */
+
+#define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */
+#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */
+
+#define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */
+#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */
+
+#define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */
+#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */
+
+/* Media and FP Feature Register 1 */
+#define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */
+#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */
+
+#define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */
+#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */
+
+#define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */
+#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */
+
+#define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */
+#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */
+
+/* Media and FP Feature Register 2 */
+
+/*@} end of group CMSIS_FPU */
+#endif
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
+ \brief Type definitions for the Core Debug Registers
+ @{
+ */
+
+/** \brief Structure type to access the Core Debug Register (CoreDebug).
+ */
+typedef struct
+{
+ __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
+ __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
+ __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
+ __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
+} CoreDebug_Type;
+
+/* Debug Halting Control and Status Register */
+#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
+#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
+
+#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
+#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
+
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
+
+#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
+#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
+
+#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
+#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
+
+#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
+#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
+
+#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
+#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
+
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
+
+#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
+#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
+
+#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
+#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
+
+#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
+#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
+
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
+
+/* Debug Core Register Selector Register */
+#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
+#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
+
+#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
+#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */
+
+/* Debug Exception and Monitor Control Register */
+#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
+#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
+
+#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */
+#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
+
+#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */
+#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
+
+#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */
+#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
+
+#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */
+#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
+
+#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
+#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
+
+#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */
+#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
+
+#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */
+#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
+
+#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */
+#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
+
+#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */
+#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
+
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
+
+#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */
+#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
+
+#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
+#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
+
+/*@} end of group CMSIS_CoreDebug */
+
+
+/** \ingroup CMSIS_core_register
+ \defgroup CMSIS_core_base Core Definitions
+ \brief Definitions for base addresses, unions, and structures.
+ @{
+ */
+
+/* Memory mapping of Cortex-M4 Hardware */
+#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
+#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
+#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
+#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
+#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
+
+#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
+#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
+#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
+#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
+#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
+#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
+
+#if (__MPU_PRESENT == 1)
+ #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
+ #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
+#endif
+
+#if (__FPU_PRESENT == 1)
+ #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
+ #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
+#endif
+
+/*@} */
+
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ Core Function Interface contains:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Debug Functions
+ - Core Register Access Functions
+ ******************************************************************************/
+/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
+*/
+
+
+
+/* ########################## NVIC functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_NVICFunctions NVIC Functions
+ \brief Functions that manage interrupts and exceptions via the NVIC.
+ @{
+ */
+
+/** \brief Set Priority Grouping
+
+ The function sets the priority grouping field using the required unlock sequence.
+ The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
+ Only values from 0..7 are used.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
+
+ \param [in] PriorityGroup Priority grouping field.
+ */
+__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
+{
+ uint32_t reg_value;
+ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
+
+ reg_value = SCB->AIRCR; /* read old register configuration */
+ reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
+ reg_value = (reg_value |
+ ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
+ (PriorityGroupTmp << 8) ); /* Insert write key and priorty group */
+ SCB->AIRCR = reg_value;
+}
+
+
+/** \brief Get Priority Grouping
+
+ The function reads the priority grouping field from the NVIC Interrupt Controller.
+
+ \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
+{
+ return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
+}
+
+
+/** \brief Enable External Interrupt
+
+ The function enables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
+}
+
+
+/** \brief Disable External Interrupt
+
+ The function disables a device-specific interrupt in the NVIC interrupt controller.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
+}
+
+
+/** \brief Get Pending Interrupt
+
+ The function reads the pending register in the NVIC and returns the pending bit
+ for the specified interrupt.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not pending.
+ \return 1 Interrupt status is pending.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
+}
+
+
+/** \brief Set Pending Interrupt
+
+ The function sets the pending bit of an external interrupt.
+
+ \param [in] IRQn Interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
+}
+
+
+/** \brief Clear Pending Interrupt
+
+ The function clears the pending bit of an external interrupt.
+
+ \param [in] IRQn External interrupt number. Value cannot be negative.
+ */
+__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
+}
+
+
+/** \brief Get Active Interrupt
+
+ The function reads the active register in NVIC and returns the active bit.
+
+ \param [in] IRQn Interrupt number.
+
+ \return 0 Interrupt status is not active.
+ \return 1 Interrupt status is active.
+ */
+__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
+{
+ return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
+}
+
+
+/** \brief Set Interrupt Priority
+
+ The function sets the priority of an interrupt.
+
+ \note The priority cannot be set for every core interrupt.
+
+ \param [in] IRQn Interrupt number.
+ \param [in] priority Priority to set.
+ */
+__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if((int32_t)IRQn < 0) {
+ SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
+ }
+ else {
+ NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
+ }
+}
+
+
+/** \brief Get Interrupt Priority
+
+ The function reads the priority of an interrupt. The interrupt
+ number can be positive to specify an external (device specific)
+ interrupt, or negative to specify an internal (core) interrupt.
+
+
+ \param [in] IRQn Interrupt number.
+ \return Interrupt Priority. Value is aligned automatically to the implemented
+ priority bits of the microcontroller.
+ */
+__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if((int32_t)IRQn < 0) {
+ return(((uint32_t)SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8 - __NVIC_PRIO_BITS)));
+ }
+ else {
+ return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8 - __NVIC_PRIO_BITS)));
+ }
+}
+
+
+/** \brief Encode Priority
+
+ The function encodes the priority for an interrupt with the given priority group,
+ preemptive priority value, and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
+
+ \param [in] PriorityGroup Used priority group.
+ \param [in] PreemptPriority Preemptive priority value (starting from 0).
+ \param [in] SubPriority Subpriority value (starting from 0).
+ \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
+ */
+__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
+ SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
+
+ return (
+ ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
+ ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
+ );
+}
+
+
+/** \brief Decode Priority
+
+ The function decodes an interrupt priority value with a given priority group to
+ preemptive priority value and subpriority value.
+ In case of a conflict between priority grouping and available
+ priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
+
+ \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
+ \param [in] PriorityGroup Used priority group.
+ \param [out] pPreemptPriority Preemptive priority value (starting from 0).
+ \param [out] pSubPriority Subpriority value (starting from 0).
+ */
+__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
+ SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
+
+ *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
+ *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
+}
+
+
+/** \brief System Reset
+
+ The function initiates a system reset request to reset the MCU.
+ */
+__STATIC_INLINE void NVIC_SystemReset(void)
+{
+ __DSB(); /* Ensure all outstanding memory accesses included
+ buffered write are completed before reset */
+ SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
+ (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
+ SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
+ __DSB(); /* Ensure completion of memory access */
+ while(1) { __NOP(); } /* wait until reset */
+}
+
+/*@} end of CMSIS_Core_NVICFunctions */
+
+
+/* ########################## FPU functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_FpuFunctions FPU Functions
+ \brief Function that provides FPU type.
+ @{
+ */
+
+/**
+ \fn uint32_t SCB_GetFPUType(void)
+ \brief get FPU type
+ \returns
+ - \b 0: No FPU
+ - \b 1: Single precision FPU
+ - \b 2: Double + Single precision FPU
+ */
+__STATIC_INLINE uint32_t SCB_GetFPUType(void)
+{
+ uint32_t mvfr0;
+
+ mvfr0 = SCB->MVFR0;
+ if ((mvfr0 & 0x00000FF0UL) == 0x220UL) {
+ return 2UL; // Double + Single precision FPU
+ } else if ((mvfr0 & 0x00000FF0UL) == 0x020UL) {
+ return 1UL; // Single precision FPU
+ } else {
+ return 0UL; // No FPU
+ }
+}
+
+
+/*@} end of CMSIS_Core_FpuFunctions */
+
+
+
+/* ########################## Cache functions #################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_CacheFunctions Cache Functions
+ \brief Functions that configure Instruction and Data cache.
+ @{
+ */
+
+/* Cache Size ID Register Macros */
+#define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos)
+#define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos )
+#define CCSIDR_LSSHIFT(x) (((x) & SCB_CCSIDR_LINESIZE_Msk ) /*>> SCB_CCSIDR_LINESIZE_Pos*/ )
+
+
+/** \brief Enable I-Cache
+
+ The function turns on I-Cache
+ */
+__STATIC_INLINE void SCB_EnableICache (void)
+{
+ #if (__ICACHE_PRESENT == 1)
+ __DSB();
+ __ISB();
+ SCB->ICIALLU = 0UL; // invalidate I-Cache
+ SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; // enable I-Cache
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Disable I-Cache
+
+ The function turns off I-Cache
+ */
+__STATIC_INLINE void SCB_DisableICache (void)
+{
+ #if (__ICACHE_PRESENT == 1)
+ __DSB();
+ __ISB();
+ SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; // disable I-Cache
+ SCB->ICIALLU = 0UL; // invalidate I-Cache
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Invalidate I-Cache
+
+ The function invalidates I-Cache
+ */
+__STATIC_INLINE void SCB_InvalidateICache (void)
+{
+ #if (__ICACHE_PRESENT == 1)
+ __DSB();
+ __ISB();
+ SCB->ICIALLU = 0UL;
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Enable D-Cache
+
+ The function turns on D-Cache
+ */
+__STATIC_INLINE void SCB_EnableDCache (void)
+{
+ #if (__DCACHE_PRESENT == 1)
+ uint32_t ccsidr, sshift, wshift, sw;
+ uint32_t sets, ways;
+
+ SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache
+ ccsidr = SCB->CCSIDR;
+ sets = (uint32_t)(CCSIDR_SETS(ccsidr));
+ sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL);
+ ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
+ wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL);
+
+ __DSB();
+
+ do { // invalidate D-Cache
+ uint32_t tmpways = ways;
+ do {
+ sw = ((tmpways << wshift) | (sets << sshift));
+ SCB->DCISW = sw;
+ } while(tmpways--);
+ } while(sets--);
+ __DSB();
+
+ SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; // enable D-Cache
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Disable D-Cache
+
+ The function turns off D-Cache
+ */
+__STATIC_INLINE void SCB_DisableDCache (void)
+{
+ #if (__DCACHE_PRESENT == 1)
+ uint32_t ccsidr, sshift, wshift, sw;
+ uint32_t sets, ways;
+
+ SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache
+ ccsidr = SCB->CCSIDR;
+ sets = (uint32_t)(CCSIDR_SETS(ccsidr));
+ sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL);
+ ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
+ wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL);
+
+ __DSB();
+
+ SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; // disable D-Cache
+
+ do { // clean & invalidate D-Cache
+ uint32_t tmpways = ways;
+ do {
+ sw = ((tmpways << wshift) | (sets << sshift));
+ SCB->DCCISW = sw;
+ } while(tmpways--);
+ } while(sets--);
+
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Invalidate D-Cache
+
+ The function invalidates D-Cache
+ */
+__STATIC_INLINE void SCB_InvalidateDCache (void)
+{
+ #if (__DCACHE_PRESENT == 1)
+ uint32_t ccsidr, sshift, wshift, sw;
+ uint32_t sets, ways;
+
+ SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache
+ ccsidr = SCB->CCSIDR;
+ sets = (uint32_t)(CCSIDR_SETS(ccsidr));
+ sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL);
+ ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
+ wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL);
+
+ __DSB();
+
+ do { // invalidate D-Cache
+ uint32_t tmpways = ways;
+ do {
+ sw = ((tmpways << wshift) | (sets << sshift));
+ SCB->DCISW = sw;
+ } while(tmpways--);
+ } while(sets--);
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Clean D-Cache
+
+ The function cleans D-Cache
+ */
+__STATIC_INLINE void SCB_CleanDCache (void)
+{
+ #if (__DCACHE_PRESENT == 1)
+ uint32_t ccsidr, sshift, wshift, sw;
+ uint32_t sets, ways;
+
+ SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache
+ ccsidr = SCB->CCSIDR;
+ sets = (uint32_t)(CCSIDR_SETS(ccsidr));
+ sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL);
+ ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
+ wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL);
+
+ __DSB();
+
+ do { // clean D-Cache
+ uint32_t tmpways = ways;
+ do {
+ sw = ((tmpways << wshift) | (sets << sshift));
+ SCB->DCCSW = sw;
+ } while(tmpways--);
+ } while(sets--);
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/** \brief Clean & Invalidate D-Cache
+
+ The function cleans and Invalidates D-Cache
+ */
+__STATIC_INLINE void SCB_CleanInvalidateDCache (void)
+{
+ #if (__DCACHE_PRESENT == 1)
+ uint32_t ccsidr, sshift, wshift, sw;
+ uint32_t sets, ways;
+
+ SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache
+ ccsidr = SCB->CCSIDR;
+ sets = (uint32_t)(CCSIDR_SETS(ccsidr));
+ sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL);
+ ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
+ wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL);
+
+ __DSB();
+
+ do { // clean & invalidate D-Cache
+ uint32_t tmpways = ways;
+ do {
+ sw = ((tmpways << wshift) | (sets << sshift));
+ SCB->DCCISW = sw;
+ } while(tmpways--);
+ } while(sets--);
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/**
+ \fn void SCB_InvalidateDCache_by_Addr(volatile uint32_t *addr, int32_t dsize)
+ \brief D-Cache Invalidate by address
+ \param[in] addr address (aligned to 32-byte boundary)
+ \param[in] dsize size of memory block (in number of bytes)
+*/
+__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize)
+{
+ #if (__DCACHE_PRESENT == 1)
+ int32_t op_size = dsize;
+ uint32_t op_addr = (uint32_t)addr;
+ uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes)
+
+ __DSB();
+
+ while (op_size > 0) {
+ SCB->DCIMVAC = op_addr;
+ op_addr += linesize;
+ op_size -= (int32_t)linesize;
+ }
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/**
+ \fn void SCB_CleanDCache_by_Addr(volatile uint32_t *addr, int32_t dsize)
+ \brief D-Cache Clean by address
+ \param[in] addr address (aligned to 32-byte boundary)
+ \param[in] dsize size of memory block (in number of bytes)
+*/
+__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize)
+{
+ #if (__DCACHE_PRESENT == 1)
+ int32_t op_size = dsize;
+ uint32_t op_addr = (uint32_t) addr;
+ uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes)
+
+ __DSB();
+
+ while (op_size > 0) {
+ SCB->DCCMVAC = op_addr;
+ op_addr += linesize;
+ op_size -= (int32_t)linesize;
+ }
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/**
+ \fn void SCB_CleanInvalidateDCache_by_Addr(volatile uint32_t *addr, int32_t dsize)
+ \brief D-Cache Clean and Invalidate by address
+ \param[in] addr address (aligned to 32-byte boundary)
+ \param[in] dsize size of memory block (in number of bytes)
+*/
+__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize)
+{
+ #if (__DCACHE_PRESENT == 1)
+ int32_t op_size = dsize;
+ uint32_t op_addr = (uint32_t) addr;
+ uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes)
+
+ __DSB();
+
+ while (op_size > 0) {
+ SCB->DCCIMVAC = op_addr;
+ op_addr += linesize;
+ op_size -= (int32_t)linesize;
+ }
+
+ __DSB();
+ __ISB();
+ #endif
+}
+
+
+/*@} end of CMSIS_Core_CacheFunctions */
+
+
+
+/* ################################## SysTick function ############################################ */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
+ \brief Functions that configure the System.
+ @{
+ */
+
+#if (__Vendor_SysTickConfig == 0)
+
+/** \brief System Tick Configuration
+
+ The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
+ Counter is in free running mode to generate periodic interrupts.
+
+ \param [in] ticks Number of ticks between two interrupts.
+
+ \return 0 Function succeeded.
+ \return 1 Function failed.
+
+ \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
+ function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
+ must contain a vendor-specific implementation of this function.
+
+ */
+__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */
+
+ SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
+ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0UL); /* Function successful */
+}
+
+#endif
+
+/*@} end of CMSIS_Core_SysTickFunctions */
+
+
+
+/* ##################################### Debug In/Output function ########################################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_core_DebugFunctions ITM Functions
+ \brief Functions that access the ITM debug interface.
+ @{
+ */
+
+extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */
+#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
+
+
+/** \brief ITM Send Character
+
+ The function transmits a character via the ITM channel 0, and
+ \li Just returns when no debugger is connected that has booked the output.
+ \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.
+
+ \param [in] ch Character to transmit.
+
+ \returns Character to transmit.
+ */
+__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
+{
+ if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
+ ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */
+ {
+ while (ITM->PORT[0].u32 == 0UL) { __NOP(); }
+ ITM->PORT[0].u8 = (uint8_t)ch;
+ }
+ return (ch);
+}
+
+
+/** \brief ITM Receive Character
+
+ The function inputs a character via the external variable \ref ITM_RxBuffer.
+
+ \return Received character.
+ \return -1 No character pending.
+ */
+__STATIC_INLINE int32_t ITM_ReceiveChar (void) {
+ int32_t ch = -1; /* no character available */
+
+ if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
+ ch = ITM_RxBuffer;
+ ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
+ }
+
+ return (ch);
+}
+
+
+/** \brief ITM Check Character
+
+ The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.
+
+ \return 0 No character available.
+ \return 1 Character available.
+ */
+__STATIC_INLINE int32_t ITM_CheckChar (void) {
+
+ if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
+ return (0); /* no character available */
+ } else {
+ return (1); /* character available */
+ }
+}
+
+/*@} end of CMSIS_core_DebugFunctions */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CORE_CM7_H_DEPENDANT */
+
+#endif /* __CMSIS_GENERIC */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cmFunc.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,636 @@
+/**************************************************************************//**
+ * @file core_cmFunc.h
+ * @brief CMSIS Cortex-M Core Function Access Header File
+ * @version V3.20
+ * @date 25. February 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#ifndef __CORE_CMFUNC_H
+#define __CORE_CMFUNC_H
+
+
+/* ########################### Core Function Access ########################### */
+/** \ingroup CMSIS_Core_FunctionInterface
+ \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
+ @{
+ */
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+#if (__ARMCC_VERSION < 400677)
+ #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
+#endif
+
+/* intrinsic void __enable_irq(); */
+/* intrinsic void __disable_irq(); */
+
+/** \brief Get Control Register
+
+ This function returns the content of the Control Register.
+
+ \return Control Register value
+ */
+__STATIC_INLINE uint32_t __get_CONTROL(void)
+{
+ register uint32_t __regControl __ASM("control");
+ return(__regControl);
+}
+
+
+/** \brief Set Control Register
+
+ This function writes the given value to the Control Register.
+
+ \param [in] control Control Register value to set
+ */
+__STATIC_INLINE void __set_CONTROL(uint32_t control)
+{
+ register uint32_t __regControl __ASM("control");
+ __regControl = control;
+}
+
+
+/** \brief Get IPSR Register
+
+ This function returns the content of the IPSR Register.
+
+ \return IPSR Register value
+ */
+__STATIC_INLINE uint32_t __get_IPSR(void)
+{
+ register uint32_t __regIPSR __ASM("ipsr");
+ return(__regIPSR);
+}
+
+
+/** \brief Get APSR Register
+
+ This function returns the content of the APSR Register.
+
+ \return APSR Register value
+ */
+__STATIC_INLINE uint32_t __get_APSR(void)
+{
+ register uint32_t __regAPSR __ASM("apsr");
+ return(__regAPSR);
+}
+
+
+/** \brief Get xPSR Register
+
+ This function returns the content of the xPSR Register.
+
+ \return xPSR Register value
+ */
+__STATIC_INLINE uint32_t __get_xPSR(void)
+{
+ register uint32_t __regXPSR __ASM("xpsr");
+ return(__regXPSR);
+}
+
+
+/** \brief Get Process Stack Pointer
+
+ This function returns the current value of the Process Stack Pointer (PSP).
+
+ \return PSP Register value
+ */
+__STATIC_INLINE uint32_t __get_PSP(void)
+{
+ register uint32_t __regProcessStackPointer __ASM("psp");
+ return(__regProcessStackPointer);
+}
+
+
+/** \brief Set Process Stack Pointer
+
+ This function assigns the given value to the Process Stack Pointer (PSP).
+
+ \param [in] topOfProcStack Process Stack Pointer value to set
+ */
+__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
+{
+ register uint32_t __regProcessStackPointer __ASM("psp");
+ __regProcessStackPointer = topOfProcStack;
+}
+
+
+/** \brief Get Main Stack Pointer
+
+ This function returns the current value of the Main Stack Pointer (MSP).
+
+ \return MSP Register value
+ */
+__STATIC_INLINE uint32_t __get_MSP(void)
+{
+ register uint32_t __regMainStackPointer __ASM("msp");
+ return(__regMainStackPointer);
+}
+
+
+/** \brief Set Main Stack Pointer
+
+ This function assigns the given value to the Main Stack Pointer (MSP).
+
+ \param [in] topOfMainStack Main Stack Pointer value to set
+ */
+__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
+{
+ register uint32_t __regMainStackPointer __ASM("msp");
+ __regMainStackPointer = topOfMainStack;
+}
+
+
+/** \brief Get Priority Mask
+
+ This function returns the current state of the priority mask bit from the Priority Mask Register.
+
+ \return Priority Mask value
+ */
+__STATIC_INLINE uint32_t __get_PRIMASK(void)
+{
+ register uint32_t __regPriMask __ASM("primask");
+ return(__regPriMask);
+}
+
+
+/** \brief Set Priority Mask
+
+ This function assigns the given value to the Priority Mask Register.
+
+ \param [in] priMask Priority Mask
+ */
+__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
+{
+ register uint32_t __regPriMask __ASM("primask");
+ __regPriMask = (priMask);
+}
+
+
+#if (__CORTEX_M >= 0x03)
+
+/** \brief Enable FIQ
+
+ This function enables FIQ interrupts by clearing the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __enable_fault_irq __enable_fiq
+
+
+/** \brief Disable FIQ
+
+ This function disables FIQ interrupts by setting the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+#define __disable_fault_irq __disable_fiq
+
+
+/** \brief Get Base Priority
+
+ This function returns the current value of the Base Priority register.
+
+ \return Base Priority register value
+ */
+__STATIC_INLINE uint32_t __get_BASEPRI(void)
+{
+ register uint32_t __regBasePri __ASM("basepri");
+ return(__regBasePri);
+}
+
+
+/** \brief Set Base Priority
+
+ This function assigns the given value to the Base Priority register.
+
+ \param [in] basePri Base Priority value to set
+ */
+__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
+{
+ register uint32_t __regBasePri __ASM("basepri");
+ __regBasePri = (basePri & 0xff);
+}
+
+
+/** \brief Get Fault Mask
+
+ This function returns the current value of the Fault Mask register.
+
+ \return Fault Mask register value
+ */
+__STATIC_INLINE uint32_t __get_FAULTMASK(void)
+{
+ register uint32_t __regFaultMask __ASM("faultmask");
+ return(__regFaultMask);
+}
+
+
+/** \brief Set Fault Mask
+
+ This function assigns the given value to the Fault Mask register.
+
+ \param [in] faultMask Fault Mask value to set
+ */
+__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
+{
+ register uint32_t __regFaultMask __ASM("faultmask");
+ __regFaultMask = (faultMask & (uint32_t)1);
+}
+
+#endif /* (__CORTEX_M >= 0x03) */
+
+
+#if (__CORTEX_M == 0x04)
+
+/** \brief Get FPSCR
+
+ This function returns the current value of the Floating Point Status/Control register.
+
+ \return Floating Point Status/Control register value
+ */
+__STATIC_INLINE uint32_t __get_FPSCR(void)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ register uint32_t __regfpscr __ASM("fpscr");
+ return(__regfpscr);
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPSCR
+
+ This function assigns the given value to the Floating Point Status/Control register.
+
+ \param [in] fpscr Floating Point Status/Control value to set
+ */
+__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ register uint32_t __regfpscr __ASM("fpscr");
+ __regfpscr = (fpscr);
+#endif
+}
+
+#endif /* (__CORTEX_M == 0x04) */
+
+
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+
+#include <cmsis_iar.h>
+
+
+#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
+/* TI CCS specific functions */
+
+#include <cmsis_ccs.h>
+
+
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+/** \brief Enable IRQ Interrupts
+
+ This function enables IRQ interrupts by clearing the I-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void)
+{
+ __ASM volatile ("cpsie i" : : : "memory");
+}
+
+
+/** \brief Disable IRQ Interrupts
+
+ This function disables IRQ interrupts by setting the I-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void)
+{
+ __ASM volatile ("cpsid i" : : : "memory");
+}
+
+
+/** \brief Get Control Register
+
+ This function returns the content of the Control Register.
+
+ \return Control Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, control" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Control Register
+
+ This function writes the given value to the Control Register.
+
+ \param [in] control Control Register value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control)
+{
+ __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
+}
+
+
+/** \brief Get IPSR Register
+
+ This function returns the content of the IPSR Register.
+
+ \return IPSR Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Get APSR Register
+
+ This function returns the content of the APSR Register.
+
+ \return APSR Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, apsr" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Get xPSR Register
+
+ This function returns the content of the xPSR Register.
+
+ \return xPSR Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, xpsr" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Get Process Stack Pointer
+
+ This function returns the current value of the Process Stack Pointer (PSP).
+
+ \return PSP Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
+{
+ register uint32_t result;
+
+ __ASM volatile ("MRS %0, psp\n" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Process Stack Pointer
+
+ This function assigns the given value to the Process Stack Pointer (PSP).
+
+ \param [in] topOfProcStack Process Stack Pointer value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
+{
+ __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp");
+}
+
+
+/** \brief Get Main Stack Pointer
+
+ This function returns the current value of the Main Stack Pointer (MSP).
+
+ \return MSP Register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
+{
+ register uint32_t result;
+
+ __ASM volatile ("MRS %0, msp\n" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Main Stack Pointer
+
+ This function assigns the given value to the Main Stack Pointer (MSP).
+
+ \param [in] topOfMainStack Main Stack Pointer value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
+{
+ __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
+}
+
+
+/** \brief Get Priority Mask
+
+ This function returns the current state of the priority mask bit from the Priority Mask Register.
+
+ \return Priority Mask value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, primask" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Priority Mask
+
+ This function assigns the given value to the Priority Mask Register.
+
+ \param [in] priMask Priority Mask
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
+{
+ __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
+}
+
+
+#if (__CORTEX_M >= 0x03)
+
+/** \brief Enable FIQ
+
+ This function enables FIQ interrupts by clearing the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void)
+{
+ __ASM volatile ("cpsie f" : : : "memory");
+}
+
+
+/** \brief Disable FIQ
+
+ This function disables FIQ interrupts by setting the F-bit in the CPSR.
+ Can only be executed in Privileged modes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void)
+{
+ __ASM volatile ("cpsid f" : : : "memory");
+}
+
+
+/** \brief Get Base Priority
+
+ This function returns the current value of the Base Priority register.
+
+ \return Base Priority register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, basepri_max" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Base Priority
+
+ This function assigns the given value to the Base Priority register.
+
+ \param [in] basePri Base Priority value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value)
+{
+ __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory");
+}
+
+
+/** \brief Get Fault Mask
+
+ This function returns the current value of the Fault Mask register.
+
+ \return Fault Mask register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void)
+{
+ uint32_t result;
+
+ __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
+ return(result);
+}
+
+
+/** \brief Set Fault Mask
+
+ This function assigns the given value to the Fault Mask register.
+
+ \param [in] faultMask Fault Mask value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
+{
+ __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
+}
+
+#endif /* (__CORTEX_M >= 0x03) */
+
+
+#if (__CORTEX_M == 0x04)
+
+/** \brief Get FPSCR
+
+ This function returns the current value of the Floating Point Status/Control register.
+
+ \return Floating Point Status/Control register value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ uint32_t result;
+
+ /* Empty asm statement works as a scheduling barrier */
+ __ASM volatile ("");
+ __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
+ __ASM volatile ("");
+ return(result);
+#else
+ return(0);
+#endif
+}
+
+
+/** \brief Set FPSCR
+
+ This function assigns the given value to the Floating Point Status/Control register.
+
+ \param [in] fpscr Floating Point Status/Control value to set
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
+{
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
+ /* Empty asm statement works as a scheduling barrier */
+ __ASM volatile ("");
+ __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc");
+ __ASM volatile ("");
+#endif
+}
+
+#endif /* (__CORTEX_M == 0x04) */
+
+
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
+/* TASKING carm specific functions */
+
+/*
+ * The CMSIS functions have been implemented as intrinsics in the compiler.
+ * Please use "carm -?i" to get an up to date list of all instrinsics,
+ * Including the CMSIS ones.
+ */
+
+#endif
+
+/*@} end of CMSIS_Core_RegAccFunctions */
+
+
+#endif /* __CORE_CMFUNC_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cmInstr.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,688 @@
+/**************************************************************************//**
+ * @file core_cmInstr.h
+ * @brief CMSIS Cortex-M Core Instruction Access Header File
+ * @version V3.20
+ * @date 05. March 2013
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2013 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#ifndef __CORE_CMINSTR_H
+#define __CORE_CMINSTR_H
+
+
+/* ########################## Core Instruction Access ######################### */
+/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
+ Access to dedicated instructions
+ @{
+*/
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+#if (__ARMCC_VERSION < 400677)
+ #error "Please use ARM Compiler Toolchain V4.0.677 or later!"
+#endif
+
+
+/** \brief No Operation
+
+ No Operation does nothing. This instruction can be used for code alignment purposes.
+ */
+#define __NOP __nop
+
+
+/** \brief Wait For Interrupt
+
+ Wait For Interrupt is a hint instruction that suspends execution
+ until one of a number of events occurs.
+ */
+#define __WFI __wfi
+
+
+/** \brief Wait For Event
+
+ Wait For Event is a hint instruction that permits the processor to enter
+ a low-power state until one of a number of events occurs.
+ */
+#define __WFE __wfe
+
+
+/** \brief Send Event
+
+ Send Event is a hint instruction. It causes an event to be signaled to the CPU.
+ */
+#define __SEV __sev
+
+
+/** \brief Instruction Synchronization Barrier
+
+ Instruction Synchronization Barrier flushes the pipeline in the processor,
+ so that all instructions following the ISB are fetched from cache or
+ memory, after the instruction has been completed.
+ */
+#define __ISB() __isb(0xF)
+
+
+/** \brief Data Synchronization Barrier
+
+ This function acts as a special kind of Data Memory Barrier.
+ It completes when all explicit memory accesses before this instruction complete.
+ */
+#define __DSB() __dsb(0xF)
+
+
+/** \brief Data Memory Barrier
+
+ This function ensures the apparent order of the explicit memory operations before
+ and after the instruction, without ensuring their completion.
+ */
+#define __DMB() __dmb(0xF)
+
+
+/** \brief Reverse byte order (32 bit)
+
+ This function reverses the byte order in integer value.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+#define __REV __rev
+
+
+/** \brief Reverse byte order (16 bit)
+
+ This function reverses the byte order in two unsigned short values.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+#ifndef __NO_EMBEDDED_ASM
+__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
+{
+ rev16 r0, r0
+ bx lr
+}
+#endif
+
+/** \brief Reverse byte order in signed short value
+
+ This function reverses the byte order in a signed short value with sign extension to integer.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+#ifndef __NO_EMBEDDED_ASM
+__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
+{
+ revsh r0, r0
+ bx lr
+}
+#endif
+
+
+/** \brief Rotate Right in unsigned value (32 bit)
+
+ This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
+
+ \param [in] value Value to rotate
+ \param [in] value Number of Bits to rotate
+ \return Rotated value
+ */
+#define __ROR __ror
+
+
+/** \brief Breakpoint
+
+ This function causes the processor to enter Debug state.
+ Debug tools can use this to investigate system state when the instruction at a particular address is reached.
+
+ \param [in] value is ignored by the processor.
+ If required, a debugger can use it to store additional information about the breakpoint.
+ */
+#define __BKPT(value) __breakpoint(value)
+
+
+#if (__CORTEX_M >= 0x03)
+
+/** \brief Reverse bit order of value
+
+ This function reverses the bit order of the given value.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+#define __RBIT __rbit
+
+
+/** \brief LDR Exclusive (8 bit)
+
+ This function performs a exclusive LDR command for 8 bit value.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint8_t at (*ptr)
+ */
+#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
+
+
+/** \brief LDR Exclusive (16 bit)
+
+ This function performs a exclusive LDR command for 16 bit values.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint16_t at (*ptr)
+ */
+#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
+
+
+/** \brief LDR Exclusive (32 bit)
+
+ This function performs a exclusive LDR command for 32 bit values.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint32_t at (*ptr)
+ */
+#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
+
+
+/** \brief STR Exclusive (8 bit)
+
+ This function performs a exclusive STR command for 8 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+#define __STREXB(value, ptr) __strex(value, ptr)
+
+
+/** \brief STR Exclusive (16 bit)
+
+ This function performs a exclusive STR command for 16 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+#define __STREXH(value, ptr) __strex(value, ptr)
+
+
+/** \brief STR Exclusive (32 bit)
+
+ This function performs a exclusive STR command for 32 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+#define __STREXW(value, ptr) __strex(value, ptr)
+
+
+/** \brief Remove the exclusive lock
+
+ This function removes the exclusive lock which is created by LDREX.
+
+ */
+#define __CLREX __clrex
+
+
+/** \brief Signed Saturate
+
+ This function saturates a signed value.
+
+ \param [in] value Value to be saturated
+ \param [in] sat Bit position to saturate to (1..32)
+ \return Saturated value
+ */
+#define __SSAT __ssat
+
+
+/** \brief Unsigned Saturate
+
+ This function saturates an unsigned value.
+
+ \param [in] value Value to be saturated
+ \param [in] sat Bit position to saturate to (0..31)
+ \return Saturated value
+ */
+#define __USAT __usat
+
+
+/** \brief Count leading zeros
+
+ This function counts the number of leading zeros of a data value.
+
+ \param [in] value Value to count the leading zeros
+ \return number of leading zeros in value
+ */
+#define __CLZ __clz
+
+#endif /* (__CORTEX_M >= 0x03) */
+
+
+
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+
+#include <cmsis_iar.h>
+
+
+#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
+/* TI CCS specific functions */
+
+#include <cmsis_ccs.h>
+
+
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+/* Define macros for porting to both thumb1 and thumb2.
+ * For thumb1, use low register (r0-r7), specified by constrant "l"
+ * Otherwise, use general registers, specified by constrant "r" */
+#if defined (__thumb__) && !defined (__thumb2__)
+#define __CMSIS_GCC_OUT_REG(r) "=l" (r)
+#define __CMSIS_GCC_USE_REG(r) "l" (r)
+#else
+#define __CMSIS_GCC_OUT_REG(r) "=r" (r)
+#define __CMSIS_GCC_USE_REG(r) "r" (r)
+#endif
+
+/** \brief No Operation
+
+ No Operation does nothing. This instruction can be used for code alignment purposes.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void)
+{
+ __ASM volatile ("nop");
+}
+
+
+/** \brief Wait For Interrupt
+
+ Wait For Interrupt is a hint instruction that suspends execution
+ until one of a number of events occurs.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void)
+{
+ __ASM volatile ("wfi");
+}
+
+
+/** \brief Wait For Event
+
+ Wait For Event is a hint instruction that permits the processor to enter
+ a low-power state until one of a number of events occurs.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void)
+{
+ __ASM volatile ("wfe");
+}
+
+
+/** \brief Send Event
+
+ Send Event is a hint instruction. It causes an event to be signaled to the CPU.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void)
+{
+ __ASM volatile ("sev");
+}
+
+
+/** \brief Instruction Synchronization Barrier
+
+ Instruction Synchronization Barrier flushes the pipeline in the processor,
+ so that all instructions following the ISB are fetched from cache or
+ memory, after the instruction has been completed.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void)
+{
+ __ASM volatile ("isb");
+}
+
+
+/** \brief Data Synchronization Barrier
+
+ This function acts as a special kind of Data Memory Barrier.
+ It completes when all explicit memory accesses before this instruction complete.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
+{
+ __ASM volatile ("dsb");
+}
+
+
+/** \brief Data Memory Barrier
+
+ This function ensures the apparent order of the explicit memory operations before
+ and after the instruction, without ensuring their completion.
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void)
+{
+ __ASM volatile ("dmb");
+}
+
+
+/** \brief Reverse byte order (32 bit)
+
+ This function reverses the byte order in integer value.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value)
+{
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+ return __builtin_bswap32(value);
+#else
+ uint32_t result;
+
+ __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
+ return(result);
+#endif
+}
+
+
+/** \brief Reverse byte order (16 bit)
+
+ This function reverses the byte order in two unsigned short values.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value)
+{
+ uint32_t result;
+
+ __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
+ return(result);
+}
+
+
+/** \brief Reverse byte order in signed short value
+
+ This function reverses the byte order in a signed short value with sign extension to integer.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value)
+{
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+ return (short)__builtin_bswap16(value);
+#else
+ uint32_t result;
+
+ __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
+ return(result);
+#endif
+}
+
+
+/** \brief Rotate Right in unsigned value (32 bit)
+
+ This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
+
+ \param [in] value Value to rotate
+ \param [in] value Number of Bits to rotate
+ \return Rotated value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
+{
+ return (op1 >> op2) | (op1 << (32 - op2));
+}
+
+
+/** \brief Breakpoint
+
+ This function causes the processor to enter Debug state.
+ Debug tools can use this to investigate system state when the instruction at a particular address is reached.
+
+ \param [in] value is ignored by the processor.
+ If required, a debugger can use it to store additional information about the breakpoint.
+ */
+#define __BKPT(value) __ASM volatile ("bkpt "#value)
+
+
+#if (__CORTEX_M >= 0x03)
+
+/** \brief Reverse bit order of value
+
+ This function reverses the bit order of the given value.
+
+ \param [in] value Value to reverse
+ \return Reversed value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
+{
+ uint32_t result;
+
+ __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+
+/** \brief LDR Exclusive (8 bit)
+
+ This function performs a exclusive LDR command for 8 bit value.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint8_t at (*ptr)
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr)
+{
+ uint32_t result;
+
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+ __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) );
+#else
+ /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
+ accepted by assembler. So has to use following less efficient pattern.
+ */
+ __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
+#endif
+ return(result);
+}
+
+
+/** \brief LDR Exclusive (16 bit)
+
+ This function performs a exclusive LDR command for 16 bit values.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint16_t at (*ptr)
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr)
+{
+ uint32_t result;
+
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+ __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) );
+#else
+ /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
+ accepted by assembler. So has to use following less efficient pattern.
+ */
+ __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
+#endif
+ return(result);
+}
+
+
+/** \brief LDR Exclusive (32 bit)
+
+ This function performs a exclusive LDR command for 32 bit values.
+
+ \param [in] ptr Pointer to data
+ \return value of type uint32_t at (*ptr)
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr)
+{
+ uint32_t result;
+
+ __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) );
+ return(result);
+}
+
+
+/** \brief STR Exclusive (8 bit)
+
+ This function performs a exclusive STR command for 8 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
+{
+ uint32_t result;
+
+ __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
+ return(result);
+}
+
+
+/** \brief STR Exclusive (16 bit)
+
+ This function performs a exclusive STR command for 16 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
+{
+ uint32_t result;
+
+ __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
+ return(result);
+}
+
+
+/** \brief STR Exclusive (32 bit)
+
+ This function performs a exclusive STR command for 32 bit values.
+
+ \param [in] value Value to store
+ \param [in] ptr Pointer to location
+ \return 0 Function succeeded
+ \return 1 Function failed
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
+{
+ uint32_t result;
+
+ __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
+ return(result);
+}
+
+
+/** \brief Remove the exclusive lock
+
+ This function removes the exclusive lock which is created by LDREX.
+
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void)
+{
+ __ASM volatile ("clrex" ::: "memory");
+}
+
+
+/** \brief Signed Saturate
+
+ This function saturates a signed value.
+
+ \param [in] value Value to be saturated
+ \param [in] sat Bit position to saturate to (1..32)
+ \return Saturated value
+ */
+#define __SSAT(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+
+/** \brief Unsigned Saturate
+
+ This function saturates an unsigned value.
+
+ \param [in] value Value to be saturated
+ \param [in] sat Bit position to saturate to (0..31)
+ \return Saturated value
+ */
+#define __USAT(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+
+/** \brief Count leading zeros
+
+ This function counts the number of leading zeros of a data value.
+
+ \param [in] value Value to count the leading zeros
+ \return number of leading zeros in value
+ */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value)
+{
+ uint32_t result;
+
+ __ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+#endif /* (__CORTEX_M >= 0x03) */
+
+
+
+
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
+/* TASKING carm specific functions */
+
+/*
+ * The CMSIS functions have been implemented as intrinsics in the compiler.
+ * Please use "carm -?i" to get an up to date list of all intrinsics,
+ * Including the CMSIS ones.
+ */
+
+#endif
+
+/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
+
+#endif /* __CORE_CMINSTR_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/cmsis/core_cmSimd.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,697 @@
+/**************************************************************************//**
+ * @file core_cmSimd.h
+ * @brief CMSIS Cortex-M SIMD Header File
+ * @version V4.10
+ * @date 18. March 2015
+ *
+ * @note
+ *
+ ******************************************************************************/
+/* Copyright (c) 2009 - 2014 ARM LIMITED
+
+ All rights reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ - Neither the name of ARM nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+ *
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ ---------------------------------------------------------------------------*/
+
+
+#if defined ( __ICCARM__ )
+ #pragma system_include /* treat file as system include file for MISRA check */
+#endif
+
+#ifndef __CORE_CMSIMD_H
+#define __CORE_CMSIMD_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ ******************************************************************************/
+
+
+/* ################### Compiler specific Intrinsics ########################### */
+/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
+ Access to dedicated SIMD instructions
+ @{
+*/
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+#define __SADD8 __sadd8
+#define __QADD8 __qadd8
+#define __SHADD8 __shadd8
+#define __UADD8 __uadd8
+#define __UQADD8 __uqadd8
+#define __UHADD8 __uhadd8
+#define __SSUB8 __ssub8
+#define __QSUB8 __qsub8
+#define __SHSUB8 __shsub8
+#define __USUB8 __usub8
+#define __UQSUB8 __uqsub8
+#define __UHSUB8 __uhsub8
+#define __SADD16 __sadd16
+#define __QADD16 __qadd16
+#define __SHADD16 __shadd16
+#define __UADD16 __uadd16
+#define __UQADD16 __uqadd16
+#define __UHADD16 __uhadd16
+#define __SSUB16 __ssub16
+#define __QSUB16 __qsub16
+#define __SHSUB16 __shsub16
+#define __USUB16 __usub16
+#define __UQSUB16 __uqsub16
+#define __UHSUB16 __uhsub16
+#define __SASX __sasx
+#define __QASX __qasx
+#define __SHASX __shasx
+#define __UASX __uasx
+#define __UQASX __uqasx
+#define __UHASX __uhasx
+#define __SSAX __ssax
+#define __QSAX __qsax
+#define __SHSAX __shsax
+#define __USAX __usax
+#define __UQSAX __uqsax
+#define __UHSAX __uhsax
+#define __USAD8 __usad8
+#define __USADA8 __usada8
+#define __SSAT16 __ssat16
+#define __USAT16 __usat16
+#define __UXTB16 __uxtb16
+#define __UXTAB16 __uxtab16
+#define __SXTB16 __sxtb16
+#define __SXTAB16 __sxtab16
+#define __SMUAD __smuad
+#define __SMUADX __smuadx
+#define __SMLAD __smlad
+#define __SMLADX __smladx
+#define __SMLALD __smlald
+#define __SMLALDX __smlaldx
+#define __SMUSD __smusd
+#define __SMUSDX __smusdx
+#define __SMLSD __smlsd
+#define __SMLSDX __smlsdx
+#define __SMLSLD __smlsld
+#define __SMLSLDX __smlsldx
+#define __SEL __sel
+#define __QADD __qadd
+#define __QSUB __qsub
+
+#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
+ ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
+
+#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
+ ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
+
+#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
+ ((int64_t)(ARG3) << 32) ) >> 32))
+
+
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+#define __SSAT16(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+#define __USAT16(ARG1,ARG2) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1); \
+ __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
+ __RES; \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
+{
+ uint32_t result;
+
+ __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
+{
+ uint32_t result;
+
+ __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc)
+{
+ union llreg_u{
+ uint32_t w32[2];
+ uint64_t w64;
+ } llr;
+ llr.w64 = acc;
+
+#ifndef __ARMEB__ // Little endian
+ __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
+#else // Big endian
+ __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
+#endif
+
+ return(llr.w64);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc)
+{
+ union llreg_u{
+ uint32_t w32[2];
+ uint64_t w64;
+ } llr;
+ llr.w64 = acc;
+
+#ifndef __ARMEB__ // Little endian
+ __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
+#else // Big endian
+ __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
+#endif
+
+ return(llr.w64);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
+{
+ uint32_t result;
+
+ __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc)
+{
+ union llreg_u{
+ uint32_t w32[2];
+ uint64_t w64;
+ } llr;
+ llr.w64 = acc;
+
+#ifndef __ARMEB__ // Little endian
+ __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
+#else // Big endian
+ __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
+#endif
+
+ return(llr.w64);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc)
+{
+ union llreg_u{
+ uint32_t w32[2];
+ uint64_t w64;
+ } llr;
+ llr.w64 = acc;
+
+#ifndef __ARMEB__ // Little endian
+ __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
+#else // Big endian
+ __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
+#endif
+
+ return(llr.w64);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)
+{
+ uint32_t result;
+
+ __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
+ return(result);
+}
+
+#define __PKHBT(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
+ __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
+ __RES; \
+ })
+
+#define __PKHTB(ARG1,ARG2,ARG3) \
+({ \
+ uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
+ if (ARG3 == 0) \
+ __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \
+ else \
+ __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
+ __RES; \
+ })
+
+__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
+{
+ int32_t result;
+
+ __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
+ return(result);
+}
+
+
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+#include <cmsis_iar.h>
+
+
+#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
+/* TI CCS specific functions */
+#include <cmsis_ccs.h>
+
+
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
+/* TASKING carm specific functions */
+/* not yet supported */
+
+
+#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/
+/* Cosmic specific functions */
+#include <cmsis_csm.h>
+
+#endif
+
+/*@} end of group CMSIS_SIMD_intrinsics */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CORE_CMSIMD_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/PeripheralNames.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,73 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PERIPHERALNAMES_H
+#define MBED_PERIPHERALNAMES_H
+
+#include "cmsis.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ UART_0 = (int)LPC_USART0_BASE,
+ UART_1 = (int)LPC_USART1_BASE,
+ UART_2 = (int)LPC_USART2_BASE,
+ UART_3 = (int)LPC_USART3_BASE,
+ UART_4 = (int)LPC_USART4_BASE,
+} UARTName;
+
+typedef enum {
+ ADC_0 = 0,
+ ADC_1,
+ ADC_2,
+ ADC_3,
+ ADC_4,
+ ADC_5,
+ ADC_6,
+ ADC_7,
+ ADC_8,
+ ADC_9,
+ ADC_10,
+ ADC_11,
+} ADCName;
+
+typedef enum {
+ SPI_0 = (int)LPC_SSP0_BASE,
+ SPI_1 = (int)LPC_SSP1_BASE
+} SPIName;
+
+typedef enum {
+ I2C_0 = (int)LPC_I2C0_BASE,
+ I2C_1 = (int)LPC_I2C1_BASE
+} I2CName;
+
+typedef enum {
+ SCT0_0 = 0,
+ SCT0_1,
+ SCT0_2,
+ SCT0_3,
+ SCT1_0,
+ SCT1_1,
+ SCT1_2,
+ SCT1_3,
+} PWMName;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/PinNames.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,181 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2014 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PINNAMES_H
+#define MBED_PINNAMES_H
+
+#include "cmsis.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ PIN_INPUT,
+ PIN_OUTPUT
+} PinDirection;
+
+#define PORT_SHIFT 16
+#define PIN_SHIFT 9
+
+typedef enum {
+ // LPC11U68 Pin Names (PORT[19:16] + PIN[15:9] + IOCON offset[8:0])
+
+ P0_0 = (0 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x000,
+ P0_1 = (0 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x004,
+ P0_2 = (0 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x008,
+ P0_3 = (0 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x00C,
+ P0_4 = (0 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x010,
+ P0_5 = (0 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x014,
+ P0_6 = (0 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x018,
+ P0_7 = (0 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x01C,
+ P0_8 = (0 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x020,
+ P0_9 = (0 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x024,
+ P0_10= (0 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x028,
+ P0_11= (0 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x02C,
+ P0_12= (0 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x030,
+ P0_13= (0 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x034,
+ P0_14= (0 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x038,
+ P0_15= (0 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x03C,
+ P0_16= (0 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x040,
+ P0_17= (0 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x044,
+ P0_18= (0 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x048,
+ P0_19= (0 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x04C,
+ P0_20= (0 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x050,
+ P0_21= (0 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x054,
+ P0_22= (0 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x058,
+ P0_23= (0 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x05C,
+
+ P1_0 = (1 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x060,
+ P1_1 = (1 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x064,
+ P1_2 = (1 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x068,
+ P1_3 = (1 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x06C,
+ P1_4 = (1 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x070,
+ P1_5 = (1 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x074,
+ P1_6 = (1 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x078,
+ P1_7 = (1 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x07C,
+ P1_8 = (1 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x080,
+ P1_9 = (1 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x084,
+ P1_10= (1 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x088,
+ P1_11= (1 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x08C,
+ P1_12= (1 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x090,
+ P1_13= (1 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x094,
+ P1_14= (1 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x098,
+ P1_15= (1 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x09C,
+ P1_16= (1 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x0A0,
+ P1_17= (1 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x0A4,
+ P1_18= (1 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x0A8,
+ P1_19= (1 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x0AC,
+ P1_20= (1 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x0B0,
+ P1_21= (1 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x0B4,
+ P1_22= (1 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x0B8,
+ P1_23= (1 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x0BC,
+ P1_24= (1 << PORT_SHIFT) | (24<< PIN_SHIFT) | 0x0C0,
+ P1_25= (1 << PORT_SHIFT) | (25<< PIN_SHIFT) | 0x0C4,
+ P1_26= (1 << PORT_SHIFT) | (26<< PIN_SHIFT) | 0x0C8,
+ P1_27= (1 << PORT_SHIFT) | (27<< PIN_SHIFT) | 0x0CC,
+ P1_28= (1 << PORT_SHIFT) | (28<< PIN_SHIFT) | 0x0D0,
+ P1_29= (1 << PORT_SHIFT) | (29<< PIN_SHIFT) | 0x0D4,
+ P1_30= (1 << PORT_SHIFT) | (30<< PIN_SHIFT) | 0x0D8,
+ P1_31= (1 << PORT_SHIFT) | (31<< PIN_SHIFT) | 0x0DC,
+
+ P2_0 = (2 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x0F0,
+ P2_1 = (2 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x0F4,
+ P2_2 = (2 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x0FC,
+ P2_3 = (2 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x100,
+ P2_4 = (2 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x104,
+ P2_5 = (2 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x108,
+ P2_6 = (2 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x10C,
+ P2_7 = (2 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x110,
+ P2_8 = (2 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x114,
+ P2_9 = (2 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x118,
+ P2_10= (2 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x11C,
+ P2_11= (2 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x120,
+ P2_12= (2 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x124,
+ P2_13= (2 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x128,
+ P2_14= (2 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x12C,
+ P2_15= (2 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x130,
+ P2_16= (2 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x134,
+ P2_17= (2 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x138,
+ P2_18= (2 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x13C,
+ P2_19= (2 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x140,
+ P2_20= (2 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x144,
+ P2_21= (2 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x148,
+ P2_22= (2 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x14C,
+ P2_23= (2 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x150,
+
+ LED_RED = P2_17,
+ LED_GREEN = P2_16,
+ LED_BLUE = P2_18,
+
+ // mbed original LED naming
+ LED1 = LED_RED,
+ LED2 = LED_GREEN,
+ LED3 = LED_BLUE,
+ LED4 = LED_BLUE,
+
+ // Serial to USB pins
+ USBTX = P0_19,
+ USBRX = P0_18,
+
+ // Arduino Shield Receptacles Names
+ D0 = P0_18,
+ D1 = P0_19,
+ D2 = P1_18,
+ D3 = P1_24,
+ D4 = P1_19,
+ D5 = P1_26,
+ D6 = P1_27,
+ D7 = P1_25,
+ D8 = P1_28,
+ D9 = P2_3,
+ D10= P0_2,
+ D11= P0_9,
+ D12= P0_8,
+ D13= P1_29,
+ D14= P0_5,
+ D15= P0_4,
+
+ A0 = P1_9,
+ A1 = P0_14,
+ A2 = P0_13,
+ A3 = P0_12,
+ A4 = P0_5, // same port as SDA
+ A5 = P0_4, // same port as SCL
+ SDA= P0_5, // same port as A4
+ SCL= P0_4, // same port as A5
+
+ // Not connected
+ NC = (int)0xFFFFFFFF,
+} PinName;
+
+typedef enum {
+ PullUp = 2,
+ PullDown = 1,
+ PullNone = 0,
+ Repeater = 3,
+ OpenDrain = 4,
+ PullDefault = PullDown
+} PinMode;
+
+#define STDIO_UART_TX USBTX
+#define STDIO_UART_RX USBRX
+#define STDIO_UART UART_0
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/PortNames.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,32 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2014 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_PORTNAMES_H
+#define MBED_PORTNAMES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ Port0 = 0,
+ Port1 = 1,
+ Port2 = 2
+} PortName;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/analogin_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,136 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include "analogin_api.h"
+#include "cmsis.h"
+#include "pinmap.h"
+#include "mbed_error.h"
+
+#if DEVICE_ANALOGIN
+
+#define ANALOGIN_MEDIAN_FILTER 1
+
+#define ADC_10BIT_RANGE 0x3FF
+#define ADC_12BIT_RANGE 0xFFF
+#define PDRUN_VALID_BITS 0x000025FFL
+#define PDRUN_RESERVED_ONE 0x0000C800L
+
+#define ADC_RANGE ADC_12BIT_RANGE
+
+static const PinMap PinMap_ADC[] = {
+ {P1_9 , ADC_0, 3},
+ {P0_23, ADC_1, 1},
+ {P0_16, ADC_2, 1},
+ {P0_15, ADC_3, 3},
+ {P1_22, ADC_4, 3},
+ {P1_3 , ADC_5, 4},
+ {P0_14, ADC_6, 2},
+ {P0_13, ADC_7, 2},
+ {P0_12, ADC_8, 2},
+ {P0_11, ADC_9, 2},
+ {P1_29, ADC_10,4},
+ {P0_22, ADC_11,1},
+ {NC , NC ,0}
+};
+
+
+void analogin_init(analogin_t *obj, PinName pin) {
+ volatile uint32_t tmp;
+ obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC);
+ MBED_ASSERT(obj->adc != (ADCName)NC);
+
+ pinmap_pinout(pin, PinMap_ADC);
+
+ __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (pin & 0x1FF));
+ // set pin to ADC mode
+ *reg &= ~(1 << 7); // set ADMODE = 0 (analog mode)
+
+ // ADC Powered
+ tmp = (LPC_SYSCON->PDRUNCFG & PDRUN_VALID_BITS);
+ tmp &= ~((1 << 4) & PDRUN_VALID_BITS);
+ LPC_SYSCON->PDRUNCFG = (tmp | PDRUN_RESERVED_ONE);
+
+ // Enable clock for ADC
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 13);
+
+ // Determine the clock divider for a 500kHz ADC clock during calibration
+ uint32_t clkdiv = (SystemCoreClock / 500000) - 1;
+
+ // Perform a self-calibration
+ LPC_ADC->CTRL = (1UL << 30) | (clkdiv & 0xFF);
+ while ((LPC_ADC->CTRL & (1UL << 30)) != 0);
+
+ // Sampling clock: SystemClock divided by 1
+ LPC_ADC->CTRL = 0;
+}
+
+static inline uint32_t adc_read(analogin_t *obj) {
+
+ // select channel
+ LPC_ADC->SEQA_CTRL &= ~(0xFFF);
+ LPC_ADC->SEQA_CTRL |= (1UL << obj->adc);
+
+ // start conversion, sequence enable with async mode
+ LPC_ADC->SEQA_CTRL |= ((1UL << 26) | (1UL << 31) | (1UL << 19));
+
+ // Repeatedly get the sample data until DONE bit
+ volatile uint32_t data;
+ do {
+ data = LPC_ADC->SEQA_GDAT;
+ } while ((data & (1UL << 31)) == 0);
+ data = LPC_ADC->DAT[obj->adc];
+
+ // Stop conversion
+ LPC_ADC->SEQA_CTRL &= ~(1UL << 31);
+
+ return ((data >> 4) & ADC_RANGE);
+}
+
+static inline void order(uint32_t *a, uint32_t *b) {
+ if (*a > *b) {
+ uint32_t t = *a;
+ *a = *b;
+ *b = t;
+ }
+}
+
+static inline uint32_t adc_read_u32(analogin_t *obj) {
+ uint32_t value;
+#if ANALOGIN_MEDIAN_FILTER
+ uint32_t v1 = adc_read(obj);
+ uint32_t v2 = adc_read(obj);
+ uint32_t v3 = adc_read(obj);
+ order(&v1, &v2);
+ order(&v2, &v3);
+ order(&v1, &v2);
+ value = v2;
+#else
+ value = adc_read(obj);
+#endif
+ return value;
+}
+
+uint16_t analogin_read_u16(analogin_t *obj) {
+ uint32_t value = adc_read_u32(obj);
+ return (value << 4) | ((value >> 8) & 0x000F); // 12 bit
+}
+
+float analogin_read(analogin_t *obj) {
+ uint32_t value = adc_read_u32(obj);
+ return (float)value * (1.0f / (float)ADC_RANGE);
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/device.h Wed Oct 11 20:35:27 2017 +0000 @@ -0,0 +1,57 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2014 ARM Limited + * + * 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. + */ +#ifndef MBED_DEVICE_H +#define MBED_DEVICE_H + +#define DEVICE_PORTIN 0 +#define DEVICE_PORTOUT 0 +#define DEVICE_PORTINOUT 0 + +#define DEVICE_INTERRUPTIN 1 + +#define DEVICE_ANALOGIN 1 +#define DEVICE_ANALOGOUT 0 + +#define DEVICE_SERIAL 1 + +#define DEVICE_I2C 1 +#define DEVICE_I2CSLAVE 1 + +#define DEVICE_SPI 1 +#define DEVICE_SPISLAVE 0 + +#define DEVICE_CAN 0 + +#define DEVICE_RTC 1 + +#define DEVICE_ETHERNET 0 + +#define DEVICE_PWMOUT 1 + +#define DEVICE_SEMIHOST 0 +#define DEVICE_LOCALFILESYSTEM 0 + +#define DEVICE_SLEEP 1 + +#define DEVICE_DEBUG_AWARENESS 0 + +#define DEVICE_STDIO_MESSAGES 0 + +#define DEVICE_ERROR_RED 1 + +#include "objects.h" + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,76 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2014 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include "gpio_api.h"
+#include "pinmap.h"
+
+static int gpio_enabled = 0;
+
+static void gpio_enable(void) {
+ gpio_enabled = 1;
+
+ /* Enable AHB clock to the GPIO and IOCON domain. */
+ LPC_SYSCON->SYSAHBCLKCTRL |= ((1 << 16) | (1 << 6));
+}
+
+uint32_t gpio_set(PinName pin) {
+ MBED_ASSERT(pin != (PinName)NC);
+ if (!gpio_enabled)
+ gpio_enable();
+
+ int func = ((pin == P0_0) || // reset
+ (pin == P0_10) || // SWCLK
+ (pin == P0_11) || // TDI
+ (pin == P0_12) || // TMS
+ (pin == P0_13) || // TDO
+ (pin == P0_14) || // TRST
+ (pin == P0_15)) ? (1) : (0); // SWDIO
+
+ pin_function(pin, func);
+
+ return (1UL << ((int)pin >> PIN_SHIFT & 0x1F));
+}
+
+void gpio_init(gpio_t *obj, PinName pin) {
+ obj->pin = pin;
+ if (pin == (PinName)NC)
+ return;
+
+ obj->mask = gpio_set(pin);
+
+ unsigned int port = (unsigned int)(pin >> PORT_SHIFT);
+
+ obj->reg_set = &LPC_GPIO_PORT->SET[port];
+ obj->reg_clr = &LPC_GPIO_PORT->CLR[port];
+ obj->reg_in = &LPC_GPIO_PORT->PIN[port];
+ obj->reg_dir = &LPC_GPIO_PORT->DIR[port];
+}
+
+void gpio_mode(gpio_t *obj, PinMode mode) {
+ pin_mode(obj->pin, mode);
+}
+
+void gpio_dir(gpio_t *obj, PinDirection direction) {
+ MBED_ASSERT(obj->pin != (PinName)NC);
+ switch (direction) {
+ case PIN_INPUT :
+ *obj->reg_dir &= ~obj->mask;
+ break;
+ case PIN_OUTPUT:
+ *obj->reg_dir |= obj->mask;
+ break;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_irq_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,143 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 <stddef.h>
+
+#include "cmsis.h"
+#include "gpio_irq_api.h"
+#include "mbed_error.h"
+
+#if DEVICE_INTERRUPTIN
+
+#define CHANNEL_NUM 8
+#define LPC_GPIO_X LPC_PINT
+#define PININT_IRQ PIN_INT0_IRQn
+
+static uint32_t channel_ids[CHANNEL_NUM] = {0};
+static gpio_irq_handler irq_handler;
+
+static inline void handle_interrupt_in(uint32_t channel) {
+ uint32_t ch_bit = (1 << channel);
+ // Return immediately if:
+ // * The interrupt was already served
+ // * There is no user handler
+ // * It is a level interrupt, not an edge interrupt
+ if ( ((LPC_GPIO_X->IST & ch_bit) == 0) ||
+ (channel_ids[channel] == 0 ) ||
+ (LPC_GPIO_X->ISEL & ch_bit ) ) return;
+
+ if ((LPC_GPIO_X->IENR & ch_bit) && (LPC_GPIO_X->RISE & ch_bit)) {
+ irq_handler(channel_ids[channel], IRQ_RISE);
+ LPC_GPIO_X->RISE = ch_bit;
+ }
+ if ((LPC_GPIO_X->IENF & ch_bit) && (LPC_GPIO_X->FALL & ch_bit)) {
+ irq_handler(channel_ids[channel], IRQ_FALL);
+ LPC_GPIO_X->FALL = ch_bit;
+ }
+ LPC_GPIO_X->IST = ch_bit;
+}
+
+void gpio_irq0(void) {handle_interrupt_in(0);}
+void gpio_irq1(void) {handle_interrupt_in(1);}
+void gpio_irq2(void) {handle_interrupt_in(2);}
+void gpio_irq3(void) {handle_interrupt_in(3);}
+void gpio_irq4(void) {handle_interrupt_in(4);}
+void gpio_irq5(void) {handle_interrupt_in(5);}
+void gpio_irq6(void) {handle_interrupt_in(6);}
+void gpio_irq7(void) {handle_interrupt_in(7);}
+
+int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id) {
+ // PINT only supprt PIO0_*, PIO1_* and from PIO2_0 to PIO0_7 interrupt
+ if (pin >= P2_8) return -1;
+
+ irq_handler = handler;
+
+ int found_free_channel = 0;
+ int i = 0;
+ for (i=0; i<CHANNEL_NUM; i++) {
+ if (channel_ids[i] == 0) {
+ channel_ids[i] = id;
+ obj->ch = i;
+ found_free_channel = 1;
+ break;
+ }
+ }
+ if (!found_free_channel) return -1;
+
+ /* Enable AHB clock to the PIN, GPIO and IOCON domain. */
+ LPC_SYSCON->SYSAHBCLKCTRL |= ((1 << 19) | (1 << 16) | (1 << 7));
+
+ LPC_SYSCON->PINTSEL[obj->ch] = ((((pin >> PORT_SHIFT) & 0x3) * 24) + ((pin >> PIN_SHIFT) & 0x1F));
+
+ // Interrupt Wake-Up Enable
+ LPC_SYSCON->STARTERP0 |= (1 << obj->ch);
+
+ LPC_GPIO_PORT->DIR[(pin >> PORT_SHIFT) & 0x3] &= ~(1 << ((pin >> PIN_SHIFT) & 0x1F));
+
+ void (*channels_irq)(void) = NULL;
+ switch (obj->ch) {
+ case 0: channels_irq = &gpio_irq0; break;
+ case 1: channels_irq = &gpio_irq1; break;
+ case 2: channels_irq = &gpio_irq2; break;
+ case 3: channels_irq = &gpio_irq3; break;
+ case 4: channels_irq = &gpio_irq4; break;
+ case 5: channels_irq = &gpio_irq5; break;
+ case 6: channels_irq = &gpio_irq6; break;
+ case 7: channels_irq = &gpio_irq7; break;
+ }
+ NVIC_SetVector((IRQn_Type)(PININT_IRQ + obj->ch), (uint32_t)channels_irq);
+ NVIC_EnableIRQ((IRQn_Type)(PININT_IRQ + obj->ch));
+
+ return 0;
+}
+
+void gpio_irq_free(gpio_irq_t *obj) {
+ channel_ids[obj->ch] = 0;
+ LPC_SYSCON->STARTERP0 &= ~(1 << obj->ch);
+}
+
+void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) {
+ unsigned int ch_bit = (1 << obj->ch);
+
+ // Clear interrupt
+ if (!(LPC_GPIO_X->ISEL & ch_bit))
+ LPC_GPIO_X->IST = ch_bit;
+
+ // Edge trigger
+ LPC_GPIO_X->ISEL &= ~ch_bit;
+ if (event == IRQ_RISE) {
+ if (enable) {
+ LPC_GPIO_X->IENR |= ch_bit;
+ } else {
+ LPC_GPIO_X->IENR &= ~ch_bit;
+ }
+ } else {
+ if (enable) {
+ LPC_GPIO_X->IENF |= ch_bit;
+ } else {
+ LPC_GPIO_X->IENF &= ~ch_bit;
+ }
+ }
+}
+
+void gpio_irq_enable(gpio_irq_t *obj) {
+ NVIC_EnableIRQ((IRQn_Type)(PININT_IRQ + obj->ch));
+}
+
+void gpio_irq_disable(gpio_irq_t *obj) {
+ NVIC_DisableIRQ((IRQn_Type)(PININT_IRQ + obj->ch));
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_object.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,56 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_GPIO_OBJECT_H
+#define MBED_GPIO_OBJECT_H
+
+#include "mbed_assert.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ PinName pin;
+ uint32_t mask;
+
+ __IO uint32_t *reg_dir;
+ __IO uint32_t *reg_set;
+ __IO uint32_t *reg_clr;
+ __I uint32_t *reg_in;
+} gpio_t;
+
+static inline void gpio_write(gpio_t *obj, int value) {
+ MBED_ASSERT(obj->pin != (PinName)NC);
+ if (value)
+ *obj->reg_set = obj->mask;
+ else
+ *obj->reg_clr = obj->mask;
+}
+
+static inline int gpio_read(gpio_t *obj) {
+ MBED_ASSERT(obj->pin != (PinName)NC);
+ return ((*obj->reg_in & obj->mask) ? 1 : 0);
+}
+
+static inline int gpio_is_connected(const gpio_t *obj) {
+ return obj->pin != (PinName)NC;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/i2c_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,394 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include "i2c_api.h"
+#include "cmsis.h"
+#include "pinmap.h"
+
+#if DEVICE_I2C
+
+static const PinMap PinMap_I2C_SDA[] = {
+ {P0_5 , I2C_0, 1},
+ {P1_3 , I2C_1, 3},
+ {P1_14, I2C_1, 1},
+ {P1_24, I2C_1, 2},
+ {NC , NC , 0}
+};
+
+static const PinMap PinMap_I2C_SCL[] = {
+ {P0_4 , I2C_0, 1},
+ {P0_7 , I2C_1, 3},
+ {P1_11, I2C_1, 1},
+ {P1_30, I2C_1, 1},
+ {NC , NC, 0}
+};
+
+#define I2C_CONSET(x) (x->i2c->CONSET)
+#define I2C_CONCLR(x) (x->i2c->CONCLR)
+#define I2C_STAT(x) (x->i2c->STAT)
+#define I2C_DAT(x) (x->i2c->DAT)
+#define I2C_SCLL(x, val) (x->i2c->SCLL = val)
+#define I2C_SCLH(x, val) (x->i2c->SCLH = val)
+
+static const uint32_t I2C_addr_offset[2][4] = {
+ {0x0C, 0x20, 0x24, 0x28}, // slave address offset
+ {0x30, 0x34, 0x38, 0x3C} // slave address mask offset
+};
+
+static inline void i2c_conclr(i2c_t *obj, int start, int stop, int interrupt, int acknowledge) {
+ I2C_CONCLR(obj) = (start << 5)
+ | (stop << 4)
+ | (interrupt << 3)
+ | (acknowledge << 2);
+}
+
+static inline void i2c_conset(i2c_t *obj, int start, int stop, int interrupt, int acknowledge) {
+ I2C_CONSET(obj) = (start << 5)
+ | (stop << 4)
+ | (interrupt << 3)
+ | (acknowledge << 2);
+}
+
+// Clear the Serial Interrupt (SI)
+static inline void i2c_clear_SI(i2c_t *obj) {
+ i2c_conclr(obj, 0, 0, 1, 0);
+}
+
+static inline int i2c_status(i2c_t *obj) {
+ return I2C_STAT(obj);
+}
+
+// Wait until the Serial Interrupt (SI) is set
+static int i2c_wait_SI(i2c_t *obj) {
+ volatile int timeout = 0;
+ while (!(I2C_CONSET(obj) & (1 << 3))) {
+ timeout++;
+ if (timeout > 100000) return -1;
+ }
+ return 0;
+}
+
+static inline void i2c_interface_enable(i2c_t *obj) {
+ I2C_CONSET(obj) = 0x40;
+}
+
+static inline void i2c_power_enable(i2c_t *obj) {
+ LPC_SYSCON->SYSAHBCLKCTRL |= ((1 << 5) | (1 << 25));
+ LPC_SYSCON->PRESETCTRL |= ((1 << 1) | (1 << 3));
+}
+
+void i2c_init(i2c_t *obj, PinName sda, PinName scl) {
+ // determine the SPI to use
+ I2CName i2c_sda = (I2CName)pinmap_peripheral(sda, PinMap_I2C_SDA);
+ I2CName i2c_scl = (I2CName)pinmap_peripheral(scl, PinMap_I2C_SCL);
+ obj->i2c = (LPC_I2C0_Type *)pinmap_merge(i2c_sda, i2c_scl);
+ MBED_ASSERT((int)obj->i2c != NC);
+
+ // enable power
+ i2c_power_enable(obj);
+
+ // set default frequency at 100k
+ i2c_frequency(obj, 100000);
+ i2c_conclr(obj, 1, 1, 1, 1);
+ i2c_interface_enable(obj);
+
+ pinmap_pinout(sda, PinMap_I2C_SDA);
+ pinmap_pinout(scl, PinMap_I2C_SCL);
+}
+
+inline int i2c_start(i2c_t *obj) {
+ int status = 0;
+ // 8.1 Before master mode can be entered, I2CON must be initialised to:
+ // - I2EN STA STO SI AA - -
+ // - 1 0 0 0 x - -
+ // if AA = 0, it can't enter slave mode
+ i2c_conclr(obj, 1, 1, 1, 1);
+
+ // The master mode may now be entered by setting the STA bit
+ // this will generate a start condition when the bus becomes free
+ i2c_conset(obj, 1, 0, 0, 1);
+
+ i2c_wait_SI(obj);
+ status = i2c_status(obj);
+
+ // Clear start bit now transmitted, and interrupt bit
+ i2c_conclr(obj, 1, 0, 0, 0);
+ return status;
+}
+
+inline int i2c_stop(i2c_t *obj) {
+ int timeout = 0;
+
+ // write the stop bit
+ i2c_conset(obj, 0, 1, 0, 0);
+ i2c_clear_SI(obj);
+
+ // wait for STO bit to reset
+ while(I2C_CONSET(obj) & (1 << 4)) {
+ timeout ++;
+ if (timeout > 100000) return 1;
+ }
+
+ return 0;
+}
+
+
+static inline int i2c_do_write(i2c_t *obj, int value, uint8_t addr) {
+ // write the data
+ I2C_DAT(obj) = value;
+
+ // clear SI to init a send
+ i2c_clear_SI(obj);
+
+ // wait and return status
+ i2c_wait_SI(obj);
+ return i2c_status(obj);
+}
+
+static inline int i2c_do_read(i2c_t *obj, int last) {
+ // we are in state 0x40 (SLA+R tx'd) or 0x50 (data rx'd and ack)
+ if (last) {
+ i2c_conclr(obj, 0, 0, 0, 1); // send a NOT ACK
+ } else {
+ i2c_conset(obj, 0, 0, 0, 1); // send a ACK
+ }
+
+ // accept byte
+ i2c_clear_SI(obj);
+
+ // wait for it to arrive
+ i2c_wait_SI(obj);
+
+ // return the data
+ return (I2C_DAT(obj) & 0xFF);
+}
+
+void i2c_frequency(i2c_t *obj, int hz) {
+ // No peripheral clock divider on the M0
+ uint32_t PCLK = SystemCoreClock;
+
+ uint32_t pulse = PCLK / (hz * 2);
+
+ // I2C Rate
+ I2C_SCLL(obj, pulse);
+ I2C_SCLH(obj, pulse);
+}
+
+// The I2C does a read or a write as a whole operation
+// There are two types of error conditions it can encounter
+// 1) it can not obtain the bus
+// 2) it gets error responses at part of the transmission
+//
+// We tackle them as follows:
+// 1) we retry until we get the bus. we could have a "timeout" if we can not get it
+// which basically turns it in to a 2)
+// 2) on error, we use the standard error mechanisms to report/debug
+//
+// Therefore an I2C transaction should always complete. If it doesn't it is usually
+// because something is setup wrong (e.g. wiring), and we don't need to programatically
+// check for that
+
+int i2c_read(i2c_t *obj, int address, char *data, int length, int stop) {
+ int count, status;
+
+ status = i2c_start(obj);
+
+ if ((status != 0x10) && (status != 0x08)) {
+ i2c_stop(obj);
+ return I2C_ERROR_BUS_BUSY;
+ }
+
+ status = i2c_do_write(obj, (address | 0x01), 1);
+ if (status != 0x40) {
+ i2c_stop(obj);
+ return I2C_ERROR_NO_SLAVE;
+ }
+
+ // Read in all except last byte
+ for (count = 0; count < (length - 1); count++) {
+ int value = i2c_do_read(obj, 0);
+ status = i2c_status(obj);
+ if (status != 0x50) {
+ i2c_stop(obj);
+ return count;
+ }
+ data[count] = (char) value;
+ }
+
+ // read in last byte
+ int value = i2c_do_read(obj, 1);
+ status = i2c_status(obj);
+ if (status != 0x58) {
+ i2c_stop(obj);
+ return length - 1;
+ }
+
+ data[count] = (char) value;
+
+ // If not repeated start, send stop.
+ if (stop) {
+ i2c_stop(obj);
+ }
+
+ return length;
+}
+
+int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) {
+ int i, status;
+
+ status = i2c_start(obj);
+
+ if ((status != 0x10) && (status != 0x08)) {
+ i2c_stop(obj);
+ return I2C_ERROR_BUS_BUSY;
+ }
+
+ status = i2c_do_write(obj, (address & 0xFE), 1);
+ if (status != 0x18) {
+ i2c_stop(obj);
+ return I2C_ERROR_NO_SLAVE;
+ }
+
+ for (i=0; i<length; i++) {
+ status = i2c_do_write(obj, data[i], 0);
+ if(status != 0x28) {
+ i2c_stop(obj);
+ return i;
+ }
+ }
+
+ // clearing the serial interrupt here might cause an unintended rewrite of the last byte
+ // see also issue report https://mbed.org/users/mbed_official/code/mbed/issues/1
+ // i2c_clear_SI(obj);
+
+ // If not repeated start, send stop.
+ if (stop) {
+ i2c_stop(obj);
+ }
+
+ return length;
+}
+
+void i2c_reset(i2c_t *obj) {
+ i2c_stop(obj);
+}
+
+int i2c_byte_read(i2c_t *obj, int last) {
+ return (i2c_do_read(obj, last) & 0xFF);
+}
+
+int i2c_byte_write(i2c_t *obj, int data) {
+ int ack;
+ int status = i2c_do_write(obj, (data & 0xFF), 0);
+
+ switch(status) {
+ case 0x18: case 0x28: // Master transmit ACKs
+ ack = 1;
+ break;
+ case 0x40: // Master receive address transmitted ACK
+ ack = 1;
+ break;
+ case 0xB8: // Slave transmit ACK
+ ack = 1;
+ break;
+ default:
+ ack = 0;
+ break;
+ }
+
+ return ack;
+}
+
+void i2c_slave_mode(i2c_t *obj, int enable_slave) {
+ if (enable_slave != 0) {
+ i2c_conclr(obj, 1, 1, 1, 0);
+ i2c_conset(obj, 0, 0, 0, 1);
+ } else {
+ i2c_conclr(obj, 1, 1, 1, 1);
+ }
+}
+
+int i2c_slave_receive(i2c_t *obj) {
+ int status;
+ int retval;
+
+ status = i2c_status(obj);
+ switch(status) {
+ case 0x60: retval = 3; break;
+ case 0x70: retval = 2; break;
+ case 0xA8: retval = 1; break;
+ default : retval = 0; break;
+ }
+
+ return(retval);
+}
+
+int i2c_slave_read(i2c_t *obj, char *data, int length) {
+ int count = 0;
+ int status;
+
+ do {
+ i2c_clear_SI(obj);
+ i2c_wait_SI(obj);
+ status = i2c_status(obj);
+ if((status == 0x80) || (status == 0x90)) {
+ data[count] = I2C_DAT(obj) & 0xFF;
+ }
+ count++;
+ } while (((status == 0x80) || (status == 0x90) ||
+ (status == 0x060) || (status == 0x70)) && (count < length));
+
+ if(status != 0xA0) {
+ i2c_stop(obj);
+ }
+
+ i2c_clear_SI(obj);
+
+ return count;
+}
+
+int i2c_slave_write(i2c_t *obj, const char *data, int length) {
+ int count = 0;
+ int status;
+
+ if(length <= 0) {
+ return(0);
+ }
+
+ do {
+ status = i2c_do_write(obj, data[count], 0);
+ count++;
+ } while ((count < length) && (status == 0xB8));
+
+ if((status != 0xC0) && (status != 0xC8)) {
+ i2c_stop(obj);
+ }
+
+ i2c_clear_SI(obj);
+
+ return(count);
+}
+
+void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) {
+ uint32_t addr;
+
+ if ((idx >= 0) && (idx <= 3)) {
+ addr = ((uint32_t)obj->i2c) + I2C_addr_offset[0][idx];
+ *((uint32_t *) addr) = address & 0xFF;
+ }
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/objects.h Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,80 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+#ifndef MBED_OBJECTS_H
+#define MBED_OBJECTS_H
+
+#include "cmsis.h"
+#include "PortNames.h"
+#include "PeripheralNames.h"
+#include "PinNames.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if DEVICE_INTERRUPTIN
+struct gpio_irq_s {
+ uint32_t ch;
+};
+#endif
+
+#if DEVICE_PWMOUT
+struct pwmout_s {
+ LPC_SCT0_Type* pwm;
+ uint32_t pwm_ch;
+};
+#endif
+
+#if DEVICE_SERIAL
+struct serial_s {
+ LPC_USART0_Type *uart;
+ LPC_USART4_Type *mini_uart;
+ unsigned char index;
+};
+#endif
+
+#if DEVICE_ANALOGIN
+struct analogin_s {
+ ADCName adc;
+};
+#endif
+
+#if DEVICE_ANALOGOUT
+struct dac_s {
+ DACName dac;
+};
+#endif
+
+#if DEVICE_I2C
+struct i2c_s {
+ LPC_I2C0_Type *i2c;
+};
+#endif
+
+#if DEVICE_SPI
+struct spi_s {
+ LPC_SSP0_Type *spi;
+ unsigned char spi_n;
+};
+#endif
+
+#include "gpio_object.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/pinmap.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,45 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include "pinmap.h"
+#include "mbed_error.h"
+
+void pin_function(PinName pin, int function) {
+ MBED_ASSERT(pin != (PinName)NC);
+ __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (pin & 0x1FF));
+
+ // pin function bits: [2:0] -> 111 = (0x7)
+ *reg = (*reg & ~0x7) | (function & 0x7);
+}
+
+void pin_mode(PinName pin, PinMode mode) {
+ MBED_ASSERT(pin != (PinName)NC);
+ if ((pin == P0_4) || (pin == P0_5)) {
+ // The true open-drain pins PIO0_4 and PIO0_5 can be configured for different I2C-bus speeds.
+ return;
+ }
+
+ __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (pin & 0x1FF));
+
+ if (mode == OpenDrain) {
+ *reg |= (1 << 10);
+ } else {
+ uint32_t tmp = *reg;
+ tmp &= ~(0x3 << 3);
+ tmp |= (mode & 0x3) << 3;
+ *reg = tmp;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/pwmout_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,188 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "pwmout_api.h"
+#include "cmsis.h"
+#include "pinmap.h"
+#include "mbed_error.h"
+
+#if DEVICE_PWMOUT
+
+#define SCT_CHANNELS 2
+
+static const PinMap PinMap_PWM[] = {
+ {P1_19, SCT0_0, 2},
+ {P2_2 , SCT0_1, 3},
+ {P2_7 , SCT0_2, 2},
+ {P1_13, SCT0_3, 2},
+ {P2_16, SCT1_0, 1},
+ {P2_17, SCT1_1, 1},
+ {P2_18, SCT1_2, 1},
+ {P2_19, SCT1_3, 1},
+ {NC , NC ,0}
+};
+
+
+static LPC_SCT0_Type *SCTs[SCT_CHANNELS] = {
+ (LPC_SCT0_Type*)LPC_SCT0,
+ (LPC_SCT0_Type*)LPC_SCT1,
+
+};
+
+// bit flags for used SCTs
+static unsigned char sct_used = 0;
+
+static int get_available_sct(void) {
+ int i;
+ for (i=0; i<SCT_CHANNELS; i++) {
+ if ((sct_used & (1 << i)) == 0)
+ return i;
+ }
+ return -1;
+}
+
+void pwmout_init(pwmout_t* obj, PinName pin) {
+ // determine the SPI to use
+ PWMName pwm_mapped = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
+ if (pwm_mapped == (PWMName)NC) {
+ error("PwmOut pin mapping failed");
+ }
+ int sct_n = get_available_sct();
+ if (sct_n == -1) {
+ error("No available SCT");
+ }
+
+ sct_used |= (1 << sct_n);
+ obj->pwm = SCTs[sct_n];
+ obj->pwm_ch = sct_n;
+
+ // Enable the SCT clock
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1UL << 31);
+
+ // Clear peripheral reset the SCT:
+ LPC_SYSCON->PRESETCTRL |= (1 << (obj->pwm_ch + 9));
+ pinmap_pinout(pin, PinMap_PWM);
+ LPC_SCT0_Type* pwm = obj->pwm;
+
+ // Unified 32-bit counter, autolimit
+ pwm->CONFIG |= ((0x3 << 17) | 0x01);
+
+ // halt and clear the counter
+ pwm->CTRL |= (1 << 2) | (1 << 3);
+
+ // System Clock -> us_ticker (1)MHz
+ pwm->CTRL &= ~(0x7F << 5);
+ pwm->CTRL |= (((SystemCoreClock/1000000 - 1) & 0x7F) << 5);
+
+ switch(pwm_mapped) {
+ case SCT0_0:
+ case SCT1_0:
+ pwm->OUT0_SET = (1 << 0); // event 0
+ pwm->OUT0_CLR = (1 << 1); // event 1
+ break;
+ case SCT0_1:
+ case SCT1_1:
+ pwm->OUT1_SET = (1 << 0); // event 0
+ pwm->OUT1_CLR = (1 << 1); // event 1
+ break;
+ case SCT0_2:
+ case SCT1_2:
+ pwm->OUT2_SET = (1 << 0); // event 0
+ pwm->OUT2_CLR = (1 << 1); // event 1
+ break;
+ case SCT0_3:
+ case SCT1_3:
+ pwm->OUT3_SET = (1 << 0); // event 0
+ pwm->OUT3_CLR = (1 << 1); // event 1
+ break;
+ default:
+ break;
+ }
+ // Event 0 : MATCH and MATCHSEL=0
+ pwm->EV0_CTRL = (1 << 12);
+ pwm->EV0_STATE = 0xFFFFFFFF;
+ // Event 1 : MATCH and MATCHSEL=1
+ pwm->EV1_CTRL = (1 << 12) | (1 << 0);
+ pwm->EV1_STATE = 0xFFFFFFFF;
+
+ // Match reload register
+ pwm->MATCHREL0 = 20000; // 20ms
+ pwm->MATCHREL1 = (pwm->MATCHREL0 / 4); // 50% duty
+
+ // unhalt the counter:
+ // - clearing bit 2 of the CTRL register
+ pwm->CTRL &= ~(1 << 2);
+
+ // default to 20ms: standard for servos, and fine for e.g. brightness control
+ pwmout_period_ms(obj, 20);
+ pwmout_write (obj, 0);
+}
+
+void pwmout_free(pwmout_t* obj) {
+ sct_used &= ~(1 << obj->pwm_ch);
+ if (sct_used == 0) {
+ // Disable the SCT clock
+ LPC_SYSCON->SYSAHBCLKCTRL &= ~(1UL << 31);
+ }
+}
+
+void pwmout_write(pwmout_t* obj, float value) {
+ if (value < 0.0f) {
+ value = 0.0;
+ } else if (value > 1.0f) {
+ value = 1.0;
+ }
+ uint32_t t_on = (uint32_t)((float)(obj->pwm->MATCHREL0) * value);
+ obj->pwm->MATCHREL1 = t_on;
+}
+
+float pwmout_read(pwmout_t* obj) {
+ uint32_t t_off = obj->pwm->MATCHREL0;
+ uint32_t t_on = obj->pwm->MATCHREL1;
+ float v = (float)t_on/(float)t_off;
+ return (v > 1.0f) ? (1.0f) : (v);
+}
+
+void pwmout_period(pwmout_t* obj, float seconds) {
+ pwmout_period_us(obj, seconds * 1000000.0f);
+}
+
+void pwmout_period_ms(pwmout_t* obj, int ms) {
+ pwmout_period_us(obj, ms * 1000);
+}
+
+// Set the PWM period, keeping the duty cycle the same.
+void pwmout_period_us(pwmout_t* obj, int us) {
+ uint32_t t_off = obj->pwm->MATCHREL0;
+ uint32_t t_on = obj->pwm->MATCHREL1;
+ float v = (float)t_on/(float)t_off;
+ obj->pwm->MATCHREL0 = (uint32_t)us;
+ obj->pwm->MATCHREL1 = (uint32_t)((float)us * (float)v);
+}
+
+void pwmout_pulsewidth(pwmout_t* obj, float seconds) {
+ pwmout_pulsewidth_us(obj, seconds * 1000000.0f);
+}
+
+void pwmout_pulsewidth_ms(pwmout_t* obj, int ms) {
+ pwmout_pulsewidth_us(obj, ms * 1000);
+}
+
+void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
+ obj->pwm->MATCHREL1 = (uint32_t)us;
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/rtc_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,64 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "rtc_api.h"
+
+#if DEVICE_RTC
+
+void rtc_init(void)
+{
+ // Enables clock for RTC
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 30);
+
+ // Software reset
+ LPC_RTC->CTRL |= 1;
+
+ LPC_RTC->COUNT = 0;
+
+ // Enabled RTC
+ LPC_RTC->CTRL |= (1 << 7);
+ // clear reset
+ LPC_RTC->CTRL &= ~1;
+}
+
+void rtc_free(void)
+{
+ LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 30);
+ LPC_RTC->CTRL &= ~(1 << 7);
+}
+
+int rtc_isenabled(void)
+{
+ return (((LPC_RTC->CTRL) & 0x80) != 0);
+}
+
+time_t rtc_read(void)
+{
+ return (time_t)LPC_RTC->COUNT;
+}
+
+void rtc_write(time_t t)
+{
+ // Disabled RTC
+ LPC_RTC->CTRL &= ~(1 << 7);
+
+ // Set count
+ LPC_RTC->COUNT = t;
+
+ //Enabled RTC
+ LPC_RTC->CTRL |= (1 << 7);
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/serial_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,489 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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.
+ */
+
+// math.h required for floating point operations for baud rate calculation
+#include "mbed_assert.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "serial_api.h"
+#include "cmsis.h"
+#include "pinmap.h"
+
+#if DEVICE_SERIAL
+
+/******************************************************************************
+ * INITIALIZATION
+ ******************************************************************************/
+
+#define UART_NUM 5
+
+// CFG
+#define UART_EN (0x01<<0)
+
+// CTL
+#define TXBRKEN (0x01<<1)
+
+// STAT
+#define RXRDY (0x01<<0)
+#define TXRDY (0x01<<2)
+#define DELTACTS (0x01<<5)
+#define RXBRK (0x01<<10)
+#define DELTARXBRK (0x01<<11)
+
+static const PinMap PinMap_UART_TX[] = {
+ {P0_19, UART_0, 1},
+ {P1_18, UART_0, 2},
+ {P1_27, UART_0, 2},
+ {P1_8 , UART_1, 2},
+ {P0_14, UART_1, 4},
+ {P1_0 , UART_2, 3},
+ {P1_23, UART_2, 3},
+ {P2_4 , UART_3, 1},
+ {P2_12, UART_4, 1},
+ { NC , NC , 0}
+};
+
+static const PinMap PinMap_UART_RX[] = {
+ {P0_18, UART_0, 1},
+ {P1_17, UART_0, 2},
+ {P1_26, UART_0, 2},
+ {P1_2 , UART_1, 3},
+ {P0_13, UART_1, 4},
+ {P0_20, UART_2, 2},
+ {P1_6 , UART_2, 2},
+ {P2_3 , UART_3, 1},
+ {P2_11, UART_4, 1},
+ {NC , NC , 0}
+};
+
+static uint32_t serial_irq_ids[UART_NUM] = {0};
+static uart_irq_handler irq_handler;
+
+int stdio_uart_inited = 0;
+serial_t stdio_uart;
+
+void serial_init(serial_t *obj, PinName tx, PinName rx) {
+ int is_stdio_uart = 0;
+
+ // determine the UART to use
+ UARTName uart_tx = (UARTName)pinmap_peripheral(tx, PinMap_UART_TX);
+ UARTName uart_rx = (UARTName)pinmap_peripheral(rx, PinMap_UART_RX);
+ UARTName uart = (UARTName)pinmap_merge(uart_tx, uart_rx);
+ MBED_ASSERT((int)uart != NC);
+
+ switch (uart) {
+ case UART_0:
+ obj->index = 0;
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 12);
+ break;
+ case UART_1:
+ obj->index = 1;
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 20);
+ LPC_SYSCON->PRESETCTRL |= (1 << 5);
+ break;
+ case UART_2:
+ obj->index = 2;
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 21);
+ LPC_SYSCON->PRESETCTRL |= (1 << 6);
+ break;
+ case UART_3:
+ obj->index = 3;
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 22);
+ LPC_SYSCON->PRESETCTRL |= (1 << 7);
+ break;
+ case UART_4:
+ obj->index = 4;
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 22);
+ LPC_SYSCON->PRESETCTRL |= (1 << 8);
+ break;
+ }
+
+ if (obj->index == 0)
+ obj->uart = (LPC_USART0_Type *)uart;
+ else
+ obj->mini_uart = (LPC_USART4_Type *)uart;
+
+ if (obj->index == 0) {
+ // enable fifos and default rx trigger level
+ obj->uart->FCR = 1 << 0 // FIFO Enable - 0 = Disables, 1 = Enabled
+ | 0 << 1 // Rx Fifo Clear
+ | 0 << 2 // Tx Fifo Clear
+ | 0 << 6; // Rx irq trigger level - 0 = 1 char, 1 = 4 chars, 2 = 8 chars, 3 = 14 chars
+ // disable irqs
+ obj->uart->IER = 0 << 0 // Rx Data available irq enable
+ | 0 << 1 // Tx Fifo empty irq enable
+ | 0 << 2; // Rx Line Status irq enable
+ }
+ else {
+ // Clear all status bits
+ obj->mini_uart->STAT = (DELTACTS | DELTARXBRK);
+ // Enable UART
+ obj->mini_uart->CFG |= UART_EN;
+ }
+ // set default baud rate and format
+ serial_baud (obj, 9600);
+ serial_format(obj, 8, ParityNone, 1);
+
+ // pinout the chosen uart
+ pinmap_pinout(tx, PinMap_UART_TX);
+ pinmap_pinout(rx, PinMap_UART_RX);
+
+ // set rx/tx pins in PullUp mode
+ if (tx != NC) {
+ pin_mode(tx, PullUp);
+ }
+ if (rx != NC) {
+ pin_mode(rx, PullUp);
+ }
+
+ is_stdio_uart = (uart == STDIO_UART) ? (1) : (0);
+
+ if (is_stdio_uart && (obj->index == 0)) {
+ stdio_uart_inited = 1;
+ memcpy(&stdio_uart, obj, sizeof(serial_t));
+ }
+}
+
+void serial_free(serial_t *obj) {
+ serial_irq_ids[obj->index] = 0;
+}
+
+// serial_baud
+// set the baud rate, taking in to account the current SystemFrequency
+void serial_baud(serial_t *obj, int baudrate) {
+ LPC_SYSCON->USART0CLKDIV = 1;
+ LPC_SYSCON->FRGCLKDIV = 1;
+
+ if (obj->index == 0) {
+ uint32_t PCLK = SystemCoreClock;
+ // First we check to see if the basic divide with no DivAddVal/MulVal
+ // ratio gives us an integer result. If it does, we set DivAddVal = 0,
+ // MulVal = 1. Otherwise, we search the valid ratio value range to find
+ // the closest match. This could be more elegant, using search methods
+ // and/or lookup tables, but the brute force method is not that much
+ // slower, and is more maintainable.
+ uint16_t DL = PCLK / (16 * baudrate);
+
+ uint8_t DivAddVal = 0;
+ uint8_t MulVal = 1;
+ int hit = 0;
+ uint16_t dlv;
+ uint8_t mv, dav;
+ if ((PCLK % (16 * baudrate)) != 0) { // Checking for zero remainder
+ int err_best = baudrate, b;
+ for (mv = 1; mv < 16 && !hit; mv++)
+ {
+ for (dav = 0; dav < mv; dav++)
+ {
+ // baudrate = PCLK / (16 * dlv * (1 + (DivAdd / Mul))
+ // solving for dlv, we get dlv = mul * PCLK / (16 * baudrate * (divadd + mul))
+ // mul has 4 bits, PCLK has 27 so we have 1 bit headroom which can be used for rounding
+ // for many values of mul and PCLK we have 2 or more bits of headroom which can be used to improve precision
+ // note: X / 32 doesn't round correctly. Instead, we use ((X / 16) + 1) / 2 for correct rounding
+
+ if ((mv * PCLK * 2) & 0x80000000) // 1 bit headroom
+ dlv = ((((2 * mv * PCLK) / (baudrate * (dav + mv))) / 16) + 1) / 2;
+ else // 2 bits headroom, use more precision
+ dlv = ((((4 * mv * PCLK) / (baudrate * (dav + mv))) / 32) + 1) / 2;
+
+ // datasheet says if DLL==DLM==0, then 1 is used instead since divide by zero is ungood
+ if (dlv == 0)
+ dlv = 1;
+
+ // datasheet says if dav > 0 then DL must be >= 2
+ if ((dav > 0) && (dlv < 2))
+ dlv = 2;
+
+ // integer rearrangement of the baudrate equation (with rounding)
+ b = ((PCLK * mv / (dlv * (dav + mv) * 8)) + 1) / 2;
+
+ // check to see how we went
+ b = abs(b - baudrate);
+ if (b < err_best)
+ {
+ err_best = b;
+
+ DL = dlv;
+ MulVal = mv;
+ DivAddVal = dav;
+
+ if (b == baudrate)
+ {
+ hit = 1;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // set LCR[DLAB] to enable writing to divider registers
+ obj->uart->LCR |= (1 << 7);
+
+ // set divider values
+ obj->uart->DLM = (DL >> 8) & 0xFF;
+ obj->uart->DLL = (DL >> 0) & 0xFF;
+ obj->uart->FDR = (uint32_t) DivAddVal << 0
+ | (uint32_t) MulVal << 4;
+
+ // clear LCR[DLAB]
+ obj->uart->LCR &= ~(1 << 7);
+ }
+ else {
+ uint32_t UARTSysClk = SystemCoreClock / LPC_SYSCON->FRGCLKDIV;
+ obj->mini_uart->BRG = UARTSysClk / 16 / baudrate - 1;
+
+ LPC_SYSCON->UARTFRGDIV = 0xFF;
+ LPC_SYSCON->UARTFRGMULT = ( ((UARTSysClk / 16) * (LPC_SYSCON->UARTFRGDIV + 1)) /
+ (baudrate * (obj->mini_uart->BRG + 1))
+ ) - (LPC_SYSCON->UARTFRGDIV + 1);
+ }
+}
+
+void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits) {
+ MBED_ASSERT((stop_bits == 1) || (stop_bits == 2)); // 0: 1 stop bits, 1: 2 stop bits
+
+ stop_bits -= 1;
+
+ if (obj->index == 0) {
+ MBED_ASSERT((data_bits > 4) && (data_bits < 9)); // 0: 5 data bits ... 3: 8 data bits
+ MBED_ASSERT((parity == ParityNone) || (parity == ParityOdd) || (parity == ParityEven) ||
+ (parity == ParityForced1) || (parity == ParityForced0));
+ data_bits -= 5;
+
+ int parity_enable, parity_select;
+ switch (parity) {
+ case ParityNone: parity_enable = 0; parity_select = 0; break;
+ case ParityOdd : parity_enable = 1; parity_select = 0; break;
+ case ParityEven: parity_enable = 1; parity_select = 1; break;
+ case ParityForced1: parity_enable = 1; parity_select = 2; break;
+ case ParityForced0: parity_enable = 1; parity_select = 3; break;
+ default:
+ return;
+ }
+
+ obj->uart->LCR = data_bits << 0
+ | stop_bits << 2
+ | parity_enable << 3
+ | parity_select << 4;
+ }
+ else {
+ // 0: 7 data bits ... 2: 9 data bits
+ MBED_ASSERT((data_bits > 6) && (data_bits < 10));
+ MBED_ASSERT((parity == ParityNone) || (parity == ParityOdd) || (parity == ParityEven));
+ data_bits -= 7;
+
+ int paritysel;
+ switch (parity) {
+ case ParityNone: paritysel = 0; break;
+ case ParityEven: paritysel = 2; break;
+ case ParityOdd : paritysel = 3; break;
+ default:
+ return;
+ }
+ obj->mini_uart->CFG = (data_bits << 2)
+ | (paritysel << 4)
+ | (stop_bits << 6)
+ | UART_EN;
+ }
+}
+
+/******************************************************************************
+ * INTERRUPTS HANDLING
+ ******************************************************************************/
+static inline void uart_irq(uint32_t iir, uint32_t index) {
+ SerialIrq irq_type;
+ switch (iir) {
+ case 1: irq_type = TxIrq; break;
+ case 2: irq_type = RxIrq; break;
+ default: return;
+ }
+
+ if (serial_irq_ids[index] != 0)
+ irq_handler(serial_irq_ids[index], irq_type);
+}
+
+void uart0_irq()
+{
+ uart_irq((LPC_USART0->IIR >> 1) & 0x7, 0);
+}
+
+void uart1_irq()
+{
+ if(LPC_USART1->STAT & (1 << 2)){
+ uart_irq(1, 1);
+ }
+ if(LPC_USART1->STAT & (1 << 0)){
+ uart_irq(2, 1);
+ }
+}
+
+void uart2_irq()
+{
+ if(LPC_USART2->STAT & (1 << 2)){
+ uart_irq(1, 2);
+ }
+ if(LPC_USART2->STAT & (1 << 0)){
+ uart_irq(2, 2);
+ }
+}
+
+void uart3_irq()
+{
+ if(LPC_USART3->STAT & (1 << 2)){
+ uart_irq(1, 3);
+ }
+ if(LPC_USART3->STAT & (1 << 0)){
+ uart_irq(2, 3);
+ }
+}
+
+void uart4_irq()
+{
+ if(LPC_USART4->STAT & (1 << 2)){
+ uart_irq(1, 4);
+ }
+ if(LPC_USART4->STAT & (1 << 0)){
+ uart_irq(2, 4);
+ }
+}
+
+void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id) {
+ irq_handler = handler;
+ serial_irq_ids[obj->index] = id;
+}
+
+void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) {
+ IRQn_Type irq_n = (IRQn_Type)0;
+ uint32_t vector = 0;
+ if(obj->index == 0){
+ irq_n = USART0_IRQn; vector = (uint32_t)&uart0_irq;
+ }
+ else{
+ switch ((int)obj->mini_uart) {
+ case UART_0: irq_n = USART0_IRQn; vector = (uint32_t)&uart0_irq; break;
+ case UART_1: irq_n = USART1_4_IRQn; vector = (uint32_t)&uart1_irq; break;
+ case UART_2: irq_n = USART2_3_IRQn; vector = (uint32_t)&uart2_irq; break;
+ case UART_3: irq_n = USART2_3_IRQn; vector = (uint32_t)&uart3_irq; break;
+ case UART_4: irq_n = USART1_4_IRQn; vector = (uint32_t)&uart4_irq; break;
+ }
+ }
+
+ if (enable) {
+ if (obj->index == 0) {
+ obj->uart->IER |= (1 << irq);
+ }
+ else {
+ obj->mini_uart->INTENSET = (1 << ((irq == RxIrq) ? 0 : 2));
+ }
+ NVIC_SetVector(irq_n, vector);
+ NVIC_EnableIRQ(irq_n);
+ } else { // disable
+ int all_disabled = 0;
+ SerialIrq other_irq = (irq == RxIrq) ? (RxIrq) : (TxIrq);
+
+ if (obj->index == 0) {
+ obj->uart->IER &= ~(1 << irq);
+ all_disabled = (obj->uart->IER & (1 << other_irq)) == 0;
+ }
+ else {
+ obj->mini_uart->INTENCLR = (1 << ((irq == RxIrq) ? 0 : 2));
+ all_disabled = (obj->mini_uart->INTENSET) == 0;
+ }
+
+ if (all_disabled)
+ NVIC_DisableIRQ(irq_n);
+ }
+}
+
+/******************************************************************************
+ * READ/WRITE
+ ******************************************************************************/
+int serial_getc(serial_t *obj) {
+ while (!serial_readable(obj));
+ if (obj->index == 0) {
+ return obj->uart->RBR;
+ }
+ else {
+ return obj->mini_uart->RXDAT;
+ }
+}
+
+void serial_putc(serial_t *obj, int c) {
+ while (!serial_writable(obj));
+ if (obj->index == 0) {
+ obj->uart->THR = c;
+ }
+ else {
+ obj->mini_uart->TXDAT = c;
+ }
+}
+
+int serial_readable(serial_t *obj) {
+ if (obj->index == 0) {
+ return obj->uart->LSR & 0x01;
+ }
+ else {
+ return obj->mini_uart->STAT & RXRDY;
+ }
+}
+
+int serial_writable(serial_t *obj) {
+ if (obj->index == 0) {
+ return obj->uart->LSR & 0x20;
+ }
+ else {
+ return obj->mini_uart->STAT & TXRDY;
+ }
+}
+
+void serial_clear(serial_t *obj) {
+ if (obj->index == 0) {
+ obj->uart->FCR = 1 << 1 // rx FIFO reset
+ | 1 << 2 // tx FIFO reset
+ | 0 << 6; // interrupt depth
+ }
+ else {
+ obj->mini_uart->STAT = 0;
+ }
+}
+
+void serial_pinout_tx(PinName tx) {
+ pinmap_pinout(tx, PinMap_UART_TX);
+}
+
+void serial_break_set(serial_t *obj) {
+ if (obj->index == 0) {
+ obj->uart->LCR |= (1 << 6);
+ }
+ else {
+ obj->mini_uart->CTL |= TXBRKEN;
+ }
+}
+
+void serial_break_clear(serial_t *obj) {
+ if (obj->index == 0) {
+ obj->uart->LCR &= ~(1 << 6);
+ }
+ else {
+ obj->mini_uart->CTL &= ~TXBRKEN;
+ }
+}
+
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/sleep.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,69 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "sleep_api.h"
+#include "cmsis.h"
+#include "mbed_interface.h"
+
+#if DEVICE_SLEEP
+
+void sleep(void) {
+
+#if (DEVICE_SEMIHOST == 1)
+ // ensure debug is disconnected
+ mbed_interface_disconnect();
+#endif
+
+ // PCON[PM] (bits 2:0) set to 0
+ LPC_PMU->PCON &= ~0x03;
+
+ // SRC[SLEEPDEEP] set to 0 = sleep
+ SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
+
+ // wait for interrupt
+ __WFI();
+}
+
+
+void deepsleep(void) {
+
+#if (DEVICE_SEMIHOST == 1)
+ // ensure debug is disconnected
+ mbed_interface_disconnect();
+#endif
+
+ // PCON[PM] (bits 2:0) set to 1
+ LPC_PMU->PCON &= ~0x03;
+ LPC_PMU->PCON |= 0x01;
+
+ //According to user manual it is kinda picky about reserved bits, so we follow that nicely
+ //Keep WDOSC and BOD in same state as they are now during deepsleep
+ LPC_SYSCON->PDSLEEPCFG = 0x00000037 | (LPC_SYSCON->PDRUNCFG & (0x00000048));
+
+ // Power up same as before powerdown
+ LPC_SYSCON->PDAWAKECFG = LPC_SYSCON->PDRUNCFG;
+
+ // All interrupts can wake
+ LPC_SYSCON->STARTERP0 = 0xFF;
+ LPC_SYSCON->STARTERP1 = 0xFFFFFFFF;
+
+ // SRC[SLEEPDEEP] set to 1 = deep sleep
+ SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
+
+ // wait for interrupt
+ __WFI();
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/spi_api.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,210 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 "mbed_assert.h"
+#include <math.h>
+
+#include "spi_api.h"
+#include "cmsis.h"
+#include "pinmap.h"
+#include "mbed_error.h"
+
+#if DEVICE_SPI
+
+static const PinMap PinMap_SPI_SCLK[] = {
+ {P0_6 , SPI_0, 0x02},
+ {P1_29, SPI_0, 0x01},
+ {P2_7 , SPI_0, 0x01},
+ {P1_20, SPI_1, 0x02},
+ {P1_27, SPI_1, 0x04},
+ {NC , NC , 0}
+};
+
+static const PinMap PinMap_SPI_MOSI[] = {
+ {P0_9 , SPI_0, 0x01},
+ {P1_12, SPI_0, 0x01},
+ {P0_21, SPI_1, 0x02},
+ {P1_22, SPI_1, 0x01},
+ {NC , NC , 0}
+};
+
+static const PinMap PinMap_SPI_MISO[] = {
+ {P0_8 , SPI_0, 0x01},
+ {P1_16, SPI_0, 0x01},
+ {P0_22, SPI_1, 0x03},
+ {P1_21, SPI_1, 0x02},
+ {NC , NC , 0}
+};
+
+static const PinMap PinMap_SPI_SSEL[] = {
+ {P0_2 , SPI_0, 0x01},
+ {P1_15, SPI_0, 0x01},
+ {P0_23, SPI_1, 0x04},
+ {P1_23, SPI_1, 0x02},
+ {NC , NC , 0}
+};
+
+static inline int ssp_disable(spi_t *obj);
+static inline int ssp_enable(spi_t *obj);
+
+void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel) {
+ // determine the SPI to use
+ SPIName spi_mosi = (SPIName)pinmap_peripheral(mosi, PinMap_SPI_MOSI);
+ SPIName spi_miso = (SPIName)pinmap_peripheral(miso, PinMap_SPI_MISO);
+ SPIName spi_sclk = (SPIName)pinmap_peripheral(sclk, PinMap_SPI_SCLK);
+ SPIName spi_ssel = (SPIName)pinmap_peripheral(ssel, PinMap_SPI_SSEL);
+ SPIName spi_data = (SPIName)pinmap_merge(spi_mosi, spi_miso);
+ SPIName spi_cntl = (SPIName)pinmap_merge(spi_sclk, spi_ssel);
+
+ obj->spi = (LPC_SSP0_Type*)pinmap_merge(spi_data, spi_cntl);
+ MBED_ASSERT((int)obj->spi != NC);
+
+ // enable power and clocking
+ switch ((int)obj->spi) {
+ case SPI_0:
+ LPC_SYSCON->SYSAHBCLKCTRL |= 1 << 11;
+ LPC_SYSCON->SSP0CLKDIV = 0x01;
+ LPC_SYSCON->PRESETCTRL |= 1 << 0;
+ break;
+ case SPI_1:
+ LPC_SYSCON->SYSAHBCLKCTRL |= 1 << 18;
+ LPC_SYSCON->SSP1CLKDIV = 0x01;
+ LPC_SYSCON->PRESETCTRL |= 1 << 2;
+ break;
+ }
+
+ // pin out the spi pins
+ pinmap_pinout(mosi, PinMap_SPI_MOSI);
+ pinmap_pinout(miso, PinMap_SPI_MISO);
+ pinmap_pinout(sclk, PinMap_SPI_SCLK);
+ if (ssel != NC) {
+ pinmap_pinout(ssel, PinMap_SPI_SSEL);
+ }
+}
+
+void spi_free(spi_t *obj) {}
+
+void spi_format(spi_t *obj, int bits, int mode, int slave) {
+ ssp_disable(obj);
+ MBED_ASSERT(((bits >= 4) && (bits <= 16)) || ((mode >= 0) && (mode <= 3)));
+
+ int polarity = (mode & 0x2) ? 1 : 0;
+ int phase = (mode & 0x1) ? 1 : 0;
+
+ // set it up
+ int DSS = bits - 1; // DSS (data select size)
+ int SPO = (polarity) ? 1 : 0; // SPO - clock out polarity
+ int SPH = (phase) ? 1 : 0; // SPH - clock out phase
+
+ int FRF = 0; // FRF (frame format) = SPI
+ uint32_t tmp = obj->spi->CR0;
+ tmp &= ~(0xFFFF);
+ tmp |= DSS << 0
+ | FRF << 4
+ | SPO << 6
+ | SPH << 7;
+ obj->spi->CR0 = tmp;
+
+ tmp = obj->spi->CR1;
+ tmp &= ~(0xD);
+ tmp |= 0 << 0 // LBM - loop back mode - off
+ | ((slave) ? 1 : 0) << 2 // MS - master slave mode, 1 = slave
+ | 0 << 3; // SOD - slave output disable - na
+ obj->spi->CR1 = tmp;
+
+ ssp_enable(obj);
+}
+
+void spi_frequency(spi_t *obj, int hz) {
+ ssp_disable(obj);
+
+ uint32_t PCLK = SystemCoreClock;
+
+ int prescaler;
+
+ for (prescaler = 2; prescaler <= 254; prescaler += 2) {
+ int prescale_hz = PCLK / prescaler;
+
+ // calculate the divider
+ int divider = floor(((float)prescale_hz / (float)hz) + 0.5f);
+
+ // check we can support the divider
+ if (divider < 256) {
+ // prescaler
+ obj->spi->CPSR = prescaler;
+
+ // divider
+ obj->spi->CR0 &= ~(0xFFFF << 8);
+ obj->spi->CR0 |= (divider - 1) << 8;
+ ssp_enable(obj);
+ return;
+ }
+ }
+ error("Couldn't setup requested SPI frequency");
+}
+
+static inline int ssp_disable(spi_t *obj) {
+ return obj->spi->CR1 &= ~(1 << 1);
+}
+
+static inline int ssp_enable(spi_t *obj) {
+ return obj->spi->CR1 |= (1 << 1);
+}
+
+static inline int ssp_readable(spi_t *obj) {
+ return obj->spi->SR & (1 << 2);
+}
+
+static inline int ssp_writeable(spi_t *obj) {
+ return obj->spi->SR & (1 << 1);
+}
+
+static inline void ssp_write(spi_t *obj, int value) {
+ while (!ssp_writeable(obj));
+ obj->spi->DR = value;
+}
+
+static inline int ssp_read(spi_t *obj) {
+ while (!ssp_readable(obj));
+ return obj->spi->DR;
+}
+
+static inline int ssp_busy(spi_t *obj) {
+ return (obj->spi->SR & (1 << 4)) ? (1) : (0);
+}
+
+int spi_master_write(spi_t *obj, int value) {
+ ssp_write(obj, value);
+ return ssp_read(obj);
+}
+
+int spi_slave_receive(spi_t *obj) {
+ return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0);
+}
+
+int spi_slave_read(spi_t *obj) {
+ return obj->spi->DR;
+}
+
+void spi_slave_write(spi_t *obj, int value) {
+ while (ssp_writeable(obj) == 0) ;
+ obj->spi->DR = value;
+}
+
+int spi_busy(spi_t *obj) {
+ return ssp_busy(obj);
+}
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-pokitto/targets/hal/TARGET_NXP/TARGET_LPC11U6X/us_ticker.c Wed Oct 11 20:35:27 2017 +0000
@@ -0,0 +1,62 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2006-2013 ARM Limited
+ *
+ * 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 <stddef.h>
+#include "us_ticker_api.h"
+#include "PeripheralNames.h"
+
+#define US_TICKER_TIMER ((LPC_CT32B0_Type *)LPC_CT32B1_BASE)
+#define US_TICKER_TIMER_IRQn CT32B1_IRQn
+
+int us_ticker_inited = 0;
+
+void us_ticker_init(void) {
+ if (us_ticker_inited) return;
+ us_ticker_inited = 1;
+
+ LPC_SYSCON->SYSAHBCLKCTRL |= (1<<10); // Clock CT32B1
+ uint32_t PCLK = SystemCoreClock;
+
+ US_TICKER_TIMER->TCR = 0x2; // reset
+
+ uint32_t prescale = PCLK / 1000000; // default to 1MHz (1 us ticks)
+ US_TICKER_TIMER->PR = prescale - 1;
+ US_TICKER_TIMER->TCR = 1; // enable = 1, reset = 0
+
+ NVIC_SetVector(US_TICKER_TIMER_IRQn, (uint32_t)us_ticker_irq_handler);
+ NVIC_EnableIRQ(US_TICKER_TIMER_IRQn);
+}
+
+uint32_t us_ticker_read() {
+ if (!us_ticker_inited)
+ us_ticker_init();
+
+ return US_TICKER_TIMER->TC;
+}
+
+void us_ticker_set_interrupt(timestamp_t timestamp) {
+ // set match value
+ US_TICKER_TIMER->MR0 = (uint32_t)timestamp;
+ // enable match interrupt
+ US_TICKER_TIMER->MCR |= 1;
+}
+
+void us_ticker_disable_interrupt(void) {
+ US_TICKER_TIMER->MCR &= ~1;
+}
+
+void us_ticker_clear_interrupt(void) {
+ US_TICKER_TIMER->IR = 1;
+}