Skip to content

Commit

Permalink
Support RedBearLab nRF51822 (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Dec 6, 2015
1 parent 6af6338 commit ef5e5c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions OneWire.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@
#define DIRECT_WRITE_LOW(base, mask) (GPOC = (mask)) //GPIO_OUT_W1TC_ADDRESS
#define DIRECT_WRITE_HIGH(base, mask) (GPOS = (mask)) //GPIO_OUT_W1TS_ADDRESS

#elif defined(RBL_NRF51822)
#define PIN_TO_BASEREG(pin) (0)
#define PIN_TO_BITMASK(pin) (pin)
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, pin) nrf_gpio_pin_read(pin)
#define DIRECT_WRITE_LOW(base, pin) nrf_gpio_pin_clear(pin)
#define DIRECT_WRITE_HIGH(base, pin) nrf_gpio_pin_set(pin)
#define DIRECT_MODE_INPUT(base, pin) nrf_gpio_cfg_input(pin, NRF_GPIO_PIN_NOPULL)
#define DIRECT_MODE_OUTPUT(base, pin) nrf_gpio_cfg_output(pin)

#else
#define PIN_TO_BASEREG(pin) (0)
#define PIN_TO_BITMASK(pin) (pin)
Expand Down

0 comments on commit ef5e5c6

Please sign in to comment.