libbladeRF: Expansion I/O

| libbladeRF 2.5.0-git Nuand bladeRF library

Loading...
Searching...
No Matches
Macros | Functions
Expansion I/O
bladeRF1-specific API

## Description

These definitions and functions provide high-level functionality for manipulating pins on the bladeRF1 U74 Expansion Header, and the associated mappings on expansion boards.

These functions are thread-safe.

## Macros
#define | BLADERF_XB_GPIO(n) (1 << (n - 1))
#define | BLADERF_XB_DIR_OUTPUT(pin) (pin)
#define | BLADERF_XB_DIR_INPUT(pin) (0)
#define | BLADERF_XB_GPIO_01 BLADERF_XB_GPIO(1)
#define | BLADERF_XB_GPIO_02 BLADERF_XB_GPIO(2)
#define | BLADERF_XB_GPIO_03 BLADERF_XB_GPIO(3)
#define | BLADERF_XB_GPIO_04 BLADERF_XB_GPIO(4)
#define | BLADERF_XB_GPIO_05 BLADERF_XB_GPIO(5)
#define | BLADERF_XB_GPIO_06 BLADERF_XB_GPIO(6)
#define | BLADERF_XB_GPIO_07 BLADERF_XB_GPIO(7)
#define | BLADERF_XB_GPIO_08 BLADERF_XB_GPIO(8)
#define | BLADERF_XB_GPIO_09 BLADERF_XB_GPIO(9)
#define | BLADERF_XB_GPIO_10 BLADERF_XB_GPIO(10)
#define | BLADERF_XB_GPIO_11 BLADERF_XB_GPIO(11)
#define | BLADERF_XB_GPIO_12 BLADERF_XB_GPIO(12)
#define | BLADERF_XB_GPIO_13 BLADERF_XB_GPIO(13)
#define | BLADERF_XB_GPIO_14 BLADERF_XB_GPIO(14)
#define | BLADERF_XB_GPIO_15 BLADERF_XB_GPIO(15)
#define | BLADERF_XB_GPIO_16 BLADERF_XB_GPIO(16)
#define | BLADERF_XB_GPIO_17 BLADERF_XB_GPIO(17)
#define | BLADERF_XB_GPIO_18 BLADERF_XB_GPIO(18)
#define | BLADERF_XB_GPIO_19 BLADERF_XB_GPIO(19)
#define | BLADERF_XB_GPIO_20 BLADERF_XB_GPIO(20)
#define | BLADERF_XB_GPIO_21 BLADERF_XB_GPIO(21)
#define | BLADERF_XB_GPIO_22 BLADERF_XB_GPIO(22)
#define | BLADERF_XB_GPIO_23 BLADERF_XB_GPIO(23)
#define | BLADERF_XB_GPIO_24 BLADERF_XB_GPIO(24)
#define | BLADERF_XB_GPIO_25 BLADERF_XB_GPIO(25)
#define | BLADERF_XB_GPIO_26 BLADERF_XB_GPIO(26)
#define | BLADERF_XB_GPIO_27 BLADERF_XB_GPIO(27)
#define | BLADERF_XB_GPIO_28 BLADERF_XB_GPIO(28)
#define | BLADERF_XB_GPIO_29 BLADERF_XB_GPIO(29)
#define | BLADERF_XB_GPIO_30 BLADERF_XB_GPIO(30)
#define | BLADERF_XB_GPIO_31 BLADERF_XB_GPIO(31)
#define | BLADERF_XB_GPIO_32 BLADERF_XB_GPIO(32)
#define | BLADERF_XB200_PIN_J7_1 BLADERF_XB_GPIO_10
#define | BLADERF_XB200_PIN_J7_2 BLADERF_XB_GPIO_11
#define | BLADERF_XB200_PIN_J7_5 BLADERF_XB_GPIO_08
#define | BLADERF_XB200_PIN_J7_6 BLADERF_XB_GPIO_09
#define | BLADERF_XB200_PIN_J13_1 BLADERF_XB_GPIO_17
#define | BLADERF_XB200_PIN_J13_2 BLADERF_XB_GPIO_18
#define | BLADERF_XB200_PIN_J16_1 BLADERF_XB_GPIO_31
#define | BLADERF_XB200_PIN_J16_2 BLADERF_XB_GPIO_32
#define | BLADERF_XB200_PIN_J16_3 BLADERF_XB_GPIO_19
#define | BLADERF_XB200_PIN_J16_4 BLADERF_XB_GPIO_20
#define | BLADERF_XB200_PIN_J16_5 BLADERF_XB_GPIO_21
#define | BLADERF_XB200_PIN_J16_6 BLADERF_XB_GPIO_24
#define | BLADERF_XB100_PIN_J2_3 BLADERF_XB_GPIO_07
#define | BLADERF_XB100_PIN_J2_4 BLADERF_XB_GPIO_08
#define | BLADERF_XB100_PIN_J3_3 BLADERF_XB_GPIO_09
#define | BLADERF_XB100_PIN_J3_4 BLADERF_XB_GPIO_10
#define | BLADERF_XB100_PIN_J4_3 BLADERF_XB_GPIO_11
#define | BLADERF_XB100_PIN_J4_4 BLADERF_XB_GPIO_12
#define | BLADERF_XB100_PIN_J5_3 BLADERF_XB_GPIO_13
#define | BLADERF_XB100_PIN_J5_4 BLADERF_XB_GPIO_14
#define | BLADERF_XB100_PIN_J11_2 BLADERF_XB_GPIO_05
#define | BLADERF_XB100_PIN_J11_3 BLADERF_XB_GPIO_04
#define | BLADERF_XB100_PIN_J11_4 BLADERF_XB_GPIO_03
#define | BLADERF_XB100_PIN_J11_5 BLADERF_XB_GPIO_06
#define | BLADERF_XB100_PIN_J12_2 BLADERF_XB_GPIO_01
#define | BLADERF_XB100_PIN_J12_5 BLADERF_XB_GPIO_02
#define | BLADERF_XB100_LED_D1 BLADERF_XB_GPIO_24
#define | BLADERF_XB100_LED_D2 BLADERF_XB_GPIO_32
#define | BLADERF_XB100_LED_D3 BLADERF_XB_GPIO_30
#define | BLADERF_XB100_LED_D4 BLADERF_XB_GPIO_28
#define | BLADERF_XB100_LED_D5 BLADERF_XB_GPIO_23
#define | BLADERF_XB100_LED_D6 BLADERF_XB_GPIO_25
#define | BLADERF_XB100_LED_D7 BLADERF_XB_GPIO_31
#define | BLADERF_XB100_LED_D8 BLADERF_XB_GPIO_29
#define | BLADERF_XB100_TLED_RED BLADERF_XB_GPIO_22
#define | BLADERF_XB100_TLED_GREEN BLADERF_XB_GPIO_21
#define | BLADERF_XB100_TLED_BLUE BLADERF_XB_GPIO_20
#define | BLADERF_XB100_DIP_SW1 BLADERF_XB_GPIO_27
#define | BLADERF_XB100_DIP_SW2 BLADERF_XB_GPIO_26
#define | BLADERF_XB100_DIP_SW3 BLADERF_XB_GPIO_16
#define | BLADERF_XB100_DIP_SW4 BLADERF_XB_GPIO_15
#define | BLADERF_XB100_BTN_J6 BLADERF_XB_GPIO_19
#define | BLADERF_XB100_BTN_J7 BLADERF_XB_GPIO_18
#define | BLADERF_XB100_BTN_J8 BLADERF_XB_GPIO_17

