mirror of https://github.com/joan2937/pigpio
V71+: tidy up documentation overviews
This commit is contained in:
parent
5966a50e45
commit
adf7caeff5
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii pig2vcd.1
|
||||
."
|
||||
.TH pig2vcd 1 2012-2018 Linux "pigpio archive"
|
||||
.TH pig2vcd 1 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pig2vd - A utility to convert pigpio notifications to VCD.
|
||||
|
||||
|
|
570
pigpio.3
570
pigpio.3
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii pigpio.3
|
||||
."
|
||||
.TH pigpio 3 2012-2018 Linux "pigpio archive"
|
||||
.TH pigpio 3 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pigpio - A C library to manipulate the Pi's GPIO.
|
||||
|
||||
|
@ -115,11 +115,6 @@ This use was inspired by Richard Hirst's servoblaster kernel module.
|
|||
|
||||
.br
|
||||
|
||||
.br
|
||||
See \fBhttps://github.com/richardghirst/PiBits/tree/master/ServoBlaster\fP
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
.SS Usage
|
||||
.br
|
||||
|
@ -194,6 +189,540 @@ error PI_INITIALISED.
|
|||
|
||||
.br
|
||||
|
||||
.br
|
||||
|
||||
.SH OVERVIEW
|
||||
|
||||
.br
|
||||
.SS ESSENTIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioInitialise Initialise library
|
||||
.br
|
||||
gpioTerminate Stop library
|
||||
.br
|
||||
.SS BASIC
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetMode Set a GPIO mode
|
||||
.br
|
||||
gpioGetMode Get a GPIO mode
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetPullUpDown Set/clear GPIO pull up/down resistor
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioRead Read a GPIO
|
||||
.br
|
||||
gpioWrite Write a GPIO
|
||||
.br
|
||||
.SS PWM (overrides servo commands on same GPIO)
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioPWM Start/stop PWM pulses on a GPIO
|
||||
.br
|
||||
gpioSetPWMfrequency Configure PWM frequency for a GPIO
|
||||
.br
|
||||
gpioSetPWMrange Configure PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioGetPWMdutycycle Get dutycycle setting on a GPIO
|
||||
.br
|
||||
gpioGetPWMfrequency Get configured PWM frequency for a GPIO
|
||||
.br
|
||||
gpioGetPWMrange Get configured PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioGetPWMrealRange Get underlying PWM range for a GPIO
|
||||
.br
|
||||
.SS Servo (overrides PWM commands on same GPIO)
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioServo Start/stop servo pulses on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioGetServoPulsewidth Get pulsewidth setting on a GPIO
|
||||
.br
|
||||
.SS INTERMEDIATE
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioTrigger Send a trigger pulse to a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetWatchdog Set a watchdog on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioRead_Bits_0_31 Read all GPIO in bank 1
|
||||
.br
|
||||
gpioRead_Bits_32_53 Read all GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWrite_Bits_0_31_Clear Clear selected GPIO in bank 1
|
||||
.br
|
||||
gpioWrite_Bits_32_53_Clear Clear selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWrite_Bits_0_31_Set Set selected GPIO in bank 1
|
||||
.br
|
||||
gpioWrite_Bits_32_53_Set Set selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetAlertFunc Request a GPIO level change callback
|
||||
.br
|
||||
gpioSetAlertFuncEx Request a GPIO change callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetTimerFunc Request a regular timed callback
|
||||
.br
|
||||
gpioSetTimerFuncEx Request a regular timed callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioStartThread Start a new thread
|
||||
.br
|
||||
gpioStopThread Stop a previously started thread
|
||||
.br
|
||||
.SS ADVANCED
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioNotifyOpen Request a notification handle
|
||||
.br
|
||||
gpioNotifyClose Close a notification
|
||||
.br
|
||||
gpioNotifyOpenWithSize Request a notification with sized pipe
|
||||
.br
|
||||
gpioNotifyBegin Start notifications for selected GPIO
|
||||
.br
|
||||
gpioNotifyPause Pause notifications
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioHardwareClock Start hardware clock on supported GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioHardwarePWM Start hardware PWM on supported GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioGlitchFilter Set a glitch filter on a GPIO
|
||||
.br
|
||||
gpioNoiseFilter Set a noise filter on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetPad Sets a pads drive strength
|
||||
.br
|
||||
gpioGetPad Gets a pads drive strength
|
||||
.br
|
||||
|
||||
.br
|
||||
shell Executes a shell command
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetISRFunc Request a GPIO interrupt callback
|
||||
.br
|
||||
gpioSetISRFuncEx Request a GPIO interrupt callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetSignalFunc Request a signal callback
|
||||
.br
|
||||
gpioSetSignalFuncEx Request a signal callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSetGetSamplesFunc Requests a GPIO samples callback
|
||||
.br
|
||||
gpioSetGetSamplesFuncEx Requests a GPIO samples callback, extended
|
||||
.br
|
||||
.SS Custom
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioCustom1 User custom function 1
|
||||
.br
|
||||
gpioCustom2 User custom function 2
|
||||
.br
|
||||
.SS Events
|
||||
.br
|
||||
|
||||
.br
|
||||
eventMonitor Sets the events to monitor
|
||||
.br
|
||||
eventSetFunc Request an event callback
|
||||
.br
|
||||
eventSetFuncEx Request an event callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
eventTrigger Trigger an event
|
||||
.br
|
||||
.SS Scripts
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioStoreScript Store a script
|
||||
.br
|
||||
gpioRunScript Run a stored script
|
||||
.br
|
||||
gpioUpdateScript Set a scripts parameters
|
||||
.br
|
||||
gpioScriptStatus Get script status and parameters
|
||||
.br
|
||||
gpioStopScript Stop a running script
|
||||
.br
|
||||
gpioDeleteScript Delete a stored script
|
||||
.br
|
||||
.SS I2C
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cOpen Opens an I2C device
|
||||
.br
|
||||
i2cClose Closes an I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cWriteQuick SMBus write quick
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadByte SMBus read byte
|
||||
.br
|
||||
i2cWriteByte SMBus write byte
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadByteData SMBus read byte data
|
||||
.br
|
||||
i2cWriteByteData SMBus write byte data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadWordData SMBus read word data
|
||||
.br
|
||||
i2cWriteWordData SMBus write word data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadBlockData SMBus read block data
|
||||
.br
|
||||
i2cWriteBlockData SMBus write block data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadI2CBlockData SMBus read I2C block data
|
||||
.br
|
||||
i2cWriteI2CBlockData SMBus write I2C block data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cReadDevice Reads the raw I2C device
|
||||
.br
|
||||
i2cWriteDevice Writes the raw I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cProcessCall SMBus process call
|
||||
.br
|
||||
i2cBlockProcessCall SMBus block process call
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cSwitchCombined Sets or clears the combined flag
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cSegments Performs multiple I2C transactions
|
||||
.br
|
||||
|
||||
.br
|
||||
i2cZip Performs multiple I2C transactions
|
||||
.br
|
||||
.SS I2C BIT BANG
|
||||
.br
|
||||
|
||||
.br
|
||||
bbI2COpen Opens GPIO for bit banging I2C
|
||||
.br
|
||||
bbI2CClose Closes GPIO for bit banging I2C
|
||||
.br
|
||||
|
||||
.br
|
||||
bbI2CZip Performs bit banged I2C transactions
|
||||
.br
|
||||
.SS I2C/SPI SLAVE
|
||||
.br
|
||||
|
||||
.br
|
||||
bscXfer I2C/SPI as slave transfer
|
||||
.br
|
||||
.SS SERIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
serOpen Opens a serial device
|
||||
.br
|
||||
serClose Closes a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serReadByte Reads a byte from a serial device
|
||||
.br
|
||||
serWriteByte Writes a byte to a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serRead Reads bytes from a serial device
|
||||
.br
|
||||
serWrite Writes bytes to a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serDataAvailable Returns number of bytes ready to be read
|
||||
.br
|
||||
.SS SERIAL BIT BANG (read only)
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSerialReadOpen Opens a GPIO for bit bang serial reads
|
||||
.br
|
||||
gpioSerialReadClose Closes a GPIO for bit bang serial reads
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSerialReadInvert Configures normal/inverted for serial reads
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioSerialRead Reads bit bang serial data from a GPIO
|
||||
.br
|
||||
.SS SPI
|
||||
.br
|
||||
|
||||
.br
|
||||
spiOpen Opens a SPI device
|
||||
.br
|
||||
spiClose Closes a SPI device
|
||||
.br
|
||||
|
||||
.br
|
||||
spiRead Reads bytes from a SPI device
|
||||
.br
|
||||
spiWrite Writes bytes to a SPI device
|
||||
.br
|
||||
spiXfer Transfers bytes with a SPI device
|
||||
.br
|
||||
.SS SPI BIT BANG
|
||||
.br
|
||||
|
||||
.br
|
||||
bbSPIOpen Opens GPIO for bit banging SPI
|
||||
.br
|
||||
bbSPIClose Closes GPIO for bit banging SPI
|
||||
.br
|
||||
|
||||
.br
|
||||
bbSPIXfer Performs bit banged SPI transactions
|
||||
.br
|
||||
.SS FILES
|
||||
.br
|
||||
|
||||
.br
|
||||
fileOpen Opens a file
|
||||
.br
|
||||
fileClose Closes a file
|
||||
.br
|
||||
|
||||
.br
|
||||
fileRead Reads bytes from a file
|
||||
.br
|
||||
fileWrite Writes bytes to a file
|
||||
.br
|
||||
|
||||
.br
|
||||
fileSeek Seeks to a position within a file
|
||||
.br
|
||||
|
||||
.br
|
||||
fileList List files which match a pattern
|
||||
.br
|
||||
.SS WAVES
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveClear Deletes all waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveAddNew Starts a new waveform
|
||||
.br
|
||||
gpioWaveAddGeneric Adds a series of pulses to the waveform
|
||||
.br
|
||||
gpioWaveAddSerial Adds serial data to the waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveCreate Creates a waveform from added data
|
||||
.br
|
||||
gpioWaveDelete Deletes a waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveTxSend Transmits a waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveChain Transmits a chain of waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveTxAt Returns the current transmitting waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveTxBusy Checks to see if the waveform has ended
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveTxStop Aborts the current waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveGetCbs Length in CBs of the current waveform
|
||||
.br
|
||||
gpioWaveGetHighCbs Length of longest waveform so far
|
||||
.br
|
||||
gpioWaveGetMaxCbs Absolute maximum allowed CBs
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveGetMicros Length in micros of the current waveform
|
||||
.br
|
||||
gpioWaveGetHighMicros Length of longest waveform so far
|
||||
.br
|
||||
gpioWaveGetMaxMicros Absolute maximum allowed micros
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioWaveGetPulses Length in pulses of the current waveform
|
||||
.br
|
||||
gpioWaveGetHighPulses Length of longest waveform so far
|
||||
.br
|
||||
gpioWaveGetMaxPulses Absolute maximum allowed pulses
|
||||
.br
|
||||
.SS UTILITIES
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioDelay Delay for a number of microseconds
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioTick Get current tick (microseconds)
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioHardwareRevision Get hardware revision
|
||||
.br
|
||||
gpioVersion Get the pigpio version
|
||||
.br
|
||||
|
||||
.br
|
||||
getBitInBytes Get the value of a bit
|
||||
.br
|
||||
putBitInBytes Set the value of a bit
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioTime Get current time
|
||||
.br
|
||||
gpioSleep Sleep for specified time
|
||||
.br
|
||||
|
||||
.br
|
||||
time_sleep Sleeps for a float number of seconds
|
||||
.br
|
||||
time_time Float number of seconds since the epoch
|
||||
.br
|
||||
.SS CONFIGURATION
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioCfgBufferSize Configure the GPIO sample buffer size
|
||||
.br
|
||||
gpioCfgClock Configure the GPIO sample rate
|
||||
.br
|
||||
gpioCfgDMAchannel Configure the DMA channel (DEPRECATED)
|
||||
.br
|
||||
gpioCfgDMAchannels Configure the DMA channels
|
||||
.br
|
||||
gpioCfgPermissions Configure the GPIO access permissions
|
||||
.br
|
||||
gpioCfgInterfaces Configure user interfaces
|
||||
.br
|
||||
gpioCfgSocketPort Configure socket port
|
||||
.br
|
||||
gpioCfgMemAlloc Configure DMA memory allocation mode
|
||||
.br
|
||||
gpioCfgNetAddr Configure allowed network addresses
|
||||
.br
|
||||
|
||||
.br
|
||||
gpioCfgInternals Configure misc. internals (DEPRECATED)
|
||||
.br
|
||||
gpioCfgGetInternals Get internal configuration settings
|
||||
.br
|
||||
gpioCfgSetInternals Set internal configuration settings
|
||||
.br
|
||||
.SS EXPERT
|
||||
.br
|
||||
|
||||
.br
|
||||
rawWaveAddSPI Not intended for general use
|
||||
.br
|
||||
rawWaveAddGeneric Not intended for general use
|
||||
.br
|
||||
rawWaveCB Not intended for general use
|
||||
.br
|
||||
rawWaveCBAdr Not intended for general use
|
||||
.br
|
||||
rawWaveGetOOL Not intended for general use
|
||||
.br
|
||||
rawWaveSetOOL Not intended for general use
|
||||
.br
|
||||
rawWaveGetOut Not intended for general use
|
||||
.br
|
||||
rawWaveSetOut Not intended for general use
|
||||
.br
|
||||
rawWaveGetIn Not intended for general use
|
||||
.br
|
||||
rawWaveSetIn Not intended for general use
|
||||
.br
|
||||
rawWaveInfo Not intended for general use
|
||||
.br
|
||||
rawDumpWave Not intended for general use
|
||||
.br
|
||||
rawDumpScript Not intended for general use
|
||||
.br
|
||||
.SH FUNCTIONS
|
||||
|
||||
|
@ -3628,9 +4157,27 @@ End
|
|||
|
||||
.IP "\fBint bscXfer(bsc_xfer_t *bsc_xfer)\fP"
|
||||
.IP "" 4
|
||||
This function provides a low-level interface to the
|
||||
SPI/I2C Slave peripheral. This peripheral allows the
|
||||
Pi to act as a slave device on an I2C or SPI bus.
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
.br
|
||||
|
||||
|
@ -3683,8 +4230,9 @@ typedef struct
|
|||
.br
|
||||
|
||||
.br
|
||||
To start a transfer set control (see below) and copy the bytes to
|
||||
be sent (if any) to txBuf and set the byte count in txCnt.
|
||||
To start a transfer set control (see below), copy the bytes to
|
||||
be added to the transmit FIFO (if any) to txBuf and set txCnt to
|
||||
the number of copied bytes.
|
||||
|
||||
.br
|
||||
|
||||
|
|
330
pigpio.h
330
pigpio.h
|
@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
|
|||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define PIGPIO_VERSION 7102
|
||||
#define PIGPIO_VERSION 7103
|
||||
|
||||
/*TEXT
|
||||
|
||||
|
@ -72,8 +72,6 @@ The PWM and servo pulses are timed using the DMA and PWM peripherals.
|
|||
|
||||
This use was inspired by Richard Hirst's servoblaster kernel module.
|
||||
|
||||
See [[https://github.com/richardghirst/PiBits/tree/master/ServoBlaster]]
|
||||
|
||||
*Usage*
|
||||
|
||||
Include <pigpio.h> in your source files.
|
||||
|
@ -117,7 +115,7 @@ ESSENTIAL
|
|||
gpioInitialise Initialise library
|
||||
gpioTerminate Stop library
|
||||
|
||||
BEGINNER
|
||||
BASIC
|
||||
|
||||
gpioSetMode Set a GPIO mode
|
||||
gpioGetMode Get a GPIO mode
|
||||
|
@ -127,29 +125,29 @@ gpioSetPullUpDown Set/clear GPIO pull up/down resistor
|
|||
gpioRead Read a GPIO
|
||||
gpioWrite Write a GPIO
|
||||
|
||||
PWM_(overrides_servo_commands_on_same_GPIO)
|
||||
|
||||
gpioPWM Start/stop PWM pulses on a GPIO
|
||||
gpioSetPWMfrequency Configure PWM frequency for a GPIO
|
||||
gpioSetPWMrange Configure PWM range for a GPIO
|
||||
|
||||
gpioGetPWMdutycycle Get dutycycle setting on a GPIO
|
||||
gpioGetPWMfrequency Get configured PWM frequency for a GPIO
|
||||
gpioGetPWMrange Get configured PWM range for a GPIO
|
||||
|
||||
gpioGetPWMrealRange Get underlying PWM range for a GPIO
|
||||
|
||||
Servo_(overrides_PWM_commands_on_same_GPIO)
|
||||
|
||||
gpioServo Start/stop servo pulses on a GPIO
|
||||
|
||||
gpioGetServoPulsewidth Get pulsewidth setting on a GPIO
|
||||
|
||||
gpioDelay Delay for a number of microseconds
|
||||
|
||||
gpioSetAlertFunc Request a GPIO level change callback
|
||||
|
||||
gpioSetTimerFunc Request a regular timed callback
|
||||
|
||||
INTERMEDIATE
|
||||
|
||||
gpioTrigger Send a trigger pulse to a GPIO.
|
||||
gpioTrigger Send a trigger pulse to a GPIO
|
||||
|
||||
gpioSetWatchdog Set a watchdog on a GPIO.
|
||||
|
||||
gpioSetPWMrange Configure PWM range for a GPIO
|
||||
gpioGetPWMrange Get configured PWM range for a GPIO
|
||||
|
||||
gpioSetPWMfrequency Configure PWM frequency for a GPIO
|
||||
gpioGetPWMfrequency Get configured PWM frequency for a GPIO
|
||||
gpioSetWatchdog Set a watchdog on a GPIO
|
||||
|
||||
gpioRead_Bits_0_31 Read all GPIO in bank 1
|
||||
gpioRead_Bits_32_53 Read all GPIO in bank 2
|
||||
|
@ -160,14 +158,34 @@ gpioWrite_Bits_32_53_Clear Clear selected GPIO in bank 2
|
|||
gpioWrite_Bits_0_31_Set Set selected GPIO in bank 1
|
||||
gpioWrite_Bits_32_53_Set Set selected GPIO in bank 2
|
||||
|
||||
gpioSetAlertFunc Request a GPIO level change callback
|
||||
gpioSetAlertFuncEx Request a GPIO change callback, extended
|
||||
|
||||
gpioSetTimerFunc Request a regular timed callback
|
||||
gpioSetTimerFuncEx Request a regular timed callback, extended
|
||||
|
||||
gpioStartThread Start a new thread
|
||||
gpioStopThread Stop a previously started thread
|
||||
|
||||
ADVANCED
|
||||
|
||||
gpioGetPWMrealRange Get underlying PWM range for a GPIO
|
||||
gpioNotifyOpen Request a notification handle
|
||||
gpioNotifyClose Close a notification
|
||||
gpioNotifyOpenWithSize Request a notification with sized pipe
|
||||
gpioNotifyBegin Start notifications for selected GPIO
|
||||
gpioNotifyPause Pause notifications
|
||||
|
||||
gpioSetAlertFuncEx Request a GPIO change callback, extended
|
||||
gpioHardwareClock Start hardware clock on supported GPIO
|
||||
|
||||
gpioHardwarePWM Start hardware PWM on supported GPIO
|
||||
|
||||
gpioGlitchFilter Set a glitch filter on a GPIO
|
||||
gpioNoiseFilter Set a noise filter on a GPIO
|
||||
|
||||
gpioSetPad Sets a pads drive strength
|
||||
gpioGetPad Gets a pads drive strength
|
||||
|
||||
shell Executes a shell command
|
||||
|
||||
gpioSetISRFunc Request a GPIO interrupt callback
|
||||
gpioSetISRFuncEx Request a GPIO interrupt callback, extended
|
||||
|
@ -178,31 +196,20 @@ gpioSetSignalFuncEx Request a signal callback, extended
|
|||
gpioSetGetSamplesFunc Requests a GPIO samples callback
|
||||
gpioSetGetSamplesFuncEx Requests a GPIO samples callback, extended
|
||||
|
||||
gpioSetTimerFuncEx Request a regular timed callback, extended
|
||||
Custom
|
||||
|
||||
gpioNotifyOpen Request a notification handle
|
||||
gpioNotifyOpenWithSize Request a notification handle with sized pipe
|
||||
gpioNotifyBegin Start notifications for selected GPIO
|
||||
gpioNotifyPause Pause notifications
|
||||
gpioNotifyClose Close a notification
|
||||
gpioCustom1 User custom function 1
|
||||
gpioCustom2 User custom function 2
|
||||
|
||||
gpioSerialReadOpen Opens a GPIO for bit bang serial reads
|
||||
gpioSerialReadInvert Configures normal/inverted for serial reads
|
||||
gpioSerialRead Reads bit bang serial data from a GPIO
|
||||
gpioSerialReadClose Closes a GPIO for bit bang serial reads
|
||||
Events
|
||||
|
||||
gpioHardwareClock Start hardware clock on supported GPIO
|
||||
gpioHardwarePWM Start hardware PWM on supported GPIO
|
||||
eventMonitor Sets the events to monitor
|
||||
eventSetFunc Request an event callback
|
||||
eventSetFuncEx Request an event callback, extended
|
||||
|
||||
gpioGlitchFilter Set a glitch filter on a GPIO
|
||||
gpioNoiseFilter Set a noise filter on a GPIO
|
||||
eventTrigger Trigger an event
|
||||
|
||||
gpioGetPad Gets a pads drive strength
|
||||
gpioSetPad Sets a pads drive strength
|
||||
|
||||
shell Executes a shell command
|
||||
|
||||
SCRIPTS
|
||||
Scripts
|
||||
|
||||
gpioStoreScript Store a script
|
||||
gpioRunScript Run a stored script
|
||||
|
@ -211,6 +218,101 @@ gpioScriptStatus Get script status and parameters
|
|||
gpioStopScript Stop a running script
|
||||
gpioDeleteScript Delete a stored script
|
||||
|
||||
I2C
|
||||
|
||||
i2cOpen Opens an I2C device
|
||||
i2cClose Closes an I2C device
|
||||
|
||||
i2cWriteQuick SMBus write quick
|
||||
|
||||
i2cReadByte SMBus read byte
|
||||
i2cWriteByte SMBus write byte
|
||||
|
||||
i2cReadByteData SMBus read byte data
|
||||
i2cWriteByteData SMBus write byte data
|
||||
|
||||
i2cReadWordData SMBus read word data
|
||||
i2cWriteWordData SMBus write word data
|
||||
|
||||
i2cReadBlockData SMBus read block data
|
||||
i2cWriteBlockData SMBus write block data
|
||||
|
||||
i2cReadI2CBlockData SMBus read I2C block data
|
||||
i2cWriteI2CBlockData SMBus write I2C block data
|
||||
|
||||
i2cReadDevice Reads the raw I2C device
|
||||
i2cWriteDevice Writes the raw I2C device
|
||||
|
||||
i2cProcessCall SMBus process call
|
||||
i2cBlockProcessCall SMBus block process call
|
||||
|
||||
i2cSwitchCombined Sets or clears the combined flag
|
||||
|
||||
i2cSegments Performs multiple I2C transactions
|
||||
|
||||
i2cZip Performs multiple I2C transactions
|
||||
|
||||
I2C_BIT_BANG
|
||||
|
||||
bbI2COpen Opens GPIO for bit banging I2C
|
||||
bbI2CClose Closes GPIO for bit banging I2C
|
||||
|
||||
bbI2CZip Performs bit banged I2C transactions
|
||||
|
||||
I2C/SPI_SLAVE
|
||||
|
||||
bscXfer I2C/SPI as slave transfer
|
||||
|
||||
SERIAL
|
||||
|
||||
serOpen Opens a serial device
|
||||
serClose Closes a serial device
|
||||
|
||||
serReadByte Reads a byte from a serial device
|
||||
serWriteByte Writes a byte to a serial device
|
||||
|
||||
serRead Reads bytes from a serial device
|
||||
serWrite Writes bytes to a serial device
|
||||
|
||||
serDataAvailable Returns number of bytes ready to be read
|
||||
|
||||
SERIAL_BIT_BANG_(read_only)
|
||||
|
||||
gpioSerialReadOpen Opens a GPIO for bit bang serial reads
|
||||
gpioSerialReadClose Closes a GPIO for bit bang serial reads
|
||||
|
||||
gpioSerialReadInvert Configures normal/inverted for serial reads
|
||||
|
||||
gpioSerialRead Reads bit bang serial data from a GPIO
|
||||
|
||||
SPI
|
||||
|
||||
spiOpen Opens a SPI device
|
||||
spiClose Closes a SPI device
|
||||
|
||||
spiRead Reads bytes from a SPI device
|
||||
spiWrite Writes bytes to a SPI device
|
||||
spiXfer Transfers bytes with a SPI device
|
||||
|
||||
SPI_BIT_BANG
|
||||
|
||||
bbSPIOpen Opens GPIO for bit banging SPI
|
||||
bbSPIClose Closes GPIO for bit banging SPI
|
||||
|
||||
bbSPIXfer Performs bit banged SPI transactions
|
||||
|
||||
FILES
|
||||
|
||||
fileOpen Opens a file
|
||||
fileClose Closes a file
|
||||
|
||||
fileRead Reads bytes from a file
|
||||
fileWrite Writes bytes to a file
|
||||
|
||||
fileSeek Seeks to a position within a file
|
||||
|
||||
fileList List files which match a pattern
|
||||
|
||||
WAVES
|
||||
|
||||
gpioWaveClear Deletes all waveforms
|
||||
|
@ -229,9 +331,14 @@ gpioWaveChain Transmits a chain of waveforms
|
|||
gpioWaveTxAt Returns the current transmitting waveform
|
||||
|
||||
gpioWaveTxBusy Checks to see if the waveform has ended
|
||||
|
||||
gpioWaveTxStop Aborts the current waveform
|
||||
|
||||
gpioWaveGetMicros Length in microseconds of the current waveform
|
||||
gpioWaveGetCbs Length in CBs of the current waveform
|
||||
gpioWaveGetHighCbs Length of longest waveform so far
|
||||
gpioWaveGetMaxCbs Absolute maximum allowed CBs
|
||||
|
||||
gpioWaveGetMicros Length in micros of the current waveform
|
||||
gpioWaveGetHighMicros Length of longest waveform so far
|
||||
gpioWaveGetMaxMicros Absolute maximum allowed micros
|
||||
|
||||
|
@ -239,111 +346,10 @@ gpioWaveGetPulses Length in pulses of the current waveform
|
|||
gpioWaveGetHighPulses Length of longest waveform so far
|
||||
gpioWaveGetMaxPulses Absolute maximum allowed pulses
|
||||
|
||||
gpioWaveGetCbs Length in control blocks of the current waveform
|
||||
gpioWaveGetHighCbs Length of longest waveform so far
|
||||
gpioWaveGetMaxCbs Absolute maximum allowed control blocks
|
||||
|
||||
I2C
|
||||
|
||||
i2cOpen Opens an I2C device
|
||||
i2cClose Closes an I2C device
|
||||
|
||||
i2cWriteQuick SMBus write quick
|
||||
i2cWriteByte SMBus write byte
|
||||
i2cReadByte SMBus read byte
|
||||
i2cWriteByteData SMBus write byte data
|
||||
i2cWriteWordData SMBus write word data
|
||||
i2cReadByteData SMBus read byte data
|
||||
i2cReadWordData SMBus read word data
|
||||
i2cProcessCall SMBus process call
|
||||
i2cWriteBlockData SMBus write block data
|
||||
i2cReadBlockData SMBus read block data
|
||||
i2cBlockProcessCall SMBus block process call
|
||||
|
||||
i2cWriteI2CBlockData SMBus write I2C block data
|
||||
i2cReadI2CBlockData SMBus read I2C block data
|
||||
|
||||
i2cReadDevice Reads the raw I2C device
|
||||
i2cWriteDevice Writes the raw I2C device
|
||||
|
||||
i2cSwitchCombined Sets or clears the combined flag
|
||||
|
||||
i2cSegments Performs multiple I2C transactions
|
||||
|
||||
i2cZip Performs multiple I2C transactions
|
||||
|
||||
bbI2COpen Opens GPIO for bit banging I2C
|
||||
bbI2CClose Closes GPIO for bit banging I2C
|
||||
bbI2CZip Performs multiple bit banged I2C transactions
|
||||
|
||||
SPI
|
||||
|
||||
spiOpen Opens a SPI device
|
||||
spiClose Closes a SPI device
|
||||
|
||||
spiRead Reads bytes from a SPI device
|
||||
spiWrite Writes bytes to a SPI device
|
||||
spiXfer Transfers bytes with a SPI device
|
||||
|
||||
bbSPIOpen Opens GPIO for bit banging SPI
|
||||
bbSPIClose Closes GPIO for bit banging SPI
|
||||
bbSPIXfer Performs multiple bit banged SPI transactions
|
||||
|
||||
I2C/SPI_SLAVE
|
||||
|
||||
bscXfer I2C/SPI as slave transfer
|
||||
|
||||
SERIAL
|
||||
|
||||
serOpen Opens a serial device
|
||||
serClose Closes a serial device
|
||||
|
||||
serReadByte Reads a byte from a serial device
|
||||
serWriteByte Writes a byte to a serial device
|
||||
serRead Reads bytes from a serial device
|
||||
serWrite Writes bytes to a serial device
|
||||
|
||||
serDataAvailable Returns number of bytes ready to be read
|
||||
|
||||
FILES
|
||||
|
||||
fileOpen Opens a file
|
||||
fileClose Closes a file
|
||||
fileRead Reads bytes from a file
|
||||
fileWrite Writes bytes to a file
|
||||
fileSeek Seeks to a position within a file
|
||||
fileList List files which match a pattern
|
||||
|
||||
EVENTS
|
||||
|
||||
eventMonitor Sets the events to monitor
|
||||
eventSetFunc Request an event callback
|
||||
eventSetFuncEx Request an event callback, extended
|
||||
eventTrigger Trigger an event
|
||||
|
||||
CONFIGURATION
|
||||
|
||||
gpioCfgBufferSize Configure the GPIO sample buffer size
|
||||
gpioCfgClock Configure the GPIO sample rate
|
||||
gpioCfgDMAchannel Configure the DMA channel (DEPRECATED)
|
||||
gpioCfgDMAchannels Configure the DMA channels
|
||||
gpioCfgPermissions Configure the GPIO access permissions
|
||||
gpioCfgInterfaces Configure user interfaces
|
||||
gpioCfgSocketPort Configure socket port
|
||||
gpioCfgMemAlloc Configure DMA memory allocation mode
|
||||
gpioCfgNetAddr Configure allowed network addresses
|
||||
|
||||
gpioCfgInternals Configure miscellaneous internals (DEPRECATED)
|
||||
gpioCfgGetInternals Get internal configuration settings
|
||||
gpioCfgSetInternals Set internal configuration settings
|
||||
|
||||
CUSTOM
|
||||
|
||||
gpioCustom1 User custom function 1
|
||||
gpioCustom2 User custom function 2
|
||||
|
||||
UTILITIES
|
||||
|
||||
gpioDelay Delay for a number of microseconds
|
||||
|
||||
gpioTick Get current tick (microseconds)
|
||||
|
||||
gpioHardwareRevision Get hardware revision
|
||||
|
@ -358,6 +364,22 @@ gpioSleep Sleep for specified time
|
|||
time_sleep Sleeps for a float number of seconds
|
||||
time_time Float number of seconds since the epoch
|
||||
|
||||
CONFIGURATION
|
||||
|
||||
gpioCfgBufferSize Configure the GPIO sample buffer size
|
||||
gpioCfgClock Configure the GPIO sample rate
|
||||
gpioCfgDMAchannel Configure the DMA channel (DEPRECATED)
|
||||
gpioCfgDMAchannels Configure the DMA channels
|
||||
gpioCfgPermissions Configure the GPIO access permissions
|
||||
gpioCfgInterfaces Configure user interfaces
|
||||
gpioCfgSocketPort Configure socket port
|
||||
gpioCfgMemAlloc Configure DMA memory allocation mode
|
||||
gpioCfgNetAddr Configure allowed network addresses
|
||||
|
||||
gpioCfgInternals Configure misc. internals (DEPRECATED)
|
||||
gpioCfgGetInternals Get internal configuration settings
|
||||
gpioCfgSetInternals Set internal configuration settings
|
||||
|
||||
EXPERT
|
||||
|
||||
rawWaveAddSPI Not intended for general use
|
||||
|
@ -2878,9 +2900,18 @@ D*/
|
|||
/*F*/
|
||||
int bscXfer(bsc_xfer_t *bsc_xfer);
|
||||
/*D
|
||||
This function provides a low-level interface to the
|
||||
SPI/I2C Slave peripheral. This peripheral allows the
|
||||
Pi to act as a slave device on an I2C or SPI bus.
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
This function is not available on the BCM2711 (e.g. as
|
||||
used in the Pi4B).
|
||||
|
@ -2906,8 +2937,9 @@ typedef struct
|
|||
} bsc_xfer_t;
|
||||
. .
|
||||
|
||||
To start a transfer set control (see below) and copy the bytes to
|
||||
be sent (if any) to txBuf and set the byte count in txCnt.
|
||||
To start a transfer set control (see below), copy the bytes to
|
||||
be added to the transmit FIFO (if any) to txBuf and set txCnt to
|
||||
the number of copied bytes.
|
||||
|
||||
Upon return rxCnt will be set to the number of received bytes placed
|
||||
in rxBuf.
|
||||
|
|
255
pigpio.py
255
pigpio.py
|
@ -95,41 +95,45 @@ the pigpio.pi class.
|
|||
|
||||
OVERVIEW
|
||||
|
||||
Essential
|
||||
ESSENTIAL
|
||||
|
||||
pigpio.pi Initialise Pi connection
|
||||
stop Stop a Pi connection
|
||||
|
||||
Beginner
|
||||
BASIC
|
||||
|
||||
set_mode Set a GPIO mode
|
||||
get_mode Get a GPIO mode
|
||||
|
||||
set_pull_up_down Set/clear GPIO pull up/down resistor
|
||||
|
||||
read Read a GPIO
|
||||
write Write a GPIO
|
||||
|
||||
PWM_(overrides_servo_commands_on_same_GPIO)
|
||||
|
||||
set_PWM_dutycycle Start/stop PWM pulses on a GPIO
|
||||
set_PWM_frequency Set PWM frequency of a GPIO
|
||||
set_PWM_range Configure PWM range of a GPIO
|
||||
|
||||
get_PWM_dutycycle Get PWM dutycycle set on a GPIO
|
||||
get_PWM_frequency Get PWM frequency of a GPIO
|
||||
get_PWM_range Get configured PWM range of a GPIO
|
||||
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
|
||||
Servo_(overrides_PWM_commands_on_same_GPIO)
|
||||
|
||||
set_servo_pulsewidth Start/Stop servo pulses on a GPIO
|
||||
|
||||
get_servo_pulsewidth Get servo pulsewidth set on a GPIO
|
||||
|
||||
callback Create GPIO level change callback
|
||||
wait_for_edge Wait for GPIO level change
|
||||
|
||||
Intermediate
|
||||
INTERMEDIATE
|
||||
|
||||
gpio_trigger Send a trigger pulse to a GPIO
|
||||
|
||||
set_watchdog Set a watchdog on a GPIO
|
||||
|
||||
set_PWM_range Configure PWM range of a GPIO
|
||||
get_PWM_range Get configured PWM range of a GPIO
|
||||
|
||||
set_PWM_frequency Set PWM frequency of a GPIO
|
||||
get_PWM_frequency Get PWM frequency of a GPIO
|
||||
|
||||
read_bank_1 Read all bank 1 GPIO
|
||||
read_bank_2 Read all bank 2 GPIO
|
||||
|
||||
|
@ -139,31 +143,42 @@ clear_bank_2 Clear selected GPIO in bank 2
|
|||
set_bank_1 Set selected GPIO in bank 1
|
||||
set_bank_2 Set selected GPIO in bank 2
|
||||
|
||||
Advanced
|
||||
callback Create GPIO level change callback
|
||||
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
wait_for_edge Wait for GPIO level change
|
||||
|
||||
ADVANCED
|
||||
|
||||
notify_open Request a notification handle
|
||||
notify_begin Start notifications for selected GPIO
|
||||
notify_pause Pause notifications
|
||||
notify_close Close a notification
|
||||
|
||||
bb_serial_read_open Open a GPIO for bit bang serial reads
|
||||
bb_serial_read Read bit bang serial data from a GPIO
|
||||
bb_serial_read_close Close a GPIO for bit bang serial reads
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
|
||||
hardware_clock Start hardware clock on supported GPIO
|
||||
|
||||
hardware_PWM Start hardware PWM on supported GPIO
|
||||
|
||||
set_glitch_filter Set a glitch filter on a GPIO
|
||||
set_noise_filter Set a noise filter on a GPIO
|
||||
|
||||
get_pad_strength Gets a pads drive strength
|
||||
set_pad_strength Sets a pads drive strength
|
||||
get_pad_strength Gets a pads drive strength
|
||||
|
||||
shell Executes a shell command
|
||||
|
||||
Custom
|
||||
|
||||
custom_1 User custom function 1
|
||||
custom_2 User custom function 2
|
||||
|
||||
Events
|
||||
|
||||
event_callback Sets a callback for an event
|
||||
|
||||
event_trigger Triggers an event
|
||||
|
||||
wait_for_event Wait for an event
|
||||
|
||||
Scripts
|
||||
|
||||
store_script Store a script
|
||||
|
@ -173,7 +188,98 @@ script_status Get script status and parameters
|
|||
stop_script Stop a running script
|
||||
delete_script Delete a stored script
|
||||
|
||||
Waves
|
||||
I2C
|
||||
|
||||
i2c_open Opens an I2C device
|
||||
i2c_close Closes an I2C device
|
||||
|
||||
i2c_write_quick SMBus write quick
|
||||
|
||||
i2c_read_byte SMBus read byte
|
||||
i2c_write_byte SMBus write byte
|
||||
|
||||
i2c_read_byte_data SMBus read byte data
|
||||
i2c_write_byte_data SMBus write byte data
|
||||
|
||||
i2c_read_word_data SMBus read word data
|
||||
i2c_write_word_data SMBus write word data
|
||||
|
||||
i2c_read_block_data SMBus read block data
|
||||
i2c_write_block_data SMBus write block data
|
||||
|
||||
i2c_read_i2c_block_data SMBus read I2C block data
|
||||
i2c_write_i2c_block_data SMBus write I2C block data
|
||||
|
||||
i2c_read_device Reads the raw I2C device
|
||||
i2c_write_device Writes the raw I2C device
|
||||
|
||||
i2c_process_call SMBus process call
|
||||
i2c_block_process_call SMBus block process call
|
||||
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
|
||||
I2C_BIT_BANG
|
||||
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
|
||||
bb_i2c_zip Performs multiple bit banged I2C transactions
|
||||
|
||||
I2C/SPI_SLAVE
|
||||
|
||||
bsc_xfer I2C/SPI as slave transfer
|
||||
bsc_i2c I2C as slave transfer
|
||||
|
||||
SERIAL
|
||||
|
||||
serial_open Opens a serial device
|
||||
serial_close Closes a serial device
|
||||
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
|
||||
serial_read Reads bytes from a serial device
|
||||
serial_write Writes bytes to a serial device
|
||||
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
|
||||
SERIAL_BIT_BANG_(read_only)
|
||||
|
||||
bb_serial_read_open Open a GPIO for bit bang serial reads
|
||||
bb_serial_read_close Close a GPIO for bit bang serial reads
|
||||
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
|
||||
bb_serial_read Read bit bang serial data from a GPIO
|
||||
|
||||
SPI
|
||||
|
||||
spi_open Opens a SPI device
|
||||
spi_close Closes a SPI device
|
||||
|
||||
spi_read Reads bytes from a SPI device
|
||||
spi_write Writes bytes to a SPI device
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
|
||||
SPI_BIT_BANG
|
||||
|
||||
bb_spi_open Opens GPIO for bit banging SPI
|
||||
bb_spi_close Closes GPIO for bit banging SPI
|
||||
bb_spi_xfer Transfers bytes with bit banging SPI
|
||||
|
||||
FILES
|
||||
|
||||
file_open Opens a file
|
||||
file_close Closes a file
|
||||
|
||||
file_read Reads bytes from a file
|
||||
file_write Writes bytes to a file
|
||||
|
||||
file_seek Seeks to a position within a file
|
||||
|
||||
file_list List files which match a pattern
|
||||
|
||||
WAVES
|
||||
|
||||
wave_clear Deletes all waveforms
|
||||
|
||||
|
@ -191,97 +297,21 @@ wave_send_using_mode Transmits a waveform in the chosen mode
|
|||
wave_chain Transmits a chain of waveforms
|
||||
|
||||
wave_tx_at Returns the current transmitting waveform
|
||||
|
||||
wave_tx_busy Checks to see if a waveform has ended
|
||||
|
||||
wave_tx_stop Aborts the current waveform
|
||||
|
||||
wave_get_micros Length in microseconds of the current waveform
|
||||
wave_get_max_micros Absolute maximum allowed micros
|
||||
wave_get_pulses Length in pulses of the current waveform
|
||||
wave_get_max_pulses Absolute maximum allowed pulses
|
||||
wave_get_cbs Length in cbs of the current waveform
|
||||
wave_get_max_cbs Absolute maximum allowed cbs
|
||||
|
||||
I2C
|
||||
wave_get_micros Length in microseconds of the current waveform
|
||||
wave_get_max_micros Absolute maximum allowed micros
|
||||
|
||||
i2c_open Opens an I2C device
|
||||
i2c_close Closes an I2C device
|
||||
wave_get_pulses Length in pulses of the current waveform
|
||||
wave_get_max_pulses Absolute maximum allowed pulses
|
||||
|
||||
i2c_write_quick SMBus write quick
|
||||
i2c_write_byte SMBus write byte
|
||||
i2c_read_byte SMBus read byte
|
||||
i2c_write_byte_data SMBus write byte data
|
||||
i2c_write_word_data SMBus write word data
|
||||
i2c_read_byte_data SMBus read byte data
|
||||
i2c_read_word_data SMBus read word data
|
||||
i2c_process_call SMBus process call
|
||||
i2c_write_block_data SMBus write block data
|
||||
i2c_read_block_data SMBus read block data
|
||||
i2c_block_process_call SMBus block process call
|
||||
|
||||
i2c_read_i2c_block_data SMBus read I2C block data
|
||||
i2c_write_i2c_block_data SMBus write I2C block data
|
||||
|
||||
i2c_read_device Reads the raw I2C device
|
||||
i2c_write_device Writes the raw I2C device
|
||||
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
bb_i2c_zip Performs multiple bit banged I2C transactions
|
||||
|
||||
SPI
|
||||
|
||||
spi_open Opens a SPI device
|
||||
spi_close Closes a SPI device
|
||||
|
||||
spi_read Reads bytes from a SPI device
|
||||
spi_write Writes bytes to a SPI device
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
|
||||
bb_spi_open Opens GPIO for bit banging SPI
|
||||
bb_spi_close Closes GPIO for bit banging SPI
|
||||
bb_spi_xfer Transfers bytes with bit banging SPI
|
||||
|
||||
I2C/SPI_Slave
|
||||
|
||||
bsc_xfer I2C/SPI as slave transfer
|
||||
bsc_i2c I2C as slave transfer
|
||||
|
||||
Serial
|
||||
|
||||
serial_open Opens a serial device
|
||||
serial_close Closes a serial device
|
||||
|
||||
serial_read Reads bytes from a serial device
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
|
||||
serial_write Writes bytes to a serial device
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
|
||||
Files
|
||||
|
||||
file_open Opens a file
|
||||
file_close Closes a file
|
||||
file_read Reads bytes from a file
|
||||
file_write Writes bytes to a file
|
||||
file_seek Seeks to a position within a file
|
||||
file_list List files which match a pattern
|
||||
|
||||
Events
|
||||
|
||||
event_callback Sets a callback for an event
|
||||
event_trigger Triggers an event
|
||||
wait_for_event Wait for an event
|
||||
|
||||
Custom
|
||||
|
||||
custom_1 User custom function 1
|
||||
custom_2 User custom function 2
|
||||
|
||||
Utility
|
||||
UTILITIES
|
||||
|
||||
get_current_tick Get current tick (microseconds)
|
||||
|
||||
|
@ -300,7 +330,7 @@ import threading
|
|||
import os
|
||||
import atexit
|
||||
|
||||
VERSION = "1.44"
|
||||
VERSION = "1.45"
|
||||
|
||||
exceptions = True
|
||||
|
||||
|
@ -3514,9 +3544,18 @@ class pi():
|
|||
|
||||
def bsc_xfer(self, bsc_control, data):
|
||||
"""
|
||||
This function provides a low-level interface to the
|
||||
SPI/I2C Slave peripheral. This peripheral allows the
|
||||
Pi to act as a slave device on an I2C or SPI bus.
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
This function is not available on the BCM2711 (e.g. as
|
||||
used in the Pi4B).
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii pigpiod.1
|
||||
."
|
||||
.TH pigpiod 1 2012-2018 Linux "pigpio archive"
|
||||
.TH pigpiod 1 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pigpiod - A utility to start the pigpio library as a daemon.
|
||||
|
||||
|
|
338
pigpiod_if.3
338
pigpiod_if.3
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii pigpiod_if.3
|
||||
."
|
||||
.TH pigpiod_if 3 2012-2018 Linux "pigpio archive"
|
||||
.TH pigpiod_if 3 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pigpiod_if - A C library to interface to the pigpio daemon.
|
||||
|
||||
|
@ -175,6 +175,342 @@ All the functions which return an int return < 0 on error
|
|||
|
||||
.br
|
||||
|
||||
.br
|
||||
|
||||
.SH OVERVIEW
|
||||
|
||||
.br
|
||||
.SS ESSENTIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
pigpio_start Connects to the pigpio daemon
|
||||
.br
|
||||
pigpio_stop Disconnects from the pigpio daemon
|
||||
.br
|
||||
.SS BEGINNER
|
||||
.br
|
||||
|
||||
.br
|
||||
set_mode Set a GPIO mode
|
||||
.br
|
||||
get_mode Get a GPIO mode
|
||||
.br
|
||||
|
||||
.br
|
||||
set_pull_up_down Set/clear GPIO pull up/down resistor
|
||||
.br
|
||||
|
||||
.br
|
||||
gpio_read Read a GPIO
|
||||
.br
|
||||
gpio_write Write a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_PWM_dutycycle Start/stop PWM pulses on a GPIO
|
||||
.br
|
||||
get_PWM_dutycycle Get the PWM dutycycle in use on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_servo_pulsewidth Start/stop servo pulses on a GPIO
|
||||
.br
|
||||
get_servo_pulsewidth Get the servo pulsewidth in use on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
callback Create GPIO level change callback
|
||||
.br
|
||||
callback_ex Create GPIO level change callback
|
||||
.br
|
||||
callback_cancel Cancel a callback
|
||||
.br
|
||||
wait_for_edge Wait for GPIO level change
|
||||
.br
|
||||
.SS INTERMEDIATE
|
||||
.br
|
||||
|
||||
.br
|
||||
gpio_trigger Send a trigger pulse to a GPIO.
|
||||
.br
|
||||
|
||||
.br
|
||||
set_watchdog Set a watchdog on a GPIO.
|
||||
.br
|
||||
|
||||
.br
|
||||
set_PWM_range Configure PWM range for a GPIO
|
||||
.br
|
||||
get_PWM_range Get configured PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_PWM_frequency Configure PWM frequency for a GPIO
|
||||
.br
|
||||
get_PWM_frequency Get configured PWM frequency for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
read_bank_1 Read all GPIO in bank 1
|
||||
.br
|
||||
read_bank_2 Read all GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
clear_bank_1 Clear selected GPIO in bank 1
|
||||
.br
|
||||
clear_bank_2 Clear selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
set_bank_1 Set selected GPIO in bank 1
|
||||
.br
|
||||
set_bank_2 Set selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
start_thread Start a new thread
|
||||
.br
|
||||
stop_thread Stop a previously started thread
|
||||
.br
|
||||
.SS ADVANCED
|
||||
.br
|
||||
|
||||
.br
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
notify_open Request a notification handle
|
||||
.br
|
||||
notify_begin Start notifications for selected GPIO
|
||||
.br
|
||||
notify_pause Pause notifications
|
||||
.br
|
||||
notify_close Close a notification
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_serial_read_open Opens a GPIO for bit bang serial reads
|
||||
.br
|
||||
bb_serial_read Reads bit bang serial data from a GPIO
|
||||
.br
|
||||
bb_serial_read_close Closes a GPIO for bit bang serial reads
|
||||
.br
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
.br
|
||||
|
||||
.br
|
||||
hardware_clock Start hardware clock on supported GPIO
|
||||
.br
|
||||
hardware_PWM Start hardware PWM on supported GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_glitch_filter Set a glitch filter on a GPIO
|
||||
.br
|
||||
set_noise_filter Set a noise filter on a GPIO
|
||||
.br
|
||||
.SS SCRIPTS
|
||||
.br
|
||||
|
||||
.br
|
||||
store_script Store a script
|
||||
.br
|
||||
run_script Run a stored script
|
||||
.br
|
||||
script_status Get script status and parameters
|
||||
.br
|
||||
stop_script Stop a running script
|
||||
.br
|
||||
delete_script Delete a stored script
|
||||
.br
|
||||
.SS WAVES
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_clear Deletes all waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_add_new Starts a new waveform
|
||||
.br
|
||||
wave_add_generic Adds a series of pulses to the waveform
|
||||
.br
|
||||
wave_add_serial Adds serial data to the waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_create Creates a waveform from added data
|
||||
.br
|
||||
wave_delete Deletes one or more waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_send_once Transmits a waveform once
|
||||
.br
|
||||
wave_send_repeat Transmits a waveform repeatedly
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_chain Transmits a chain of waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_tx_busy Checks to see if the waveform has ended
|
||||
.br
|
||||
wave_tx_stop Aborts the current waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_micros Length in microseconds of the current waveform
|
||||
.br
|
||||
wave_get_high_micros Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_micros Absolute maximum allowed micros
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_pulses Length in pulses of the current waveform
|
||||
.br
|
||||
wave_get_high_pulses Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_pulses Absolute maximum allowed pulses
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_cbs Length in cbs of the current waveform
|
||||
.br
|
||||
wave_get_high_cbs Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_cbs Absolute maximum allowed cbs
|
||||
.br
|
||||
.SS I2C
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_open Opens an I2C device
|
||||
.br
|
||||
i2c_close Closes an I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_write_quick smbus write quick
|
||||
.br
|
||||
i2c_write_byte smbus write byte
|
||||
.br
|
||||
i2c_read_byte smbus read byte
|
||||
.br
|
||||
i2c_write_byte_data smbus write byte data
|
||||
.br
|
||||
i2c_write_word_data smbus write word data
|
||||
.br
|
||||
i2c_read_byte_data smbus read byte data
|
||||
.br
|
||||
i2c_read_word_data smbus read word data
|
||||
.br
|
||||
i2c_process_call smbus process call
|
||||
.br
|
||||
i2c_write_block_data smbus write block data
|
||||
.br
|
||||
i2c_read_block_data smbus read block data
|
||||
.br
|
||||
i2c_block_process_call smbus block process call
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_write_i2c_block_data smbus write I2C block data
|
||||
.br
|
||||
i2c_read_i2c_block_data smbus read I2C block data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_device Reads the raw I2C device
|
||||
.br
|
||||
i2c_write_device Writes the raw I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
.br
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
.br
|
||||
bb_i2c_zip Performs multiple bit banged I2C transactions
|
||||
.br
|
||||
.SS SPI
|
||||
.br
|
||||
|
||||
.br
|
||||
spi_open Opens a SPI device
|
||||
.br
|
||||
spi_close Closes a SPI device
|
||||
.br
|
||||
|
||||
.br
|
||||
spi_read Reads bytes from a SPI device
|
||||
.br
|
||||
spi_write Writes bytes to a SPI device
|
||||
.br
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
.br
|
||||
.SS SERIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_open Opens a serial device
|
||||
.br
|
||||
serial_close Closes a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
.br
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
.br
|
||||
serial_write Writes bytes to a serial device
|
||||
.br
|
||||
serial_read Reads bytes from a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
.br
|
||||
.SS CUSTOM
|
||||
.br
|
||||
|
||||
.br
|
||||
custom_1 User custom function 1
|
||||
.br
|
||||
custom_2 User custom function 2
|
||||
.br
|
||||
.SS UTILITIES
|
||||
.br
|
||||
|
||||
.br
|
||||
get_current_tick Get current tick (microseconds)
|
||||
.br
|
||||
|
||||
.br
|
||||
get_hardware_revision Get hardware revision
|
||||
.br
|
||||
get_pigpio_version Get the pigpio version
|
||||
.br
|
||||
pigpiod_if_version Get the pigpiod_if version
|
||||
.br
|
||||
|
||||
.br
|
||||
pigpio_error Get a text description of an error code.
|
||||
.br
|
||||
|
||||
.br
|
||||
time_sleep Sleeps for a float number of seconds
|
||||
.br
|
||||
time_time Float number of seconds since the epoch
|
||||
.br
|
||||
.SH FUNCTIONS
|
||||
|
||||
|
|
481
pigpiod_if2.3
481
pigpiod_if2.3
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii pigpiod_if2.3
|
||||
."
|
||||
.TH pigpiod_if2 3 2012-2018 Linux "pigpio archive"
|
||||
.TH pigpiod_if2 3 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pigpiod_if2 - A C library to interface to the pigpio daemon.
|
||||
|
||||
|
@ -169,6 +169,456 @@ All the functions which return an int return < 0 on error
|
|||
|
||||
.br
|
||||
|
||||
.br
|
||||
|
||||
.SH OVERVIEW
|
||||
|
||||
.br
|
||||
.SS ESSENTIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
pigpio_start Connects to a pigpio daemon
|
||||
.br
|
||||
pigpio_stop Disconnects from a pigpio daemon
|
||||
.br
|
||||
.SS BASIC
|
||||
.br
|
||||
|
||||
.br
|
||||
set_mode Set a GPIO mode
|
||||
.br
|
||||
get_mode Get a GPIO mode
|
||||
.br
|
||||
|
||||
.br
|
||||
set_pull_up_down Set/clear GPIO pull up/down resistor
|
||||
.br
|
||||
|
||||
.br
|
||||
gpio_read Read a GPIO
|
||||
.br
|
||||
gpio_write Write a GPIO
|
||||
.br
|
||||
.SS PWM (overrides servo commands on same GPIO)
|
||||
.br
|
||||
|
||||
.br
|
||||
set_PWM_dutycycle Start/stop PWM pulses on a GPIO
|
||||
.br
|
||||
set_PWM_frequency Configure PWM frequency for a GPIO
|
||||
.br
|
||||
set_PWM_range Configure PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
get_PWM_dutycycle Get the PWM dutycycle in use on a GPIO
|
||||
.br
|
||||
get_PWM_frequency Get configured PWM frequency for a GPIO
|
||||
.br
|
||||
get_PWM_range Get configured PWM range for a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
.br
|
||||
.SS Servo (overrides PWM commands on same GPIO)
|
||||
.br
|
||||
|
||||
.br
|
||||
set_servo_pulsewidth Start/stop servo pulses on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
get_servo_pulsewidth Get the servo pulsewidth in use on a GPIO
|
||||
.br
|
||||
.SS INTERMEDIATE
|
||||
.br
|
||||
|
||||
.br
|
||||
gpio_trigger Send a trigger pulse to a GPIO.
|
||||
.br
|
||||
|
||||
.br
|
||||
set_watchdog Set a watchdog on a GPIO.
|
||||
.br
|
||||
|
||||
.br
|
||||
read_bank_1 Read all GPIO in bank 1
|
||||
.br
|
||||
read_bank_2 Read all GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
clear_bank_1 Clear selected GPIO in bank 1
|
||||
.br
|
||||
clear_bank_2 Clear selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
set_bank_1 Set selected GPIO in bank 1
|
||||
.br
|
||||
set_bank_2 Set selected GPIO in bank 2
|
||||
.br
|
||||
|
||||
.br
|
||||
callback Create GPIO level change callback
|
||||
.br
|
||||
callback_ex Create GPIO level change callback, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
callback_cancel Cancel a callback
|
||||
.br
|
||||
|
||||
.br
|
||||
wait_for_edge Wait for GPIO level change
|
||||
.br
|
||||
|
||||
.br
|
||||
start_thread Start a new thread
|
||||
.br
|
||||
stop_thread Stop a previously started thread
|
||||
.br
|
||||
.SS ADVANCED
|
||||
.br
|
||||
|
||||
.br
|
||||
notify_open Request a notification handle
|
||||
.br
|
||||
notify_begin Start notifications for selected GPIO
|
||||
.br
|
||||
notify_pause Pause notifications
|
||||
.br
|
||||
notify_close Close a notification
|
||||
.br
|
||||
|
||||
.br
|
||||
hardware_clock Start hardware clock on supported GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
hardware_PWM Start hardware PWM on supported GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_glitch_filter Set a glitch filter on a GPIO
|
||||
.br
|
||||
set_noise_filter Set a noise filter on a GPIO
|
||||
.br
|
||||
|
||||
.br
|
||||
set_pad_strength Sets a pads drive strength
|
||||
.br
|
||||
get_pad_strength Gets a pads drive strength
|
||||
.br
|
||||
|
||||
.br
|
||||
shell_ Executes a shell command
|
||||
.br
|
||||
.SS Custom
|
||||
.br
|
||||
|
||||
.br
|
||||
custom_1 User custom function 1
|
||||
.br
|
||||
custom_2 User custom function 2
|
||||
.br
|
||||
.SS Events
|
||||
.br
|
||||
|
||||
.br
|
||||
event_callback Sets a callback for an event
|
||||
.br
|
||||
event_callback_ex Sets a callback for an event, extended
|
||||
.br
|
||||
|
||||
.br
|
||||
event_callback_cancel Cancel an event callback
|
||||
.br
|
||||
|
||||
.br
|
||||
event_trigger Triggers an event
|
||||
.br
|
||||
|
||||
.br
|
||||
wait_for_event Wait for an event
|
||||
.br
|
||||
.SS Scripts
|
||||
.br
|
||||
|
||||
.br
|
||||
store_script Store a script
|
||||
.br
|
||||
run_script Run a stored script
|
||||
.br
|
||||
update_script Set a scripts parameters
|
||||
.br
|
||||
script_status Get script status and parameters
|
||||
.br
|
||||
stop_script Stop a running script
|
||||
.br
|
||||
delete_script Delete a stored script
|
||||
.br
|
||||
.SS I2C
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_open Opens an I2C device
|
||||
.br
|
||||
i2c_close Closes an I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_write_quick smbus write quick
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_byte smbus read byte
|
||||
.br
|
||||
i2c_write_byte smbus write byte
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_byte_data smbus read byte data
|
||||
.br
|
||||
i2c_write_byte_data smbus write byte data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_word_data smbus read word data
|
||||
.br
|
||||
i2c_write_word_data smbus write word data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_block_data smbus read block data
|
||||
.br
|
||||
i2c_write_block_data smbus write block data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_i2c_block_data smbus read I2C block data
|
||||
.br
|
||||
i2c_write_i2c_block_data smbus write I2C block data
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_read_device Reads the raw I2C device
|
||||
.br
|
||||
i2c_write_device Writes the raw I2C device
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_process_call smbus process call
|
||||
.br
|
||||
i2c_block_process_call smbus block process call
|
||||
.br
|
||||
|
||||
.br
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
.br
|
||||
.SS I2C BIT BANG
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
.br
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_i2c_zip Performs bit banged I2C transactions
|
||||
.br
|
||||
.SS I2C/SPI SLAVE
|
||||
.br
|
||||
|
||||
.br
|
||||
bsc_xfer I2C/SPI as slave transfer
|
||||
.br
|
||||
bsc_i2c I2C as slave transfer
|
||||
.br
|
||||
.SS SERIAL
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_open Opens a serial device
|
||||
.br
|
||||
serial_close Closes a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
.br
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_read Reads bytes from a serial device
|
||||
.br
|
||||
serial_write Writes bytes to a serial device
|
||||
.br
|
||||
|
||||
.br
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
.br
|
||||
.SS SERIAL BIT BANG (read only)
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_serial_read_open Opens a GPIO for bit bang serial reads
|
||||
.br
|
||||
bb_serial_read_close Closes a GPIO for bit bang serial reads
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_serial_read Reads bit bang serial data from a GPIO
|
||||
.br
|
||||
.SS SPI
|
||||
.br
|
||||
|
||||
.br
|
||||
spi_open Opens a SPI device
|
||||
.br
|
||||
spi_close Closes a SPI device
|
||||
.br
|
||||
|
||||
.br
|
||||
spi_read Reads bytes from a SPI device
|
||||
.br
|
||||
spi_write Writes bytes to a SPI device
|
||||
.br
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
.br
|
||||
.SS SPI BIT BANG
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_spi_open Opens GPIO for bit banging SPI
|
||||
.br
|
||||
bb_spi_close Closes GPIO for bit banging SPI
|
||||
.br
|
||||
|
||||
.br
|
||||
bb_spi_xfer Transfers bytes with bit banging SPI
|
||||
.br
|
||||
.SS FILES
|
||||
.br
|
||||
|
||||
.br
|
||||
file_open Opens a file
|
||||
.br
|
||||
file_close Closes a file
|
||||
.br
|
||||
|
||||
.br
|
||||
file_read Reads bytes from a file
|
||||
.br
|
||||
file_write Writes bytes to a file
|
||||
.br
|
||||
|
||||
.br
|
||||
file_seek Seeks to a position within a file
|
||||
.br
|
||||
|
||||
.br
|
||||
file_list List files which match a pattern
|
||||
.br
|
||||
.SS WAVES
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_clear Deletes all waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_add_new Starts a new waveform
|
||||
.br
|
||||
wave_add_generic Adds a series of pulses to the waveform
|
||||
.br
|
||||
wave_add_serial Adds serial data to the waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_create Creates a waveform from added data
|
||||
.br
|
||||
wave_delete Deletes one or more waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_send_once Transmits a waveform once
|
||||
.br
|
||||
wave_send_repeat Transmits a waveform repeatedly
|
||||
.br
|
||||
wave_send_using_mode Transmits a waveform in the chosen mode
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_chain Transmits a chain of waveforms
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_tx_at Returns the current transmitting waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_tx_busy Checks to see if the waveform has ended
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_tx_stop Aborts the current waveform
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_cbs Length in cbs of the current waveform
|
||||
.br
|
||||
wave_get_high_cbs Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_cbs Absolute maximum allowed cbs
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_micros Length in micros of the current waveform
|
||||
.br
|
||||
wave_get_high_micros Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_micros Absolute maximum allowed micros
|
||||
.br
|
||||
|
||||
.br
|
||||
wave_get_pulses Length in pulses of the current waveform
|
||||
.br
|
||||
wave_get_high_pulses Length of longest waveform so far
|
||||
.br
|
||||
wave_get_max_pulses Absolute maximum allowed pulses
|
||||
.br
|
||||
.SS UTILITIES
|
||||
.br
|
||||
|
||||
.br
|
||||
get_current_tick Get current tick (microseconds)
|
||||
.br
|
||||
|
||||
.br
|
||||
get_hardware_revision Get hardware revision
|
||||
.br
|
||||
get_pigpio_version Get the pigpio version
|
||||
.br
|
||||
pigpiod_if_version Get the pigpiod_if2 version
|
||||
.br
|
||||
|
||||
.br
|
||||
pigpio_error Get a text description of an error code.
|
||||
.br
|
||||
|
||||
.br
|
||||
time_sleep Sleeps for a float number of seconds
|
||||
.br
|
||||
time_time Float number of seconds since the epoch
|
||||
.br
|
||||
.SH FUNCTIONS
|
||||
|
||||
|
@ -5598,9 +6048,27 @@ The function returns 1 if the edge occurred, otherwise 0.
|
|||
|
||||
.IP "\fBint bsc_xfer(int pi, bsc_xfer_t *bscxfer)\fP"
|
||||
.IP "" 4
|
||||
This function provides a low-level interface to the
|
||||
SPI/I2C Slave peripheral. This peripheral allows the
|
||||
Pi to act as a slave device on an I2C or SPI bus.
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
.br
|
||||
|
||||
.br
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
.br
|
||||
|
||||
|
@ -5655,8 +6123,9 @@ typedef struct
|
|||
.br
|
||||
|
||||
.br
|
||||
To start a transfer set control (see below) and copy the bytes to
|
||||
be sent (if any) to txBuf and set the byte count in txCnt.
|
||||
To start a transfer set control (see below), copy the bytes to
|
||||
be added to the transmit FIFO (if any) to txBuf and set txCnt to
|
||||
the number of copied bytes.
|
||||
|
||||
.br
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|||
For more information, please refer to <http://unlicense.org/>
|
||||
*/
|
||||
|
||||
/* PIGPIOD_IF2_VERSION 15 */
|
||||
/* PIGPIOD_IF2_VERSION 16 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
267
pigpiod_if2.h
267
pigpiod_if2.h
|
@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
|
|||
|
||||
#include "pigpio.h"
|
||||
|
||||
#define PIGPIOD_IF2_VERSION 15
|
||||
#define PIGPIOD_IF2_VERSION 16
|
||||
|
||||
/*TEXT
|
||||
|
||||
|
@ -104,7 +104,7 @@ ESSENTIAL
|
|||
pigpio_start Connects to a pigpio daemon
|
||||
pigpio_stop Disconnects from a pigpio daemon
|
||||
|
||||
BEGINNER
|
||||
BASIC
|
||||
|
||||
set_mode Set a GPIO mode
|
||||
get_mode Get a GPIO mode
|
||||
|
@ -114,16 +114,23 @@ set_pull_up_down Set/clear GPIO pull up/down resistor
|
|||
gpio_read Read a GPIO
|
||||
gpio_write Write a GPIO
|
||||
|
||||
PWM_(overrides_servo_commands_on_same_GPIO)
|
||||
|
||||
set_PWM_dutycycle Start/stop PWM pulses on a GPIO
|
||||
set_PWM_frequency Configure PWM frequency for a GPIO
|
||||
set_PWM_range Configure PWM range for a GPIO
|
||||
|
||||
get_PWM_dutycycle Get the PWM dutycycle in use on a GPIO
|
||||
get_PWM_frequency Get configured PWM frequency for a GPIO
|
||||
get_PWM_range Get configured PWM range for a GPIO
|
||||
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
|
||||
Servo_(overrides_PWM_commands_on_same_GPIO)
|
||||
|
||||
set_servo_pulsewidth Start/stop servo pulses on a GPIO
|
||||
get_servo_pulsewidth Get the servo pulsewidth in use on a GPIO
|
||||
|
||||
callback Create GPIO level change callback
|
||||
callback_ex Create GPIO level change callback, extended
|
||||
callback_cancel Cancel a callback
|
||||
wait_for_edge Wait for GPIO level change
|
||||
get_servo_pulsewidth Get the servo pulsewidth in use on a GPIO
|
||||
|
||||
INTERMEDIATE
|
||||
|
||||
|
@ -131,12 +138,6 @@ gpio_trigger Send a trigger pulse to a GPIO.
|
|||
|
||||
set_watchdog Set a watchdog on a GPIO.
|
||||
|
||||
set_PWM_range Configure PWM range for a GPIO
|
||||
get_PWM_range Get configured PWM range for a GPIO
|
||||
|
||||
set_PWM_frequency Configure PWM frequency for a GPIO
|
||||
get_PWM_frequency Get configured PWM frequency for a GPIO
|
||||
|
||||
read_bank_1 Read all GPIO in bank 1
|
||||
read_bank_2 Read all GPIO in bank 2
|
||||
|
||||
|
@ -146,35 +147,52 @@ clear_bank_2 Clear selected GPIO in bank 2
|
|||
set_bank_1 Set selected GPIO in bank 1
|
||||
set_bank_2 Set selected GPIO in bank 2
|
||||
|
||||
callback Create GPIO level change callback
|
||||
callback_ex Create GPIO level change callback, extended
|
||||
|
||||
callback_cancel Cancel a callback
|
||||
|
||||
wait_for_edge Wait for GPIO level change
|
||||
|
||||
start_thread Start a new thread
|
||||
stop_thread Stop a previously started thread
|
||||
|
||||
ADVANCED
|
||||
|
||||
get_PWM_real_range Get underlying PWM range for a GPIO
|
||||
|
||||
notify_open Request a notification handle
|
||||
notify_begin Start notifications for selected GPIO
|
||||
notify_pause Pause notifications
|
||||
notify_close Close a notification
|
||||
|
||||
bb_serial_read_open Opens a GPIO for bit bang serial reads
|
||||
bb_serial_read Reads bit bang serial data from a GPIO
|
||||
bb_serial_read_close Closes a GPIO for bit bang serial reads
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
|
||||
hardware_clock Start hardware clock on supported GPIO
|
||||
|
||||
hardware_PWM Start hardware PWM on supported GPIO
|
||||
|
||||
set_glitch_filter Set a glitch filter on a GPIO
|
||||
set_noise_filter Set a noise filter on a GPIO
|
||||
|
||||
get_pad_strength Gets a pads drive strength
|
||||
set_pad_strength Sets a pads drive strength
|
||||
get_pad_strength Gets a pads drive strength
|
||||
|
||||
shell_ Executes a shell command
|
||||
|
||||
SCRIPTS
|
||||
Custom
|
||||
|
||||
custom_1 User custom function 1
|
||||
custom_2 User custom function 2
|
||||
|
||||
Events
|
||||
|
||||
event_callback Sets a callback for an event
|
||||
event_callback_ex Sets a callback for an event, extended
|
||||
|
||||
event_callback_cancel Cancel an event callback
|
||||
|
||||
event_trigger Triggers an event
|
||||
|
||||
wait_for_event Wait for an event
|
||||
|
||||
Scripts
|
||||
|
||||
store_script Store a script
|
||||
run_script Run a stored script
|
||||
|
@ -183,6 +201,98 @@ script_status Get script status and parameters
|
|||
stop_script Stop a running script
|
||||
delete_script Delete a stored script
|
||||
|
||||
I2C
|
||||
|
||||
i2c_open Opens an I2C device
|
||||
i2c_close Closes an I2C device
|
||||
|
||||
i2c_write_quick smbus write quick
|
||||
|
||||
i2c_read_byte smbus read byte
|
||||
i2c_write_byte smbus write byte
|
||||
|
||||
i2c_read_byte_data smbus read byte data
|
||||
i2c_write_byte_data smbus write byte data
|
||||
|
||||
i2c_read_word_data smbus read word data
|
||||
i2c_write_word_data smbus write word data
|
||||
|
||||
i2c_read_block_data smbus read block data
|
||||
i2c_write_block_data smbus write block data
|
||||
|
||||
i2c_read_i2c_block_data smbus read I2C block data
|
||||
i2c_write_i2c_block_data smbus write I2C block data
|
||||
|
||||
i2c_read_device Reads the raw I2C device
|
||||
i2c_write_device Writes the raw I2C device
|
||||
|
||||
i2c_process_call smbus process call
|
||||
i2c_block_process_call smbus block process call
|
||||
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
|
||||
I2C_BIT_BANG
|
||||
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
|
||||
bb_i2c_zip Performs bit banged I2C transactions
|
||||
|
||||
I2C/SPI_SLAVE
|
||||
|
||||
bsc_xfer I2C/SPI as slave transfer
|
||||
bsc_i2c I2C as slave transfer
|
||||
|
||||
SERIAL
|
||||
|
||||
serial_open Opens a serial device
|
||||
serial_close Closes a serial device
|
||||
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
|
||||
serial_read Reads bytes from a serial device
|
||||
serial_write Writes bytes to a serial device
|
||||
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
|
||||
SERIAL_BIT_BANG_(read_only)
|
||||
|
||||
bb_serial_read_open Opens a GPIO for bit bang serial reads
|
||||
bb_serial_read_close Closes a GPIO for bit bang serial reads
|
||||
|
||||
bb_serial_invert Invert serial logic (1 invert, 0 normal)
|
||||
|
||||
bb_serial_read Reads bit bang serial data from a GPIO
|
||||
|
||||
SPI
|
||||
|
||||
spi_open Opens a SPI device
|
||||
spi_close Closes a SPI device
|
||||
|
||||
spi_read Reads bytes from a SPI device
|
||||
spi_write Writes bytes to a SPI device
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
|
||||
SPI_BIT_BANG
|
||||
|
||||
bb_spi_open Opens GPIO for bit banging SPI
|
||||
bb_spi_close Closes GPIO for bit banging SPI
|
||||
|
||||
bb_spi_xfer Transfers bytes with bit banging SPI
|
||||
|
||||
FILES
|
||||
|
||||
file_open Opens a file
|
||||
file_close Closes a file
|
||||
|
||||
file_read Reads bytes from a file
|
||||
file_write Writes bytes to a file
|
||||
|
||||
file_seek Seeks to a position within a file
|
||||
|
||||
file_list List files which match a pattern
|
||||
|
||||
WAVES
|
||||
|
||||
wave_clear Deletes all waveforms
|
||||
|
@ -201,10 +311,16 @@ wave_send_using_mode Transmits a waveform in the chosen mode
|
|||
wave_chain Transmits a chain of waveforms
|
||||
|
||||
wave_tx_at Returns the current transmitting waveform
|
||||
|
||||
wave_tx_busy Checks to see if the waveform has ended
|
||||
|
||||
wave_tx_stop Aborts the current waveform
|
||||
|
||||
wave_get_micros Length in microseconds of the current waveform
|
||||
wave_get_cbs Length in cbs of the current waveform
|
||||
wave_get_high_cbs Length of longest waveform so far
|
||||
wave_get_max_cbs Absolute maximum allowed cbs
|
||||
|
||||
wave_get_micros Length in micros of the current waveform
|
||||
wave_get_high_micros Length of longest waveform so far
|
||||
wave_get_max_micros Absolute maximum allowed micros
|
||||
|
||||
|
@ -212,91 +328,6 @@ wave_get_pulses Length in pulses of the current waveform
|
|||
wave_get_high_pulses Length of longest waveform so far
|
||||
wave_get_max_pulses Absolute maximum allowed pulses
|
||||
|
||||
wave_get_cbs Length in cbs of the current waveform
|
||||
wave_get_high_cbs Length of longest waveform so far
|
||||
wave_get_max_cbs Absolute maximum allowed cbs
|
||||
|
||||
I2C
|
||||
|
||||
i2c_open Opens an I2C device
|
||||
i2c_close Closes an I2C device
|
||||
|
||||
i2c_write_quick smbus write quick
|
||||
i2c_write_byte smbus write byte
|
||||
i2c_read_byte smbus read byte
|
||||
i2c_write_byte_data smbus write byte data
|
||||
i2c_write_word_data smbus write word data
|
||||
i2c_read_byte_data smbus read byte data
|
||||
i2c_read_word_data smbus read word data
|
||||
i2c_process_call smbus process call
|
||||
i2c_write_block_data smbus write block data
|
||||
i2c_read_block_data smbus read block data
|
||||
i2c_block_process_call smbus block process call
|
||||
|
||||
i2c_write_i2c_block_data smbus write I2C block data
|
||||
i2c_read_i2c_block_data smbus read I2C block data
|
||||
|
||||
i2c_read_device Reads the raw I2C device
|
||||
i2c_write_device Writes the raw I2C device
|
||||
|
||||
i2c_zip Performs multiple I2C transactions
|
||||
|
||||
bb_i2c_open Opens GPIO for bit banging I2C
|
||||
bb_i2c_close Closes GPIO for bit banging I2C
|
||||
bb_i2c_zip Performs multiple bit banged I2C transactions
|
||||
|
||||
SPI
|
||||
|
||||
spi_open Opens a SPI device
|
||||
spi_close Closes a SPI device
|
||||
|
||||
spi_read Reads bytes from a SPI device
|
||||
spi_write Writes bytes to a SPI device
|
||||
spi_xfer Transfers bytes with a SPI device
|
||||
|
||||
bb_spi_open Opens GPIO for bit banging SPI
|
||||
bb_spi_close Closes GPIO for bit banging SPI
|
||||
bb_spi_xfer Transfers bytes with bit banging SPI
|
||||
|
||||
I2C/SPI_SLAVE
|
||||
|
||||
bsc_xfer I2C/SPI as slave transfer
|
||||
bsc_i2c I2C as slave transfer
|
||||
|
||||
SERIAL
|
||||
|
||||
serial_open Opens a serial device
|
||||
serial_close Closes a serial device
|
||||
|
||||
serial_write_byte Writes a byte to a serial device
|
||||
serial_read_byte Reads a byte from a serial device
|
||||
serial_write Writes bytes to a serial device
|
||||
serial_read Reads bytes from a serial device
|
||||
|
||||
serial_data_available Returns number of bytes ready to be read
|
||||
|
||||
FILES
|
||||
|
||||
file_open Opens a file
|
||||
file_close Closes a file
|
||||
file_read Reads bytes from a file
|
||||
file_write Writes bytes to a file
|
||||
file_seek Seeks to a position within a file
|
||||
file_list List files which match a pattern
|
||||
|
||||
EVENTS
|
||||
|
||||
event_callback Sets a callback for an event
|
||||
event_callback_ex Sets a callback for an event, extended
|
||||
event_callback_cancel Cancel an event callback
|
||||
event_trigger Triggers an event
|
||||
wait_for_event Wait for an event
|
||||
|
||||
CUSTOM
|
||||
|
||||
custom_1 User custom function 1
|
||||
custom_2 User custom function 2
|
||||
|
||||
UTILITIES
|
||||
|
||||
get_current_tick Get current tick (microseconds)
|
||||
|
@ -3398,9 +3429,18 @@ D*/
|
|||
/*F*/
|
||||
int bsc_xfer(int pi, bsc_xfer_t *bscxfer);
|
||||
/*D
|
||||
This function provides a low-level interface to the
|
||||
SPI/I2C Slave peripheral. This peripheral allows the
|
||||
Pi to act as a slave device on an I2C or SPI bus.
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
This function is not available on the BCM2711 (e.g. as
|
||||
used in the Pi4B).
|
||||
|
@ -3427,8 +3467,9 @@ typedef struct
|
|||
} bsc_xfer_t;
|
||||
. .
|
||||
|
||||
To start a transfer set control (see below) and copy the bytes to
|
||||
be sent (if any) to txBuf and set the byte count in txCnt.
|
||||
To start a transfer set control (see below), copy the bytes to
|
||||
be added to the transmit FIFO (if any) to txBuf and set txCnt to
|
||||
the number of copied bytes.
|
||||
|
||||
Upon return rxCnt will be set to the number of received bytes placed
|
||||
in rxBuf.
|
||||
|
|
403
pigs.1
403
pigs.1
|
@ -2,7 +2,7 @@
|
|||
." Process this file with
|
||||
." groff -man -Tascii foo.1
|
||||
."
|
||||
.TH pigs 1 2012-2018 Linux "pigpio archive"
|
||||
.TH pigs 1 2012-2019 Linux "pigpio archive"
|
||||
.SH NAME
|
||||
pigs - command line socket access to the pigpio daemon.
|
||||
|
||||
|
@ -28,8 +28,8 @@ or
|
|||
|
||||
|
||||
.br
|
||||
The socket and pipe interfaces allow control of the GPIO by passing
|
||||
messages to the running pigpio library.
|
||||
The socket and pipe interfaces allow control of the Pi's GPIO by
|
||||
passing messages to the running pigpio library.
|
||||
|
||||
.br
|
||||
The normal way to start the pigpio library would be as a daemon during boot.
|
||||
|
@ -42,10 +42,6 @@ sudo pigpiod
|
|||
|
||||
.EE
|
||||
|
||||
.br
|
||||
pigs is a program and internally uses the socket interface to pigpio
|
||||
whereas /dev/pigpio uses the pipe interface.
|
||||
|
||||
.br
|
||||
.SS Features
|
||||
.br
|
||||
|
@ -80,7 +76,11 @@ ALL GPIO are identified by their Broadcom number.
|
|||
.br
|
||||
.SS Usage
|
||||
.br
|
||||
pigs and the socket interface share the same commands and are invoked in
|
||||
pigs is a program and internally uses the socket interface to pigpio
|
||||
whereas /dev/pigpio uses the pipe interface.
|
||||
|
||||
.br
|
||||
pigs and the pipe interface share the same commands and are invoked in
|
||||
a similar fashion from the command line.
|
||||
|
||||
.br
|
||||
|
@ -242,6 +242,372 @@ $ pigs -x slr 4 100
|
|||
|
||||
.br
|
||||
|
||||
.SH OVERVIEW
|
||||
.SS BASIC
|
||||
.B M/MODES g m
|
||||
Set GPIO mode
|
||||
.P
|
||||
.B MG/MODEG g
|
||||
Get GPIO mode
|
||||
.P
|
||||
.B PUD g p
|
||||
Set GPIO pull up/down
|
||||
.P
|
||||
.B R/READ g
|
||||
Read GPIO level
|
||||
.P
|
||||
.B W/WRITE g L
|
||||
Write GPIO level
|
||||
.P
|
||||
.SS PWM (overrides servo commands on same GPIO)
|
||||
.B P/PWM u v
|
||||
Set GPIO PWM value
|
||||
.P
|
||||
.B PFS u v
|
||||
Set GPIO PWM frequency
|
||||
.P
|
||||
.B PRS u v
|
||||
Set GPIO PWM range
|
||||
.P
|
||||
.B GDC u
|
||||
Get GPIO PWM dutycycle
|
||||
.P
|
||||
.B PFG u
|
||||
Get GPIO PWM frequency
|
||||
.P
|
||||
.B PRG u
|
||||
Get GPIO PWM range
|
||||
.P
|
||||
.B PRRG u
|
||||
Get GPIO PWM real range
|
||||
.P
|
||||
.SS Servo (overrides PWM commands on same GPIO)
|
||||
.B S/SERVO u v
|
||||
Set GPIO servo pulsewidth
|
||||
.P
|
||||
.B GPW u
|
||||
Get GPIO servo pulsewidth
|
||||
.P
|
||||
.SS INTERMEDIATE
|
||||
.B TRIG u pl L
|
||||
Send a trigger pulse
|
||||
.P
|
||||
.B WDOG u v
|
||||
Set GPIO watchdog
|
||||
.P
|
||||
.B BR1
|
||||
Read bank 1 GPIO
|
||||
.P
|
||||
.B BR2
|
||||
Read bank 2 GPIO
|
||||
.P
|
||||
.B BC1 bits
|
||||
Clear specified GPIO in bank 1
|
||||
.P
|
||||
.B BC2 bits
|
||||
Clear specified GPIO in bank 2
|
||||
.P
|
||||
.B BS1 bits
|
||||
Set specified GPIO in bank 1
|
||||
.P
|
||||
.B BS2 bits
|
||||
Set specified GPIO in bank 2
|
||||
.P
|
||||
.SS ADVANCED
|
||||
.B NO
|
||||
Request a notification
|
||||
.P
|
||||
.B NC h
|
||||
Close notification
|
||||
.P
|
||||
.B NB h bits
|
||||
Start notification
|
||||
.P
|
||||
.B NP h
|
||||
Pause notification
|
||||
.P
|
||||
.B HC g cf
|
||||
Set hardware clock frequency
|
||||
.P
|
||||
.B HP g pf pdc
|
||||
Set hardware PWM frequency and dutycycle
|
||||
.P
|
||||
.B FG u stdy
|
||||
Set a glitch filter on a GPIO
|
||||
.P
|
||||
.B FN u stdy actv
|
||||
Set a noise filter on a GPIO
|
||||
.P
|
||||
.B PADS pad padma
|
||||
Set pad drive strength
|
||||
.P
|
||||
.B PADG pad
|
||||
Get pad drive strength
|
||||
.P
|
||||
.B SHELL name str
|
||||
Execute a shell command
|
||||
.P
|
||||
.SS Custom
|
||||
.B CF1 uvs
|
||||
Custom function 1
|
||||
.P
|
||||
.B CF2 uvs
|
||||
Custom function 2
|
||||
.P
|
||||
.SS Events
|
||||
.B EVM h bits
|
||||
Set events to monitor
|
||||
.P
|
||||
.B EVT event
|
||||
Trigger event
|
||||
.P
|
||||
.SS Scripts
|
||||
.B PROC t
|
||||
Store script
|
||||
.P
|
||||
.B PROCR sid pars
|
||||
Run script
|
||||
.P
|
||||
.B PROCU sid pars
|
||||
Set script parameters
|
||||
.P
|
||||
.B PROCP sid
|
||||
Get script status and parameters
|
||||
.P
|
||||
.B PROCS sid
|
||||
Stop script
|
||||
.P
|
||||
.B PROCD sid
|
||||
Delete script
|
||||
.P
|
||||
.B PARSE t
|
||||
Validate script
|
||||
.P
|
||||
.SS I2C
|
||||
.B I2CO ib id if
|
||||
Open I2C bus and device with flags
|
||||
.P
|
||||
.B I2CC h
|
||||
Close I2C handle
|
||||
.P
|
||||
.B I2CWQ h bit
|
||||
smb Write Quick: write bit
|
||||
.P
|
||||
.B I2CRS h
|
||||
smb Read Byte: read byte
|
||||
.P
|
||||
.B I2CWS h bv
|
||||
smb Write Byte: write byte
|
||||
.P
|
||||
.B I2CRB h r
|
||||
smb Read Byte Data: read byte from register
|
||||
.P
|
||||
.B I2CWB h r bv
|
||||
smb Write Byte Data: write byte to register
|
||||
.P
|
||||
.B I2CRW h r
|
||||
smb Read Word Data: read word from register
|
||||
.P
|
||||
.B I2CWW h r wv
|
||||
smb Write Word Data: write word to register
|
||||
.P
|
||||
.B I2CRK h r
|
||||
smb Read Block Data: read data from register
|
||||
.P
|
||||
.B I2CWK h r bvs
|
||||
smb Write Block Data: write data to register
|
||||
.P
|
||||
.B I2CWI h r bvs
|
||||
smb Write I2C Block Data
|
||||
.P
|
||||
.B I2CRI h r num
|
||||
smb Read I2C Block Data: read bytes from register
|
||||
.P
|
||||
.B I2CRD h num
|
||||
i2c Read device
|
||||
.P
|
||||
.B I2CWD h bvs
|
||||
i2c Write device
|
||||
.P
|
||||
.B I2CPC h r wv
|
||||
smb Process Call: exchange register with word
|
||||
.P
|
||||
.B I2CPK h r bvs
|
||||
smb Block Process Call: exchange data bytes with register
|
||||
.P
|
||||
.B I2CZ h bvs
|
||||
Performs multiple I2C transactions
|
||||
.P
|
||||
.SS I2C BIT BANG
|
||||
.B BI2CO sda scl b
|
||||
Open bit bang I2C
|
||||
.P
|
||||
.B BI2CC sda
|
||||
Close bit bang I2C
|
||||
.P
|
||||
.B BI2CZ sda bvs
|
||||
I2C bit bang multiple transactions
|
||||
.P
|
||||
.SS I2C/SPI SLAVE
|
||||
.B BSCX bctl bvs
|
||||
BSC I2C/SPI transfer
|
||||
.P
|
||||
.SS SERIAL
|
||||
.B SERO dev b sef
|
||||
Open serial device dev at baud b with flags
|
||||
.P
|
||||
.B SERC h
|
||||
Close serial handle
|
||||
.P
|
||||
.B SERRB
|
||||
Read byte from serial handle
|
||||
.P
|
||||
.B SERWB h bv
|
||||
Write byte to serial handle
|
||||
.P
|
||||
.B SERR h num
|
||||
Read bytes from serial handle
|
||||
.P
|
||||
.B SERW h bvs
|
||||
Write bytes to serial handle
|
||||
.P
|
||||
.B SERDA h
|
||||
Check for serial data ready to read
|
||||
.P
|
||||
.SS SERIAL BIT BANG (read only)
|
||||
.B SLRO u b db
|
||||
Open GPIO for bit bang serial data
|
||||
.P
|
||||
.B SLRC u
|
||||
Close GPIO for bit bang serial data
|
||||
.P
|
||||
.B SLRI u v
|
||||
Sets bit bang serial data logic levels
|
||||
.P
|
||||
.B SLR u num
|
||||
Read bit bang serial data from GPIO
|
||||
.P
|
||||
.SS SPI
|
||||
.B SPIO c b spf
|
||||
SPI open channel at baud b with flags
|
||||
.P
|
||||
.B SPIC h
|
||||
SPI close handle
|
||||
.P
|
||||
.B SPIR h num
|
||||
SPI read bytes from handle
|
||||
.P
|
||||
.B SPIW h bvs
|
||||
SPI write bytes to handle
|
||||
.P
|
||||
.B SPIX h bvs
|
||||
SPI transfer bytes to handle
|
||||
.P
|
||||
.SS SPI BIT BANG
|
||||
.B BSPIO cs miso mosi sclk b spf
|
||||
Open bit bang SPI
|
||||
.P
|
||||
.B BSPIC cs
|
||||
Close bit bang SPI
|
||||
.P
|
||||
.B BSPIX cs bvs
|
||||
SPI bit bang transfer
|
||||
.P
|
||||
.SS FILES
|
||||
.B FO file mode
|
||||
Open a file in mode
|
||||
.P
|
||||
.B FC h
|
||||
Close file handle
|
||||
.P
|
||||
.B FR h num
|
||||
Read bytes from file handle
|
||||
.P
|
||||
.B FW h bvs
|
||||
Write bytes to file handle
|
||||
.P
|
||||
.B FS h num from
|
||||
Seek to file handle position
|
||||
.P
|
||||
.B FL pat num
|
||||
List files which match pattern
|
||||
.P
|
||||
.SS WAVES
|
||||
.B WVCLR
|
||||
Clear all waveforms
|
||||
.P
|
||||
.B WVNEW
|
||||
Initialise a new waveform
|
||||
.P
|
||||
.B WVAG trips
|
||||
Add generic pulses to waveform
|
||||
.P
|
||||
.B WVAS u b db sb o bvs
|
||||
Add serial data to waveform
|
||||
.P
|
||||
.B WVCRE
|
||||
Create a waveform
|
||||
.P
|
||||
.B WVDEL wid
|
||||
Delete selected waveform
|
||||
.P
|
||||
.B WVTX wid
|
||||
Transmits waveform once
|
||||
.P
|
||||
.B WVTXM wid wmde
|
||||
Transmits waveform using mode
|
||||
.P
|
||||
.B WVTXR wid
|
||||
Transmits waveform repeatedly
|
||||
.P
|
||||
.B WVCHA bvs
|
||||
Transmits a chain of waveforms
|
||||
.P
|
||||
.B WVTAT
|
||||
Returns the current transmitting waveform
|
||||
.P
|
||||
.B WVBSY
|
||||
Check if waveform is being transmitted
|
||||
.P
|
||||
.B WVHLT
|
||||
Stop waveform
|
||||
.P
|
||||
.B WVSC ws
|
||||
Get waveform DMA CB stats
|
||||
.P
|
||||
.B WVSM ws
|
||||
Get waveform time stats
|
||||
.P
|
||||
.B WVSP ws
|
||||
Get waveform pulse stats
|
||||
.P
|
||||
.SS UTILITIES
|
||||
.B H/HELP
|
||||
Display command help
|
||||
.P
|
||||
.B HWVER
|
||||
Get hardware version
|
||||
.P
|
||||
.B MICS v
|
||||
Microseconds delay
|
||||
.P
|
||||
.B MILS v
|
||||
Milliseconds delay
|
||||
.P
|
||||
.B PIGPV
|
||||
Get pigpio library version
|
||||
.P
|
||||
.B T/TICK
|
||||
Get current tick
|
||||
.P
|
||||
.SS CONFIGURATION
|
||||
.B CGI
|
||||
Configuration get internals
|
||||
.P
|
||||
.B CSI v
|
||||
Configuration set internals
|
||||
.P
|
||||
|
||||
.SH COMMANDS
|
||||
|
||||
.br
|
||||
|
@ -542,6 +908,23 @@ ERROR: no permission to update one or more GPIO
|
|||
This command performs a BSC I2C/SPI slave transfer as defined by
|
||||
\fBbctl\fP with data \fBbvs\fP.
|
||||
|
||||
.br
|
||||
This function provides a low-level interface to the SPI/I2C Slave
|
||||
peripheral on the BCM chip.
|
||||
|
||||
.br
|
||||
This peripheral allows the Pi to act as a hardware slave device
|
||||
on an I2C or SPI bus.
|
||||
|
||||
.br
|
||||
This is not a bit bang version and as such is OS timing
|
||||
independent. The bus timing is handled directly by the chip.
|
||||
|
||||
.br
|
||||
The output process is simple. You simply append data to the FIFO
|
||||
buffer on the chip. This works like a queue, you add data to the
|
||||
queue and the master removes it.
|
||||
|
||||
.br
|
||||
This function is not available on the BCM2711 (e.g. as
|
||||
used in the Pi4B).
|
||||
|
@ -1974,7 +2357,7 @@ $ pigs i2crb 0 0
|
|||
|
||||
.br
|
||||
|
||||
.IP "\fBI2CRD h num\fP - i2c Read bytes"
|
||||
.IP "\fBI2CRD h num\fP - i2c Read device"
|
||||
.IP "" 4
|
||||
|
||||
.br
|
||||
|
@ -2146,7 +2529,7 @@ $ pigs i2cwb 0 10 0x54
|
|||
|
||||
.br
|
||||
|
||||
.IP "\fBI2CWD h bvs\fP - i2c Write data"
|
||||
.IP "\fBI2CWD h bvs\fP - i2c Write device"
|
||||
.IP "" 4
|
||||
|
||||
.br
|
||||
|
|
Loading…
Reference in New Issue