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.
Dependents: Eavesdropper BitstreamGenerator SimpleDecimationFilter 11U68_MP3Player with TFTLCD ... more
Revision 3:3dd9466e73fc, committed 2014-07-12
- Comitter:
- Sissors
- Date:
- Sat Jul 12 09:48:05 2014 +0000
- Parent:
- 2:1a6ed4b84590
- Child:
- 4:6ebbf25b9167
- Commit message:
- Added K20D50M
Changed in this revision
| FastIO.h | Show annotated file Show diff for this revision Revisions of this file |
| FastIO_K20D50M.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/FastIO.h Fri Jul 04 17:28:45 2014 +0000 +++ b/FastIO.h Sat Jul 12 09:48:05 2014 +0000 @@ -5,6 +5,7 @@ #include "FastIO_LPC11UXX.h" #include "FastIO_LPC81X.h" #include "FastIO_KLXX.h" +#include "FastIO_K20D50M.h" #ifndef INIT_PIN #warning Target is not supported by FastIO
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FastIO_K20D50M.h Sat Jul 12 09:48:05 2014 +0000
@@ -0,0 +1,26 @@
+#ifdef TARGET_K20D50M
+
+#include "mbed.h"
+#include "pinmap.h"
+
+typedef struct {
+ uint32_t mask;
+} fastio_vars;
+
+#define PORT_BASE ((GPIO_Type *)(PTA_BASE + ((unsigned int)pin >> PORT_SHIFT) * 0x40))
+#define PINMASK (1 << ((pin & 0x7F) >> 2))
+#define PCR ((__IO uint32_t*)(PORTA_BASE + pin))
+
+#define INIT_PIN container.mask = PINMASK; pin_function(pin, 1)
+#define DESTROY_PIN
+
+#define SET_DIR_INPUT (PORT_BASE->PDDR &= ~PINMASK)
+#define SET_DIR_OUTPUT (PORT_BASE->PDDR |= PINMASK)
+#define SET_MODE(pull) (*PCR = (*PCR & ~0x3) | pull)
+
+#define WRITE_PIN_SET (PORT_BASE->PSOR |= container.mask)
+#define WRITE_PIN_CLR (PORT_BASE->PCOR |= container.mask)
+
+#define READ_PIN ((PORT_BASE->PDIR & container.mask) ? 1 : 0)
+
+#endif
