4 * Created on: 26.11.2012
7 * This file contains getter and setter functions for GPIO port type.
10 //#include "hal/port_gpio.h"
11 //#include "hal/gpio_tms570.h"
15 * Get values of all pins of given port.
16 * @param[in] config Pointer to array of pin descriptors
17 * @param[in] num_val Number of pins assigned to the port
18 * @param[out] values Stored values of all pins of the port. 1st bit -> pin0, 2nd bit -> pin1...
21 uint32_t hal_gio_port_get_val(uint32_t* config, uint32_t num_val, uint32_t* values) {
23 for (i = 0; i < num_val; i++) {
24 values[i] = hal_gpio_pin_get_value(config[i]);
30 * Set values to all pins of given port.
31 * @param[in] config Pointer to array of pin descriptors
32 * @param[in] num_val Number of pins assigned to the port
33 * @param[in] values Stored values of all pins of the port. 1st bit -> pin0, 2nd bit -> pin1...
36 uint32_t hal_gio_port_set_val(uint32_t* config, uint32_t num_val, const uint32_t* values) {
38 for (i = 0; i < num_val; i++) {
39 hal_gpio_pin_set_value(config[i], values[i]);