fork/GramFirmware

git clone https://git.julia.blue/fork/GramFirmware

Jonathan HaylettMerge pull request #7 from JonnyHaystack/v23ab6a9b

gram
443 B16 linesraw
1#include "gpio.hpp"
2
3#include "stdlib.hpp"
4
5// TODO: Might be better to replace with port manipulation
6namespace gpio {
7    void init_pin(uint pin, GpioMode mode) {
8        if (mode == GpioMode::GPIO_OUTPUT) {
9            pinMode(pin, OUTPUT);
10        } else if (mode == GpioMode::GPIO_INPUT_PULLUP) {
11            pinMode(pin, INPUT_PULLUP);
12        } else if (mode == GpioMode::GPIO_INPUT) {
13            pinMode(pin, INPUT);
14        }
15    }
16}