2 * Copyright (C) 2015 Czech Technical University in Prague
5 * - Michal Sojka <sojkam1@fel.cvut.cz>
8 * This document contains proprietary information belonging to Czech
9 * Technical University in Prague. Passing on and copying of this
10 * document, and communication of its contents is not permitted
11 * without prior written authorization.
19 #include "drv/gio_names.h"
21 #define RPP_GIO_PORT_GIOA 0x2
22 #define RPP_GIO_PORT_GIOB 0x4
23 #define RPP_GIO_PORT_NHET1 0x8
24 #define RPP_GIO_PORT_ALL (RPP_GIO_PORT_GIOA|RPP_GIO_PORT_GIOB|RPP_GIO_PORT_NHET1)
26 int8_t rpp_gio_init(uint32_t init_ports);
28 int8_t rpp_gio_set(enum pin_name pin, boolean_t value);
29 int8_t rpp_gio_get(enum pin_name pin);
31 /** GIO pin input mode */
32 enum rpp_gio_in_mode {
33 RPP_GIO_MODE_PULLDIS, /**< Disable pull resistor */
35 RPP_GIO_MODE_PULLDOWN,
38 /** GIO pin direction */
47 * @param pin Pin to configure
48 * @param io Configure the pin as input or output.
49 * @param in_mode Input settings. Ignored when pin is configured as
51 * @param open_drain Output is open drain when TRUE, pull/push when
52 * FALSE. Ignored when pin is configured as input.
54 * @return SUCCESS or FAILURE.
56 int8_t rpp_gio_setup(enum pin_name pin,
58 enum rpp_gio_in_mode in_mode,
59 boolean_t open_drain);
61 int8_t rpp_gio_port_set(int port, uint32_t bits);
62 int8_t rpp_gio_port_get(int port, uint32_t *bits);