]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/hal/port_gpio.h
f7b0b3e95e051609201f831fecbe1b3b150cc073
[pes-rpp/rpp-lib.git] / rpp / include / hal / port_gpio.h
1 /* Copyright (C) 2013-2014 Czech Technical University in Prague
2  * Authors:
3  *     - Michal Horn <hornmich@fel.cvut.cz>
4  *
5  * This document contains proprietary information belonging to Czech
6  * Technical University in Prague. Passing on and copying of this
7  * document, and communication of its contents is not permitted
8  * without prior written authorization.
9  */
10
11 #ifndef PORT_GPIO_H_
12 #define PORT_GPIO_H_
13
14 //#include "sys_common.h"
15 #include "hal/hal.h"
16
17 /**
18  * Get values of all pins of given port.
19  * @param[in] config    Pointer to array of pin descriptors
20  * @param[in] num_val   Number of pins assigned to the port
21  * @param[out] values   Stored values of all pins of the port. 1st bit -> pin0, 2nd bit -> pin1...
22  * @return always 0
23  */
24 uint32_t hal_gio_port_get_val(uint32_t *config, uint32_t num_val, uint32_t *values);
25
26 /**
27  * Set values to all pins of given port.
28  * @param[in] config    Pointer to array of pin descriptors
29  * @param[in] num_val   Number of pins assigned to the port
30  * @param[in] values    Stored values of all pins of the port. 1st bit -> pin0, 2nd bit -> pin1...
31  * @return always 0
32  */
33 uint32_t hal_gio_port_set_val(uint32_t *config, uint32_t num_val, const uint32_t *values);
34
35 /**
36  *  Get port descriptor assigned to port name.
37  *  @param[in]  port_name   Pointer to string - the name of the port.
38  *  @param[in]  len         Length of the name, if terminated by '/0', then len=-1
39  *  @return Port descriptor or NULL if not found
40  */
41 const port_def_t *hal_port_get_definitions();
42
43 port_desc_t *hal_port_get_dsc(const char *port_name, int len);
44
45 /**
46  *  Get port descriptor assigned to port name.
47  *  @param[in]  port_name   Pointer to string - the name of the port.
48  *  @param[in]  len         Length of the name, if terminated by '/0', then len=-1
49  *  @return Port descriptor or NULL if not found
50  */
51 port_desc_t *hal_port_get_dsc(const char *port_name, int len);
52
53 #endif /* PORT_GPIO_H_ */