## Functions
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_read (struct bladerf *dev, uint32_t *val)
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_write (struct bladerf *dev, uint32_t val)
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_masked_write (struct bladerf *dev, uint32_t mask, uint32_t value)
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_dir_read (struct bladerf *dev, uint32_t *outputs)
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_dir_write (struct bladerf *dev, uint32_t outputs)
API_EXPORT int CALL_CONV | bladerf_expansion_gpio_dir_masked_write (struct bladerf *dev, uint32_t mask, uint32_t outputs)

## Macro Definition Documentation

## ◆ BLADERF_XB100_BTN_J6

#define BLADERF_XB100_BTN_J6 BLADERF_XB_GPIO_19

Bitmask for XB-100 button J6

Definition at line 888 of file bladeRF1.h.

## ◆ BLADERF_XB100_BTN_J7

#define BLADERF_XB100_BTN_J7 BLADERF_XB_GPIO_18

Bitmask for XB-100 button J7

Definition at line 891 of file bladeRF1.h.

## ◆ BLADERF_XB100_BTN_J8

#define BLADERF_XB100_BTN_J8 BLADERF_XB_GPIO_17

Bitmask for XB-100 button J8

Definition at line 894 of file bladeRF1.h.

## ◆ BLADERF_XB100_DIP_SW1

