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_LPC11U6X.h@22:45b32f07e790, 2016-09-20 (annotated)
- Committer:
- Sissors
- Date:
- Tue Sep 20 20:41:42 2016 +0000
- Revision:
- 22:45b32f07e790
- Parent:
- 18:c95920122b2e
Fixed bug in enabling of port hardware of the F030 (via: https://developer.mbed.org/users/viquiram/)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nameless129 | 18:c95920122b2e | 1 | #ifdef TARGET_LPC11U6X |
| nameless129 | 18:c95920122b2e | 2 | |
| nameless129 | 18:c95920122b2e | 3 | #include "mbed.h" |
| nameless129 | 18:c95920122b2e | 4 | #include "pinmap.h" |
| nameless129 | 18:c95920122b2e | 5 | |
| nameless129 | 18:c95920122b2e | 6 | typedef struct { |
| nameless129 | 18:c95920122b2e | 7 | uint32_t mask; |
| nameless129 | 18:c95920122b2e | 8 | } fastio_vars; |
| nameless129 | 18:c95920122b2e | 9 | |
| nameless129 | 18:c95920122b2e | 10 | #define PORT ((unsigned int)pin >> PORT_SHIFT) |
| nameless129 | 18:c95920122b2e | 11 | #define PINMASK ( 1 << ((int)pin >> PIN_SHIFT & 0x1F) ) |
| nameless129 | 18:c95920122b2e | 12 | static inline void initpin(PinName pin); |
| nameless129 | 18:c95920122b2e | 13 | |
| nameless129 | 18:c95920122b2e | 14 | #define INIT_PIN container.mask = PINMASK; initpin(pin) |
| nameless129 | 18:c95920122b2e | 15 | #define DESTROY_PIN |
| nameless129 | 18:c95920122b2e | 16 | |
| nameless129 | 18:c95920122b2e | 17 | #define SET_DIR_INPUT (LPC_GPIO_PORT->DIR[PORT] &= ~PINMASK) |
| nameless129 | 18:c95920122b2e | 18 | #define SET_DIR_OUTPUT (LPC_GPIO_PORT->DIR[PORT] |= PINMASK) |
| nameless129 | 18:c95920122b2e | 19 | #define SET_MODE(pull) (pin_mode(pin, pull)) |
| nameless129 | 18:c95920122b2e | 20 | |
| nameless129 | 18:c95920122b2e | 21 | #define WRITE_PIN_SET (LPC_GPIO_PORT->SET[PORT] = PINMASK) |
| nameless129 | 18:c95920122b2e | 22 | #define WRITE_PIN_CLR (LPC_GPIO_PORT->CLR[PORT] = PINMASK) |
| nameless129 | 18:c95920122b2e | 23 | |
| nameless129 | 18:c95920122b2e | 24 | #define READ_PIN ((LPC_GPIO_PORT->PIN[PORT] & container.mask) ? 1 : 0) |
| nameless129 | 18:c95920122b2e | 25 | |
| nameless129 | 18:c95920122b2e | 26 | static inline void initpin(PinName pin) { |
| nameless129 | 18:c95920122b2e | 27 | int f = ((pin == P0_0) || |
| nameless129 | 18:c95920122b2e | 28 | (pin == P0_10) || |
| nameless129 | 18:c95920122b2e | 29 | (pin == P0_11) || |
| nameless129 | 18:c95920122b2e | 30 | (pin == P0_12) || |
| nameless129 | 18:c95920122b2e | 31 | (pin == P0_13) || |
| nameless129 | 18:c95920122b2e | 32 | (pin == P0_14) || |
| nameless129 | 18:c95920122b2e | 33 | (pin == P0_15)) ? (1) : (0); |
| nameless129 | 18:c95920122b2e | 34 | pin_function(pin, f); |
| nameless129 | 18:c95920122b2e | 35 | } |
| nameless129 | 18:c95920122b2e | 36 | |
| nameless129 | 18:c95920122b2e | 37 | #endif |
