libpynq (release 5EWC0-2023 version 0.2.1 of 2023-09-01 11:02)
|
Macros | |
#define | NUM_SWITCHBOX_NAMES 40 |
Enumerations | |
enum | io_configuration { SWB_GPIO = 0x00 , SWB_Interrupt_In = 0x01 , SWB_UART0_TX = 0x02 , SWB_UART0_RX = 0x03 , SWB_SPI0_CLK = 0x04 , SWB_SPI0_MISO = 0x05 , SWB_SPI0_MOSI = 0x06 , SWB_SPI0_SS = 0x07 , SWB_SPI1_CLK = 0x08 , SWB_SPI1_MISO = 0x09 , SWB_SPI1_MOSI = 0x0A , SWB_SPI1_SS = 0x0B , SWB_IIC0_SDA = 0x0C , SWB_IIC0_SCL = 0x0D , SWB_IIC1_SDA = 0x0E , SWB_IIC1_SCL = 0x0F , SWB_PWM0 = 0x10 , SWB_PWM1 = 0x11 , SWB_PWM2 = 0x12 , SWB_PWM3 = 0x13 , SWB_PWM4 = 0x14 , SWB_PWM5 = 0x15 , SWB_TIMER_G0 = 0x18 , SWB_TIMER_G1 = 0x19 , SWB_TIMER_G2 = 0x1A , SWB_TIMER_G3 = 0x1B , SWB_TIMER_G4 = 0x1C , SWB_TIMER_G5 = 0x1D , SWB_TIMER_G6 = 0x1E , SWB_TIMER_G7 = 0x1F , SWB_UART1_TX = 0x22 , SWB_UART1_RX = 0x23 , SWB_TIMER_IC0 = 0x38 , SWB_TIMER_IC1 = 0x39 , SWB_TIMER_IC2 = 0x3A , SWB_TIMER_IC3 = 0x3B , SWB_TIMER_IC4 = 0x3C , SWB_TIMER_IC5 = 0x3D , SWB_TIMER_IC6 = 0x3E , SWB_TIMER_IC7 = 0x3F , NUM_IO_CONFIGURATIONS } |
Functions | |
void | switchbox_init (void) |
void | switchbox_set_pin (const pin_t pin_number, const uint8_t pin_type) |
void | switchbox_reset (void) |
void | switchbox_destroy (void) |
uint8_t | switchbox_get_pin (const pin_t pin_number) |
Variables | |
char *const | switchbox_names [NUM_SWITCHBOX_NAMES] |
The switchbox enables run-time (re)mapping of I/O pins.
For example, output pin of UART 0 (SWB_UART0_TX) can be mapped to analog pins 0 and 1 (SWB_AR0 & SWB_AR1). Or output pin PWM 0 (SWB_PWM0) can be mapped to green LED 0 (SWB_LD0). Or output pin PWM 0 (SWB_PWM0) can be mapped to the green component of color LED 0 (SWB_LD0).
#define NUM_SWITCHBOX_NAMES 40 |
Definition at line 134 of file switchbox.h.
enum io_configuration |
Definition at line 61 of file switchbox.h.
void switchbox_destroy | ( | void | ) |
Resets all pins of the switch box to be input.
Definition at line 6 of file switchbox.c.
uint8_t switchbox_get_pin | ( | const pin_t | pin_number | ) |
Sets the mode of a specified pin.
pin_number | The pin number to set the mode for |
pin_type | The mode to set the pin to (input/output) |
Sets the mode of the specified pin on the io switch
Definition at line 163 of file switchbox.c.
void switchbox_init | ( | void | ) |
Initializes the switch box.
Initializes the shared memory and sets the io switch base address
Definition at line 3 of file switchbox.c.
void switchbox_reset | ( | void | ) |
Resets all pins of the switch box to be input.
Definition at line 5 of file switchbox.c.
void switchbox_set_pin | ( | const pin_t | pin_number, |
const uint8_t | pin_type | ||
) |
Set the type of a switch pin.
pin_number | The number of the pin to set |
pin_type | The type of the pin (0 for input, 1 for output) |
Definition at line 128 of file switchbox.c.
|
extern |
Taken from scpi_names.h, lookup table for channels in the mapping_info function.
Definition at line 2 of file switchbox.c.