#define BLADERF_XB100_DIP_SW1 BLADERF_XB_GPIO_27

Bitmask for XB-100 DIP switch 1

Definition at line 876 of file bladeRF1.h.

## ◆ BLADERF_XB100_DIP_SW2

#define BLADERF_XB100_DIP_SW2 BLADERF_XB_GPIO_26

Bitmask for XB-100 DIP switch 2

Definition at line 879 of file bladeRF1.h.

## ◆ BLADERF_XB100_DIP_SW3

#define BLADERF_XB100_DIP_SW3 BLADERF_XB_GPIO_16

Bitmask for XB-100 DIP switch 3

Definition at line 882 of file bladeRF1.h.

## ◆ BLADERF_XB100_DIP_SW4

#define BLADERF_XB100_DIP_SW4 BLADERF_XB_GPIO_15

Bitmask for XB-100 DIP switch 4

Definition at line 885 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D1

#define BLADERF_XB100_LED_D1 BLADERF_XB_GPIO_24

Bitmask for XB-100 LED_D1 (blue)

Definition at line 843 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D2

#define BLADERF_XB100_LED_D2 BLADERF_XB_GPIO_32

Bitmask for XB-100 LED_D2 (blue)

Definition at line 846 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D3

#define BLADERF_XB100_LED_D3 BLADERF_XB_GPIO_30

Bitmask for XB-100 LED_D3 (blue)

Definition at line 849 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D4

#define BLADERF_XB100_LED_D4 BLADERF_XB_GPIO_28

Bitmask for XB-100 LED_D4 (red)

Definition at line 852 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D5

#define BLADERF_XB100_LED_D5 BLADERF_XB_GPIO_23

Bitmask for XB-100 LED_D5 (red)

Definition at line 855 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D6

#define BLADERF_XB100_LED_D6 BLADERF_XB_GPIO_25

Bitmask for XB-100 LED_D6 (red)

Definition at line 858 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D7

#define BLADERF_XB100_LED_D7 BLADERF_XB_GPIO_31

Bitmask for XB-100 LED_D7 (green)

Definition at line 861 of file bladeRF1.h.

## ◆ BLADERF_XB100_LED_D8

#define BLADERF_XB100_LED_D8 BLADERF_XB_GPIO_29

Bitmask for XB-100 LED_D8 (green)

Definition at line 864 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J11_2

#define BLADERF_XB100_PIN_J11_2 BLADERF_XB_GPIO_05

Bitmask for XB-100 header J11, pin 2

Definition at line 823 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J11_3

#define BLADERF_XB100_PIN_J11_3 BLADERF_XB_GPIO_04

Bitmask for XB-100 header J11, pin 3

Definition at line 826 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J11_4

#define BLADERF_XB100_PIN_J11_4 BLADERF_XB_GPIO_03

Bitmask for XB-100 header J11, pin 4

Definition at line 829 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J11_5

#define BLADERF_XB100_PIN_J11_5 BLADERF_XB_GPIO_06

Bitmask for XB-100 header J11, pin 5

Definition at line 832 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J12_2

#define BLADERF_XB100_PIN_J12_2 BLADERF_XB_GPIO_01

Bitmask for XB-100 header J12, pin 2

