summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano/driver/gpio.cc
blob: 66e24db55c99ba9eead6f13085a03effb0de885f (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
#include "driver/gpio.h"
#include <avr/io.h>

void GPIO::setup()
{
	DDRB = _BV(PB5);
}

void GPIO::led_on(unsigned char id)
{
	PORTB |= _BV(PB5);
}

void GPIO::led_off(unsigned char id)
{
	PORTB &= ~_BV(PB5);
}

void GPIO::led_toggle(unsigned char id)
{
	PINB = _BV(PB5);
}

GPIO gpio;