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 FastIO by
FastIO_LPC1768.h
00001 #ifdef TARGET_LPC1768 00002 00003 #include "mbed.h" 00004 #include "pinmap.h" 00005 00006 typedef struct { 00007 uint32_t mask; 00008 } fastio_vars; 00009 00010 #define LPC_GPIO ((LPC_GPIO_TypeDef*)(pin & ~0x1F)) 00011 #define PINMASK (1UL << (((pin) - P0_0)%32)) 00012 00013 #define PINSELREG (*(volatile uint32_t*)(LPC_PINCON_BASE + 4*(((pin) - P0_0)/16))) 00014 #define PINSELMASK (0x03 << (((pin - P0_0)%16)*2) ) 00015 00016 #define INIT_PIN container.mask = PINMASK; (PINSELREG &= ~PINSELMASK) 00017 #define DESTROY_PIN 00018 00019 #define SET_DIR_INPUT (LPC_GPIO->FIODIR &= ~PINMASK) 00020 #define SET_DIR_OUTPUT (LPC_GPIO->FIODIR |= PINMASK) 00021 #define SET_MODE(pull) (pin_mode(pin, pull)) 00022 00023 #define WRITE_PIN_SET (LPC_GPIO->FIOSET = PINMASK) 00024 #define WRITE_PIN_CLR (LPC_GPIO->FIOCLR = PINMASK) 00025 00026 #define READ_PIN ((LPC_GPIO->FIOPIN & container.mask) ? 1 : 0) 00027 00028 #endif
Generated on Wed Jul 13 2022 05:20:08 by
1.7.2