Definition at line 835 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J12_5

#define BLADERF_XB100_PIN_J12_5 BLADERF_XB_GPIO_02

Bitmask for XB-100 header J12, pin 5

Definition at line 840 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J2_3

#define BLADERF_XB100_PIN_J2_3 BLADERF_XB_GPIO_07

Bitmask for XB-100 header J2, pin 3

Definition at line 799 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J2_4

#define BLADERF_XB100_PIN_J2_4 BLADERF_XB_GPIO_08

Bitmask for XB-100 header J2, pin 4

Definition at line 802 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J3_3

#define BLADERF_XB100_PIN_J3_3 BLADERF_XB_GPIO_09

Bitmask for XB-100 header J3, pin 3

Definition at line 805 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J3_4

#define BLADERF_XB100_PIN_J3_4 BLADERF_XB_GPIO_10

Bitmask for XB-100 header J3, pin 4

Definition at line 808 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J4_3

#define BLADERF_XB100_PIN_J4_3 BLADERF_XB_GPIO_11

Bitmask for XB-100 header J4, pin 3

Definition at line 811 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J4_4

#define BLADERF_XB100_PIN_J4_4 BLADERF_XB_GPIO_12

Bitmask for XB-100 header J4, pin 4

Definition at line 814 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J5_3

#define BLADERF_XB100_PIN_J5_3 BLADERF_XB_GPIO_13

Bitmask for XB-100 header J5, pin 3

Definition at line 817 of file bladeRF1.h.

## ◆ BLADERF_XB100_PIN_J5_4

#define BLADERF_XB100_PIN_J5_4 BLADERF_XB_GPIO_14

Bitmask for XB-100 header J5, pin 4

Definition at line 820 of file bladeRF1.h.

## ◆ BLADERF_XB100_TLED_BLUE

#define BLADERF_XB100_TLED_BLUE BLADERF_XB_GPIO_20

Bitmask for XB-100 tricolor LED, blue cathode

Definition at line 873 of file bladeRF1.h.

## ◆ BLADERF_XB100_TLED_GREEN

#define BLADERF_XB100_TLED_GREEN BLADERF_XB_GPIO_21

Bitmask for XB-100 tricolor LED, green cathode

Definition at line 870 of file bladeRF1.h.

## ◆ BLADERF_XB100_TLED_RED

#define BLADERF_XB100_TLED_RED BLADERF_XB_GPIO_22

Bitmask for XB-100 tricolor LED, red cathode

Definition at line 867 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J13_1

#define BLADERF_XB200_PIN_J13_1 BLADERF_XB_GPIO_17

Bitmask for XB-200 header J13, pin 1

Definition at line 773 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J13_2

#define BLADERF_XB200_PIN_J13_2 BLADERF_XB_GPIO_18

Bitmask for XB-200 header J13, pin 2

Definition at line 776 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_1

#define BLADERF_XB200_PIN_J16_1 BLADERF_XB_GPIO_31

Bitmask for XB-200 header J16, pin 1

Definition at line 781 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_2

#define BLADERF_XB200_PIN_J16_2 BLADERF_XB_GPIO_32

Bitmask for XB-200 header J16, pin 2

Definition at line 784 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_3

#define BLADERF_XB200_PIN_J16_3 BLADERF_XB_GPIO_19

Bitmask for XB-200 header J16, pin 3

Definition at line 787 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_4

#define BLADERF_XB200_PIN_J16_4 BLADERF_XB_GPIO_20

Bitmask for XB-200 header J16, pin 4

Definition at line 790 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_5

#define BLADERF_XB200_PIN_J16_5 BLADERF_XB_GPIO_21

Bitmask for XB-200 header J16, pin 5

Definition at line 793 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J16_6

#define BLADERF_XB200_PIN_J16_6 BLADERF_XB_GPIO_24

Bitmask for XB-200 header J16, pin 6

Definition at line 796 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J7_1

#define BLADERF_XB200_PIN_J7_1 BLADERF_XB_GPIO_10

Bitmask for XB-200 header J7, pin 1

