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.
Fork of libMiMic by
Diff: mbed/jsonrpc/Target_K64F.cpp
- Revision:
- 91:db8279c869d3
- Child:
- 94:b5eabbb28ae0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed/jsonrpc/Target_K64F.cpp Sat Sep 27 13:33:26 2014 +0000
@@ -0,0 +1,83 @@
+/**
+ * @file
+ *K64Fのターゲットテーブルです。
+ */
+#include "TargetTypes.h"
+#include "RpcHandlerBase.h"
+#ifdef TARGET_K64F
+namespace MiMic
+{
+
+
+
+const static struct TPinNameMapItem pin_table[]={
+
+
+ // Other mbed Pin Names
+
+ {LED1 ,PINID_OTHER_MBED_LEDx+0}, {LED2 ,PINID_OTHER_MBED_LEDx+1}, {LED3 ,PINID_OTHER_MBED_LEDx+2}, {LED4 ,PINID_OTHER_MBED_LEDx+3},
+
+ {USBTX,PINID_OTHER_MBED_USBx+0},{USBRX,PINID_OTHER_MBED_USBx+1},
+
+ // Arch Pro Pin Names(Arudino)
+ {D0 ,PINID_ARCH_PRO_Dx+0}, {D1 ,PINID_ARCH_PRO_Dx+1}, {D2,PINID_ARCH_PRO_Dx+2}, {D3,PINID_ARCH_PRO_Dx+3},
+ {D4 ,PINID_ARCH_PRO_Dx+4}, {D5 ,PINID_ARCH_PRO_Dx+5}, {D6,PINID_ARCH_PRO_Dx+6}, {D7,PINID_ARCH_PRO_Dx+7},
+ {D8 ,PINID_ARCH_PRO_Dx+8}, {D9 ,PINID_ARCH_PRO_Dx+9}, {D10,PINID_ARCH_PRO_Dx+10},{D11,PINID_ARCH_PRO_Dx+11},
+ {D12,PINID_ARCH_PRO_Dx+12}, {D13,PINID_ARCH_PRO_Dx+13}, {D14,PINID_ARCH_PRO_Dx+14},{D15,PINID_ARCH_PRO_Dx+15},
+
+ {A0,PINID_ARCH_PRO_Ax+0}, {A1,PINID_ARCH_PRO_Ax+1}, {A2,PINID_ARCH_PRO_Ax+2}, {A3,PINID_ARCH_PRO_Ax+3},
+ {A4,PINID_ARCH_PRO_Ax+4}, {A5,PINID_ARCH_PRO_Ax+5},
+
+ {NC,PINID_NC}
+};
+
+#define NUMBER_OF_PINMODE 4
+const static struct TPinModeMapItem pinmode_table[]=
+{
+ {PullUp ,PINMODEID+0},
+ {PullDown ,PINMODEID+1},
+ {PullNone ,PINMODEID+2},
+ {PullDefault,PINMODEID+1}
+};
+#define NUMBER_OF_PORT_NAME 5
+const static struct TPortNameMapItem portname_table[]=
+{
+ {PortA ,PORTID+0},
+ {PortB ,PORTID+1},
+ {PortC ,PORTID+2},
+ {PortD ,PORTID+3},
+ {PortE ,PORTID+4},
+};
+
+PinName RpcHandlerBase::pinId2PinName(unsigned int i_id)
+{
+ for(int i=0;pin_table[i].name!=NC;i++){
+ if(i_id==pin_table[i].id){
+ return pin_table[i].name;
+ }
+ }
+ return NC;
+}
+
+PinMode RpcHandlerBase::pinmodeId2PinMode(unsigned int i_id)
+{
+ for(int i=0;i<NUMBER_OF_PINMODE;i++){
+ if(i_id==pinmode_table[i].id){
+ return pinmode_table[i].mode;
+ }
+ }
+ return PullDefault;
+}
+PortName RpcHandlerBase::portId2PortName(unsigned int i_id)
+{
+ for(int i=0;i<NUMBER_OF_PORT_NAME;i++){
+ if(i_id==portname_table[i].id){
+ return portname_table[i].port;
+ }
+ }
+ return PortA;
+}
+
+}
+#endif
+
