Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Status Code Reference

Every gallo_* FFI function (except the lifecycle calls gallo_init, gallo_init_with_serial_number, and gallo_free) returns a Status value. Status is a C enum backed by int32_t.

  • Ok (0) — success.
  • Negative values — errors, grouped roughly by peripheral.

Stability

Important

Status code numeric values are part of the C ABI and never change once shipped. Existing codes are never renumbered or reused; new codes are only appended at the bottom of the enum.

If you compile against a header from an older release, codes you don’t recognize will be values your code has never seen. Treat unknown negative values as “some error” — never assume a number that doesn’t appear in your header means success.

Complete Status Table

NameValueDescription
Ok0Operation successful
I2cReadFailed−1I²C read failed
I2cWriteFailed−2I²C write failed
InvalidResponse−3Firmware produced an invalid response
Uninitialized−4Library was not initialised (NULL context)
InvalidArgument−5Caller passed an invalid argument
PingFailed−6Ping round-trip failed
SpiReadFailed−7SPI read failed
SpiWriteFailed−8SPI write failed
SpiFlushFailed−9SPI flush failed
GpioGetFailed−10GPIO get failed
GpioPutFailed−11GPIO put failed
GpioWaitFailed−12GPIO wait failed
SetConfigFailed−13Set config failed (legacy)
VersionFailed−14Version query failed
I2cWriteReadFailed−15I²C write-read failed
I2cSetConfigFailed−16I²C set config failed
SpiSetConfigFailed−17SPI set config failed
I2cNack−18I²C target did not acknowledge
I2cBusError−19I²C bus error
I2cArbitrationLoss−20I²C arbitration loss
I2cOverrun−21I²C data overrun
BufferTooLong−22Buffer exceeds firmware transfer limit
I2cAddressOutOfRange−23I²C address out of valid range
GpioInvalidPin−24Invalid GPIO pin number
CommsFailed−25USB communication failure
I2cScanFailed−26I²C bus scan failed
GpioSetConfigFailed−27GPIO set config failed
GpioWrongDirection−28GPIO pin direction mismatch
I2cGetConfigFailed−29I²C get config failed
SpiGetConfigFailed−30SPI get config failed
UartReadFailed−31UART read failed
UartWriteFailed−32UART write failed
UartFlushFailed−33UART flush failed
UartOverrun−34UART receiver overrun
UartBreak−35UART break condition
UartParity−36UART parity error
UartFraming−37UART framing error
UartInvalidBaudRate−38Invalid baud rate
UartSetConfigFailed−39UART set config failed
UartGetConfigFailed−40UART get config failed
PwmSetDutyCycleFailed−41PWM set duty cycle failed
PwmGetDutyCycleFailed−42PWM get duty cycle failed
PwmEnableFailed−43PWM enable failed
PwmDisableFailed−44PWM disable failed
PwmSetConfigFailed−45PWM set config failed
PwmGetConfigFailed−46PWM get config failed
PwmInvalidChannel−47Invalid PWM channel
PwmInvalidDutyCycle−48Invalid PWM duty cycle
PwmInvalidConfiguration−49Invalid PWM configuration
AdcReadFailed−50ADC read failed
AdcGetConfigFailed−51ADC get config failed
AdcConversionFailed−52ADC conversion error
GpioPinMonitored−53Pin is currently subscribed
GpioPinNotMonitored−54Pin is not subscribed
GpioSubscribeFailed−55GPIO subscribe failed
GpioUnsubscribeFailed−56GPIO unsubscribe failed
OneWireNoPresence−571-Wire: no device responded to reset
OneWireBusError−581-Wire: bus communication error
OneWireReadFailed−591-Wire: read failed
OneWireWriteFailed−601-Wire: write failed
OneWireSearchFailed−611-Wire: ROM search failed
DeviceInfoFailed−62Device info query failed
SchemaMismatch−63Schema version mismatch between host and firmware
LegacyFirmware−64Firmware too old to support device/info
Unsupported−65Peripheral not available on this hardware revision
I2cBatchFailed−66I2C batch transaction failed
SpiBatchFailed−67SPI batch transaction failed
SpiTransferFailed−68SPI full-duplex transfer failed
SystemResetSubscriptionsFailed−69system/reset-subscriptions call failed

Source of Truth

The enum lives in crates/pico-de-gallo-ffi/src/lib.rs and is mirrored into the generated pico_de_gallo.h by cbindgen. If a code is missing from this table after a release, file an issue — that’s a documentation bug.