Definition at line 761 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J7_2

#define BLADERF_XB200_PIN_J7_2 BLADERF_XB_GPIO_11

Bitmask for XB-200 header J7, pin 2

Definition at line 764 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J7_5

#define BLADERF_XB200_PIN_J7_5 BLADERF_XB_GPIO_08

Bitmask for XB-200 header J7, pin 5

Definition at line 767 of file bladeRF1.h.

## ◆ BLADERF_XB200_PIN_J7_6

#define BLADERF_XB200_PIN_J7_6 BLADERF_XB_GPIO_09

Bitmask for XB-200 header J7, pin 6

Definition at line 770 of file bladeRF1.h.

## ◆ BLADERF_XB_DIR_INPUT

#define BLADERF_XB_DIR_INPUT | ( |  | pin | ) | (0)

Specifies a pin to be an input

Definition at line 661 of file bladeRF1.h.

## ◆ BLADERF_XB_DIR_OUTPUT

#define BLADERF_XB_DIR_OUTPUT | ( |  | pin | ) | (pin)

Specifies a pin to be an output

Definition at line 658 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO

#define BLADERF_XB_GPIO | ( |  | n | ) | (1 << (n - 1))

Expansion pin GPIO number to bitmask

Definition at line 655 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_01

#define BLADERF_XB_GPIO_01 BLADERF_XB_GPIO(1)

Pin bitmask for Expansion GPIO 1 (U74 pin 11)

Definition at line 664 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_02

#define BLADERF_XB_GPIO_02 BLADERF_XB_GPIO(2)

Pin bitmask for Expansion GPIO 2 (U74 pin 13)

Definition at line 667 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_03

#define BLADERF_XB_GPIO_03 BLADERF_XB_GPIO(3)

Pin bitmask for Expansion GPIO 3 (U74 pin 17)

Definition at line 670 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_04

#define BLADERF_XB_GPIO_04 BLADERF_XB_GPIO(4)

Pin bitmask for Expansion GPIO 4 (U74 pin 19)

Definition at line 673 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_05

#define BLADERF_XB_GPIO_05 BLADERF_XB_GPIO(5)

Pin bitmask for Expansion GPIO 5 (U74 pin 23)

Definition at line 676 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_06

#define BLADERF_XB_GPIO_06 BLADERF_XB_GPIO(6)

Pin bitmask for Expansion GPIO 6 (U74 pin 25)

Definition at line 679 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_07

#define BLADERF_XB_GPIO_07 BLADERF_XB_GPIO(7)

Pin bitmask for Expansion GPIO 7 (U74 pin 29)

Definition at line 682 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_08

#define BLADERF_XB_GPIO_08 BLADERF_XB_GPIO(8)

Pin bitmask for Expansion GPIO 8 (U74 pin 31)

Definition at line 685 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_09

#define BLADERF_XB_GPIO_09 BLADERF_XB_GPIO(9)

Pin bitmask for Expansion GPIO 9 (U74 pin 35)

Definition at line 688 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_10

#define BLADERF_XB_GPIO_10 BLADERF_XB_GPIO(10)

Pin bitmask for Expansion GPIO 10 (U74 pin 37)

Definition at line 691 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_11

#define BLADERF_XB_GPIO_11 BLADERF_XB_GPIO(11)

Pin bitmask for Expansion GPIO 11 (U74 pin 41)

Definition at line 694 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_12

#define BLADERF_XB_GPIO_12 BLADERF_XB_GPIO(12)

Pin bitmask for Expansion GPIO 12 (U74 pin 43)

Definition at line 697 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_13

#define BLADERF_XB_GPIO_13 BLADERF_XB_GPIO(13)

Pin bitmask for Expansion GPIO 13 (U74 pin 47)

Definition at line 700 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_14

#define BLADERF_XB_GPIO_14 BLADERF_XB_GPIO(14)

Pin bitmask for Expansion GPIO 14 (U74 pin 49)

Definition at line 703 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_15

#define BLADERF_XB_GPIO_15 BLADERF_XB_GPIO(15)

