IPS(Interpreter for Process Structures) for mbed
Dependencies: ConfigFile FATFileSystem mbed
IPS port from linux/unix version.
mbed_blinky.ips
0 VAR led1 " LED1 " DigitalOut led1 ! : main ANFANG 1 JA? 1 led1 @ write 200 wait_ms 0 led1 @ write 200 wait_ms DANN/NOCHMAL ; main
- ips-02.tgz - ips for linux/unix
- ipsdoc.zip - document
- https://bitbucket.org/va009039/ips/
Revision 2:908338b1151a, committed 2015-05-23
- Comitter:
- va009039
- Date:
- Sat May 23 16:50:59 2015 +0900
- Parent:
- 1:e74530ad6b9e
- Child:
- 3:9f526f0d9720
- Commit message:
- add mbedAPI
Changed in this revision
--- a/BaseIPS.cpp Wed May 13 18:39:01 2015 +0900 +++ b/BaseIPS.cpp Sat May 23 16:50:59 2015 +0900 @@ -1,9 +1,12 @@ -// BaseIPS.cpp 2015/5/6 +// BaseIPS.cpp 2015/5/22 +#include <algorithm> #include "mbed.h" #include "BaseIPS.h" +#ifndef NO_MATH #include <math.h> #define Round(x) ( (x>=0) ? (int)(x+0.5) : (int)(x-0.5) ) +#endif BaseIPS::BaseIPS() { PS = 0xfff8; @@ -58,7 +61,7 @@ depth++; } -void BaseIPS::c_consex(void) { // 2 +void BaseIPS::c_consex(void) { // 2 push_ps(peek(HP)); } @@ -402,11 +405,11 @@ void BaseIPS::c_cyc2(void) { // 50 u32 ch,a,crcc; int i; - + ch=pull_ps(); a=pull_ps(); crcc=(a>>8)|((a&0xff)<<8); - + ch<<=8; for (i=0;i<=7;i++) { //int test; @@ -430,13 +433,11 @@ if (inputfile) { file_close(inputfile); } - int namelen = pull_ps(); + size_t namelen = pull_ps(); int namestart = pull_ps(); char filename[256]; - if (namelen > sizeof(filename)-1) { - namelen = sizeof(filename) - 1; - } - for(int i = 0; i < namelen; i++) { + namelen = std::min(namelen, sizeof(filename)-1); + for(size_t i = 0; i < namelen; i++) { filename[i] = peekB(namestart + i); } filename[namelen] = '\0'; @@ -489,6 +490,7 @@ PS=pull_ps(); } +#ifndef NO_MATH void BaseIPS::c_rp_code(void) { // 59 double theta,x,y,r; pull_ps(); @@ -514,6 +516,14 @@ push_ps(Round(r*cos(theta))); push_ps(Round(r*sin(theta))); } +#else +void BaseIPS::c_rp_code(void) { + error("c_rp_code not implemented!\n"); +} +void BaseIPS::c_tr_code(void) { + error("c_tr_code not implemented!\n"); +} +#endif void BaseIPS::c_swap3(void) { // 61 u16 h; @@ -546,15 +556,6 @@ push_ps(c>>16); } -void BaseIPS::c_sleepifidle(void) { // 80 -/* extension for IPS-Mu, i.e., the linux/unix version */ - if (idle) { - //do_sleep(); - //leaveloop=0; - } - idle=1; -} - void BaseIPS::do_20ms(void) { pokeB(UHR, peekB(UHR) + 2); // 20ms if (peekB(UHR) == 100) { @@ -609,14 +610,14 @@ do { int ch = file_getc(inputfile); - if (ch<1) { + if (ch<1) { if (input_ptr == peek(a_PI)) { - file_close(inputfile); - inputfile = NULL; - pokeB(LOADFLAG, 0); + file_close(inputfile); + inputfile = NULL; + pokeB(LOADFLAG, 0); input_ptr = 0x200; } - break; + break; } if (ch=='\r') { /* ignore \r, we expect at least also a \n as end-of-line */ @@ -644,6 +645,7 @@ HP += 2; trace(cycle++, PPC-2, HP-2, CPC, PS, RS); switch(CPC) { + case 0: c_rumpelstilzchen(); break; case 1: c_defex(); break; case 2: c_consex(); break; case 3: c_varex(); break; @@ -708,8 +710,7 @@ case 62: c_defchar(); break; case 63: c_pplus(); break; case 64: c_pminus(); break; - case 80: c_sleepifidle(); break; - default: c_rumpelstilzchen(); break; + default: usercode(CPC); break; } do_io(); if (test_20ms()) {
--- a/BaseIPS.h Wed May 13 18:39:01 2015 +0900 +++ b/BaseIPS.h Sat May 23 16:50:59 2015 +0900 @@ -1,4 +1,4 @@ -// BaseIPS.h 2015/5/6 +// BaseIPS.h 2015/5/22 #pragma once /* data types */ @@ -33,9 +33,15 @@ void load_image(const u8* image, int size); void command(const char* s); + void push_ps(u16 w); + u16 pull_ps(); + virtual uint8_t mem_peek(uint16_t a) = 0; + virtual void mem_poke(uint16_t a, uint8_t b) = 0; + + uint8_t peekB(u16 a) { return mem_peek(a); } + void pokeB(uint16_t a, uint8_t b) { mem_poke(a, b); } + protected: - virtual u8 peekB(u16 a) = 0; - virtual void pokeB(u16 a, u8 b) = 0; void poke(u16 a, u16 w); u16 peek(u16 a); virtual void do_io() = 0; @@ -45,6 +51,7 @@ virtual void file_putc(int c, void* handle) {} virtual bool file_close(void* handle) { return false; } virtual void trace(u32 cycle, u16 ppc, u16 hp, u16 cpc, u16 ps, u16 rs) {} + virtual void usercode(uint16_t cpc) = 0; int input_ptr; private: @@ -54,8 +61,6 @@ int depth; int redraw; int idle; - void push_ps(u16 w); - u16 pull_ps(); void push_rs(u16 w); u16 pull_rs(); void* inputfile; @@ -69,8 +74,8 @@ void c_retex(void); // 4 void c_get(void); // 5 void c_getB(void); // 6 - void c_put(void); // 7 - void c_putB(void); // 8 + void c_put(void); // 7 + void c_putB(void); // 8 void c_1bliteral(void); // 9 void c_2bliteral(void); // 10 void c_bronz(void); // 11 @@ -102,7 +107,7 @@ void c_sbit(void); // 37 void c_tbit(void); // 38 void loop_sharedcode(int i); - void c_jeex(void); // 39 + void c_jeex(void); // 39 void c_loopex(void); // 40 void c_plusloopex(void); // 41 void c_fieldtrans(void); // 42 @@ -116,7 +121,7 @@ void c_cyc2(void); // 50 void c_close(void); // 51 void c_open(void); // 52 - void c_oscli(void); // 53 + void c_oscli(void); // 53 void c_load(void); // 54 void c_save(void); // 55 void c_setkbptr(void); // 56 @@ -128,7 +133,7 @@ void c_defchar(void); // 62 void c_pplus(void); // 63 void c_pminus(void); // 64 - void c_sleepifidle(void); // 80 }; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IPS-Mmbed_bin.h Sat May 23 16:50:59 2015 +0900 @@ -0,0 +1,338 @@ +const uint8_t IPS_Mmbed_bin[] = { // IPS-Mmbed.bin +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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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, +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,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,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,0x49,0x50,0x53,0x2d,0x4d, +0x6d,0x62,0x65,0x64,0x20,0x32,0x30,0x31,0x35,0x30,0x35,0x32,0x33,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,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,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,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,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,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,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,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,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,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,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, +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,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,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,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,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,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,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,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,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,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,0x20,0x20,0x20,0x20,0x20,0x20, +0x14,0x0d,0xe5,0x12,0x06,0x05,0x06,0x05,0x06,0x05,0x06,0x05,0x06,0x05,0x06,0x05, +0x06,0x05,0xf6,0x06,0x4e,0x05,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x14,0x00,0x00,0x00,0xfd,0x08, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x0f,0x8c,0x8e,0x46,0x00,0x00,0x00,0x00,0x05,0x0b,0x7a,0x4a,0x00,0x05,0x04,0x00, +0x01,0x6a,0xaf,0x9d,0x08,0x05,0x05,0x00,0x02,0x52,0xd5,0x5f,0x10,0x05,0x06,0x00, +0x01,0xa8,0xaf,0x9d,0x18,0x05,0x07,0x00,0x02,0x53,0x51,0x5f,0x20,0x05,0x08,0x00, +0x09,0xa7,0x2c,0xd4,0x28,0x05,0x09,0x00,0x09,0x75,0x1b,0x34,0x30,0x05,0x0a,0x00, +0x05,0x2a,0x32,0x93,0x38,0x05,0x0b,0x00,0x04,0xb4,0x41,0xf3,0x40,0x05,0x0c,0x00, +0x03,0xe4,0xb9,0x12,0x48,0x05,0x0d,0x00,0x04,0xa1,0x21,0xe2,0x50,0x05,0x0e,0x00, +0x01,0xbc,0xaf,0x9d,0x58,0x05,0x0f,0x00,0x01,0xb0,0xaf,0x9d,0x60,0x05,0x10,0x00, +0x03,0xfa,0xf9,0x8a,0x68,0x05,0x11,0x00,0x04,0xbf,0x61,0x7a,0x70,0x05,0x12,0x00, +0x04,0xef,0xbd,0x72,0x78,0x05,0x13,0x00,0x03,0x24,0xf1,0x7a,0x80,0x05,0x14,0x00, +0x03,0x90,0xbd,0x3a,0x88,0x05,0x15,0x00,0x03,0xa4,0xbd,0x3a,0x90,0x05,0x16,0x00, +0x01,0x78,0xaf,0x9d,0x98,0x05,0x17,0x00,0x03,0x8f,0x55,0x32,0xa0,0x05,0x18,0x00, +0x03,0x9d,0x55,0x3a,0xa8,0x05,0x19,0x00,0x02,0xb7,0x21,0x5f,0xb0,0x05,0x1a,0x00, +0x02,0xb7,0x2d,0x5f,0xb8,0x05,0x1b,0x00,0x02,0xb7,0x25,0x5f,0xc0,0x05,0x1c,0x00, +0x03,0x51,0x5a,0x5a,0xc8,0x05,0x1d,0x00,0x07,0x4d,0x71,0x44,0xd0,0x05,0x1e,0x00, +0x05,0xf0,0x69,0xf2,0xd8,0x05,0x1f,0x00,0x03,0xc2,0x95,0x02,0xe0,0x05,0x20,0x00, +0x04,0xcc,0xc1,0x7b,0xe8,0x05,0x21,0x00,0x03,0xd4,0xcd,0x82,0xf0,0x05,0x22,0x00, +0x03,0x92,0x89,0xba,0xf8,0x05,0x23,0x00,0x04,0x31,0x71,0x4b,0x00,0x06,0x24,0x00, +0x04,0xf3,0x71,0x4a,0x08,0x06,0x25,0x00,0x04,0xa7,0x91,0x4a,0x10,0x06,0x26,0x00, +0x05,0xa4,0x97,0x42,0x18,0x06,0x27,0x00,0x06,0xea,0xb5,0x72,0x20,0x06,0x28,0x00, +0x07,0x37,0x8f,0x74,0x28,0x06,0x29,0x00,0x03,0x87,0x56,0x5a,0x30,0x06,0x2a,0x00, +0x02,0x82,0x95,0x5f,0x38,0x06,0x2b,0x00,0x05,0xf6,0x62,0x04,0x40,0x06,0x2c,0x00, +0x04,0xab,0xe1,0xfd,0x48,0x06,0x2d,0x00,0x09,0x2c,0xb2,0xd7,0x50,0x06,0x2e,0x00, +0x06,0xdb,0x87,0x3e,0x58,0x06,0x2f,0x00,0x06,0xcc,0x17,0x5f,0x60,0x06,0x30,0x00, +0x03,0x8c,0x8d,0xb2,0x68,0x06,0x31,0x00,0x04,0x4d,0x59,0x93,0x70,0x06,0x32,0x00, +0x0a,0x1d,0xff,0x0d,0x78,0x06,0x33,0x00,0x09,0xbe,0x96,0xd4,0x80,0x06,0x34,0x00, +0x0a,0x46,0xae,0x1a,0x88,0x06,0x35,0x00,0x09,0x34,0x6b,0xa1,0x90,0x06,0x36,0x00, +0x09,0xf2,0x79,0xc3,0x98,0x06,0x37,0x00,0x09,0xc2,0x9e,0xbe,0xa0,0x06,0x38,0x00, +0x08,0xe9,0x5f,0xef,0xa8,0x06,0x39,0x00,0x09,0xec,0x48,0xdb,0xb0,0x06,0x3a,0x00, +0x07,0x8e,0x58,0x6f,0xb8,0x06,0x3b,0x00,0x07,0x7c,0x54,0x8c,0xc0,0x06,0x3c,0x00, +0x03,0x4c,0xf6,0x32,0xc8,0x06,0x3d,0x00,0x0c,0xe5,0x0c,0xf6,0xd0,0x06,0x3e,0x00, +0x02,0x80,0x95,0x5f,0xd8,0x06,0x3f,0x00,0x02,0x8c,0x95,0x5f,0xe0,0x06,0x40,0x00, +0x0c,0x72,0x08,0xf9,0xe8,0x06,0x50,0x00,0x08,0xaa,0x4d,0xb5,0xf0,0x06,0x60,0x00, +0x03,0xee,0x8d,0x02,0xf8,0x06,0x02,0x00,0x18,0x04,0x03,0x4a,0xf9,0x32,0x00,0x07, +0x02,0x00,0x1e,0x04,0x03,0x48,0xf9,0x32,0x0a,0x07,0x02,0x00,0x22,0x04,0x03,0x4e, +0xf9,0x32,0x14,0x07,0x02,0x00,0x26,0x04,0x03,0x4c,0xf9,0x32,0x1e,0x07,0x02,0x00, +0x2a,0x04,0x05,0xb3,0x40,0x0a,0x28,0x07,0x02,0x00,0x02,0x04,0x01,0x8a,0xaf,0x9d, +0x32,0x07,0x02,0x00,0x00,0x00,0x01,0x88,0xaf,0x9d,0x3c,0x07,0x02,0x00,0x01,0x00, +0x01,0x8e,0xaf,0x9d,0x46,0x07,0x02,0x00,0x02,0x00,0x01,0x82,0xaf,0x9d,0x50,0x07, +0x02,0x00,0x04,0x00,0x01,0x96,0xaf,0x9d,0x5a,0x07,0x01,0x00,0x6e,0x05,0xc6,0x05, +0x0e,0x05,0x02,0xab,0x25,0x5f,0x64,0x07,0x01,0x00,0x6e,0x05,0xbe,0x05,0xe6,0x05, +0x0e,0x05,0x01,0x90,0xaf,0x9d,0x72,0x07,0x01,0x00,0x6e,0x05,0xbe,0x05,0x0e,0x05, +0x02,0xad,0x2d,0x5f,0x82,0x07,0x01,0x00,0x6e,0x05,0xce,0x05,0xe6,0x05,0x0e,0x05, +0x01,0x92,0xaf,0x9d,0x90,0x07,0x01,0x00,0x6e,0x05,0xce,0x05,0x0e,0x05,0x02,0xad, +0x25,0x5f,0xa0,0x07,0x01,0x00,0x6e,0x05,0xc6,0x05,0xe6,0x05,0x0e,0x05,0x03,0xbb, +0x56,0x4a,0xae,0x07,0x01,0x00,0xbe,0x05,0xe6,0x05,0x0e,0x05,0x01,0xbe,0xaf,0x9d, +0xbe,0x07,0x01,0x00,0x46,0x06,0x56,0x05,0x0e,0x05,0x02,0x88,0x95,0x5f,0xcc,0x07, +0x01,0x00,0x4e,0x06,0x56,0x05,0x0e,0x05,0x04,0xfc,0xe9,0x35,0xda,0x07,0x01,0x00, +0x36,0x05,0x00,0x86,0x05,0x4e,0x06,0x0e,0x05,0x01,0xb4,0xaf,0x9d,0xe8,0x07,0x01, +0x00,0xee,0x07,0x56,0x05,0x0e,0x05,0x03,0x42,0x91,0xc2,0xf9,0x07,0x01,0x00,0xee, +0x07,0x86,0x05,0x56,0x05,0x0e,0x05,0x02,0x95,0x79,0x5f,0x07,0x08,0x01,0x00,0x76, +0x05,0x16,0x05,0x9e,0x05,0x66,0x05,0x86,0x05,0x26,0x05,0x0e,0x05,0x07,0x6e,0x92, +0x2b,0x17,0x08,0x02,0x00,0xc0,0x01,0x09,0x1b,0x34,0xa9,0x2d,0x08,0x02,0x00,0x2e, +0x04,0x03,0xd0,0xee,0x8a,0x37,0x08,0x02,0x00,0x2f,0x04,0x03,0xc8,0xee,0x8a,0x41, +0x08,0x02,0x00,0x31,0x04,0x03,0x38,0xee,0x8a,0x4b,0x08,0x02,0x00,0x33,0x04,0x03, +0x3e,0xee,0x8a,0x55,0x08,0x02,0x00,0x35,0x04,0x03,0x3c,0xee,0x8a,0x5f,0x08,0x02, +0x00,0x37,0x04,0x02,0x47,0x45,0x5f,0x69,0x08,0x02,0x00,0x39,0x04,0x08,0xb9,0xf4, +0xad,0x73,0x08,0x02,0x00,0x3b,0x04,0x03,0xc2,0xe2,0x8a,0x7d,0x08,0x02,0x00,0xf8, +0xff,0x03,0xc2,0x9a,0x8a,0x87,0x08,0x02,0x00,0x00,0xff,0x03,0xc2,0x9e,0x8a,0x91, +0x08,0x02,0x00,0xff,0x14,0x05,0x28,0x6f,0x5a,0x9b,0x08,0x02,0x00,0x01,0x00,0x05, +0x1b,0x1b,0x7a,0xa5,0x08,0x02,0x00,0x03,0x00,0x06,0xc9,0x97,0xbd,0xaf,0x08,0x02, +0x00,0x02,0x00,0x03,0x3a,0xf5,0x0a,0xb9,0x08,0x02,0x00,0x00,0x00,0x03,0x32,0xf5, +0x0a,0xc3,0x08,0x02,0x00,0x00,0x01,0x03,0x2a,0xf5,0x0a,0xcd,0x08,0x02,0x00,0x00, +0x02,0x04,0x87,0xed,0xfd,0xd7,0x08,0x02,0x00,0x00,0x00,0x04,0xab,0xed,0xfd,0xe1, +0x08,0x02,0x00,0xff,0x03,0x03,0xd2,0x96,0x8a,0xeb,0x08,0x03,0x00,0x00,0x00,0x00, +0x00,0x03,0xfc,0xe6,0x8a,0xf5,0x08,0x03,0x00,0x01,0x00,0x03,0x38,0xb6,0x8a,0x01, +0x09,0x03,0x00,0x00,0x00,0x03,0x3e,0xb6,0x8a,0x0b,0x09,0x03,0x00,0x00,0x00,0x03, +0xcc,0x82,0x8a,0x15,0x09,0x03,0x00,0x00,0x00,0x05,0x1e,0x4e,0x72,0x1f,0x09,0x03, +0x00,0x00,0x00,0x03,0xa0,0xb9,0xba,0x29,0x09,0x03,0x00,0x00,0x00,0x03,0xb8,0xb9, +0xba,0x33,0x09,0x03,0x00,0x01,0x00,0x0b,0xac,0x62,0x28,0x3d,0x09,0x03,0x00,0x00, +0x00,0x07,0x3b,0x77,0xc6,0x47,0x09,0x03,0x00,0x00,0x00,0x0b,0x3d,0x25,0x13,0x51, +0x09,0x03,0x00,0x00,0x00,0x03,0x38,0xf6,0x8a,0x5b,0x09,0x03,0x00,0x00,0x00,0x04, +0x0a,0x8d,0x13,0x65,0x09,0x03,0x00,0xed,0x14,0x0c,0x46,0xb2,0xf5,0x6f,0x09,0x03, +0x00,0x53,0x54,0x41,0x50,0x45,0x4c,0x20,0x4c,0x45,0x45,0x52,0x20,0x21,0x20,0x20, +0x20,0x0e,0xa0,0x6c,0xa2,0x79,0x09,0x03,0x00,0x53,0x54,0x41,0x43,0x4b,0x20,0x45, +0x4d,0x50,0x54,0x59,0x20,0x21,0x20,0x20,0x20,0x0a,0x01,0xab,0xd5,0x91,0x09,0x03, +0x00,0x53,0x50,0x45,0x49,0x43,0x48,0x45,0x52,0x20,0x56,0x4f,0x4c,0x4c,0x20,0x21, +0x20,0x0c,0x94,0x68,0x94,0xa9,0x09,0x03,0x00,0x4d,0x45,0x4d,0x4f,0x52,0x59,0x20, +0x46,0x55,0x4c,0x4c,0x20,0x21,0x20,0x20,0x20,0x0b,0xca,0xb2,0xb7,0xc1,0x09,0x03, +0x00,0x4e,0x41,0x4d,0x45,0x20,0x46,0x45,0x48,0x4c,0x54,0x20,0x21,0x20,0x20,0x20, +0x20,0x0d,0xa5,0x99,0x31,0xd9,0x09,0x03,0x00,0x4e,0x41,0x4d,0x45,0x20,0x4d,0x49, +0x53,0x53,0x49,0x4e,0x47,0x20,0x21,0x20,0x20,0x0c,0xef,0x11,0x2e,0xf1,0x09,0x03, +0x00,0x53,0x54,0x52,0x55,0x4b,0x54,0x55,0x52,0x46,0x45,0x48,0x4c,0x45,0x52,0x20, +0x21,0x0e,0x09,0xcf,0x79,0x09,0x0a,0x03,0x00,0x53,0x54,0x52,0x55,0x43,0x54,0x55, +0x52,0x45,0x20,0x45,0x52,0x52,0x4f,0x52,0x21,0x0b,0x80,0xf0,0x70,0x21,0x0a,0x03, +0x00,0x54,0x45,0x58,0x54,0x46,0x45,0x48,0x4c,0x45,0x52,0x20,0x21,0x20,0x20,0x20, +0x20,0x0d,0xef,0xdb,0xf6,0x39,0x0a,0x03,0x00,0x54,0x45,0x58,0x54,0x2d,0x45,0x52, +0x52,0x4f,0x52,0x20,0x21,0x20,0x20,0x20,0x20,0x09,0x23,0xc6,0x6c,0x51,0x0a,0x03, +0x00,0x55,0x4e,0x5a,0x55,0x4c,0x2e,0x20,0x4e,0x41,0x4d,0x45,0x20,0x21,0x20,0x20, +0x20,0x0b,0xc2,0x66,0xb8,0x69,0x0a,0x03,0x00,0x44,0x55,0x50,0x4c,0x49,0x43,0x41, +0x54,0x45,0x20,0x4e,0x41,0x4d,0x45,0x20,0x21,0x04,0x24,0x19,0x2b,0x81,0x0a,0x01, +0x00,0x76,0x05,0x16,0x05,0x4c,0x07,0x66,0x05,0x86,0x05,0x26,0x05,0x0e,0x05,0x04, +0x48,0x21,0x13,0x99,0x0a,0x01,0x00,0x79,0x08,0x16,0x05,0x0e,0x05,0x05,0xf5,0x80, +0x25,0xaf,0x0a,0x01,0x00,0xb5,0x0a,0x56,0x07,0x66,0x05,0x79,0x08,0x26,0x05,0x0e, +0x05,0x04,0x81,0xa1,0x7d,0xbd,0x0a,0x01,0x00,0xb5,0x0a,0x26,0x05,0xc3,0x0a,0x0e, +0x05,0x04,0xcd,0xa1,0x45,0xd1,0x0a,0x01,0x00,0x76,0x05,0xae,0x06,0x76,0x05,0x1e, +0x05,0x36,0x05,0x80,0xf6,0x05,0x8e,0x05,0x2e,0x05,0x51,0x08,0x26,0x05,0xf1,0x08, +0x47,0x08,0x26,0x05,0x42,0x07,0x3d,0x08,0x2e,0x05,0x0e,0x05,0x02,0x5c,0xf1,0x5f, +0xe1,0x0a,0x01,0x00,0x5b,0x08,0x16,0x05,0x76,0x05,0x51,0x08,0x16,0x05,0x4c,0x07, +0x6e,0x05,0x26,0x06,0x35,0x0b,0xa6,0x05,0x1e,0x05,0x36,0x05,0x80,0xfe,0x05,0xa6, +0x05,0x2e,0x05,0x2e,0x06,0x26,0x0b,0xe7,0x0a,0x56,0x05,0x86,0x06,0x0e,0x05,0x05, +0x92,0x7b,0x62,0x0c,0x0b,0x02,0x00,0x00,0x00,0x08,0x5f,0xf7,0xdd,0x3f,0x0b,0x01, +0x00,0x45,0x0b,0x66,0x05,0x33,0x08,0x36,0x05,0x10,0x3e,0x06,0x42,0x07,0x12,0x0b, +0x0e,0x05,0x04,0x91,0x4e,0xab,0x49,0x0b,0x01,0x00,0x76,0x05,0x3e,0x05,0x00,0x01, +0x6a,0x07,0x46,0x05,0x9c,0x0b,0x3e,0x05,0x00,0x01,0x6e,0x05,0xae,0x05,0x7e,0x05, +0x3e,0x05,0x00,0x01,0x3e,0x06,0x3e,0x05,0x00,0x01,0x66,0x05,0x86,0x05,0x3e,0x05, +0x00,0x01,0x66,0x05,0x86,0x05,0xb6,0x05,0x4e,0x05,0x6a,0x0b,0x76,0x05,0xc6,0x05, +0x46,0x05,0xaa,0x0b,0x3e,0x06,0x4e,0x05,0xae,0x0b,0x5e,0x05,0x56,0x05,0x0e,0x05, +0x05,0xbb,0xaf,0xc3,0x62,0x0b,0x01,0x00,0x75,0x09,0x16,0x05,0x6f,0x08,0x26,0x05, +0x66,0x06,0x0e,0x05,0x05,0xae,0x37,0x62,0xb0,0x0b,0x01,0x00,0x42,0x07,0x3d,0x08, +0x1e,0x05,0x42,0x07,0x65,0x08,0x26,0x05,0x46,0x05,0x46,0x0c,0x4c,0x07,0x6e,0x06, +0xc6,0x05,0x46,0x05,0x46,0x0c,0x51,0x08,0x16,0x05,0x5b,0x08,0x26,0x05,0x56,0x07, +0x6e,0x06,0x5e,0x05,0x3e,0x05,0x57,0xce,0x36,0x05,0x8d,0x5b,0x08,0x16,0x05,0x51, +0x08,0x16,0x05,0x8e,0x05,0x6e,0x05,0x76,0x05,0x36,0x05,0x3f,0x6a,0x07,0x46,0x05, +0x17,0x0c,0x56,0x05,0x36,0x05,0x3f,0x76,0x05,0xfb,0x08,0x2e,0x05,0x4c,0x07,0x6e, +0x05,0x8e,0x05,0x66,0x05,0x26,0x06,0x31,0x0c,0xa6,0x05,0x1e,0x05,0x5e,0x06,0x2e, +0x06,0x29,0x0c,0xfb,0x08,0x36,0x05,0x03,0x66,0x05,0x2e,0x05,0xfb,0x08,0x4c,0x07, +0x66,0x05,0x26,0x05,0x4c,0x07,0x0e,0x05,0x05,0x0e,0xa3,0x63,0xc4,0x0b,0x01,0x00, +0x4c,0x07,0x42,0x07,0x51,0x08,0x16,0x05,0x4c,0x07,0x6e,0x05,0x5b,0x08,0x16,0x05, +0x36,0x05,0x2d,0x8e,0x05,0x1e,0x05,0x88,0x07,0x46,0x05,0x7e,0x0c,0x4c,0x07,0x66, +0x05,0x3e,0x05,0xff,0xff,0xae,0x05,0x36,0x05,0x0a,0x4e,0x05,0xb4,0x0c,0x4c,0x07, +0xae,0x05,0x36,0x05,0x23,0x8e,0x05,0x1e,0x05,0x88,0x07,0x46,0x05,0x9a,0x0c,0x4c, +0x07,0x66,0x05,0x36,0x05,0x10,0x4e,0x05,0xb4,0x0c,0x36,0x05,0x42,0x8e,0x05,0x1e, +0x05,0x88,0x07,0x46,0x05,0xb1,0x0c,0x4c,0x07,0x66,0x05,0x56,0x07,0x4e,0x05,0xb4, +0x0c,0x36,0x05,0x0a,0x2f,0x09,0x26,0x05,0x86,0x05,0x26,0x06,0x04,0x0d,0x2f,0x09, +0x16,0x05,0xd2,0x07,0xa6,0x05,0x1e,0x05,0x76,0x05,0x36,0x05,0x3a,0xa6,0x07,0x46, +0x05,0xd8,0x0c,0x36,0x05,0x30,0x6e,0x05,0x76,0x05,0x36,0x05,0x40,0x6a,0x07,0x46, +0x05,0xe8,0x0c,0x36,0x05,0x37,0x6e,0x05,0x76,0x05,0x2f,0x09,0x16,0x05,0x96,0x07, +0x8e,0x05,0xce,0x05,0xf6,0x05,0x46,0x05,0x00,0x0d,0x56,0x05,0x42,0x07,0x96,0x05, +0x66,0x05,0x2e,0x06,0xbe,0x0c,0xb6,0x05,0xd2,0x07,0x86,0x05,0x0e,0x05,0x08,0x5d, +0x53,0xd7,0x48,0x0c,0x01,0x00,0xca,0x0b,0x46,0x05,0x3e,0x0e,0xb6,0x0b,0x4c,0x07, +0x39,0x09,0x1e,0x05,0x46,0x05,0x62,0x0d,0x8e,0x05,0x3e,0x05,0x06,0x05,0x88,0x07, +0x46,0x05,0x3e,0x0d,0x42,0x07,0x39,0x09,0x26,0x05,0x4e,0x05,0x62,0x0d,0x57,0x09, +0x16,0x05,0x46,0x05,0x50,0x0d,0x5e,0x05,0x42,0x07,0x4c,0x07,0x4e,0x05,0x62,0x0d, +0x8e,0x05,0x43,0x09,0x16,0x05,0xa6,0x07,0x46,0x05,0x62,0x0d,0x12,0x0b,0x56,0x05, +0x42,0x07,0x46,0x05,0x3e,0x0e,0x76,0x05,0xbe,0x05,0x46,0x05,0xc6,0x0d,0x56,0x05, +0x4e,0x0c,0x46,0x05,0xc0,0x0d,0x61,0x09,0x1e,0x05,0x46,0x05,0xaa,0x0d,0x76,0x05, +0x3e,0x05,0x00,0xff,0xee,0x05,0xbe,0x05,0x46,0x05,0x9e,0x0d,0x3e,0x05,0x36,0x05, +0xd7,0x0a,0xb5,0x0a,0x2e,0x05,0x79,0x08,0x9f,0x0a,0x4e,0x05,0xa6,0x0d,0x3e,0x05, +0x3e,0x05,0xd7,0x0a,0xd7,0x0a,0x4e,0x05,0xbc,0x0d,0x39,0x09,0x1e,0x05,0x46,0x05, +0xbc,0x0d,0x4d,0x09,0x26,0x05,0x42,0x07,0x57,0x09,0x26,0x05,0x4e,0x05,0xc2,0x0d, +0x12,0x0b,0x4e,0x05,0x28,0x0e,0x76,0x05,0x36,0x05,0x06,0x6e,0x05,0x1e,0x05,0x36, +0x05,0xc0,0xee,0x05,0x61,0x09,0x1e,0x05,0xf6,0x05,0x76,0x05,0x4c,0x07,0x88,0x07, +0x46,0x05,0x00,0x0e,0x56,0x05,0xb5,0x0a,0x97,0x08,0xd6,0x05,0x46,0x05,0xfa,0x0d, +0x56,0x05,0xaf,0x09,0x4f,0x0b,0x4e,0x05,0xfc,0x0d,0xd7,0x0a,0x4e,0x05,0x28,0x0e, +0x76,0x05,0x36,0x05,0x80,0x88,0x07,0x86,0x05,0x36,0x05,0xc1,0x88,0x07,0xf6,0x05, +0x46,0x05,0x1a,0x0e,0x12,0x0b,0x4e,0x05,0x28,0x0e,0xb6,0x05,0x6b,0x09,0x26,0x05, +0x56,0x06,0x6b,0x09,0x16,0x05,0xae,0x05,0xb6,0x06,0x8d,0x08,0x6a,0x07,0x46,0x05, +0x3e,0x0e,0x8d,0x08,0xbe,0x06,0x7f,0x09,0x4f,0x0b,0x56,0x05,0x11,0x09,0x3d,0x08, +0x1e,0x05,0x65,0x08,0x1e,0x05,0xee,0x05,0x46,0x05,0x6d,0x0e,0x36,0x05,0x20,0xdd, +0x08,0x2e,0x05,0xdd,0x08,0x76,0x05,0x4c,0x07,0x66,0x05,0x51,0x08,0x16,0x05,0xdd, +0x08,0x6e,0x05,0x4c,0x07,0x6e,0x05,0x68,0x0b,0xdd,0x08,0xe7,0x0a,0x0e,0x05,0x0a, +0xd5,0x8b,0x97,0x0e,0x0d,0x01,0x00,0x11,0x09,0x25,0x09,0x26,0x05,0xca,0x0b,0x76, +0x05,0x46,0x05,0xc9,0x0e,0xb6,0x0b,0xbe,0x05,0xe6,0x05,0x07,0x09,0x16,0x05,0xee, +0x05,0x46,0x05,0xa1,0x0e,0x6f,0x0a,0x4f,0x0b,0x56,0x05,0x42,0x07,0x4e,0x05,0xc5, +0x0e,0xb5,0x0a,0x76,0x05,0x25,0x09,0x26,0x05,0x75,0x09,0x16,0x05,0xc3,0x0a,0xc3, +0x0a,0xd7,0x0a,0xfb,0x08,0x8e,0x05,0x60,0x07,0x3e,0x06,0x75,0x09,0x26,0x05,0xb5, +0x0a,0x86,0x05,0xc3,0x0a,0x4e,0x05,0xcd,0x0e,0xdf,0x09,0x4f,0x0b,0x0e,0x05,0x07, +0x26,0x44,0x6d,0x6f,0x0e,0x01,0x00,0xca,0x0b,0x46,0x05,0xf5,0x0e,0xb6,0x0b,0x76, +0x05,0xbe,0x05,0x46,0x05,0xef,0x0e,0x12,0x0b,0x42,0x07,0x4e,0x05,0xf1,0x0e,0x4c, +0x07,0x4e,0x05,0xfb,0x0e,0xdf,0x09,0x4f,0x0b,0x42,0x07,0x0e,0x05,0x41,0xa4,0xaf, +0x9d,0xcf,0x0e,0x01,0x00,0xd5,0x0e,0x46,0x05,0x1b,0x0f,0x61,0x09,0x16,0x05,0x46, +0x05,0x1b,0x0f,0x3e,0x05,0x3e,0x05,0xd7,0x0a,0xd7,0x0a,0x0e,0x05,0x81,0x9c,0xaf, +0x9d,0xfd,0x0e,0x01,0x00,0x3e,0x05,0x0e,0x05,0xd7,0x0a,0x42,0x07,0x61,0x09,0x2e, +0x05,0x1b,0x09,0x78,0x07,0x46,0x05,0x63,0x0f,0x0f,0x0a,0x45,0x0b,0x66,0x05,0x33, +0x08,0x36,0x05,0x20,0x66,0x05,0x36,0x05,0x10,0x3e,0x06,0x75,0x09,0x16,0x05,0x76, +0x05,0x79,0x08,0x26,0x05,0x60,0x07,0x66,0x05,0x16,0x05,0x75,0x09,0x26,0x05,0x42, +0x07,0x12,0x0b,0x0e,0x05,0xc1,0x9e,0xaf,0x9d,0x1d,0x0f,0x01,0x00,0x75,0x0e,0x46, +0x05,0x81,0x0f,0xab,0x08,0x86,0x05,0x26,0x05,0x4c,0x07,0x61,0x09,0x2e,0x05,0x1b, +0x09,0x0e,0x05,0x09,0x32,0xfb,0xee,0x65,0x0f,0x01,0x00,0x25,0x09,0x16,0x05,0x1e, +0x05,0xf6,0x05,0x25,0x09,0x16,0x05,0x2e,0x05,0x0e,0x05,0xc6,0xd5,0xc6,0x60,0x83, +0x0f,0x01,0x00,0x6b,0x0f,0x36,0x05,0x80,0x89,0x0f,0x0e,0x05,0xc5,0xec,0x5c,0x6a, +0x9b,0x0f,0x01,0x00,0x6b,0x0f,0x36,0x05,0x40,0x89,0x0f,0x0e,0x05,0xc4,0x32,0x4d, +0x14,0xac,0x0f,0x01,0x00,0x6b,0x0f,0x36,0x05,0xc0,0x89,0x0f,0x0e,0x05,0x83,0xc4, +0xa9,0xfa,0xbd,0x0f,0x01,0x00,0x3e,0x05,0x46,0x05,0xd7,0x0a,0xb5,0x0a,0xc3,0x0a, +0x0e,0x05,0x84,0x61,0x8d,0x53,0xce,0x0f,0x01,0x00,0xb5,0x0a,0x86,0x05,0x26,0x05, +0x0e,0x05,0x85,0x1d,0xf1,0xa2,0xe2,0x0f,0x01,0x00,0x3e,0x05,0x4e,0x05,0xd7,0x0a, +0xb5,0x0a,0xc3,0x0a,0x86,0x05,0xe8,0x0f,0x0e,0x05,0x82,0x5c,0xfd,0x5f,0xf2,0x0f, +0x01,0x00,0x3e,0x05,0x26,0x06,0xd7,0x0a,0xb5,0x0a,0xc3,0x0a,0x0e,0x05,0x83,0x66, +0xf9,0xda,0x0a,0x10,0x01,0x00,0x3e,0x05,0x2e,0x06,0xd7,0x0a,0x76,0x05,0xe8,0x0f, +0x56,0x07,0x66,0x05,0xd7,0x0a,0x0e,0x05,0x84,0xa8,0x01,0x2d,0x1e,0x10,0x01,0x00, +0x3e,0x05,0x36,0x06,0xd7,0x0a,0x76,0x05,0xe8,0x0f,0x56,0x07,0x66,0x05,0xd7,0x0a, +0x0e,0x05,0x86,0xb4,0x83,0x8c,0x38,0x10,0x01,0x00,0xb5,0x0a,0x0e,0x05,0x85,0x83, +0x37,0x0a,0x52,0x10,0x01,0x00,0x3e,0x05,0x46,0x05,0xd7,0x0a,0xd7,0x0a,0x0e,0x05, +0x8c,0xea,0x7d,0xfd,0x5e,0x10,0x01,0x00,0x86,0x05,0x3e,0x05,0x4e,0x05,0xd7,0x0a, +0xd7,0x0a,0xe8,0x0f,0x0e,0x05,0xc3,0x36,0x91,0xf2,0x70,0x10,0x01,0x00,0x75,0x0e, +0x46,0x05,0x9c,0x10,0xbf,0x08,0x86,0x05,0x26,0x05,0xd7,0x0a,0x0e,0x05,0xc3,0xde, +0xa9,0x1a,0x86,0x10,0x01,0x00,0x75,0x0e,0x46,0x05,0xb4,0x10,0xb5,0x08,0x86,0x05, +0x26,0x05,0xd7,0x0a,0x0e,0x05,0xc4,0x0d,0xc5,0x73,0x9e,0x10,0x01,0x00,0x75,0x0e, +0x46,0x05,0xd2,0x10,0xb5,0x08,0x86,0x05,0x26,0x05,0xb5,0x0a,0x66,0x05,0x79,0x08, +0x26,0x05,0x0e,0x05,0x02,0x76,0x99,0x5f,0xb6,0x10,0x03,0x00,0x00,0x01,0x05,0x1d, +0x7e,0x6a,0xd4,0x10,0x01,0x00,0xda,0x10,0x16,0x05,0x2e,0x05,0xda,0x10,0x9f,0x0a, +0x0e,0x05,0x08,0x47,0x95,0xb8,0xde,0x10,0x01,0x00,0xa6,0x05,0x4c,0x07,0x66,0x05, +0xb6,0x05,0x1e,0x05,0x7e,0x05,0x66,0x05,0xae,0x05,0xda,0x10,0x16,0x05,0x7e,0x05, +0x66,0x05,0xda,0x10,0x26,0x05,0x86,0x05,0x3e,0x06,0x0e,0x05,0x41,0xae,0xaf,0x9d, +0xf2,0x10,0x01,0x00,0x51,0x08,0x9f,0x0a,0x51,0x08,0x16,0x05,0x42,0x07,0x8e,0x05, +0x76,0x05,0x3e,0x05,0x01,0x01,0x66,0x05,0x76,0x05,0xf1,0x08,0x6a,0x07,0x46,0x05, +0x46,0x11,0x56,0x05,0xf1,0x08,0x26,0x06,0x69,0x11,0x51,0x08,0x16,0x05,0x1e,0x05, +0x36,0x05,0x22,0x88,0x07,0x46,0x05,0x63,0x11,0xb6,0x05,0x5e,0x05,0x4c,0x07,0xa6, +0x05,0xae,0x05,0x51,0x08,0x9f,0x0a,0x2e,0x06,0x4a,0x11,0x8e,0x05,0x51,0x08,0x16, +0x05,0x56,0x07,0x6e,0x05,0x86,0x05,0x6e,0x05,0x76,0x05,0xc6,0x05,0x9e,0x05,0xee, +0x05,0x46,0x05,0xb3,0x11,0x61,0x09,0x16,0x05,0x46,0x05,0xaf,0x11,0xae,0x05,0xa6, +0x05,0x3e,0x05,0xf8,0x10,0xd7,0x0a,0xb5,0x0a,0x2e,0x05,0x79,0x08,0x9f,0x0a,0xb5, +0x0a,0xa6,0x05,0x3e,0x06,0xb5,0x0a,0xb6,0x05,0x66,0x05,0x79,0x08,0x26,0x05,0x4e, +0x05,0xbb,0x11,0x3f,0x0a,0x4f,0x0b,0x86,0x05,0x56,0x05,0x0e,0x05,0xc2,0x7f,0x51, +0x5f,0x1c,0x11,0x01,0x00,0x86,0x05,0x3e,0x06,0x0e,0x05,0x05,0x1d,0xf1,0x42,0xbd, +0x11,0x01,0x00,0xae,0x05,0xda,0x10,0x16,0x05,0x36,0x05,0x20,0x8e,0x05,0x2e,0x05, +0x76,0x05,0x4c,0x07,0x66,0x05,0xb6,0x05,0x4c,0x07,0x6e,0x05,0x68,0x0b,0x0e,0x05, +0xc2,0x40,0xe9,0x5f,0xcb,0x11,0x01,0x00,0xda,0x10,0x16,0x05,0x33,0x08,0xda,0x10, +0x26,0x05,0x36,0x05,0x40,0xd1,0x11,0xda,0x10,0x26,0x05,0x0e,0x05,0x03,0x9c,0xb6, +0xa2,0xf0,0x11,0x01,0x00,0xae,0x05,0xa6,0x05,0x56,0x07,0xd2,0x07,0x66,0x05,0x4c, +0x07,0xb6,0x05,0x26,0x06,0x35,0x12,0x56,0x07,0x6e,0x05,0x76,0x05,0xae,0x05,0x26, +0x05,0xb6,0x05,0x2e,0x06,0x27,0x12,0x56,0x05,0x0e,0x05,0x04,0x93,0xed,0x52,0x0d, +0x12,0x01,0x00,0x2f,0x09,0x16,0x05,0x36,0x05,0x0a,0x88,0x07,0x46,0x05,0x69,0x12, +0x76,0x05,0xce,0x05,0x46,0x05,0x5f,0x12,0x76,0x06,0x36,0x05,0x2d,0xe4,0x10,0x3e, +0x05,0x10,0x27,0x42,0x07,0x4e,0x05,0x7b,0x12,0x36,0x05,0x10,0x2f,0x09,0x26,0x05, +0x36,0x05,0x23,0xe4,0x10,0x3e,0x05,0x00,0x10,0x4c,0x07,0xae,0x05,0x86,0x05,0x8e, +0x05,0xee,0x07,0x86,0x05,0xa6,0x05,0xe6,0x05,0x46,0x05,0x9d,0x12,0x76,0x05,0xc6, +0x05,0x46,0x05,0x9d,0x12,0xb6,0x05,0x56,0x05,0x4c,0x07,0xae,0x05,0xa6,0x05,0x46, +0x05,0xbc,0x12,0x76,0x05,0x36,0x05,0x30,0x66,0x05,0x76,0x05,0x36,0x05,0x39,0x6a, +0x07,0x46,0x05,0xba,0x12,0x36,0x05,0x07,0x66,0x05,0xe4,0x10,0x56,0x05,0x86,0x05, +0x2f,0x09,0x16,0x05,0xff,0x07,0x76,0x05,0xbe,0x05,0x46,0x05,0x7d,0x12,0x5e,0x05, +0xb6,0x05,0xe6,0x05,0x46,0x05,0xdd,0x12,0x36,0x05,0x30,0xe4,0x10,0x0e,0x05,0x0b, +0x8c,0x88,0x89,0x3b,0x12,0x01,0x00,0x65,0x08,0x16,0x05,0x46,0x05,0x66,0x13,0xda, +0x10,0x16,0x05,0xae,0x05,0xe7,0x08,0xda,0x10,0x26,0x05,0x36,0x05,0x80,0xd1,0x11, +0xb6,0x06,0x8d,0x08,0x8e,0x05,0x6e,0x05,0x76,0x05,0x36,0x05,0x20,0x6a,0x07,0x46, +0x05,0x18,0x13,0x56,0x05,0x36,0x05,0x20,0xae,0x05,0xa6,0x05,0x66,0x05,0xa6,0x05, +0xc6,0x05,0x46,0x05,0x5c,0x13,0x76,0x05,0xa6,0x05,0x6e,0x05,0x76,0x05,0x4c,0x07, +0x66,0x05,0x1e,0x05,0x3e,0x05,0x00,0x01,0xd2,0x07,0x86,0x05,0x1e,0x05,0x66,0x05, +0xb6,0x05,0x56,0x07,0x6e,0x05,0xae,0x05,0xe7,0x08,0xa6,0x05,0x60,0x07,0xd2,0x07, +0x66,0x05,0xda,0x10,0x26,0x05,0x41,0x12,0x4e,0x05,0x1e,0x13,0xb6,0x05,0x5e,0x05, +0xb6,0x05,0xda,0x10,0x26,0x05,0x0e,0x05,0x07,0xb1,0x74,0x2a,0xdf,0x12,0x01,0x00, +0x86,0x05,0x36,0x05,0x07,0xee,0x05,0x56,0x07,0xd2,0x07,0x38,0x07,0x66,0x05,0x26, +0x05,0x0e,0x05,0x09,0xd6,0xf2,0xaf,0x68,0x13,0x01,0x00,0x61,0x09,0x16,0x05,0x46, +0x05,0xa5,0x13,0x3e,0x05,0x3e,0x05,0xd7,0x0a,0xd7,0x0a,0x3e,0x05,0x6e,0x13,0xd7, +0x0a,0x4e,0x05,0xbb,0x13,0x8e,0x05,0x3e,0x05,0xf8,0xff,0xee,0x05,0xbe,0x05,0x46, +0x05,0xb9,0x13,0x6e,0x13,0x4e,0x05,0xbb,0x13,0x12,0x0b,0x0e,0x05,0x44,0x41,0x59, +0xf3,0x83,0x13,0x01,0x00,0x3e,0x05,0x06,0x05,0x89,0x13,0x0e,0x05,0x44,0xf1,0xad, +0x13,0xbd,0x13,0x01,0x00,0xd5,0x0e,0x46,0x05,0xdd,0x13,0x89,0x13,0x0e,0x05,0xc1, +0x94,0xaf,0x9d,0xcd,0x13,0x01,0x00,0xd5,0x0e,0x46,0x05,0xf1,0x13,0x56,0x07,0x66, +0x05,0x0e,0x05,0x07,0x53,0x44,0xe7,0xdf,0x13,0x01,0x00,0xae,0x05,0xda,0x10,0x16, +0x05,0xa6,0x05,0x3e,0x06,0xda,0x10,0x16,0x05,0xb6,0x05,0x66,0x05,0xda,0x10,0x26, +0x05,0x0e,0x05,0xc6,0xd5,0x10,0x17,0xf3,0x13,0x01,0x00,0xd5,0x0e,0x46,0x05,0x47, +0x14,0x76,0x05,0xa1,0x08,0x86,0x05,0xd6,0x05,0x46,0x05,0x33,0x14,0x12,0x0b,0x4e, +0x05,0x47,0x14,0x56,0x07,0x6e,0x05,0x76,0x05,0x16,0x05,0x75,0x09,0x26,0x05,0x60, +0x07,0x6e,0x05,0x79,0x08,0x26,0x05,0x0e,0x05,0xc3,0x8c,0x9d,0xb2,0x13,0x14,0x01, +0x00,0x8d,0x08,0xbe,0x06,0x0e,0x05,0xc5,0xe1,0xfb,0x63,0x49,0x14,0x01,0x00,0xa6, +0x06,0x76,0x05,0xbe,0x05,0x46,0x05,0x6f,0x14,0x12,0x0b,0x4e,0x05,0x71,0x14,0x56, +0x05,0x0e,0x05,0xc5,0x74,0x47,0x12,0x57,0x14,0x01,0x00,0x9e,0x06,0x76,0x05,0xbe, +0x05,0x46,0x05,0x8b,0x14,0x12,0x0b,0x4e,0x05,0x8d,0x14,0x56,0x05,0x0e,0x05,0xc5, +0x51,0x01,0xb3,0x73,0x14,0x01,0x00,0x96,0x06,0x76,0x05,0xbe,0x05,0x46,0x05,0xa7, +0x14,0x12,0x0b,0x4e,0x05,0xa9,0x14,0x56,0x05,0x0e,0x05,0xc4,0xbf,0x71,0x72,0x8f, +0x14,0x01,0x00,0x8e,0x06,0x76,0x05,0xbe,0x05,0x46,0x05,0xc1,0x14,0x12,0x0b,0x42, +0x07,0x83,0x08,0x2e,0x05,0x0e,0x05,0x04,0x92,0x8d,0x53,0xab,0x14,0x01,0x00,0xc4, +0x07,0x46,0x05,0xdf,0x14,0x97,0x09,0x7f,0x09,0x6e,0x05,0x4e,0x05,0xe1,0x14,0x42, +0x07,0x3e,0x05,0x45,0x0b,0x56,0x07,0x66,0x05,0x26,0x05,0x0e,0x05,0x04,0x37,0x6a, +0x32,0xc7,0x14,0x01,0x00,0x42,0x07,0x3e,0x05,0xe5,0x12,0x6e,0x13,0x0e,0x05,}; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PinNameTable.h Sat May 23 16:50:59 2015 +0900 @@ -0,0 +1,205 @@ +/* + * by pinname.py on + * Sat Jul 19 08:40:59 2014 + * + * DO NOT EDIT THIS FILE. + * ANY CHANGES WILL BE LOST. + */ + +#include "mbed.h" +#pragma once + +struct pinNameStr { + const char* name; + const PinName pin; +}; + +#define P(A) {#A, A} +const struct pinNameStr pinname_table[] = { +#if 0 + +#elif defined(TARGET_LPC1768) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12),P(P0_13), +P(P0_14),P(P0_15),P(P0_16),P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20),P(P0_21), +P(P0_22),P(P0_23),P(P0_24),P(P0_25),P(P0_26),P(P0_27),P(P0_28),P(P0_29),P(P0_3), +P(P0_30),P(P0_31),P(P0_4),P(P0_5),P(P0_6),P(P0_7),P(P0_8),P(P0_9),P(P1_0),P(P1_1), +P(P1_10),P(P1_11),P(P1_12),P(P1_13),P(P1_14),P(P1_15),P(P1_16),P(P1_17),P(P1_18), +P(P1_19),P(P1_2),P(P1_20),P(P1_21),P(P1_22),P(P1_23),P(P1_24),P(P1_25),P(P1_26), +P(P1_27),P(P1_28),P(P1_29),P(P1_3),P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6),P(P1_7), +P(P1_8),P(P1_9),P(P2_0),P(P2_1),P(P2_10),P(P2_11),P(P2_12),P(P2_13),P(P2_14),P(P2_15), +P(P2_16),P(P2_17),P(P2_18),P(P2_19),P(P2_2),P(P2_20),P(P2_21),P(P2_22),P(P2_23), +P(P2_24),P(P2_25),P(P2_26),P(P2_27),P(P2_28),P(P2_29),P(P2_3),P(P2_30),P(P2_31), +P(P2_4),P(P2_5),P(P2_6),P(P2_7),P(P2_8),P(P2_9),P(P3_0),P(P3_1),P(P3_10),P(P3_11), +P(P3_12),P(P3_13),P(P3_14),P(P3_15),P(P3_16),P(P3_17),P(P3_18),P(P3_19),P(P3_2), +P(P3_20),P(P3_21),P(P3_22),P(P3_23),P(P3_24),P(P3_25),P(P3_26),P(P3_27),P(P3_28), +P(P3_29),P(P3_3),P(P3_30),P(P3_31),P(P3_4),P(P3_5),P(P3_6),P(P3_7),P(P3_8),P(P3_9), +P(P4_0),P(P4_1),P(P4_10),P(P4_11),P(P4_12),P(P4_13),P(P4_14),P(P4_15),P(P4_16),P(P4_17), +P(P4_18),P(P4_19),P(P4_2),P(P4_20),P(P4_21),P(P4_22),P(P4_23),P(P4_24),P(P4_25), +P(P4_26),P(P4_27),P(P4_28),P(P4_29),P(P4_3),P(P4_30),P(P4_31),P(P4_4),P(P4_5),P(P4_6), +P(P4_7),P(P4_8),P(P4_9),P(USBRX),P(USBTX),P(p10),P(p11),P(p12),P(p13),P(p14),P(p15), +P(p16),P(p17),P(p18),P(p19),P(p20),P(p21),P(p22),P(p23),P(p24),P(p25),P(p26),P(p27), +P(p28),P(p29),P(p30),P(p5),P(p6),P(p7),P(p8),P(p9), +#elif defined(TARGET_LPC1549) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(LED1),P(LED2),P(LED3),P(LED4), +P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12), +P(P0_13),P(P0_14),P(P0_15),P(P0_16),P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20), +P(P0_21),P(P0_22),P(P0_23),P(P0_24),P(P0_25),P(P0_26),P(P0_27),P(P0_28),P(P0_29), +P(P0_3),P(P0_30),P(P0_31),P(P0_4),P(P0_5),P(P0_6),P(P0_7),P(P0_8),P(P0_9),P(P1_0), +P(P1_1),P(P1_10),P(P1_11),P(P1_12),P(P1_13),P(P1_14),P(P1_15),P(P1_16),P(P1_17), +P(P1_18),P(P1_19),P(P1_2),P(P1_20),P(P1_21),P(P1_22),P(P1_23),P(P1_24),P(P1_25), +P(P1_26),P(P1_27),P(P1_28),P(P1_29),P(P1_3),P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6), +P(P1_7),P(P1_8),P(P1_9),P(P2_0),P(P2_1),P(P2_10),P(P2_11),P(P2_12),P(P2_2),P(P2_3), +P(P2_4),P(P2_5),P(P2_6),P(P2_7),P(P2_8),P(P2_9),P(SCL),P(SDA),P(USBRX),P(USBTX), + +#elif defined(TARGET_KL25Z) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(PTA0),P(PTA1), +P(PTA10),P(PTA11),P(PTA12),P(PTA13),P(PTA14),P(PTA15),P(PTA16),P(PTA17),P(PTA18), +P(PTA19),P(PTA2),P(PTA20),P(PTA21),P(PTA22),P(PTA23),P(PTA24),P(PTA25),P(PTA26), +P(PTA27),P(PTA28),P(PTA29),P(PTA3),P(PTA30),P(PTA31),P(PTA4),P(PTA5),P(PTA6),P(PTA7), +P(PTA8),P(PTA9),P(PTB0),P(PTB1),P(PTB10),P(PTB11),P(PTB12),P(PTB13),P(PTB14),P(PTB15), +P(PTB16),P(PTB17),P(PTB18),P(PTB19),P(PTB2),P(PTB20),P(PTB21),P(PTB22),P(PTB23), +P(PTB24),P(PTB25),P(PTB26),P(PTB27),P(PTB28),P(PTB29),P(PTB3),P(PTB30),P(PTB31), +P(PTB4),P(PTB5),P(PTB6),P(PTB7),P(PTB8),P(PTB9),P(PTC0),P(PTC1),P(PTC10),P(PTC11), +P(PTC12),P(PTC13),P(PTC14),P(PTC15),P(PTC16),P(PTC17),P(PTC18),P(PTC19),P(PTC2), +P(PTC20),P(PTC21),P(PTC22),P(PTC23),P(PTC24),P(PTC25),P(PTC26),P(PTC27),P(PTC28), +P(PTC29),P(PTC3),P(PTC30),P(PTC31),P(PTC4),P(PTC5),P(PTC6),P(PTC7),P(PTC8),P(PTC9), +P(PTD0),P(PTD1),P(PTD10),P(PTD11),P(PTD12),P(PTD13),P(PTD14),P(PTD15),P(PTD16),P(PTD17), +P(PTD18),P(PTD19),P(PTD2),P(PTD20),P(PTD21),P(PTD22),P(PTD23),P(PTD24),P(PTD25), +P(PTD26),P(PTD27),P(PTD28),P(PTD29),P(PTD3),P(PTD30),P(PTD31),P(PTD4),P(PTD5),P(PTD6), +P(PTD7),P(PTD8),P(PTD9),P(PTE0),P(PTE1),P(PTE10),P(PTE11),P(PTE12),P(PTE13),P(PTE14), +P(PTE15),P(PTE16),P(PTE17),P(PTE18),P(PTE19),P(PTE2),P(PTE20),P(PTE21),P(PTE22), +P(PTE23),P(PTE24),P(PTE25),P(PTE26),P(PTE27),P(PTE28),P(PTE29),P(PTE3),P(PTE30), +P(PTE31),P(PTE4),P(PTE5),P(PTE6),P(PTE7),P(PTE8),P(PTE9),P(TSI_ELEC0),P(TSI_ELEC1), +P(USBRX),P(USBTX), +#elif defined(TARGET_KL46Z) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(LED_GREEN),P(LED_RED),P(NC),P(PTA0),P(PTA1),P(PTA10),P(PTA11), +P(PTA12),P(PTA13),P(PTA14),P(PTA15),P(PTA16),P(PTA17),P(PTA18),P(PTA19),P(PTA2), +P(PTA20),P(PTA21),P(PTA22),P(PTA23),P(PTA24),P(PTA25),P(PTA26),P(PTA27),P(PTA28), +P(PTA29),P(PTA3),P(PTA30),P(PTA31),P(PTA4),P(PTA5),P(PTA6),P(PTA7),P(PTA8),P(PTA9), +P(PTB0),P(PTB1),P(PTB10),P(PTB11),P(PTB12),P(PTB13),P(PTB14),P(PTB15),P(PTB16),P(PTB17), +P(PTB18),P(PTB19),P(PTB2),P(PTB20),P(PTB21),P(PTB22),P(PTB23),P(PTB24),P(PTB25), +P(PTB26),P(PTB27),P(PTB28),P(PTB29),P(PTB3),P(PTB30),P(PTB31),P(PTB4),P(PTB5),P(PTB6), +P(PTB7),P(PTB8),P(PTB9),P(PTC0),P(PTC1),P(PTC10),P(PTC11),P(PTC12),P(PTC13),P(PTC14), +P(PTC15),P(PTC16),P(PTC17),P(PTC18),P(PTC19),P(PTC2),P(PTC20),P(PTC21),P(PTC22), +P(PTC23),P(PTC24),P(PTC25),P(PTC26),P(PTC27),P(PTC28),P(PTC29),P(PTC3),P(PTC30), +P(PTC31),P(PTC4),P(PTC5),P(PTC6),P(PTC7),P(PTC8),P(PTC9),P(PTD0),P(PTD1),P(PTD10), +P(PTD11),P(PTD12),P(PTD13),P(PTD14),P(PTD15),P(PTD16),P(PTD17),P(PTD18),P(PTD19), +P(PTD2),P(PTD20),P(PTD21),P(PTD22),P(PTD23),P(PTD24),P(PTD25),P(PTD26),P(PTD27), +P(PTD28),P(PTD29),P(PTD3),P(PTD30),P(PTD31),P(PTD4),P(PTD5),P(PTD6),P(PTD7),P(PTD8), +P(PTD9),P(PTE0),P(PTE1),P(PTE10),P(PTE11),P(PTE12),P(PTE13),P(PTE14),P(PTE15),P(PTE16), +P(PTE17),P(PTE18),P(PTE19),P(PTE2),P(PTE20),P(PTE21),P(PTE22),P(PTE23),P(PTE24), +P(PTE25),P(PTE26),P(PTE27),P(PTE28),P(PTE29),P(PTE3),P(PTE30),P(PTE31),P(PTE4),P(PTE5), +P(PTE6),P(PTE7),P(PTE8),P(PTE9),P(SW1),P(SW3),P(TSI_ELEC0),P(TSI_ELEC1),P(USBRX), +P(USBTX), +#elif defined(TARGET_K64F) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(DAC0_OUT),P(I2C_SCL),P(I2C_SDA), +P(LED1),P(LED2),P(LED3),P(LED4),P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(PTA0), +P(PTA1),P(PTA10),P(PTA11),P(PTA12),P(PTA13),P(PTA14),P(PTA15),P(PTA16),P(PTA17), +P(PTA18),P(PTA19),P(PTA2),P(PTA20),P(PTA21),P(PTA22),P(PTA23),P(PTA24),P(PTA25), +P(PTA26),P(PTA27),P(PTA28),P(PTA29),P(PTA3),P(PTA30),P(PTA31),P(PTA4),P(PTA5),P(PTA6), +P(PTA7),P(PTA8),P(PTA9),P(PTB0),P(PTB1),P(PTB10),P(PTB11),P(PTB12),P(PTB13),P(PTB14), +P(PTB15),P(PTB16),P(PTB17),P(PTB18),P(PTB19),P(PTB2),P(PTB20),P(PTB21),P(PTB22), +P(PTB23),P(PTB24),P(PTB25),P(PTB26),P(PTB27),P(PTB28),P(PTB29),P(PTB3),P(PTB30), +P(PTB31),P(PTB4),P(PTB5),P(PTB6),P(PTB7),P(PTB8),P(PTB9),P(PTC0),P(PTC1),P(PTC10), +P(PTC11),P(PTC12),P(PTC13),P(PTC14),P(PTC15),P(PTC16),P(PTC17),P(PTC18),P(PTC19), +P(PTC2),P(PTC20),P(PTC21),P(PTC22),P(PTC23),P(PTC24),P(PTC25),P(PTC26),P(PTC27), +P(PTC28),P(PTC29),P(PTC3),P(PTC30),P(PTC31),P(PTC4),P(PTC5),P(PTC6),P(PTC7),P(PTC8), +P(PTC9),P(PTD0),P(PTD1),P(PTD10),P(PTD11),P(PTD12),P(PTD13),P(PTD14),P(PTD15),P(PTD16), +P(PTD17),P(PTD18),P(PTD19),P(PTD2),P(PTD20),P(PTD21),P(PTD22),P(PTD23),P(PTD24), +P(PTD25),P(PTD26),P(PTD27),P(PTD28),P(PTD29),P(PTD3),P(PTD30),P(PTD31),P(PTD4),P(PTD5), +P(PTD6),P(PTD7),P(PTD8),P(PTD9),P(PTE0),P(PTE1),P(PTE10),P(PTE11),P(PTE12),P(PTE13), +P(PTE14),P(PTE15),P(PTE16),P(PTE17),P(PTE18),P(PTE19),P(PTE2),P(PTE20),P(PTE21), +P(PTE22),P(PTE23),P(PTE24),P(PTE25),P(PTE26),P(PTE27),P(PTE28),P(PTE29),P(PTE3), +P(PTE30),P(PTE31),P(PTE4),P(PTE5),P(PTE6),P(PTE7),P(PTE8),P(PTE9),P(SW2),P(SW3), +P(USBRX),P(USBTX), +#elif defined(TARGET_LPC4088) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(LED1),P(LED2),P(LED3),P(LED4), +P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12),P(P0_13),P(P0_14),P(P0_15),P(P0_16), +P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20),P(P0_21),P(P0_22),P(P0_23),P(P0_24), +P(P0_25),P(P0_26),P(P0_27),P(P0_28),P(P0_29),P(P0_3),P(P0_30),P(P0_31),P(P0_4),P(P0_5), +P(P0_6),P(P0_7),P(P0_8),P(P0_9),P(P1_0),P(P1_1),P(P1_10),P(P1_11),P(P1_12),P(P1_13), +P(P1_14),P(P1_15),P(P1_16),P(P1_17),P(P1_18),P(P1_19),P(P1_2),P(P1_20),P(P1_21), +P(P1_22),P(P1_23),P(P1_24),P(P1_25),P(P1_26),P(P1_27),P(P1_28),P(P1_29),P(P1_3), +P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6),P(P1_7),P(P1_8),P(P1_9),P(P2_0),P(P2_1), +P(P2_10),P(P2_11),P(P2_12),P(P2_13),P(P2_14),P(P2_15),P(P2_16),P(P2_17),P(P2_18), +P(P2_19),P(P2_2),P(P2_20),P(P2_21),P(P2_22),P(P2_23),P(P2_24),P(P2_25),P(P2_26), +P(P2_27),P(P2_28),P(P2_29),P(P2_3),P(P2_30),P(P2_31),P(P2_4),P(P2_5),P(P2_6),P(P2_7), +P(P2_8),P(P2_9),P(P3_0),P(P3_1),P(P3_10),P(P3_11),P(P3_12),P(P3_13),P(P3_14),P(P3_15), +P(P3_16),P(P3_17),P(P3_18),P(P3_19),P(P3_2),P(P3_20),P(P3_21),P(P3_22),P(P3_23), +P(P3_24),P(P3_25),P(P3_26),P(P3_27),P(P3_28),P(P3_29),P(P3_3),P(P3_30),P(P3_31), +P(P3_4),P(P3_5),P(P3_6),P(P3_7),P(P3_8),P(P3_9),P(P4_0),P(P4_1),P(P4_10),P(P4_11), +P(P4_12),P(P4_13),P(P4_14),P(P4_15),P(P4_16),P(P4_17),P(P4_18),P(P4_19),P(P4_2), +P(P4_20),P(P4_21),P(P4_22),P(P4_23),P(P4_24),P(P4_25),P(P4_26),P(P4_27),P(P4_28), +P(P4_29),P(P4_3),P(P4_30),P(P4_31),P(P4_4),P(P4_5),P(P4_6),P(P4_7),P(P4_8),P(P4_9), +P(P5_0),P(P5_1),P(P5_2),P(P5_3),P(P5_4),P(USBRX),P(USBTX),P(p10),P(p11),P(p12),P(p13), +P(p14),P(p15),P(p16),P(p17),P(p18),P(p19),P(p20),P(p23),P(p24),P(p25),P(p26),P(p27), +P(p28),P(p29),P(p30),P(p31),P(p32),P(p33),P(p34),P(p37),P(p38),P(p39),P(p5),P(p6), +P(p7),P(p8),P(p9), +#elif defined(TARGET_NUCLEO_F401RE) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(NC),P(PA_0),P(PA_1),P(PA_10),P(PA_11),P(PA_12),P(PA_13), +P(PA_14),P(PA_15),P(PA_2),P(PA_3),P(PA_4),P(PA_5),P(PA_6),P(PA_7),P(PA_8),P(PA_9), +P(PB_0),P(PB_1),P(PB_10),P(PB_12),P(PB_13),P(PB_14),P(PB_15),P(PB_2),P(PB_3),P(PB_4), +P(PB_5),P(PB_6),P(PB_7),P(PB_8),P(PB_9),P(PC_0),P(PC_1),P(PC_10),P(PC_11),P(PC_12), +P(PC_13),P(PC_14),P(PC_15),P(PC_2),P(PC_3),P(PC_4),P(PC_5),P(PC_6),P(PC_7),P(PC_8), +P(PC_9),P(PD_2),P(PH_0),P(PH_1),P(PWM_OUT),P(SERIAL_RX),P(SERIAL_TX),P(SPI_CS),P(SPI_MISO), +P(SPI_MOSI),P(SPI_SCK),P(USBRX),P(USBTX),P(USER_BUTTON), +#elif defined(TARGET_LPC11U68) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(LED1),P(LED2),P(LED3),P(LED4), +P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12), +P(P0_13),P(P0_14),P(P0_15),P(P0_16),P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20), +P(P0_21),P(P0_22),P(P0_23),P(P0_3),P(P0_4),P(P0_5),P(P0_6),P(P0_7),P(P0_8),P(P0_9), +P(P1_0),P(P1_1),P(P1_10),P(P1_11),P(P1_12),P(P1_13),P(P1_14),P(P1_15),P(P1_16),P(P1_17), +P(P1_18),P(P1_19),P(P1_2),P(P1_20),P(P1_21),P(P1_22),P(P1_23),P(P1_24),P(P1_25), +P(P1_26),P(P1_27),P(P1_28),P(P1_29),P(P1_3),P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6), +P(P1_7),P(P1_8),P(P1_9),P(P2_0),P(P2_1),P(P2_10),P(P2_11),P(P2_12),P(P2_13),P(P2_14), +P(P2_15),P(P2_16),P(P2_17),P(P2_18),P(P2_19),P(P2_2),P(P2_20),P(P2_21),P(P2_22), +P(P2_23),P(P2_3),P(P2_4),P(P2_5),P(P2_6),P(P2_7),P(P2_8),P(P2_9),P(SCL),P(SDA),P(USBRX), +P(USBTX), +#elif defined(TARGET_NUCLEO_F411RE) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(NC),P(PA_0),P(PA_1),P(PA_10),P(PA_11),P(PA_12),P(PA_13), +P(PA_14),P(PA_15),P(PA_2),P(PA_3),P(PA_4),P(PA_5),P(PA_6),P(PA_7),P(PA_8),P(PA_9), +P(PB_0),P(PB_1),P(PB_10),P(PB_12),P(PB_13),P(PB_14),P(PB_15),P(PB_2),P(PB_3),P(PB_4), +P(PB_5),P(PB_6),P(PB_7),P(PB_8),P(PB_9),P(PC_0),P(PC_1),P(PC_10),P(PC_11),P(PC_12), +P(PC_13),P(PC_14),P(PC_15),P(PC_2),P(PC_3),P(PC_4),P(PC_5),P(PC_6),P(PC_7),P(PC_8), +P(PC_9),P(PD_2),P(PH_0),P(PH_1),P(PWM_OUT),P(SERIAL_RX),P(SERIAL_TX),P(SPI_CS),P(SPI_MISO), +P(SPI_MOSI),P(SPI_SCK),P(USBRX),P(USBTX),P(USER_BUTTON), +#elif defined(TARGET_NUCLEO_L152RE) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(NC),P(PA_0),P(PA_1),P(PA_10),P(PA_11),P(PA_12),P(PA_13), +P(PA_14),P(PA_15),P(PA_2),P(PA_3),P(PA_4),P(PA_5),P(PA_6),P(PA_7),P(PA_8),P(PA_9), +P(PB_0),P(PB_1),P(PB_10),P(PB_11),P(PB_12),P(PB_13),P(PB_14),P(PB_15),P(PB_2),P(PB_3), +P(PB_4),P(PB_5),P(PB_6),P(PB_7),P(PB_8),P(PB_9),P(PC_0),P(PC_1),P(PC_10),P(PC_11), +P(PC_12),P(PC_13),P(PC_14),P(PC_15),P(PC_2),P(PC_3),P(PC_4),P(PC_5),P(PC_6),P(PC_7), +P(PC_8),P(PC_9),P(PD_2),P(PH_0),P(PH_1),P(PWM_OUT),P(SERIAL_RX),P(SERIAL_TX),P(SPI_CS), +P(SPI_MISO),P(SPI_MOSI),P(SPI_SCK),P(USBRX),P(USBTX),P(USER_BUTTON), +#elif defined(TARGET_NUCLEO_F103RB) +P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14), +P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1), +P(LED2),P(LED3),P(LED4),P(NC),P(PA_0),P(PA_1),P(PA_10),P(PA_11),P(PA_12),P(PA_13), +P(PA_14),P(PA_15),P(PA_2),P(PA_3),P(PA_4),P(PA_5),P(PA_6),P(PA_7),P(PA_8),P(PA_9), +P(PB_0),P(PB_1),P(PB_10),P(PB_11),P(PB_12),P(PB_13),P(PB_14),P(PB_15),P(PB_2),P(PB_3), +P(PB_4),P(PB_5),P(PB_6),P(PB_7),P(PB_8),P(PB_9),P(PC_0),P(PC_1),P(PC_10),P(PC_11), +P(PC_12),P(PC_13),P(PC_14),P(PC_15),P(PC_2),P(PC_3),P(PC_4),P(PC_5),P(PC_6),P(PC_7), +P(PC_8),P(PC_9),P(PD_2),P(PWM_OUT),P(SERIAL_RX),P(SERIAL_TX),P(SPI_CS),P(SPI_MISO), +P(SPI_MOSI),P(SPI_SCK),P(USBRX),P(USBTX),P(USER_BUTTON), + +#else +#error "target error" +#endif +}; +
--- a/VideoRAM.h Wed May 13 18:39:01 2015 +0900 +++ b/VideoRAM.h Sat May 23 16:50:59 2015 +0900 @@ -1,9 +1,14 @@ +// VideoRAM.h 2015/5/22 #pragma once +template<class SERIAL_T> class VideoRAM { + SERIAL_T& _pc; + uint16_t x, y; + bool f_init; + public: - VideoRAM(RawSerial& pc):_pc(pc),x(0),y(0) { - _puts("\x1b[2J"); // erase + VideoRAM(RawSerial& pc):_pc(pc),x(0),y(0),f_init(false) { } void vpoke(uint16_t i, uint8_t b) { if (i < 1024) { @@ -20,15 +25,20 @@ } private: + void init() { + _puts("\x1b[2J"); // erase + } void _puts(const char* s) { while(*s) { _putc(*s++); } } void _putc(int c) { + if (!f_init) { + f_init = true; + init(); + } _pc.putc(c); } - RawSerial& _pc; - uint16_t x, y; };
--- a/main.cpp Wed May 13 18:39:01 2015 +0900 +++ b/main.cpp Sat May 23 16:50:59 2015 +0900 @@ -1,59 +1,60 @@ -// main.cpp 2015/5/13 +// main.cpp 2015/5/23 +#include <new> #include "mbed.h" #include "BaseIPS.h" #include "VideoRAM.h" #include "VirtualRAM.h" +#include "IPS-Mmbed_bin.h" +#include "mbedAPI.h" #include "SDFileSystem.h" #include "ConfigFile.h" -#include <string> -#define CFG_FILE "/local/ips.cfg" +const char* CFG_FILE = "/local/ips.cfg"; -#ifndef MBED_SPI0 +#ifdef TARGET_FF_ARDUINO #define MBED_SPI0 D11, D12, D13, D4 #endif SDFileSystem local(MBED_SPI0, "local"); // mosi, miso, sclk, cs, name RawSerial pc(USBTX,USBRX); +template<class SERIAL_T> class myips : public BaseIPS { - VideoRAM vram; + VideoRAM<SERIAL_T> vram; VirtualRAM mem; - RawSerial& _pc; + SERIAL_T& _pc; + mbedAPI mbedapi; Timer t20ms; public: - myips(RawSerial& pc): vram(pc),_pc(pc) { + myips(SERIAL_T& pc): vram(pc),_pc(pc),mbedapi(*this) { t20ms.reset(); t20ms.start(); } - virtual u8 peekB(u16 a) { + virtual uint8_t mem_peek(uint16_t a) { return mem.peek(a); } - virtual void pokeB(u16 a, u8 b) { + virtual void mem_poke(uint16_t a, uint8_t b) { mem.poke(a, b); vram.vpoke(a, b); } virtual void* file_open(const char* filename, const char* mode) { - string path = string("/local/") + filename; - return fopen(path.c_str(), mode); + if (filename[0] == '/') { + return fopen(filename, mode); + } + char path[128]; + snprintf(path, sizeof(path), "/local/%s", filename); + return fopen(path, mode); } virtual int file_getc(void* handle) { - MBED_ASSERT(handle); int c = fgetc((FILE*)handle); return c == EOF ? (-1) : c; } virtual void file_putc(int c, void* handle) { - MBED_ASSERT(handle); fputc(c, (FILE*)handle); } virtual bool file_close(void* handle) { - MBED_ASSERT(handle); - if (fclose((FILE*)handle) == 0) { - return true; - } - return false; + return fclose((FILE*)handle) == 0 ? true : false; } - virtual bool test_20ms() { if (t20ms.read_ms() >= 20) { t20ms.reset(); @@ -81,44 +82,70 @@ } } } + virtual void usercode(uint16_t cpc) { + switch(cpc) { + case 80: break; // c_sleepifidle(void) + case 96: mbedapi.code(); break; + default: error("code(#%x) not implemented!", cpc); + } + } }; +void no_memory () { + perror("Failed to allocate memory!"); +} + int main() { - string image = "IPS-Mu.bin"; - string file; - string cmd; - ConfigFile cfg; - if(cfg.read(CFG_FILE)) { - char buf[128]; - if (cfg.getValue("image", buf, sizeof(buf))) { - image = buf; - } - if (cfg.getValue("file", buf, sizeof(buf))) { - file = buf; - cmd = string("\" ") + file + string(" \" READ"); - } - if (cfg.getValue("cmd", buf, sizeof(buf))) { - cmd = buf; + std::set_new_handler(no_memory); + + char* image = NULL; + char* cmd = NULL; + if (CFG_FILE) { + ConfigFile cfg; + if(cfg.read(const_cast<char*>(CFG_FILE))) { + char buf[128]; + if (cfg.getValue(const_cast<char*>("image"), buf, sizeof(buf))) { + static char buf2[128]; + snprintf(buf2, sizeof(buf2), "%s", buf); + image = buf2; + } + if (cfg.getValue(const_cast<char*>("file"), buf, sizeof(buf))) { + static char buf2[128]; + snprintf(buf2, sizeof(buf2), "\" %s \" READ", buf); + cmd = buf2; + } + if (cfg.getValue(const_cast<char*>("cmd"), buf, sizeof(buf))) { + cmd = buf; + } } } - myips* ips = new myips(pc); - void* fh = ips->file_open(image.c_str(), "rb"); - MBED_ASSERT(fh); - if (fh) { - for(int i = 0; i <= 65535; i++) { - int c = ips->file_getc(fh); - if (c == (-1)) { - break; + myips<RawSerial> ips(pc); + if (image != NULL) { + void* fh = ips.file_open(image, "rb"); + if (fh == NULL) { + pc.printf("file open error [%s]\n", image); + image = NULL; + } else { + for(int i = 0; i <= 65535; i++) { + int c = ips.file_getc(fh); + if (c == (-1)) { + break; + } + ips.pokeB(i, c); } - ips->pokeB(i, c); + ips.file_close(fh); } - ips->file_close(fh); } - if (cmd != "") { - ips->command(cmd.c_str()); + if (image == NULL) { + for(size_t i = 0; i < sizeof(IPS_Mmbed_bin); i++) { + ips.pokeB(i, IPS_Mmbed_bin[i]); + } } - ips->emulator(); - /* NOTREACHED */ + if (cmd) { + ips.command(cmd); + } + ips.emulator(); + std::exit(1); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbedAPI.cpp Sat May 23 16:50:59 2015 +0900 @@ -0,0 +1,278 @@ +// mbedAPI.cpp 2015/5/22 +#include <algorithm> +#include "mbed.h" +#include "mbedAPI.h" +#include "PinNameTable.h" + +// $MBEDAPI +#define mbed_wait 1 +#define mbed_wait_ms 2 +#define mbed_DigitalOut 3 +#define mbed_DigitalIn 4 +#define mbed_DigitalInOut 5 +#define mbed_Timer 6 +#define mbed_RawSerial 7 +#define mbed_read 8 +#define mbed_write 9 +#define mbed_putc 10 +#define mbed_getc 11 +#define mbed_readable 12 +#define mbed_baud 13 +#define mbed_SPI 14 +#define mbed_I2C 15 +#define mbed_start 16 +#define mbed_stop 17 +#define mbed_reset 18 +#define mbed_read_ms 19 +#define mbed_read_us 20 +#define mbed_PwmOut 21 +#define mbed_period_ms 22 +#define mbed_period_us 23 +#define mbed_pulsewidth_ms 24 +#define mbed_pulsewidth_us 25 +#define mbed_AnalogIn 26 +#define mbed_read_u16 27 + +void mbedAPI::code() { + int f = ips.pull_ps(); + uint16_t a1; + switch(f) { + case mbed_wait_ms: + a1 = ips.pull_ps(); + wait_ms(a1); + break; + case mbed_Timer: + init<Timer>(f); + break; + case mbed_DigitalOut: + init<DigitalOut, PinName>(f); + break; + case mbed_DigitalIn: + init<DigitalIn, PinName>(f); + break; + case mbed_DigitalInOut: + init<DigitalInOut, PinName>(f); + break; + case mbed_AnalogIn: + init<AnalogIn, PinName>(f); + break; + case mbed_PwmOut: + init<PwmOut, PinName>(f); + break; + case mbed_RawSerial: + init<RawSerial, PinName, PinName>(f); + break; + case mbed_SPI: + init<SPI, PinName, PinName, PinName>(f); + break; + case mbed_I2C: + init<I2C, PinName, PinName>(f); + break; + default: + code_method(f); + break; + } +} + +void mbedAPI::code_method(int f) { + mbedObj obj = pull_ps_obj(); + uint16_t a1; + switch(obj.ct) { + case mbed_DigitalOut: + switch(f) { + case mbed_write: + method<DigitalOut, int, &DigitalOut::write>(obj.p); + break; + case mbed_read: + method<int, DigitalOut, &DigitalOut::read>(obj.p); + break; + default: + break; + } + break; + case mbed_DigitalInOut: + switch(f) { + case mbed_write: + method<DigitalInOut, int, &DigitalInOut::write>(obj.p); + break; + case mbed_read: + method<int, DigitalInOut, &DigitalInOut::read>(obj.p); + break; + default: + break; + } + break; + case mbed_AnalogIn: + switch(f) { + case mbed_read_u16: + method<unsigned short, AnalogIn, &AnalogIn::read_u16>(obj.p); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + case mbed_PwmOut: + switch(f) { + case mbed_period_ms: + method<PwmOut, int, &PwmOut::period_ms>(obj.p); + break; + case mbed_period_us: + method<PwmOut, int, &PwmOut::period_us>(obj.p); + break; + case mbed_pulsewidth_ms: + method<PwmOut, int, &PwmOut::pulsewidth_ms>(obj.p); + break; + case mbed_pulsewidth_us: + method<PwmOut, int, &PwmOut::pulsewidth_us>(obj.p); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + case mbed_Timer: + switch(f) { + case mbed_start: + method<Timer, &Timer::start>(obj.p); + break; + case mbed_stop: + method<Timer, &Timer::stop>(obj.p); + break; + case mbed_reset: + method<Timer, &Timer::reset>(obj.p); + break; + case mbed_read_ms: + method<int, Timer, &Timer::read_ms>(obj.p); + break; + case mbed_read_us: + method<int, Timer, &Timer::read_us>(obj.p); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + case mbed_DigitalIn: + switch(f) { + case mbed_read: + method<int, DigitalIn, &DigitalIn::read>(obj.p); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + case mbed_SPI: + switch(f) { + case mbed_write: + method<int, SPI, int, &SPI::write>(obj.p); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + case mbed_I2C: + code_method_I2C(f, obj); + break; + case mbed_RawSerial: + switch(f) { + case mbed_putc: + a1 = ips.pull_ps(); + reinterpret_cast<RawSerial*>(obj.p)->putc(a1); + break; + case mbed_getc: + method<int, RawSerial, &RawSerial::getc>(obj.p); + break; + case mbed_readable: + ips.push_ps(reinterpret_cast<RawSerial*>(obj.p)->readable()); + break; + case mbed_baud: + a1 = ips.pull_ps(); + reinterpret_cast<RawSerial*>(obj.p)->baud(a1); + break; + default: + error("%s %d", __LINE__, f); + break; + } + break; + default: + break; + } +} + +void mbedAPI::code_method_I2C(int f, mbedObj& obj) { + if (f == mbed_read) { + uint16_t a3 = ips.pull_ps(); // addr + uint16_t a2 = ips.pull_ps(); // data length + uint16_t a1 = ips.pull_ps(); // data pointer + char buf[a2]; + reinterpret_cast<I2C*>(obj.p)->read(a3, buf, a1); + for(int i = 0; i < a2; i++) { + ips.pokeB(a1 + i, buf[i]); + } + } else if (f == mbed_write) { + uint16_t a3 = ips.pull_ps(); // addr + uint16_t a2 = ips.pull_ps(); // data length + uint16_t a1 = ips.pull_ps(); // data pointer + char buf[a2]; + for(int i = 0; i < a2; i++) { + buf[i] = ips.peekB(a1 + i); + } + reinterpret_cast<I2C*>(obj.p)->write(a3, buf, a1); + } else { + error("%s %d", __LINE__, f); + } +} + +template<> +PinName mbedAPI::pull_ps<PinName>() { + char buf[64]; + pull_ps_string(buf, sizeof(buf)); + return findPinName(buf); +} + +mbedObj mbedAPI::pull_ps_obj() { + int i = ips.pull_ps(); + return objs[i]; +} + +void mbedAPI::pull_ps_string(char* buf, size_t size) { + size_t s_len = ips.pull_ps(); + int s_start = ips.pull_ps(); + s_len = std::min(s_len, size-1); + for(size_t i = 0; i < s_len; i++) { + buf[i] = ips.peekB(s_start + i); + } + buf[s_len] = '\0'; +} + +PinName mbedAPI::findPinName(const char* name) const { + int imin = 0; + int imax = sizeof(pinname_table) / sizeof(pinNameStr) - 1; + while(imax >= imin) { + int i = (imin + imax) / 2; + int c = strcmp(name, pinname_table[i].name); + if (c == 0) { + return pinname_table[i].pin; + } else if (c > 0) { + imin = i + 1; + } else { + imax = i - 1; + } + } + return NC; +} + +void mbedAPI::push_ps_obj(void* p, int ct) { + mbedObj obj; + obj.p = p; + obj.ct = ct; + objs.push_back(obj); + uint16_t r1 = objs.size() - 1; + ips.push_ps(r1); +} + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbedAPI.h Sat May 23 16:50:59 2015 +0900 @@ -0,0 +1,78 @@ +// mbedAPI.h 2015/5/22 +#include "BaseIPS.h" +#include "myvector.h" + +struct mbedObj { + void* p; + uint8_t ct; +}; + +class mbedAPI { + BaseIPS& ips; + +public: + mbedAPI(BaseIPS& ips_): ips(ips_) {} + void code(); + +private: + template<class T> + void init(int ct) { + push_ps_obj(new T(), ct); + } + + template<class T, typename A1> + void init(int ct) { + A1 a1 = pull_ps<A1>(); + push_ps_obj(new T(a1), ct); + } + + template<class T, typename A1, typename A2> + void init(int ct) { + A2 a2 = pull_ps<A2>(); + A1 a1 = pull_ps<A1>(); + push_ps_obj(new T(a1, a2), ct); + } + + template<class T, typename A1, typename A2, typename A3> + void init(int ct) { + A3 a3 = pull_ps<A3>(); + A2 a2 = pull_ps<A2>(); + A1 a1 = pull_ps<A1>(); + push_ps_obj(new T(a1, a2, a3), ct); + } + + template<class T, void(T::*member)()> + void method(void* obj) { + (reinterpret_cast<T*>(obj)->*member)(); + } + + template<class T, typename A1, void(T::*member)(A1)> + void method(void* obj) { + A1 a1 = ips.pull_ps(); + (reinterpret_cast<T*>(obj)->*member)(a1); + } + + template<typename R, class T, R(T::*member)()> + void method(void* obj) { + ips.push_ps((reinterpret_cast<T*>(obj)->*member)()); + } + + template<typename R, class T, typename A1, R(T::*member)(A1)> + void method(void* obj) { + A1 a1 = ips.pull_ps(); + ips.push_ps((reinterpret_cast<T*>(obj)->*member)(a1)); + } + + template<typename T> + PinName pull_ps(); + + void code_method(int f); + void code_method_I2C(int f, mbedObj& obj); + mbedObj pull_ps_obj(); + void push_ps_obj(void*, int ct); + void pull_ps_string(char* buf, size_t size); + PinName findPinName(const char* name) const; + myvector<mbedObj> objs; +}; + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myvector.h Sat May 23 16:50:59 2015 +0900 @@ -0,0 +1,34 @@ +#pragma once + +template<class T> +class myvector { +public: + myvector() { + m_size = 0; + m_buf = NULL; + } + ~myvector() { + if (m_buf) { + delete[] m_buf; + } + } + void push_back(T v) { + T* new_buf = new T[m_size+1]; + if (m_size > 0) { + for(int i = 0; i < m_size; i++) { + new_buf[i] = m_buf[i]; + } + delete[] m_buf; + } + m_buf = new_buf; + m_buf[m_size++] = v; + } + T& operator[](const int index) { + return m_buf[index]; + } + int size() { return m_size; } + +private: + int m_size; + T *m_buf; +};