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_NRF51822.h
00001 #ifdef TARGET_MCU_NRF51822 00002 00003 #include "mbed.h" 00004 #include "gpio_api.h" 00005 00006 typedef struct { 00007 uint32_t mask; 00008 } fastio_vars; 00009 00010 #define PINMASK (1 << pin) 00011 00012 00013 #define INIT_PIN container.mask = PINMASK; NRF_GPIO->PIN_CNF[pin] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) \ 00014 | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) \ 00015 | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) \ 00016 | (NRF_GPIO->PIN_CNF[pin] & 0x01); 00017 #define DESTROY_PIN 00018 00019 #define SET_DIR_INPUT NRF_GPIO->DIRCLR = PINMASK 00020 #define SET_DIR_OUTPUT NRF_GPIO->DIRSET = PINMASK 00021 #define SET_MODE(pull) NRF_GPIO->PIN_CNF[pin] = (NRF_GPIO->PIN_CNF[pin] & (~GPIO_PIN_CNF_PULL_Msk)) | pull 00022 00023 #define WRITE_PIN_SET NRF_GPIO->OUTSET = PINMASK 00024 #define WRITE_PIN_CLR NRF_GPIO->OUTCLR = PINMASK 00025 00026 #define READ_PIN ((NRF_GPIO->IN & container.mask) ? 1 : 0) 00027 00028 #endif
Generated on Wed Jul 13 2022 05:20:08 by
1.7.2