Pin bitmask for Expansion GPIO 15 (U74 pin 53)

Definition at line 706 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_16

#define BLADERF_XB_GPIO_16 BLADERF_XB_GPIO(16)

Pin bitmask for Expansion GPIO 16 (U74 pin 55)

Definition at line 709 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_17

#define BLADERF_XB_GPIO_17 BLADERF_XB_GPIO(17)

Pin bitmask for Expansion GPIO 17 (U74 pin 12)

Definition at line 712 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_18

#define BLADERF_XB_GPIO_18 BLADERF_XB_GPIO(18)

Pin bitmask for Expansion GPIO 18 (U74 pin 14)

Definition at line 715 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_19

#define BLADERF_XB_GPIO_19 BLADERF_XB_GPIO(19)

Pin bitmask for Expansion GPIO 19 (U74 pin 18)

Definition at line 718 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_20

#define BLADERF_XB_GPIO_20 BLADERF_XB_GPIO(20)

Pin bitmask for Expansion GPIO 20 (U74 pin 20)

Definition at line 721 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_21

#define BLADERF_XB_GPIO_21 BLADERF_XB_GPIO(21)

Pin bitmask for Expansion GPIO 21 (U74 pin 24)

Definition at line 724 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_22

#define BLADERF_XB_GPIO_22 BLADERF_XB_GPIO(22)

Pin bitmask for Expansion GPIO 22 (U74 pin 26)

Definition at line 727 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_23

#define BLADERF_XB_GPIO_23 BLADERF_XB_GPIO(23)

Pin bitmask for Expansion GPIO 23 (U74 pin 30)

Definition at line 730 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_24

#define BLADERF_XB_GPIO_24 BLADERF_XB_GPIO(24)

Pin bitmask for Expansion GPIO 24 (U74 pin 32)

Definition at line 733 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_25

#define BLADERF_XB_GPIO_25 BLADERF_XB_GPIO(25)

Pin bitmask for Expansion GPIO 25 (U74 pin 36)

Definition at line 736 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_26

#define BLADERF_XB_GPIO_26 BLADERF_XB_GPIO(26)

Pin bitmask for Expansion GPIO 26 (U74 pin 38)

Definition at line 739 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_27

#define BLADERF_XB_GPIO_27 BLADERF_XB_GPIO(27)

Pin bitmask for Expansion GPIO 27 (U74 pin 42)

Definition at line 742 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_28

#define BLADERF_XB_GPIO_28 BLADERF_XB_GPIO(28)

Pin bitmask for Expansion GPIO 28 (U74 pin 44)

Definition at line 745 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_29

#define BLADERF_XB_GPIO_29 BLADERF_XB_GPIO(29)

Pin bitmask for Expansion GPIO 29 (U74 pin 48)

Definition at line 748 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_30

#define BLADERF_XB_GPIO_30 BLADERF_XB_GPIO(30)

Pin bitmask for Expansion GPIO 30 (U74 pin 50)

Definition at line 751 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_31

#define BLADERF_XB_GPIO_31 BLADERF_XB_GPIO(31)

Pin bitmask for Expansion GPIO 31 (U74 pin 54)

Definition at line 754 of file bladeRF1.h.

## ◆ BLADERF_XB_GPIO_32

#define BLADERF_XB_GPIO_32 BLADERF_XB_GPIO(32)

Pin bitmask for Expansion GPIO 32 (U74 pin 56)

Definition at line 757 of file bladeRF1.h.

## Function Documentation

## ◆ bladerf_expansion_gpio_dir_masked_write()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_dir_masked_write | ( | struct bladerf * | dev,
|  | uint32_t | mask,
|  | uint32_t | outputs
| ) |  |

Configure the direction of the specified expansion GPIO pins

This function alleviates the need for the caller to perform a read-modify-write sequence. The supplied mask is used by the FPGA to perform the required RMW operation.

Parameters

  | dev | Device handle
  [in] | mask | Bitmask of pins to configure
  [in] | outputs | Pins set to '1' will be configured as outputs. Pins set to '0' will be configured as inputs.

