1/*
2 * Copyright 2019, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12
13procedure GPIO {
14    include <platsupport/gpio.h>;
15    int init_pin(in gpio_id_t pin_id, in gpio_dir_t dir);
16    /* GPIO_LEVEL_LOW for a low level, GPIO_LEVEL_HIGH for a high level */
17    int set_level(in gpio_id_t pin_id, in gpio_level_t level);
18    /* Returns GPIO_LEVEL_HIGH on high, GPIO_LEVEL_LOW on low, negative number on error */
19    int read_level(in gpio_id_t pin_id);
20};
21