120 for (uint_fast32_t i = 0; i < (64 / 4); i++) {
128 int numWordstoPass, byteNumber;
129 uint32_t switchConfigValue;
138 pynq_warning(
"pin: %s is set as GPIO ouput, but not mapped as GPIO. "
139 "Reconfiguring as input.",
146 numWordstoPass = pin_number / 4;
147 byteNumber = pin_number % 4;
150 switchConfigValue =
ioswitch[numWordstoPass];
153 switchConfigValue = (switchConfigValue & (~(0xFF << (byteNumber * 8)))) |
154 (io_type << (byteNumber * 8));
157 ioswitch[numWordstoPass] = switchConfigValue;
163 int numWordstoPass, byteNumber;
164 uint32_t switchConfigValue;
169 numWordstoPass = pin_number / 4;
170 byteNumber = pin_number % 4;
174 switchConfigValue =
ioswitch[numWordstoPass];
175 switchConfigValue = (switchConfigValue >> (byteNumber * 8)) & 0xFF;
178 return switchConfigValue;
void arm_shared_close(arm_shared *handle)
void * arm_shared_init(arm_shared *handle, const uint32_t address, const uint32_t length)
gpio_direction_t gpio_get_direction(const io_t pin)
Returns the direction the set pin is initialized in.
bool gpio_is_initialized(void)
void gpio_set_direction(const io_t pin, const gpio_direction_t dir)
Set the IO pin as in input or output.
#define pynq_warning(...)
char *const pin_names[]
Pin names.
void switchbox_destroy(void)
Resets all pins of the switch box to be input.
io_configuration_t switchbox_get_pin(const io_t pin_number)
Sets the mode of a specified pin.
#define NUM_SWITCHBOX_NAMES
void switchbox_reset(void)
Resets all pins of the switch box to be input.
void switchbox_init(void)
Initializes the switch box.
char *const switchbox_names[NUM_SWITCHBOX_NAMES]
Taken from scpi_names.h, lookup table for channels in the mapping_info function.
void switchbox_set_pin(const io_t pin_number, const io_configuration_t io_type)
Set the type of a switch pin.
enum io_configuration io_configuration_t
io_configuration_t channel
volatile uint32_t * ioswitch
arm_shared ioswitch_handle