summaryrefslogtreecommitdiff
path: root/src/libs/gpio.h
blob: b9d2bb65326c965cf77e8fc29b19aab05032320b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __GPIO_H__
#define __GPIO_H__

#include "types.h"

#define GPIO_FN_SPI    1
#define GPIO_FN_UART   2
#define GPIO_FN_I2C    3
#define GPIO_FN_PWM    4
#define GPIO_FN_SIO    5
#define GPIO_FN_PIO0   6
#define GPIO_FN_PIO1   7
#define GPIO_FN_USB    8

void gpio_init();
void gpio_set_function(u8 gpio, u8 fn);
void gpio_output_enable(u8 gpio);
void gpio_toggle_state(u8 gpio);
void gpio_toggle_led();
void gpio_blink_led(int n);

#endif