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;
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)
gpio_direction_t gpio_get_direction(const pin_t pin)
Returns the direction the set pin is initialized in.
void gpio_set_direction(const pin_t pin, const gpio_direction_t dir)
Set the GPIO 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.
#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.
uint8_t switchbox_get_pin(const pin_t pin_number)
Sets the mode of a specified pin.
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 pin_t pin_number, const uint8_t pin_type)
Set the type of a switch pin.
volatile uint32_t * ioswitch
arm_shared ioswitch_handle