120 for (uint_fast32_t i = 0; i < (64 / 4); i++) {
129 int numWordstoPass, byteNumber;
130 uint32_t switchConfigValue;
139 pynq_warning(
"pin: %s is set as GPIO ouput, but not mapped as GPIO. "
140 "Reconfiguring as input.",
147 numWordstoPass = pin_number / 4;
148 byteNumber = pin_number % 4;
151 switchConfigValue =
ioswitch[numWordstoPass];
154 switchConfigValue = (switchConfigValue & (~(0xFF << (byteNumber * 8)))) |
155 (pin_type << (byteNumber * 8));
158 ioswitch[numWordstoPass] = switchConfigValue;
164 int numWordstoPass, byteNumber;
165 uint32_t switchConfigValue;
170 numWordstoPass = pin_number / 4;
171 byteNumber = pin_number % 4;
175 switchConfigValue =
ioswitch[numWordstoPass];
176 switchConfigValue = (switchConfigValue >> (byteNumber * 8)) & 0xFF;
179 return switchConfigValue;
gpio_direction_t gpio_get_direction(const gpio_t pin)
void gpio_set_direction(const gpio_t pin, const gpio_direction_t direction)
uint8_t switchbox_get_pin(const int32_t pin_number)
void switchbox_set_pin(const int32_t pin_number, const uint8_t pin_type)
void arm_shared_close(arm_shared *handle)
void * arm_shared_init(arm_shared *handle, const uint32_t address, const uint32_t length)
bool gpio_is_initialized(void)
#define pynq_warning(...)
char *const pin_names[]
Pin names.
void switchbox_destroy(void)
Resets all pins of the switch box to be input.
#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.
volatile uint32_t * ioswitch
arm_shared ioswitch_handle