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_KLXX.h
00001 #ifdef TARGET_KLXX 00002 00003 #include "mbed.h" 00004 #include "pinmap.h" 00005 00006 typedef struct { 00007 uint32_t mask; 00008 } fastio_vars; 00009 00010 #define PORT_BASE ((FGPIO_Type *)(FPTA_BASE + ((unsigned int)pin >> PORT_SHIFT) * 0x40)) 00011 #define PINMASK (1 << ((pin & 0x7F) >> 2)) 00012 #define PCR ((__IO uint32_t*)(PORTA_BASE + pin)) 00013 00014 #define INIT_PIN container.mask = PINMASK; pin_function(pin, 1) 00015 #define DESTROY_PIN 00016 00017 #define SET_DIR_INPUT (PORT_BASE->PDDR &= ~PINMASK) 00018 #define SET_DIR_OUTPUT (PORT_BASE->PDDR |= PINMASK) 00019 #define SET_MODE(pull) (*PCR = (*PCR & ~0x3) | pull) 00020 00021 #define WRITE_PIN_SET (PORT_BASE->PSOR |= PINMASK) 00022 #define WRITE_PIN_CLR (PORT_BASE->PCOR |= PINMASK) 00023 00024 #define READ_PIN ((PORT_BASE->PDIR & container.mask) ? 1 : 0) 00025 00026 #endif
Generated on Wed Jul 13 2022 05:20:08 by
1.7.2
