summaryrefslogtreecommitdiff
path: root/src/drivers/DebugPins.cpp
blob: 92091280e509b18b4246fcc86ec16864dd2d0a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "drivers/DebugPins.h"
#include <hal/nrf_gpio.h>

#ifdef USE_DEBUG_PINS
void debugpins_init() {
  nrf_gpio_cfg_output(DebugPin0);
  nrf_gpio_pin_clear(DebugPin0);

  nrf_gpio_cfg_output(DebugPin1);
  nrf_gpio_pin_clear(DebugPin1);

  nrf_gpio_cfg_output(DebugPin2);
  nrf_gpio_pin_clear(DebugPin2);

  nrf_gpio_cfg_output(DebugPin3);
  nrf_gpio_pin_clear(DebugPin3);

  nrf_gpio_cfg_output(DebugPin4);
  nrf_gpio_pin_clear(DebugPin4);
}
void debugpins_set(debugpins_pins pin) {
  nrf_gpio_pin_set((uint32_t) (pin));
}

void debugpins_clear(debugpins_pins pin) {
  nrf_gpio_pin_clear((uint32_t) (pin));
}

void debugpins_pulse(debugpins_pins pin) {
  nrf_gpio_pin_set((uint32_t) (pin));
  nrf_gpio_pin_clear((uint32_t) (pin));
}
#else
void debugpins_init() {
}
void debugpins_set(debugpins_pins pin) {
}

void debugpins_clear(debugpins_pins pin) {
}

void debugpins_pulse(debugpins_pins pin) {
}

#endif