120 for (uint_fast32_t i = 0; i < (64 / 4); i++) {
129 int numWordstoPass, byteNumber;
130 uint32_t switchConfigValue;
133 numWordstoPass = pin_number / 4;
134 byteNumber = pin_number % 4;
137 switchConfigValue =
ioswitch[numWordstoPass];
140 switchConfigValue = (switchConfigValue & (~(0xFF << (byteNumber * 8)))) |
141 (pin_type << (byteNumber * 8));
144 ioswitch[numWordstoPass] = switchConfigValue;
150 int numWordstoPass, byteNumber;
151 uint32_t switchConfigValue;
154 numWordstoPass = pin_number / 4;
155 byteNumber = pin_number % 4;
159 switchConfigValue =
ioswitch[numWordstoPass];
160 switchConfigValue = (switchConfigValue >> (byteNumber * 8)) & 0xFF;
163 return switchConfigValue;
void arm_shared_close(arm_shared *handle)
void * arm_shared_init(arm_shared *handle, const uint32_t address, const uint32_t length)
void switchbox_destroy(void)
Resets all pins of the switch box to be input.
uint8_t switchbox_get_pin(const int32_t pin_number)
Sets the mode of a specified pin.
void switchbox_set_pin(const int32_t pin_number, const uint8_t pin_type)
Set the type of a switch 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.
volatile uint32_t * ioswitch
arm_shared ioswitch_handle