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
Devices/FastIO_LPC11UXX.h@10:bb22a3dbedb4, 2014-09-20 (annotated)
- Committer:
- Sissors
- Date:
- Sat Sep 20 13:04:45 2014 +0000
- Revision:
- 10:bb22a3dbedb4
- Parent:
- 4:6ebbf25b9167
And this time correct
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Sissors | 0:d394ebd01052 | 1 | #ifdef TARGET_LPC11UXX |
| Sissors | 0:d394ebd01052 | 2 | |
| Sissors | 0:d394ebd01052 | 3 | #include "mbed.h" |
| Sissors | 0:d394ebd01052 | 4 | #include "pinmap.h" |
| Sissors | 0:d394ebd01052 | 5 | |
| Sissors | 0:d394ebd01052 | 6 | typedef struct { |
| Sissors | 0:d394ebd01052 | 7 | uint32_t mask; |
| Sissors | 0:d394ebd01052 | 8 | } fastio_vars; |
| Sissors | 0:d394ebd01052 | 9 | |
| Sissors | 0:d394ebd01052 | 10 | #define PORT ((unsigned int)pin >> PORT_SHIFT) |
| Sissors | 0:d394ebd01052 | 11 | #define PINMASK (1 << ((int)pin & 0x1F)) |
| Sissors | 0:d394ebd01052 | 12 | static inline void initpin(PinName pin); |
| Sissors | 0:d394ebd01052 | 13 | |
| Sissors | 0:d394ebd01052 | 14 | #define INIT_PIN container.mask = PINMASK; initpin(pin) |
| Sissors | 2:1a6ed4b84590 | 15 | #define DESTROY_PIN |
| Sissors | 0:d394ebd01052 | 16 | |
| Sissors | 0:d394ebd01052 | 17 | #define SET_DIR_INPUT (LPC_GPIO->DIR[PORT] &= ~PINMASK) |
| Sissors | 0:d394ebd01052 | 18 | #define SET_DIR_OUTPUT (LPC_GPIO->DIR[PORT] |= PINMASK) |
| Sissors | 0:d394ebd01052 | 19 | #define SET_MODE(pull) (pin_mode(pin, pull)) |
| Sissors | 0:d394ebd01052 | 20 | |
| Sissors | 0:d394ebd01052 | 21 | #define WRITE_PIN_SET (LPC_GPIO->SET[PORT] = PINMASK) |
| Sissors | 0:d394ebd01052 | 22 | #define WRITE_PIN_CLR (LPC_GPIO->CLR[PORT] = PINMASK) |
| Sissors | 0:d394ebd01052 | 23 | |
| Sissors | 0:d394ebd01052 | 24 | #define READ_PIN ((LPC_GPIO->PIN[PORT] & container.mask) ? 1 : 0) |
| Sissors | 0:d394ebd01052 | 25 | |
| Sissors | 0:d394ebd01052 | 26 | static inline void initpin(PinName pin) { |
| Sissors | 0:d394ebd01052 | 27 | int f = ((pin == P0_0) || |
| Sissors | 0:d394ebd01052 | 28 | (pin == P0_10) || |
| Sissors | 0:d394ebd01052 | 29 | (pin == P0_11) || |
| Sissors | 0:d394ebd01052 | 30 | (pin == P0_12) || |
| Sissors | 0:d394ebd01052 | 31 | (pin == P0_13) || |
| Sissors | 0:d394ebd01052 | 32 | (pin == P0_14) || |
| Sissors | 0:d394ebd01052 | 33 | (pin == P0_15)) ? (1) : (0); |
| Sissors | 0:d394ebd01052 | 34 | |
| Sissors | 0:d394ebd01052 | 35 | pin_function(pin, f); |
| Sissors | 0:d394ebd01052 | 36 | } |
| Sissors | 0:d394ebd01052 | 37 | |
| Sissors | 0:d394ebd01052 | 38 | #endif |
