libpynq (release 5EWC0-2023 version 0.2.6 of 2023-10-24 17:28)
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 IO_PMODA1   IO_RBPI07
 
#define IO_PMODA2   IO_RBPI29
 
#define IO_PMODA3   IO_RBPI27
 
#define IO_PMODA4   IO_RBPI28
 
#define IO_PMODA7   IO_RBPI31
 
#define IO_PMODA8   IO_RBPI26
 
#define PIN_CHECK(pin)
 

Enumerations

enum  io_t {
  IO_AR0 = 0 , IO_AR1 = 1 , IO_AR2 = 2 , IO_AR3 = 3 ,
  IO_AR4 = 4 , IO_AR5 = 5 , IO_AR6 = 6 , IO_AR7 = 7 ,
  IO_AR8 = 8 , IO_AR9 = 9 , IO_AR10 = 10 , IO_AR11 = 11 ,
  IO_AR12 = 12 , IO_AR13 = 13 , IO_A0 = 14 , IO_A1 = 15 ,
  IO_A2 = 16 , IO_A3 = 17 , IO_A4 = 18 , IO_A5 = 19 ,
  IO_SW0 = 20 , IO_SW1 = 21 , IO_BTN0 = 22 , IO_BTN1 = 23 ,
  IO_BTN2 = 24 , IO_BTN3 = 25 , IO_LD0 = 26 , IO_LD1 = 27 ,
  IO_LD2 = 28 , IO_LD3 = 29 , IO_AR_SCL = 31 , IO_AR_SDA = 30 ,
  IO_LD4B = 32 , IO_LD4R = 33 , IO_LD4G = 34 , IO_LD5B = 35 ,
  IO_LD5R = 36 , IO_LD5G = 37 , IO_RBPI40 = 38 , IO_RBPI37 = 39 ,
  IO_RBPI38 = 40 , IO_RBPI35 = 41 , IO_RBPI36 = 42 , IO_RBPI33 = 43 ,
  IO_RBPI18 = 44 , IO_RBPI32 = 45 , IO_RBPI10 = 46 , IO_RBPI27 = 47 ,
  IO_RBPI28 = 48 , IO_RBPI22 = 49 , IO_RBPI23 = 50 , IO_RBPI24 = 51 ,
  IO_RBPI21 = 52 , IO_RBPI26 = 53 , IO_RBPI19 = 54 , IO_RBPI31 = 55 ,
  IO_RBPI15 = 56 , IO_RBPI16 = 57 , IO_RBPI13 = 58 , IO_RBPI12 = 59 ,
  IO_RBPI29 = 60 , IO_RBPI08 = 61 , IO_RBPI07 = 62 , IO_RBPI05 = 63 ,
  IO_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 IO_AR0 to specify analog reference pin AR0. Specifically, symbolic pin names are prefixed with IO_ because they are used as inputs to switchbox functions, but the pin name when printed omits the IO_.

Macro Definition Documentation

◆ IO_PMODA1

#define IO_PMODA1   IO_RBPI07

6 RaspberryPi headers are also accessible via Pmod A.

Definition at line 150 of file pinmap.h.

◆ IO_PMODA2

#define IO_PMODA2   IO_RBPI29

Definition at line 151 of file pinmap.h.

◆ IO_PMODA3

#define IO_PMODA3   IO_RBPI27

Definition at line 152 of file pinmap.h.

◆ IO_PMODA4

#define IO_PMODA4   IO_RBPI28

Definition at line 153 of file pinmap.h.

◆ IO_PMODA7

#define IO_PMODA7   IO_RBPI31

Definition at line 154 of file pinmap.h.

◆ IO_PMODA8

#define IO_PMODA8   IO_RBPI26

Definition at line 155 of file pinmap.h.

◆ 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 >= IO_NUM_PINS) { \
pynq_error("pin %u is invalid, must be 0..%u-1.\n", pin, IO_NUM_PINS); \
} \
} while (0);
@ IO_NUM_PINS
Definition pinmap.h:144

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

Definition at line 160 of file pinmap.h.

Enumeration Type Documentation

◆ io_t

enum io_t
Enumerator
IO_AR0 

Analog reference pins (Arduino header).

IO_AR1 
IO_AR2 
IO_AR3 
IO_AR4 
IO_AR5 
IO_AR6 
IO_AR7 
IO_AR8 
IO_AR9 
IO_AR10 
IO_AR11 
IO_AR12 
IO_AR13 
IO_A0 

Analog input pins (Arduino header).

IO_A1 
IO_A2 
IO_A3 
IO_A4 
IO_A5 
IO_SW0 

Switch input pins.

IO_SW1 
IO_BTN0 

Button input pins.

IO_BTN1 
IO_BTN2 
IO_BTN3 
IO_LD0 

LED output pins.

IO_LD1 
IO_LD2 
IO_LD3 
IO_AR_SCL 

I2C pins.

IO_AR_SDA 
IO_LD4B 

The RGB adresses for IO_LD4 and IO_LD5.

IO_LD4R 
IO_LD4G 
IO_LD5B 
IO_LD5R 
IO_LD5G 
IO_RBPI40 

The RaspberryPi header-pin indexing.

IO_RBPI37 
IO_RBPI38 
IO_RBPI35 
IO_RBPI36 
IO_RBPI33 
IO_RBPI18 
IO_RBPI32 
IO_RBPI10 
IO_RBPI27 
IO_RBPI28 
IO_RBPI22 
IO_RBPI23 
IO_RBPI24 
IO_RBPI21 
IO_RBPI26 
IO_RBPI19 
IO_RBPI31 
IO_RBPI15 
IO_RBPI16 
IO_RBPI13 
IO_RBPI12 
IO_RBPI29 
IO_RBPI08 
IO_RBPI07 
IO_RBPI05 
IO_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.