For example, to configure XB200 pins J16-1 and J16-2 and pins J16-4 and J16-5 as inputs:

const uint32_t pins_to_config =
BLADERF_XB200_PIN_J16_1 |
BLADERF_XB200_PIN_J16_2 |
BLADERF_XB200_PIN_J16_3 |
BLADERF_XB200_PIN_J16_4;
const uint32_t output_pins =
BLADERF_XB200_PIN_J16_1 |
BLADERF_XB200_PIN_J16_2;
int status = bladerf_expansion_gpio_masked_write(dev,
pins_to_config,
output_pins);
BLADERF_XB200_PIN_J16_2
#define BLADERF_XB200_PIN_J16_2
Definition bladeRF1.h:784
BLADERF_XB200_PIN_J16_1
#define BLADERF_XB200_PIN_J16_1
Definition bladeRF1.h:781
bladerf_expansion_gpio_masked_write
API_EXPORT int CALL_CONV bladerf_expansion_gpio_masked_write(struct bladerf *dev, uint32_t mask, uint32_t value)
BLADERF_XB200_PIN_J16_3
#define BLADERF_XB200_PIN_J16_3
Definition bladeRF1.h:787
BLADERF_XB200_PIN_J16_4
#define BLADERF_XB200_PIN_J16_4
Definition bladeRF1.h:790

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_expansion_gpio_dir_read()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_dir_read | ( | struct bladerf * | dev,
|  | uint32_t * | outputs
| ) |  |

Read the expansion GPIO direction register

Parameters

  | dev | Device handle
  [out] | outputs | Pins configured as outputs will be set to '1'. Pins configured as inputs will be set to '0'.

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_expansion_gpio_dir_write()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_dir_write | ( | struct bladerf * | dev,
|  | uint32_t | outputs
| ) |  |

Write to the expansion GPIO direction register.

Callers should be sure to perform a read-modify-write sequence to avoid accidentally clearing other GPIO bits that may be set by the library internally.

Consider using bladerf_expansion_gpio_dir_masked_write() instead.

Parameters

  | dev | Device handle
  [in] | outputs | Pins set to '1' will be configured as outputs. Pins set to '0' will be configured as inputs.

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_expansion_gpio_masked_write()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_masked_write | ( | struct bladerf * | dev,
|  | uint32_t | mask,
|  | uint32_t | value
| ) |  |

Write values to the specified GPIO pins

This function alleviates the need for the caller to perform a read-modify-write sequence. The supplied mask is used by the FPGA to perform the required RMW operation.

Parameters

  | dev | Device handle
  [in] | mask | Mask of pins to write
  [in] | value | Value to write.

For example, to set XB200 pins J16-1 and J16-2, and clear J16-4 and J16-5:

const uint32_t pins_to_write =
BLADERF_XB200_PIN_J16_1 |
BLADERF_XB200_PIN_J16_2 |
BLADERF_XB200_PIN_J16_3 |
BLADERF_XB200_PIN_J16_4;
const uint32_t values_to_write =
BLADERF_XB200_PIN_J16_1 |
BLADERF_XB200_PIN_J16_2;
int status = bladerf_expansion_gpio_masked_write(dev,
pins_to_write,
values_to_write);

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_expansion_gpio_read()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_read | ( | struct bladerf * | dev,
|  | uint32_t * | val
| ) |  |

Read the state of expansion GPIO values

Parameters

  | dev | Device handle
  [out] | val | Value of GPIO pins

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_expansion_gpio_write()

API_EXPORT int CALL_CONV bladerf_expansion_gpio_write | ( | struct bladerf * | dev,
|  | uint32_t | val
| ) |  |

Write expansion GPIO pins.

Callers should be sure to perform a read-modify-write sequence to avoid accidentally clearing other GPIO bits that may be set by the library internally.

Consider using bladerf_expansion_gpio_masked_write() instead.

Parameters

  | dev | Device handle
  [in] | val | Data to write to GPIO pins

Returns
  0 on success, value from Error codes list on failure