GPIO
gpio.alias
Abbreviation
gp a
Access
get/set
Description
A GPIO alias name between 1-15 characters. GPIO name aliasing avoids the need to remember which GPIO is connected where. You can give the GPIO a recognisable name instead! Retrieve aliases with get gp a all
. Remove an alias by setting to an empty double quoted string ("").
Arguments
<all> / <GPIO#> <alias name>
Default
Properties
- takes effect immediately
Supported Platforms
Get example
> get gp a 6
R000008
MyGPIO
Set example
> set gp a 6 FrontDoor
R000008
Set OK
gpio.config_file
Abbreviation
gp c
Access
get/set
Description
A file used to configure and initialize GPIOs on bootup. The file may have multiple lines and must follow a specified format. Further information about GPIO configuration using system indicators is provided in Configuration and Setup, GPIO Configuration.
Arguments
<filename>
Default
gpio_config_init.csv
Properties
Supported Platforms
Get example
> get gp c
R000022
gpio_config_init.csv
Set example
> set gp c my_gpio_config.csv
R000008
Set OK
gpio.init
Abbreviation
gp i
Access
get/set
Description
The initial direction and value of a GPIO after bootup/reset. Retrieve a list of GPIOs that will be initialized with the all
option.
Arguments
<all> / <GPIO#> <direction> <initial value>
Default
<none>
for unassigned GPIOs
Properties
Supported Platforms
Get example
> get gp i 0
R000021
output_open_drain 1
Set example
> set gp i 0 out 1
R000008
Set OK
gpio.sleep
Abbreviation
gp s
Access
get/set
Description
Set the state of the specified GPIO when sleeping.
GPIOs are initialized is as follows:
- On startup, all unused pins (i.e. MCU pins not assigned a module GPIO) are set to the default state for the MCU (WALLABY= input-pullup, NUMBAT=Analog input)
- Then module GPIOs are set to either their gpio.init value if specified, else the MCU default state
On sleep, module GPIOs are set to their
gpio.sleep
value if specified, else the MCU default state.Sleep state can also be set using a GPIO configuration file. See Configuration and Setup, Using a GPIO Configuration File.
Arguments
<all> / <GPIO#> <state>
where state is one of the following:
State | Description |
---|---|
default | factory default state |
input_highz | input high impedance |
input_pull_down | input pull down |
input_pull_up | input pull up |
output_high | output high |
output_low | output low |
Default
default
Properties
Supported Platforms
Get example
> get gp s 0
input_pull_up
Set example
> set gp s 0 output_low
Set OK
gpio.usage
Abbreviation
gp u
Access
get
Description
Returns information about which GPIOs have been registered for functions, and which have standard I/O options set. GPIOs may be de-registered by setting the GPIO to -1 using the appropriate variable. e.g. set ioconn.status_gpio -1. See Peripherals.
Arguments
-
Default
<platform dependent>
Supported Platforms
Get example
> get gp u
! # Description
# 0 GPIO in
# 1 system.indicator.wlan
# 2 system.indicator.network
# 5 system.indicator.softap
# 11 setup.control_gpio
# 13 UART1 RX
# 14 UART1 TX
# 17 SPI0 CLK
# 18 SPI0 MOSI
# 19 SPI0 MISO
# 21 GPIO out
# 22 GPIO out