InfiniTime/src/drivers/DebugPins.cpp
Reinhold Gschweicher ac7b2da611 Update includes to to be relative to src directory
Don't use relative imports like `../foo.h` as those depend on the
relative position of both files. Rather than that use imports relative
to the `src` directory, which explicitly is part of the include
directories.
2021-11-15 22:02:49 +01:00

45 lines
910 B
C++

#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