summaryrefslogtreecommitdiff
path: root/bsp/rdk/s100/drivers/drv_gpio.h
blob: ee6464129b1ec47398b0acf182bfce7bcacfbf87 (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
#ifndef DRV_GPIO_H__
#define DRV_GPIO_H__

#include "drv_pinmux.h"

/*
 * MCU GPIO access layer used by both the RT-Thread pin device and simple
 * board-level helpers.
 */
typedef enum
{
    S100_PIN_DIR_IN = 0,
    S100_PIN_DIR_OUT,
    S100_PIN_DIR_HIGH_Z,
} s100_pin_direction_t;

typedef enum
{
    S100_PIN_LEVEL_LOW = 0,
    S100_PIN_LEVEL_HIGH,
} s100_pin_level_t;

rt_err_t s100_gpio_set_direction(s100_pin_t pin, s100_pin_direction_t direction);
rt_err_t s100_gpio_write_pin(s100_pin_t pin, s100_pin_level_t level);
rt_err_t s100_gpio_read_pin(s100_pin_t pin, s100_pin_level_t *level);

void s100_gpio_write(rt_uint8_t pin, rt_uint8_t value);
rt_uint8_t s100_gpio_read(rt_uint8_t pin);

#endif