libpynq (release 5EWC0-2023 version 0.2.1 of 2023-09-01 11:02)
Loading...
Searching...
No Matches
I/O pin mapping

Macros

#define NUM_ANALOG_REFERENCE_PINS   14 /* # analog reference pins */
 
#define NUM_ANALOG_IN_PINS   6 /* # analog input pins */
 
#define PIN_CHECK(pin)
 

Enumerations

enum  pin_t {
  SWB_AR0 = 0 , SWB_AR1 = 1 , SWB_AR2 = 2 , SWB_AR3 = 3 ,
  SWB_AR4 = 4 , SWB_AR5 = 5 , SWB_AR6 = 6 , SWB_AR7 = 7 ,
  SWB_AR8 = 8 , SWB_AR9 = 9 , SWB_AR10 = 10 , SWB_AR11 = 11 ,
  SWB_AR12 = 12 , SWB_AR13 = 13 , SWB_A0 = 14 , SWB_A1 = 15 ,
  SWB_A2 = 16 , SWB_A3 = 17 , SWB_A4 = 18 , SWB_A5 = 19 ,
  SWB_SW0 = 20 , SWB_SW1 = 21 , SWB_BTN0 = 22 , SWB_BTN1 = 23 ,
  SWB_BTN2 = 24 , SWB_BTN3 = 25 , SWB_LD0 = 26 , SWB_LD1 = 27 ,
  SWB_LD2 = 28 , SWB_LD3 = 29 , SWB_AR_SCL = 31 , SWB_AR_SDA = 30 ,
  SWB_LD4B = 32 , SWB_LD4R = 33 , SWB_LD4G = 34 , SWB_LD5B = 35 ,
  SWB_LD5R = 36 , SWB_LD5G = 37 , SWB_RBPI40 = 38 , SWB_RBPI37 = 39 ,
  SWB_RBPI38 = 40 , SWB_RBPI35 = 41 , SWB_RBPI36 = 42 , SWB_RBPI33 = 43 ,
  SWB_RBPI18 = 44 , SWB_RBPI32 = 45 , SWB_RBPI10 = 46 , SWB_RBPI27 = 47 ,
  SWB_RBPI28 = 48 , SWB_RBPI22 = 49 , SWB_RBPI23 = 50 , SWB_RBPI24 = 51 ,
  SWB_RBPI21 = 52 , SWB_RBPI26 = 53 , SWB_RBPI19 = 54 , SWB_RBPI31 = 55 ,
  SWB_RBPI15 = 56 , SWB_RBPI16 = 57 , SWB_RBPI13 = 58 , SWB_RBPI12 = 59 ,
  SWB_RBPI29 = 60 , SWB_RBPI08 = 61 , SWB_RBPI07 = 62 , SWB_RBPI05 = 63 ,
  SWB_NUM_PINS = 64
}
 

Variables

char *const pin_names [64]
 

Detailed Description

Definitions of I/O pin numbers and names for the switchbox and GPIO.

For example, when calling a function, use SWB_AR0 to specify analog reference pin AR0. Specifically, symbolic pin names are prefixed with SWB_ because they are used as inputs to switchbox functions, but the pin name when printed omits the SWB_.

Macro Definition Documentation

◆ NUM_ANALOG_IN_PINS

#define NUM_ANALOG_IN_PINS   6 /* # analog input pins */

Definition at line 43 of file pinmap.h.

◆ NUM_ANALOG_REFERENCE_PINS

#define NUM_ANALOG_REFERENCE_PINS   14 /* # analog reference pins */

Definition of the number of I/O pins we have for each category.

Definition at line 42 of file pinmap.h.

◆ PIN_CHECK

#define PIN_CHECK (   pin)
Value:
do { \
if (pin >= SWB_NUM_PINS) { \
pynq_error("pin %u is invalid, must be 0..%u-1.", pin, SWB_NUM_PINS); \
} \
} while (0);
@ SWB_NUM_PINS
Definition pinmap.h:144

macro that checks if the pin number is valid, throws an error if not.

Definition at line 150 of file pinmap.h.

Enumeration Type Documentation

◆ pin_t

enum pin_t
Enumerator
SWB_AR0 

Analog reference pins.

SWB_AR1 
SWB_AR2 
SWB_AR3 
SWB_AR4 
SWB_AR5 
SWB_AR6 
SWB_AR7 
SWB_AR8 
SWB_AR9 
SWB_AR10 
SWB_AR11 
SWB_AR12 
SWB_AR13 
SWB_A0 

Analog input pins.

SWB_A1 
SWB_A2 
SWB_A3 
SWB_A4 
SWB_A5 
SWB_SW0 

Switch input pins.

SWB_SW1 
SWB_BTN0 

Button input pins.

SWB_BTN1 
SWB_BTN2 
SWB_BTN3 
SWB_LD0 

LED output pins.

SWB_LD1 
SWB_LD2 
SWB_LD3 
SWB_AR_SCL 

I2C pins.

SWB_AR_SDA 
SWB_LD4B 

The RGB adresses for SWB_LD4 and SWB_LD5.

SWB_LD4R 
SWB_LD4G 
SWB_LD5B 
SWB_LD5R 
SWB_LD5G 
SWB_RBPI40 

The RaspberryPi header-pin indexing.

SWB_RBPI37 
SWB_RBPI38 
SWB_RBPI35 
SWB_RBPI36 
SWB_RBPI33 
SWB_RBPI18 
SWB_RBPI32 
SWB_RBPI10 
SWB_RBPI27 
SWB_RBPI28 
SWB_RBPI22 
SWB_RBPI23 
SWB_RBPI24 
SWB_RBPI21 
SWB_RBPI26 
SWB_RBPI19 
SWB_RBPI31 
SWB_RBPI15 
SWB_RBPI16 
SWB_RBPI13 
SWB_RBPI12 
SWB_RBPI29 
SWB_RBPI08 
SWB_RBPI07 
SWB_RBPI05 
SWB_NUM_PINS 

Definition at line 45 of file pinmap.h.

Variable Documentation

◆ pin_names

char* const pin_names[64]
extern

Pin names.

Definition at line 24 of file pinmap.c.