#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <ctype.h>
#include <syslog.h>
#include <poll.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <signal.h>
#include <errno.h>
#include <time.h>
#include <sys/ioctl.h>
#include <limits.h>
#include <pthread.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/sysmacros.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/select.h>
#include <fnmatch.h>
#include <glob.h>
#include "pigpio.h"
#include "command.h"
#include "custom.cext"
Go to the source code of this file.
Classes | |
struct | clkCfg_t |
struct | clkInf_t |
struct | dmaIPage_t |
struct | DMAMem_t |
struct | dmaOPage_t |
struct | dmaPage_t |
struct | eventAlert_t |
struct | fileInfo_t |
struct | gpioAlert_t |
struct | gpioCfg_t |
struct | gpioGetSamples_t |
struct | gpioInfo_t |
struct | gpioISR_t |
struct | gpioNotify_t |
struct | gpioScript_t |
struct | gpioSignal_t |
struct | gpioStats_t |
struct | gpioTimer_t |
struct | i2cInfo_t |
struct | my_i2c_rdwr_ioctl_data_t |
union | my_smbus_data |
struct | my_smbus_ioctl_data |
struct | serInfo_t |
struct | spiInfo_t |
struct | wfRx_t |
struct | wfRxI2C_t |
struct | wfRxSerial_t |
struct | wfRxSPI_t |
struct | wfStats_t |
Defines | |
#define | _GNU_SOURCE |
#define | AUX_BASE (pi_peri_phys + 0x00215000) |
#define | AUX_ENABLES 1 |
#define | AUX_IRQ 0 |
#define | AUX_LEN 0xD8 |
#define | AUX_MU_BAUD_REG 26 |
#define | AUX_MU_CNTL_REG 24 |
#define | AUX_MU_IER_REG 17 |
#define | AUX_MU_IIR_REG 18 |
#define | AUX_MU_IO_REG 16 |
#define | AUX_MU_LCR_REG 19 |
#define | AUX_MU_LSR_REG 21 |
#define | AUX_MU_MCR_REG 20 |
#define | AUX_MU_MSR_REG 22 |
#define | AUX_MU_SCRATCH 23 |
#define | AUX_MU_STAT_REG 25 |
#define | AUX_SPI0_CNTL0_REG 32 |
#define | AUX_SPI0_CNTL1_REG 33 |
#define | AUX_SPI0_IO_REG 40 |
#define | AUX_SPI0_PEEK_REG 35 |
#define | AUX_SPI0_STAT_REG 34 |
#define | AUX_SPI0_TX_HOLD 44 |
#define | AUX_SPI1_CNTL0_REG 48 |
#define | AUX_SPI1_CNTL1_REG 49 |
#define | AUX_SPI1_IO_REG 56 |
#define | AUX_SPI1_PEEK_REG 51 |
#define | AUX_SPI1_STAT_REG 50 |
#define | AUX_SPI1_TX_HOLD 60 |
#define | AUXENB_SPI1 (1<<1) |
#define | AUXENB_SPI2 (1<<2) |
#define | AUXENB_UART (1<<0) |
#define | AUXSPI_CNTL0_CLR_FIFOS (1<<9) |
#define | AUXSPI_CNTL0_CS(x) ((x)<<17) |
#define | AUXSPI_CNTL0_DOUT_HOLD(x) ((x)<<12) |
#define | AUXSPI_CNTL0_ENABLE (1<<11) |
#define | AUXSPI_CNTL0_IN_RISING(x) ((x)<<10) |
#define | AUXSPI_CNTL0_INVERT_CLK(x) ((x)<<7) |
#define | AUXSPI_CNTL0_MSB_FIRST(x) ((x)<<6) |
#define | AUXSPI_CNTL0_OUT_RISING(x) ((x)<<8) |
#define | AUXSPI_CNTL0_POSTINP (1<<16) |
#define | AUXSPI_CNTL0_SHIFT_LEN(x) ((x)<<0) |
#define | AUXSPI_CNTL0_SPEED(x) ((x)<<20) |
#define | AUXSPI_CNTL0_VAR_CS (1<<15) |
#define | AUXSPI_CNTL0_VAR_WIDTH (1<<14) |
#define | AUXSPI_CNTL1_CS_HIGH(x) ((x)<<8) |
#define | AUXSPI_CNTL1_DONE_IRQ (1<<6) |
#define | AUXSPI_CNTL1_KEEP_INPUT (1<<0) |
#define | AUXSPI_CNTL1_MSB_FIRST(x) ((x)<<1) |
#define | AUXSPI_CNTL1_TX_IRQ (1<<7) |
#define | AUXSPI_STAT_BITS(x) ((x)<<0) |
#define | AUXSPI_STAT_BUSY (1<<6) |
#define | AUXSPI_STAT_RX_EMPTY (1<<7) |
#define | AUXSPI_STAT_RX_FIFO(x) ((x)<<20) |
#define | AUXSPI_STAT_TX_EMPTY (1<<9) |
#define | AUXSPI_STAT_TX_FIFO(x) ((x)<<28) |
#define | AUXSPI_STAT_TX_FULL (1<<10) |
#define | BANK (gpio>>5) |
#define | BCM_PASSWD (0x5A<<24) |
#define | BILLION 1000000000 |
#define | BIT (1<<(gpio&0x1F)) |
#define | BLOCK_SIZE (PAGES_PER_BLOCK*PAGE_SIZE) |
#define | BPD 4 |
#define | BSCS_BASE (pi_peri_phys + 0x00214000) |
#define | BSCS_LEN 0x40 |
#define | BUS_TO_PHYS(x) ((x)&~0xC0000000) |
#define | CBS_PER_CYCLE ((PULSE_PER_CYCLE*3)+2) |
#define | CBS_PER_IPAGE 117 |
#define | CBS_PER_OPAGE 118 |
#define | CHECK_INITED |
#define | CHECK_INITED_RET_NIL |
#define | CHECK_INITED_RET_NULL_PTR |
#define | CHECK_NOT_INITED |
#define | CLK_BASE (pi_peri_phys + 0x00101000) |
#define | CLK_CTL_BUSY (1 <<7) |
#define | CLK_CTL_ENAB (1 <<4) |
#define | CLK_CTL_KILL (1 <<5) |
#define | CLK_CTL_MASH(x) ((x)<<9) |
#define | CLK_CTL_SRC(x) ((x)<<0) |
#define | CLK_CTL_SRC_OSC 1 |
#define | CLK_CTL_SRC_PLLD 6 |
#define | CLK_DIV_DIVF(x) ((x)<< 0) |
#define | CLK_DIV_DIVI(x) ((x)<<12) |
#define | CLK_GP0_CTL 28 |
#define | CLK_GP0_DIV 29 |
#define | CLK_GP1_CTL 30 |
#define | CLK_GP1_DIV 31 |
#define | CLK_GP2_CTL 32 |
#define | CLK_GP2_DIV 33 |
#define | CLK_LEN 0xA8 |
#define | CLK_OSC_FREQ 19200000 |
#define | CLK_PCMCTL 38 |
#define | CLK_PCMDIV 39 |
#define | CLK_PLLD_FREQ 500000000 |
#define | CLK_PWMCTL 40 |
#define | CLK_PWMDIV 41 |
#define | CLK_SRCS 2 |
#define | CYCLES_PER_BLOCK 80 |
#define | DBG(level, format, arg...) DO_DBG(level, format, ## arg) |
#define | DBG_ALWAYS 0 |
#define | DBG_DMACBS 2 |
#define | DBG_FAST_TICK 7 |
#define | DBG_INTERNAL 5 |
#define | DBG_MAX_LEVEL 8 |
#define | DBG_MIN_LEVEL 0 |
#define | DBG_SCRIPT 3 |
#define | DBG_SLOW_TICK 6 |
#define | DBG_STARTUP 1 |
#define | DBG_USER 4 |
#define | DEFAULT_PWM_IDX 5 |
#define | DMA15_BASE (pi_peri_phys + 0x00E05000) |
#define | DMA_ACTIVATE (1<< 0) |
#define | DMA_BASE (pi_peri_phys + 0x00007000) |
#define | DMA_BURST_LENGTH(x) ((x)<<12) |
#define | DMA_CHANNEL_RESET (1<<31) |
#define | DMA_CONBLK_AD 1 |
#define | DMA_CS 0 |
#define | DMA_DEBUG 8 |
#define | DMA_DEBUG_FIFO_ERR (1<<1) |
#define | DMA_DEBUG_RD_LST_NOT_SET_ERR (1<<0) |
#define | DMA_DEBUG_READ_ERR (1<<2) |
#define | DMA_DEST_DREQ (1<< 6) |
#define | DMA_DEST_IGNORE (1<< 7) |
#define | DMA_DEST_INC (1<< 4) |
#define | DMA_DEST_WIDTH (1<< 5) |
#define | DMA_ENABLE (0xFF0/4) |
#define | DMA_END_FLAG (1<< 1) |
#define | DMA_INTERRUPT_STATUS (1<< 2) |
#define | DMA_LEN 0x1000 /* allow access to all channels */ |
#define | DMA_LITE_FIRST 7 |
#define | DMA_LITE_MAX 0xfffc |
#define | DMA_NO_WIDE_BURSTS (1<<26) |
#define | DMA_PANIC_PRIORITY(x) ((x)<<20) |
#define | DMA_PERIPHERAL_MAPPING(x) ((x)<<16) |
#define | DMA_PRIORITY(x) ((x)<<16) |
#define | DMA_SRC_DREQ (1<<10) |
#define | DMA_SRC_IGNORE (1<<11) |
#define | DMA_SRC_INC (1<< 8) |
#define | DMA_SRC_WIDTH (1<< 9) |
#define | DMA_WAIT_ON_WRITES (1<<28) |
#define | DMA_WAIT_RESP (1<< 3) |
#define | DMAI_PAGES (PAGES_PER_BLOCK * bufferBlocks) |
#define | DMAO_PAGES (PAGES_PER_BLOCK * PI_WAVE_BLOCKS) |
#define | DO_DBG(level, format, arg...) |
#define | FLUSH_PAGES 1024 |
#define | GPAFEN0 34 |
#define | GPAFEN1 35 |
#define | GPAREN0 31 |
#define | GPAREN1 32 |
#define | GPCLR0 10 |
#define | GPCLR1 11 |
#define | GPEDS0 16 |
#define | GPEDS1 17 |
#define | GPFEN0 22 |
#define | GPFEN1 23 |
#define | GPFSEL0 0 |
#define | GPHEN0 25 |
#define | GPHEN1 26 |
#define | GPIO_BASE (pi_peri_phys + 0x00200000) |
#define | GPIO_HW_CLK 4 |
#define | GPIO_HW_PWM 5 |
#define | GPIO_I2C 7 |
#define | GPIO_LEN 0xB4 |
#define | GPIO_PWM 2 |
#define | GPIO_SERVO 3 |
#define | GPIO_SPI 6 |
#define | GPIO_UNDEFINED 0 |
#define | GPIO_WRITE 1 |
#define | GPLEN0 28 |
#define | GPLEN1 29 |
#define | GPLEV0 13 |
#define | GPLEV1 14 |
#define | GPPUD 37 |
#define | GPPUDCLK0 38 |
#define | GPPUDCLK1 39 |
#define | GPREN0 19 |
#define | GPREN1 20 |
#define | GPSET0 7 |
#define | GPSET1 8 |
#define | LVS_PER_IPAGE 38 |
#define | MAX_EMITS (PIPE_BUF / sizeof(gpioReport_t)) |
#define | MAX_REPORT 250 |
#define | MAX_SAMPLE 4000 |
#define | MB_ALLOCATE_MEMORY_TAG 0x3000C |
#define | MB_DEV1 "/dev/vcio" |
#define | MB_DEV2 "/dev/pigpio-mb" |
#define | MB_DEV_MAJOR 100 |
#define | MB_END_TAG 0 |
#define | MB_IOCTL _IOWR(MB_DEV_MAJOR, 0, char *) |
#define | MB_LOCK_MEMORY_TAG 0x3000D |
#define | MB_PROCESS_REQUEST 0 |
#define | MB_RELEASE_MEMORY_TAG 0x3000F |
#define | MB_UNLOCK_MEMORY_TAG 0x3000E |
#define | MILLION 1000000 |
#define | NORMAL_DMA (DMA_NO_WIDE_BURSTS | DMA_WAIT_RESP) |
#define | NUM_CBS (CBS_PER_CYCLE * bufferCycles) |
#define | NUM_WAVE_CBS (DMAO_PAGES * CBS_PER_OPAGE) |
#define | NUM_WAVE_OOL (DMAO_PAGES * OOL_PER_OPAGE) |
#define | OFF_PER_IPAGE 38 |
#define | ON_PER_IPAGE 2 |
#define | OOL_PER_OPAGE 79 |
#define | PAD_PER_IPAGE 7 |
#define | PADS_BASE (pi_peri_phys + 0x00100000) |
#define | PADS_LEN 0x38 |
#define | PAGE_SIZE 4096 |
#define | PAGES_PER_BLOCK 53 |
#define | PCM_BASE (pi_peri_phys + 0x00203000) |
#define | PCM_CS 0 |
#define | PCM_CS_DMAEN (1 <<9) |
#define | PCM_CS_EN (1 <<0) |
#define | PCM_CS_RXCLR (1 <<4) |
#define | PCM_CS_RXERR (1 <<16) |
#define | PCM_CS_RXON (1 <<1) |
#define | PCM_CS_RXSEX (1 <<23) |
#define | PCM_CS_RXTHR(x) ((x)<<7) |
#define | PCM_CS_STBY (1 <<25) |
#define | PCM_CS_SYNC (1 <<24) |
#define | PCM_CS_TXCLR (1 <<3) |
#define | PCM_CS_TXERR (1 <<15) |
#define | PCM_CS_TXON (1 <<2) |
#define | PCM_CS_TXTHR(x) ((x)<<5) |
#define | PCM_DREQ 5 |
#define | PCM_DREQ_RX_PANIC(x) ((x)<<16) |
#define | PCM_DREQ_RX_REQ_L(x) ((x)<< 0) |
#define | PCM_DREQ_TX_PANIC(x) ((x)<<24) |
#define | PCM_DREQ_TX_REQ_L(x) ((x)<< 8) |
#define | PCM_FIFO 1 |
#define | PCM_GRAY 8 |
#define | PCM_GRAY_CLR (1<<1) |
#define | PCM_GRAY_EN (1<<0) |
#define | PCM_GRAY_FLUSH (1<<2) |
#define | PCM_INTEN 6 |
#define | PCM_INTEN_RXERR (1<<3) |
#define | PCM_INTEN_RXR (1<<1) |
#define | PCM_INTEN_TXERR (1<<2) |
#define | PCM_INTEN_TXW (1<<0) |
#define | PCM_INTSTC 7 |
#define | PCM_INTSTC_RXERR (1<<3) |
#define | PCM_INTSTC_RXR (1<<1) |
#define | PCM_INTSTC_TXERR (1<<2) |
#define | PCM_INTSTC_TXW (1<<0) |
#define | PCM_LEN 0x24 |
#define | PCM_MODE 2 |
#define | PCM_MODE_CLK_DIS (1 <<28) |
#define | PCM_MODE_CLKI (1 <<22) |
#define | PCM_MODE_CLKM (1 <<23) |
#define | PCM_MODE_FLEN(x) ((x)<<10) |
#define | PCM_MODE_FRXP (1 <<25) |
#define | PCM_MODE_FSI (1 <<20) |
#define | PCM_MODE_FSLEN(x) ((x)<< 0) |
#define | PCM_MODE_FSM (1 <<21) |
#define | PCM_MODE_FTXP (1 <<24) |
#define | PCM_MODE_PDME (1 <<26) |
#define | PCM_MODE_PDMN (1 <<27) |
#define | PCM_RXC 3 |
#define | PCM_RXC_CH1EN (1 <<30) |
#define | PCM_RXC_CH1POS(x) ((x)<<20) |
#define | PCM_RXC_CH1WEX (1 <<31) |
#define | PCM_RXC_CH1WID(x) ((x)<<16) |
#define | PCM_RXC_CH2EN (1 <<14) |
#define | PCM_RXC_CH2POS(x) ((x)<< 4) |
#define | PCM_RXC_CH2WEX (1 <<15) |
#define | PCM_RXC_CH2WID(x) ((x)<< 0) |
#define | PCM_TIMER (((PCM_BASE + PCM_FIFO*4) & 0x00ffffff) | PI_PERI_BUS) |
#define | PCM_TXC 4 |
#define | PCM_TXC_CH1EN (1 <<30) |
#define | PCM_TXC_CH1POS(x) ((x)<<20) |
#define | PCM_TXC_CH1WEX (1 <<31) |
#define | PCM_TXC_CH1WID(x) ((x)<<16) |
#define | PCM_TXC_CH2EN (1 <<14) |
#define | PCM_TXC_CH2POS(x) ((x)<< 4) |
#define | PCM_TXC_CH2WEX (1 <<15) |
#define | PCM_TXC_CH2WID(x) ((x)<< 0) |
#define | PI_ASPI_CE0 18 |
#define | PI_ASPI_CE1 17 |
#define | PI_ASPI_CE2 16 |
#define | PI_ASPI_MISO 19 |
#define | PI_ASPI_MOSI 20 |
#define | PI_ASPI_SCLK 21 |
#define | PI_ENDING 2 |
#define | PI_FILE_CLOSED 0 |
#define | PI_FILE_OPENED 2 |
#define | PI_FILE_RESERVED 1 |
#define | PI_I2C_CLOSED 0 |
#define | PI_I2C_FUNC_SMBUS_PROC_CALL 0x00800000 |
#define | PI_I2C_FUNC_SMBUS_QUICK 0x00010000 |
#define | PI_I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 |
#define | PI_I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
#define | PI_I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 |
#define | PI_I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 |
#define | PI_I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 |
#define | PI_I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 |
#define | PI_I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 |
#define | PI_I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 |
#define | PI_I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 |
#define | PI_I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 |
#define | PI_I2C_FUNCS 0x0705 |
#define | PI_I2C_OPENED 2 |
#define | PI_I2C_RDWR 0x0707 |
#define | PI_I2C_RESERVED 1 |
#define | PI_I2C_RETRIES 0x0701 |
#define | PI_I2C_SLAVE 0x0703 |
#define | PI_I2C_SMBUS 0x0720 |
#define | PI_I2C_SMBUS_BLOCK_DATA 5 |
#define | PI_I2C_SMBUS_BLOCK_MAX 32 |
#define | PI_I2C_SMBUS_BLOCK_PROC_CALL 7 |
#define | PI_I2C_SMBUS_BYTE 1 |
#define | PI_I2C_SMBUS_BYTE_DATA 2 |
#define | PI_I2C_SMBUS_I2C_BLOCK_BROKEN 6 |
#define | PI_I2C_SMBUS_I2C_BLOCK_DATA 8 |
#define | PI_I2C_SMBUS_I2C_BLOCK_MAX 32 |
#define | PI_I2C_SMBUS_PROC_CALL 4 |
#define | PI_I2C_SMBUS_QUICK 0 |
#define | PI_I2C_SMBUS_READ 1 |
#define | PI_I2C_SMBUS_WORD_DATA 3 |
#define | PI_I2C_SMBUS_WRITE 0 |
#define | PI_I2C_TIMEOUT 0x0702 |
#define | PI_MASH_MAX_FREQ 23800000 |
#define | PI_MAX_PATH 512 |
#define | PI_NOTIFY_CLOSED 0 |
#define | PI_NOTIFY_CLOSING 2 |
#define | PI_NOTIFY_OPENED 3 |
#define | PI_NOTIFY_PAUSED 5 |
#define | PI_NOTIFY_RESERVED 1 |
#define | PI_NOTIFY_RUNNING 4 |
#define | PI_PERI_BUS 0x7E000000 |
#define | PI_RUNNING 1 |
#define | PI_SCRIPT_DELETE 2 |
#define | PI_SCRIPT_DYING 3 |
#define | PI_SCRIPT_FREE 0 |
#define | PI_SCRIPT_HALT 0 |
#define | PI_SCRIPT_IN_USE 2 |
#define | PI_SCRIPT_RESERVED 1 |
#define | PI_SCRIPT_RUN 1 |
#define | PI_SCRIPT_STACK_SIZE 256 |
#define | PI_SER_CLOSED 0 |
#define | PI_SER_OPENED 2 |
#define | PI_SER_RESERVED 1 |
#define | PI_SPI_CE0 8 |
#define | PI_SPI_CE1 7 |
#define | PI_SPI_CLOSED 0 |
#define | PI_SPI_FLAGS_CHANNEL(x) ((x&7)<<29) |
#define | PI_SPI_FLAGS_GET_3WIRE(x) (((x)>>9)&1) |
#define | PI_SPI_FLAGS_GET_3WREN(x) (((x)>>10)&15) |
#define | PI_SPI_FLAGS_GET_AUX_SPI(x) (((x)>>8)&1) |
#define | PI_SPI_FLAGS_GET_BITLEN(x) (((x)>>16)&63) |
#define | PI_SPI_FLAGS_GET_CHANNEL(x) (((x)>>29)&7) |
#define | PI_SPI_FLAGS_GET_CPHA(x) ((x)&1) |
#define | PI_SPI_FLAGS_GET_CPOL(x) ((x)&2) |
#define | PI_SPI_FLAGS_GET_CSPOL(x) ((x)&4) |
#define | PI_SPI_FLAGS_GET_CSPOLS(x) (((x)>>2)&7) |
#define | PI_SPI_FLAGS_GET_MODE(x) ((x)&3) |
#define | PI_SPI_FLAGS_GET_RESVD(x) (((x)>>5)&7) |
#define | PI_SPI_FLAGS_GET_RX_LSB(x) (((x)>>15)&1) |
#define | PI_SPI_FLAGS_GET_TX_LSB(x) (((x)>>14)&1) |
#define | PI_SPI_MISO 9 |
#define | PI_SPI_MOSI 10 |
#define | PI_SPI_OPENED 2 |
#define | PI_SPI_RESERVED 1 |
#define | PI_SPI_SCLK 11 |
#define | PI_STARTING 0 |
#define | PI_THREAD_NONE 0 |
#define | PI_THREAD_RUNNING 2 |
#define | PI_THREAD_STARTED 1 |
#define | PI_WF_MICROS 1 |
#define | PI_WFRX_I2C_SCL 3 |
#define | PI_WFRX_I2C_SDA 2 |
#define | PI_WFRX_NONE 0 |
#define | PI_WFRX_SERIAL 1 |
#define | PI_WFRX_SPI_CS 7 |
#define | PI_WFRX_SPI_MISO 5 |
#define | PI_WFRX_SPI_MOSI 6 |
#define | PI_WFRX_SPI_SCLK 4 |
#define | PULSE_PER_CYCLE 25 |
#define | PWM_BASE (pi_peri_phys + 0x0020C000) |
#define | PWM_CTL 0 |
#define | PWM_CTL_CLRF1 (1<<6) |
#define | PWM_CTL_MODE1 (1<<1) |
#define | PWM_CTL_MSEN1 (1<<7) |
#define | PWM_CTL_MSEN2 (1<<15) |
#define | PWM_CTL_PWEN1 (1<<0) |
#define | PWM_CTL_PWEN2 (1<<8) |
#define | PWM_CTL_USEF1 (1<<5) |
#define | PWM_DAT1 5 |
#define | PWM_DAT2 9 |
#define | PWM_DMAC 2 |
#define | PWM_DMAC_DREQ(x) (x) |
#define | PWM_DMAC_ENAB (1 <<31) |
#define | PWM_DMAC_PANIC(x) ((x)<< 8) |
#define | PWM_FIFO 6 |
#define | PWM_FREQS 18 |
#define | PWM_LEN 0x28 |
#define | PWM_RNG1 4 |
#define | PWM_RNG2 8 |
#define | PWM_STA 1 |
#define | PWM_TIMER (((PWM_BASE + PWM_FIFO*4) & 0x00ffffff) | PI_PERI_BUS) |
#define | SER_CHECK_INITED CHECK_INITED |
#define | SOFT_ERROR(x, format, arg...) |
#define | SPI_BASE (pi_peri_phys + 0x00204000) |
#define | SPI_CLK 2 |
#define | SPI_CS 0 |
#define | SPI_CS0 0 |
#define | SPI_CS1 1 |
#define | SPI_CS2 2 |
#define | SPI_CS_ADCS (1<<11) |
#define | SPI_CS_CLEAR(x) ((x)<<4) |
#define | SPI_CS_CS(x) ((x)<<0) |
#define | SPI_CS_CSPOL(x) ((x)<<6) |
#define | SPI_CS_CSPOLS(x) ((x)<<21) |
#define | SPI_CS_DMA_LEN (1<<24) |
#define | SPI_CS_DMAEN (1<<8) |
#define | SPI_CS_DONE (1<<16) |
#define | SPI_CS_INTD (1<<9) |
#define | SPI_CS_INTR (1<<10) |
#define | SPI_CS_LEN (1<<13) |
#define | SPI_CS_LEN_LONG (1<<25) |
#define | SPI_CS_MODE(x) ((x)<<2) |
#define | SPI_CS_REN (1<<12) |
#define | SPI_CS_RXD (1<<17) |
#define | SPI_CS_RXF (1<<20) |
#define | SPI_CS_RXR (1<<19) |
#define | SPI_CS_TA (1<<7) |
#define | SPI_CS_TXD (1<<18) |
#define | SPI_DC 5 |
#define | SPI_DC_RDREQ(x) ((x)<<16) |
#define | SPI_DC_RPANIC(x) ((x)<<24) |
#define | SPI_DC_TDREQ(x) ((x)<<0) |
#define | SPI_DC_TPANIC(x) ((x)<<8) |
#define | SPI_DLEN 3 |
#define | SPI_FIFO 1 |
#define | SPI_LEN 0x18 |
#define | SPI_LTOH 4 |
#define | SPI_MODE0 0 |
#define | SPI_MODE1 1 |
#define | SPI_MODE2 2 |
#define | SPI_MODE3 3 |
#define | SRX_BUF_SIZE 8192 |
#define | STACK_SIZE (256*1024) |
#define | SUPERCYCLE 800 |
#define | SUPERLEVEL 20000 |
#define | SYST_BASE (pi_peri_phys + 0x00003000) |
#define | SYST_CHI 2 |
#define | SYST_CLO 1 |
#define | SYST_CS 0 |
#define | SYST_LEN 0x1C |
#define | TCK_PER_IPAGE 2 |
#define | THOUSAND 1000 |
#define | TICKSLOTS 50 |
#define | TIMED_DMA(x) (DMA_DEST_DREQ | DMA_PERIPHERAL_MAPPING(x)) |
#define | TIMER_ADD(a, b, result) |
#define | TIMER_SUB(a, b, result) |
#define | WCB_CHAIN_CBS 60 |
#define | WCB_CHAIN_OOL 60 |
#define | WCB_CNT_CBS 13 |
#define | WCB_CNT_OOL 68 |
#define | WCB_CNT_PER_PAGE 2 |
#define | WCB_COUNTER_CBS (WCB_CNT_PER_PAGE * WCB_CNT_CBS) |
#define | WCB_COUNTER_OOL (WCB_CNT_PER_PAGE * WCB_CNT_OOL) |
#define | WCB_COUNTERS (WCB_CNT_PER_PAGE * PI_WAVE_COUNT_PAGES) |
Typedefs | |
typedef void(* | callbk_t )() |
Functions | |
static void | _spiRXBits (char *buf, int pos, int bitlen, int msbf, uint32_t bits) |
static uint32_t | _spiTXBits (char *buf, int pos, int bitlen, int msbf) |
static int | addrAllowed (struct sockaddr *saddr) |
static void | alertEmit (gpioSample_t *sample, int numSamples, uint32_t changedBits, uint32_t eTick) |
static void | alertGlitchFilter (gpioSample_t *sample, int numSamples) |
static void | alertNoiseFilter (gpioSample_t *sample, int numSamples) |
static void | alertWdogCheck (gpioSample_t *sample, int numSamples) |
int | bbI2CClose (unsigned SDA) |
int | bbI2COpen (unsigned SDA, unsigned SCL, unsigned baud) |
int | bbI2CZip (unsigned SDA, char *inBuf, unsigned inLen, char *outBuf, unsigned outLen) |
int | bbSPIClose (unsigned CS) |
int | bbSPIOpen (unsigned CS, unsigned MISO, unsigned MOSI, unsigned SCLK, unsigned baud, unsigned spiFlags) |
static void | bbSPIStart (wfRx_t *w) |
static void | bbSPIStop (wfRx_t *w) |
int | bbSPIXfer (unsigned CS, char *inBuf, char *outBuf, unsigned count) |
static uint8_t | bbSPIXferByte (wfRx_t *w, char txByte) |
void | bscInit (int mode) |
void | bscTerm (int mode) |
int | bscXfer (bsc_xfer_t *xfer) |
static int | chainGetCB (int n) |
static int | chainGetCntCB (int counter) |
static uint32_t | chainGetCntVal (int counter, int slot) |
static uint32_t | chainGetCntValPadr (int counter, int slot) |
static uint32_t | chainGetValPadr (int n) |
static void | chainMakeCounter (unsigned counter, unsigned blklen, unsigned blocks, unsigned count, uint32_t repeat, uint32_t next) |
static void | chainSetCntVal (int counter, int slot, uint32_t value) |
static void | chainSetVal (int n, uint32_t val) |
static int | chooseBestClock (clkInf_t *clkInf, unsigned f, unsigned numc, unsigned *cf) |
static void | clear_CS (wfRx_t *w) |
static void | clear_SCL (wfRx_t *w) |
static void | clear_SCLK (wfRx_t *w) |
static void | clear_SDA (wfRx_t *w) |
static void | closeOrphanedNotifications (int slot, int fd) |
static rawCbs_t * | dmaCB2adr (int pos) |
static uint32_t | dmaCbAdr (int pos) |
static void | dmaCbPrint (int pos) |
static unsigned | dmaCurrentSlot (unsigned pos) |
static void | dmaDelayCb (int b) |
static uint32_t | dmaGpioOffAdr (int pos) |
static void | dmaGpioOffCb (int b, int pos) |
static uint32_t | dmaGpioOnAdr (int pos) |
static void | dmaGpioOnCb (int b, int pos) |
static void | dmaInitCbs (void) |
static unsigned | dmaNowAtICB (void) |
static int | dmaNowAtOCB (void) |
static uint32_t | dmaPwmDataAdr (int pos) |
static uint32_t | dmaReadLevelsAdr (int pos) |
static void | dmaReadLevelsCb (int b, int pos) |
static uint32_t | dmaTickAdr (int pos) |
static void | dmaTickCb (int b, int pos) |
int | eventMonitor (unsigned handle, uint32_t bits) |
int | eventSetFunc (unsigned event, eventFunc_t f) |
int | eventSetFuncEx (unsigned event, eventFuncEx_t f, void *userdata) |
int | eventTrigger (unsigned event) |
int | fileApprove (char *filename) |
int | fileClose (unsigned handle) |
int | fileList (char *fpat, char *buf, unsigned count) |
int | fileOpen (char *file, unsigned mode) |
int | fileRead (unsigned handle, char *buf, unsigned count) |
int | fileSeek (unsigned handle, int32_t seekOffset, int seekFrom) |
int | fileWrite (unsigned handle, char *buf, unsigned count) |
static void | flushMemory (void) |
int | getBitInBytes (int bitPos, char *buf, int numBits) |
int | gpioCfgBufferSize (unsigned millis) |
int | gpioCfgClock (unsigned micros, unsigned peripheral, unsigned source) |
int | gpioCfgDMAchannel (unsigned DMAchannel) |
int | gpioCfgDMAchannels (unsigned primaryChannel, unsigned secondaryChannel) |
uint32_t | gpioCfgGetInternals (void) |
int | gpioCfgInterfaces (unsigned ifFlags) |
int | gpioCfgInternals (unsigned cfgWhat, unsigned cfgVal) |
int | gpioCfgMemAlloc (unsigned memAllocMode) |
int | gpioCfgNetAddr (int numSockAddr, uint32_t *sockAddr) |
int | gpioCfgPermissions (uint64_t updateMask) |
int | gpioCfgSetInternals (uint32_t cfgVal) |
int | gpioCfgSocketPort (unsigned port) |
uint32_t | gpioDelay (uint32_t micros) |
int | gpioDeleteScript (unsigned script_id) |
int | gpioGetMode (unsigned gpio) |
int | gpioGetPad (unsigned pad) |
int | gpioGetPWMdutycycle (unsigned gpio) |
int | gpioGetPWMfrequency (unsigned gpio) |
int | gpioGetPWMrange (unsigned gpio) |
int | gpioGetPWMrealRange (unsigned gpio) |
int | gpioGetServoPulsewidth (unsigned gpio) |
int | gpioGlitchFilter (unsigned gpio, unsigned steady) |
int | gpioHardwareClock (unsigned gpio, unsigned frequency) |
int | gpioHardwarePWM (unsigned gpio, unsigned frequency, unsigned dutycycle) |
unsigned | gpioHardwareRevision (void) |
int | gpioInitialise (void) |
int | gpioNoiseFilter (unsigned gpio, unsigned steady, unsigned active) |
int | gpioNotifyBegin (unsigned handle, uint32_t bits) |
int | gpioNotifyClose (unsigned handle) |
int | gpioNotifyOpen (void) |
static int | gpioNotifyOpenInBand (int fd) |
int | gpioNotifyOpenWithSize (int bufSize) |
int | gpioNotifyPause (unsigned handle) |
int | gpioPWM (unsigned gpio, unsigned val) |
int | gpioRead (unsigned gpio) |
uint32_t | gpioRead_Bits_0_31 (void) |
uint32_t | gpioRead_Bits_32_53 (void) |
int | gpioRunScript (unsigned script_id, unsigned numParam, uint32_t *param) |
int | gpioScriptStatus (unsigned script_id, uint32_t *param) |
int | gpioSerialRead (unsigned gpio, void *buf, size_t bufSize) |
int | gpioSerialReadClose (unsigned gpio) |
int | gpioSerialReadInvert (unsigned gpio, unsigned invert) |
int | gpioSerialReadOpen (unsigned gpio, unsigned baud, unsigned data_bits) |
int | gpioServo (unsigned gpio, unsigned val) |
int | gpioSetAlertFunc (unsigned gpio, gpioAlertFunc_t f) |
int | gpioSetAlertFuncEx (unsigned gpio, gpioAlertFuncEx_t f, void *userdata) |
int | gpioSetGetSamplesFunc (gpioGetSamplesFunc_t f, uint32_t bits) |
int | gpioSetGetSamplesFuncEx (gpioGetSamplesFuncEx_t f, uint32_t bits, void *userdata) |
int | gpioSetISRFunc (unsigned gpio, unsigned edge, int timeout, gpioISRFunc_t f) |
int | gpioSetISRFuncEx (unsigned gpio, unsigned edge, int timeout, gpioAlertFuncEx_t f, void *userdata) |
int | gpioSetMode (unsigned gpio, unsigned mode) |
int | gpioSetPad (unsigned pad, unsigned padStrength) |
int | gpioSetPullUpDown (unsigned gpio, unsigned pud) |
int | gpioSetPWMfrequency (unsigned gpio, unsigned frequency) |
int | gpioSetPWMrange (unsigned gpio, unsigned range) |
int | gpioSetSignalFunc (unsigned signum, gpioSignalFunc_t f) |
int | gpioSetSignalFuncEx (unsigned signum, gpioSignalFuncEx_t f, void *userdata) |
int | gpioSetTimerFunc (unsigned id, unsigned millis, gpioTimerFunc_t f) |
int | gpioSetTimerFuncEx (unsigned id, unsigned millis, gpioTimerFuncEx_t f, void *userdata) |
int | gpioSetWatchdog (unsigned gpio, unsigned timeout) |
int | gpioSleep (unsigned timetype, int seconds, int micros) |
pthread_t * | gpioStartThread (gpioThreadFunc_t f, void *userdata) |
int | gpioStopScript (unsigned script_id) |
void | gpioStopThread (pthread_t *pth) |
int | gpioStoreScript (char *script) |
void | gpioTerminate (void) |
uint32_t | gpioTick (void) |
int | gpioTime (unsigned timetype, int *seconds, int *micros) |
int | gpioTrigger (unsigned gpio, unsigned pulseLen, unsigned level) |
int | gpioUpdateScript (unsigned script_id, unsigned numParam, uint32_t *param) |
unsigned | gpioVersion (void) |
int | gpioWaveAddGeneric (unsigned numPulses, gpioPulse_t *pulses) |
int | gpioWaveAddNew (void) |
int | gpioWaveAddSerial (unsigned gpio, unsigned baud, unsigned data_bits, unsigned stop_bits, unsigned offset, unsigned numBytes, char *bstr) |
int | gpioWaveChain (char *buf, unsigned bufSize) |
int | gpioWaveClear (void) |
int | gpioWaveCreate (void) |
int | gpioWaveDelete (unsigned wave_id) |
int | gpioWaveGetCbs (void) |
int | gpioWaveGetHighCbs (void) |
int | gpioWaveGetHighMicros (void) |
int | gpioWaveGetHighPulses (void) |
int | gpioWaveGetMaxCbs (void) |
int | gpioWaveGetMaxMicros (void) |
int | gpioWaveGetMaxPulses (void) |
int | gpioWaveGetMicros (void) |
int | gpioWaveGetPulses (void) |
int | gpioWaveTxAt (void) |
int | gpioWaveTxBusy (void) |
int | gpioWaveTxSend (unsigned wave_id, unsigned wave_mode) |
int | gpioWaveTxStart (unsigned wave_mode) |
int | gpioWaveTxStop (void) |
int | gpioWrite (unsigned gpio, unsigned level) |
int | gpioWrite_Bits_0_31_Clear (uint32_t bits) |
int | gpioWrite_Bits_0_31_Set (uint32_t bits) |
int | gpioWrite_Bits_32_53_Clear (uint32_t bits) |
int | gpioWrite_Bits_32_53_Set (uint32_t bits) |
static void | I2C_clock_stretch (wfRx_t *w) |
static void | I2C_delay (wfRx_t *w) |
int | i2cBlockProcessCall (unsigned handle, unsigned reg, char *buf, unsigned count) |
int | i2cClose (unsigned handle) |
static int | I2CGetBit (wfRx_t *w) |
static uint8_t | I2CGetByte (wfRx_t *w, int nack) |
int | i2cOpen (unsigned i2cBus, unsigned i2cAddr, unsigned i2cFlags) |
int | i2cProcessCall (unsigned handle, unsigned reg, unsigned wVal) |
static void | I2CPutBit (wfRx_t *w, int bit) |
static int | I2CPutByte (wfRx_t *w, int byte) |
int | i2cReadBlockData (unsigned handle, unsigned reg, char *buf) |
int | i2cReadByte (unsigned handle) |
int | i2cReadByteData (unsigned handle, unsigned reg) |
int | i2cReadDevice (unsigned handle, char *buf, unsigned count) |
int | i2cReadI2CBlockData (unsigned handle, unsigned reg, char *buf, unsigned count) |
int | i2cReadWordData (unsigned handle, unsigned reg) |
int | i2cSegments (unsigned handle, pi_i2c_msg_t *segs, unsigned numSegs) |
static void | I2CStart (wfRx_t *w) |
static void | I2CStop (wfRx_t *w) |
void | i2cSwitchCombined (int setting) |
int | i2cWriteBlockData (unsigned handle, unsigned reg, char *buf, unsigned count) |
int | i2cWriteByte (unsigned handle, unsigned bVal) |
int | i2cWriteByteData (unsigned handle, unsigned reg, unsigned bVal) |
int | i2cWriteDevice (unsigned handle, char *buf, unsigned count) |
int | i2cWriteI2CBlockData (unsigned handle, unsigned reg, char *buf, unsigned count) |
int | i2cWriteQuick (unsigned handle, unsigned bit) |
int | i2cWriteWordData (unsigned handle, unsigned reg, unsigned wVal) |
int | i2cZip (unsigned handle, char *inBuf, unsigned inLen, char *outBuf, unsigned outLen) |
static int | initAllocDMAMem (void) |
static void | initCheckLockFile (void) |
static int | initCheckPermitted (void) |
static void | initClearGlobals (void) |
static void | initClock (int mainClock) |
static void | initDMAgo (volatile uint32_t *dmaAddr, uint32_t cbAddr) |
static int | initGrabLockFile (void) |
static void | initHWClk (int clkCtl, int clkDiv, int clkSrc, int divI, int divF, int MASH) |
int | initInitialise (void) |
static uint32_t * | initMapMem (int fd, uint32_t addr, uint32_t len) |
static int | initMboxBlock (int block) |
static int | initPagemapBlock (int block) |
static void | initPCM (unsigned bits) |
static int | initPeripherals (void) |
static void | initPWM (unsigned bits) |
static void | initReleaseResources (void) |
static int | initZaps (int pmapFd, void *virtualBase, int basePage, int pages) |
static int | intEventSetFunc (unsigned event, void *f, int user, void *userdata) |
static int | intGpioSetAlertFunc (unsigned gpio, void *f, int user, void *userdata) |
static int | intGpioSetISRFunc (unsigned gpio, unsigned edge, int timeout, void *f, int user, void *userdata) |
static int | intGpioSetTimerFunc (unsigned id, unsigned millis, void *f, int user, void *userdata) |
static void | intNotifyBits (void) |
static void | intScriptBits (void) |
static void | intScriptEventBits (void) |
static unsigned | mbAllocateMemory (int fd, unsigned size, unsigned align, unsigned flags) |
static void | mbClose (int fd) |
static int | mbCreate (char *dev) |
static int | mbDMAAlloc (DMAMem_t *DMAMemP, unsigned size, uint32_t pi_mem_flag) |
static void | mbDMAFree (DMAMem_t *DMAMemP) |
static unsigned | mbLockMemory (int fd, unsigned handle) |
static void * | mbMapMem (unsigned base, unsigned size) |
static int | mbOpen (void) |
static int | mbProperty (int fd, void *buf) |
static unsigned | mbReleaseMemory (int fd, unsigned handle) |
static unsigned | mbUnlockMemory (int fd, unsigned handle) |
static int | mbUnmapMem (void *addr, unsigned size) |
static int | my_smbus_access (int fd, char rw, uint8_t cmd, int size, union my_smbus_data *data) |
static char * | myBuf2Str (unsigned count, char *buf) |
static void | myClearGpioOff (unsigned gpio, int pos) |
static void | myClearGpioOn (unsigned gpio, int pos) |
static void | myCreatePipe (char *name, int perm) |
static int | myDoCommand (uint32_t *p, unsigned bufSize, char *buf) |
static uint32_t | myGetLevel (int pos) |
static uint32_t | myGetTick (int pos) |
static uint32_t | myGpioDelay (uint32_t micros) |
static int | myGpioRead (unsigned gpio) |
static void | myGpioSetMode (unsigned gpio, unsigned mode) |
static void | myGpioSetPwm (unsigned gpio, int oldVal, int newVal) |
static void | myGpioSetServo (unsigned gpio, int oldVal, int newVal) |
static void | myGpioSleep (int seconds, int micros) |
static void | myGpioWrite (unsigned gpio, unsigned level) |
static int | myI2CGetPar (char *inBuf, int *inPos, int inLen, int *esc) |
static void | myLvsPageSlot (int pos, int *page, int *slot) |
static void | myOffPageSlot (int pos, int *page, int *slot) |
int | myPathBad (char *name) |
static int | myPermit (unsigned gpio) |
int | myScriptNameValid (char *name) |
static void | mySetGpioOff (unsigned gpio, int pos) |
static void | mySetGpioOn (unsigned gpio, int pos) |
static void | myTckPageSlot (int pos, int *page, int *slot) |
static char * | myTimeStamp () |
static void | notifyMutex (int lock) |
static void * | pthAlertThread (void *x) |
static void * | pthFifoThread (void *x) |
static void * | pthISRThread (void *x) |
static void * | pthScript (void *x) |
static void * | pthSocketThread (void *x) |
static void * | pthSocketThreadHandler (void *fdC) |
static void * | pthTimerTick (void *x) |
void | putBitInBytes (int bitPos, char *buf, int bit) |
void | rawDumpScript (unsigned script_id) |
void | rawDumpWave (void) |
int | rawWaveAddGeneric (unsigned numIn1, rawWave_t *in1) |
int | rawWaveAddSPI (rawSPI_t *spi, unsigned offset, unsigned spiSS, char *buf, unsigned spiTxBits, unsigned spiBitFirst, unsigned spiBitLast, unsigned spiBits) |
unsigned | rawWaveCB (void) |
rawCbs_t * | rawWaveCBAdr (int cbNum) |
uint32_t | rawWaveGetIn (int pos) |
uint32_t | rawWaveGetOOL (int pos) |
uint32_t | rawWaveGetOut (int pos) |
rawWaveInfo_t | rawWaveInfo (int wave_id) |
void | rawWaveSetIn (int pos, uint32_t value) |
void | rawWaveSetOOL (int pos, uint32_t value) |
void | rawWaveSetOut (int pos, uint32_t value) |
static int | read_SDA (wfRx_t *w) |
static int | scrEvtWait (gpioScript_t *s, uint32_t bits) |
static int | scrPop (gpioScript_t *s, int *SP, int *S) |
static void | scrPush (gpioScript_t *s, int *SP, int *S, int val) |
static void | scrSwap (int *v1, int *v2) |
static int | scrSys (char *cmd, uint32_t p1, uint32_t p2) |
static int | scrWait (gpioScript_t *s, uint32_t bits) |
int | serClose (unsigned handle) |
int | serDataAvailable (unsigned handle) |
int | serOpen (char *tty, unsigned serBaud, unsigned serFlags) |
int | serRead (unsigned handle, char *buf, unsigned count) |
int | serReadByte (unsigned handle) |
int | serWrite (unsigned handle, char *buf, unsigned count) |
int | serWriteByte (unsigned handle, unsigned bVal) |
static void | set_CS (wfRx_t *w) |
static void | set_SCLK (wfRx_t *w) |
static void | set_SDA (wfRx_t *w) |
int | shell (char *scriptName, char *scriptString) |
static void | sigHandler (int signum) |
static void | sigSetHandler (void) |
static void | SPI_delay (wfRx_t *w) |
static void | spiACS (int channel, int on) |
static int | spiAnyOpen (uint32_t flags) |
int | spiClose (unsigned handle) |
static void | spiGo (unsigned speed, uint32_t flags, char *txBuf, char *rxBuf, unsigned count) |
static void | spiGoA (unsigned speed, uint32_t flags, char *txBuf, char *rxBuf, unsigned count) |
static void | spiGoS (unsigned speed, uint32_t flags, char *txBuf, char *rxBuf, unsigned count) |
static void | spiInit (uint32_t flags) |
static void | spinWhileStarting (void) |
int | spiOpen (unsigned spiChan, unsigned baud, unsigned spiFlags) |
int | spiRead (unsigned handle, char *buf, unsigned count) |
static void | spiTerm (uint32_t flags) |
int | spiWrite (unsigned handle, char *buf, unsigned count) |
int | spiXfer (unsigned handle, char *txBuf, char *rxBuf, unsigned count) |
static void | stopHardwarePWM (void) |
static void | switchFunctionOff (unsigned gpio) |
void | time_sleep (double seconds) |
double | time_time (void) |
static int | wave2Cbs (unsigned wave_mode, int *CB, int *BOOL, int *TOOL) |
static void | waveBitDelay (unsigned baud, unsigned bits, unsigned stops, unsigned *bitDelay) |
static uint32_t | waveCbPOadr (int pos) |
static void | waveCBsOOLs (int *numCBs, int *numBOOLs, int *numTOOLs) |
static int | waveDelayCBs (uint32_t delay) |
static void | waveOOLPageSlot (int pos, int *page, int *slot) |
static uint32_t | waveOOLPOadr (int pos) |
static void | waveRxBit (int gpio, int level, uint32_t tick) |
static void | waveRxSerial (wfRx_t *w, int level, uint32_t tick) |
static void | waveSetOOL (int pos, uint32_t OOL) |
static void | wfRx_lock (int i) |
static void | wfRx_unlock (int i) |
Variables | |
unsigned | alert_delays [] |
static volatile uint32_t | alertBits = 0 |
static volatile uint32_t * | auxReg = MAP_FAILED |
static uint32_t | bscFR |
static volatile uint32_t * | bscsReg = MAP_FAILED |
static unsigned | bufferBlocks |
static unsigned | bufferCycles |
static const clkCfg_t | clkCfg [] |
static const uint8_t | clkDef [PI_MAX_GPIO+1] |
static volatile uint32_t * | clkReg = MAP_FAILED |
static dmaPage_t ** | dmaBus = MAP_FAILED |
static dmaIPage_t ** | dmaIBus = MAP_FAILED |
static volatile uint32_t * | dmaIn = MAP_FAILED |
static dmaIPage_t ** | dmaIVirt = MAP_FAILED |
static DMAMem_t * | dmaMboxBlk = MAP_FAILED |
static dmaOPage_t ** | dmaOBus = MAP_FAILED |
static volatile uint32_t * | dmaOut = MAP_FAILED |
static dmaOPage_t ** | dmaOVirt = MAP_FAILED |
static uintptr_t ** | dmaPMapBlk = MAP_FAILED |
static volatile uint32_t * | dmaReg = MAP_FAILED |
static dmaPage_t ** | dmaVirt = MAP_FAILED |
static eventAlert_t | eventAlert [PI_MAX_EVENT+1] |
static int | fdLock = -1 |
static int | fdMbox = -1 |
static int | fdMem = -1 |
static int | fdPmap = -1 |
static int | fdSock = -1 |
static fileInfo_t | fileInfo [PI_FILE_SLOTS] |
static volatile uint32_t | gFilterBits = 0 |
static gpioAlert_t | gpioAlert [PI_MAX_USER_GPIO+1] |
static volatile gpioCfg_t | gpioCfg |
static gpioGetSamples_t | gpioGetSamples |
static gpioInfo_t | gpioInfo [PI_MAX_GPIO+1] |
static gpioISR_t | gpioISR [PI_MAX_GPIO+1] |
static uint64_t | gpioMask |
static int | gpioMaskSet = 0 |
static gpioNotify_t | gpioNotify [PI_NOTIFY_SLOTS] |
static volatile uint32_t * | gpioReg = MAP_FAILED |
static gpioScript_t | gpioScript [PI_MAX_SCRIPTS] |
static gpioSignal_t | gpioSignal [PI_MAX_SIGNUM+1] |
static volatile gpioStats_t | gpioStats |
static gpioTimer_t | gpioTimer [PI_MAX_TIMER+1] |
static uint32_t | hw_clk_freq [3] |
static uint32_t | hw_pwm_duty [2] |
static uint32_t | hw_pwm_freq [2] |
static uint32_t | hw_pwm_real_range [2] |
static i2cInfo_t | i2cInfo [PI_I2C_SLOTS] |
static FILE * | inpFifo = NULL |
static int | libInitialised = 0 |
static struct timespec | libStarted |
static volatile uint32_t | monitorBits = 0 |
static volatile uint32_t | nFilterBits = 0 |
static volatile uint32_t | notifyBits = 0 |
static int | numSockNetAddr = 0 |
static unsigned | old_mode_ace0 |
static unsigned | old_mode_ace1 |
static unsigned | old_mode_ace2 |
static unsigned | old_mode_amiso |
static unsigned | old_mode_amosi |
static unsigned | old_mode_asclk |
static unsigned | old_mode_ce0 |
static unsigned | old_mode_ce1 |
static unsigned | old_mode_miso |
static unsigned | old_mode_mosi |
static unsigned | old_mode_sclk |
static uint32_t | old_spi_clk |
static uint32_t | old_spi_cntl0 |
static uint32_t | old_spi_cntl1 |
static uint32_t | old_spi_cs |
static FILE * | outFifo = NULL |
static volatile uint32_t * | padsReg = MAP_FAILED |
static volatile uint32_t * | pcmReg = MAP_FAILED |
static volatile uint32_t | pi_dram_bus = 0x40000000 |
static volatile uint32_t | pi_mem_flag = 0x0C |
static volatile uint32_t | pi_peri_phys = 0x20000000 |
static volatile uint32_t | piCores = 0 |
static pthread_t | pthAlert |
static int | pthAlertRunning = PI_THREAD_NONE |
static pthread_t | pthFifo |
static int | pthFifoRunning = PI_THREAD_NONE |
static pthread_t | pthSocket |
static int | pthSocketRunning = PI_THREAD_NONE |
static int | PWMClockInited = 0 |
static const uint16_t | pwmCycles [PWM_FREQS] |
static const uint8_t | PWMDef [PI_MAX_GPIO+1] |
static int | pwmFreq [PWM_FREQS] |
static const uint16_t | pwmRealRange [PWM_FREQS] |
static volatile uint32_t * | pwmReg = MAP_FAILED |
static uint32_t | reportedLevel = 0 |
static volatile int | runState = PI_STARTING |
static volatile uint32_t | scriptBits = 0 |
static volatile uint32_t | scriptEventBits = 0 |
static serInfo_t | serInfo [PI_SER_SLOTS] |
static uint32_t | sockNetAddr [MAX_CONNECT_ADDRESSES] |
static uint32_t | spi_dummy |
static spiInfo_t | spiInfo [PI_SPI_SLOTS] |
static volatile uint32_t * | spiReg = MAP_FAILED |
static volatile uint32_t * | systReg = MAP_FAILED |
static int | waveClockInited = 0 |
static uint32_t * | waveEndPtr = NULL |
static rawWaveInfo_t | waveInfo [PI_MAX_WAVES] |
static int | waveOutBotCB = PI_WAVE_COUNT_PAGES*CBS_PER_OPAGE |
static int | waveOutBotOOL = PI_WAVE_COUNT_PAGES*OOL_PER_OPAGE |
static int | waveOutCount = 0 |
static int | waveOutTopOOL = NUM_WAVE_OOL |
static volatile uint32_t | wdogBits = 0 |
static rawWave_t | wf [3][PI_WAVE_MAX_PULSES] |
static int | wfc [3] = {0, 0, 0} |
static int | wfcur = 0 |
static wfRx_t | wfRx [PI_MAX_USER_GPIO+1] |
static wfStats_t | wfStats |
#define _GNU_SOURCE |
#define AUX_BASE (pi_peri_phys + 0x00215000) |
#define AUX_ENABLES 1 |
#define AUX_MU_BAUD_REG 26 |
#define AUX_MU_CNTL_REG 24 |
#define AUX_MU_IER_REG 17 |
#define AUX_MU_IIR_REG 18 |
#define AUX_MU_IO_REG 16 |
#define AUX_MU_LCR_REG 19 |
#define AUX_MU_LSR_REG 21 |
#define AUX_MU_MCR_REG 20 |
#define AUX_MU_MSR_REG 22 |
#define AUX_MU_SCRATCH 23 |
#define AUX_MU_STAT_REG 25 |
#define AUX_SPI0_CNTL0_REG 32 |
#define AUX_SPI0_CNTL1_REG 33 |
#define AUX_SPI0_IO_REG 40 |
#define AUX_SPI0_PEEK_REG 35 |
#define AUX_SPI0_STAT_REG 34 |
#define AUX_SPI0_TX_HOLD 44 |
#define AUX_SPI1_CNTL0_REG 48 |
#define AUX_SPI1_CNTL1_REG 49 |
#define AUX_SPI1_IO_REG 56 |
#define AUX_SPI1_PEEK_REG 51 |
#define AUX_SPI1_STAT_REG 50 |
#define AUX_SPI1_TX_HOLD 60 |
#define AUXENB_SPI1 (1<<1) |
#define AUXENB_SPI2 (1<<2) |
#define AUXENB_UART (1<<0) |
#define AUXSPI_CNTL0_CLR_FIFOS (1<<9) |
#define AUXSPI_CNTL0_CS | ( | x | ) | ((x)<<17) |
#define AUXSPI_CNTL0_DOUT_HOLD | ( | x | ) | ((x)<<12) |
#define AUXSPI_CNTL0_ENABLE (1<<11) |
#define AUXSPI_CNTL0_IN_RISING | ( | x | ) | ((x)<<10) |
#define AUXSPI_CNTL0_INVERT_CLK | ( | x | ) | ((x)<<7) |
#define AUXSPI_CNTL0_MSB_FIRST | ( | x | ) | ((x)<<6) |
#define AUXSPI_CNTL0_OUT_RISING | ( | x | ) | ((x)<<8) |
#define AUXSPI_CNTL0_POSTINP (1<<16) |
#define AUXSPI_CNTL0_SHIFT_LEN | ( | x | ) | ((x)<<0) |
#define AUXSPI_CNTL0_SPEED | ( | x | ) | ((x)<<20) |
#define AUXSPI_CNTL0_VAR_CS (1<<15) |
#define AUXSPI_CNTL0_VAR_WIDTH (1<<14) |
#define AUXSPI_CNTL1_CS_HIGH | ( | x | ) | ((x)<<8) |
#define AUXSPI_CNTL1_DONE_IRQ (1<<6) |
#define AUXSPI_CNTL1_KEEP_INPUT (1<<0) |
#define AUXSPI_CNTL1_MSB_FIRST | ( | x | ) | ((x)<<1) |
#define AUXSPI_CNTL1_TX_IRQ (1<<7) |
#define AUXSPI_STAT_BITS | ( | x | ) | ((x)<<0) |
#define AUXSPI_STAT_BUSY (1<<6) |
#define AUXSPI_STAT_RX_EMPTY (1<<7) |
#define AUXSPI_STAT_RX_FIFO | ( | x | ) | ((x)<<20) |
#define AUXSPI_STAT_TX_EMPTY (1<<9) |
#define AUXSPI_STAT_TX_FIFO | ( | x | ) | ((x)<<28) |
#define AUXSPI_STAT_TX_FULL (1<<10) |
#define BCM_PASSWD (0x5A<<24) |
#define BLOCK_SIZE (PAGES_PER_BLOCK*PAGE_SIZE) |
#define BSCS_BASE (pi_peri_phys + 0x00214000) |
#define BUS_TO_PHYS | ( | x | ) | ((x)&~0xC0000000) |
#define CBS_PER_CYCLE ((PULSE_PER_CYCLE*3)+2) |
#define CBS_PER_IPAGE 117 |
#define CBS_PER_OPAGE 118 |
#define CHECK_INITED |
do \ { \ if (!libInitialised) \ { \ DBG(DBG_ALWAYS, \ "pigpio uninitialised, call gpioInitialise()"); \ return PI_NOT_INITIALISED; \ } \ } \ while (0)
#define CHECK_INITED_RET_NIL |
do \ { \ if (!libInitialised) \ { \ DBG(DBG_ALWAYS, \ "pigpio uninitialised, call gpioInitialise()"); \ } \ } \ while (0)
#define CHECK_INITED_RET_NULL_PTR |
do \ { \ if (!libInitialised) \ { \ DBG(DBG_ALWAYS, \ "pigpio uninitialised, call gpioInitialise()"); \ return (NULL); \ } \ } \ while (0)
#define CHECK_NOT_INITED |
do \ { \ if (libInitialised) \ { \ DBG(DBG_ALWAYS, \ "pigpio initialised, call gpioTerminate()"); \ return PI_INITIALISED; \ } \ } \ while (0)
#define CLK_BASE (pi_peri_phys + 0x00101000) |
#define CLK_CTL_BUSY (1 <<7) |
#define CLK_CTL_ENAB (1 <<4) |
#define CLK_CTL_KILL (1 <<5) |
#define CLK_CTL_MASH | ( | x | ) | ((x)<<9) |
#define CLK_CTL_SRC | ( | x | ) | ((x)<<0) |
#define CLK_CTL_SRC_OSC 1 |
#define CLK_CTL_SRC_PLLD 6 |
#define CLK_DIV_DIVF | ( | x | ) | ((x)<< 0) |
#define CLK_DIV_DIVI | ( | x | ) | ((x)<<12) |
#define CLK_GP0_CTL 28 |
#define CLK_GP0_DIV 29 |
#define CLK_GP1_CTL 30 |
#define CLK_GP1_DIV 31 |
#define CLK_GP2_CTL 32 |
#define CLK_GP2_DIV 33 |
#define CLK_OSC_FREQ 19200000 |
#define CLK_PCMCTL 38 |
#define CLK_PCMDIV 39 |
#define CLK_PLLD_FREQ 500000000 |
#define CLK_PWMCTL 40 |
#define CLK_PWMDIV 41 |
#define CYCLES_PER_BLOCK 80 |
#define DBG_ALWAYS 0 |
#define DBG_DMACBS 2 |
#define DBG_FAST_TICK 7 |
#define DBG_INTERNAL 5 |
#define DBG_MAX_LEVEL 8 |
#define DBG_MIN_LEVEL 0 |
#define DBG_SCRIPT 3 |
#define DBG_SLOW_TICK 6 |
#define DBG_STARTUP 1 |
#define DEFAULT_PWM_IDX 5 |
#define DMA15_BASE (pi_peri_phys + 0x00E05000) |
#define DMA_ACTIVATE (1<< 0) |
#define DMA_BASE (pi_peri_phys + 0x00007000) |
#define DMA_BURST_LENGTH | ( | x | ) | ((x)<<12) |
#define DMA_CHANNEL_RESET (1<<31) |
#define DMA_CONBLK_AD 1 |
#define DMA_DEBUG_FIFO_ERR (1<<1) |
#define DMA_DEBUG_RD_LST_NOT_SET_ERR (1<<0) |
#define DMA_DEBUG_READ_ERR (1<<2) |
#define DMA_DEST_DREQ (1<< 6) |
#define DMA_DEST_IGNORE (1<< 7) |
#define DMA_DEST_INC (1<< 4) |
#define DMA_DEST_WIDTH (1<< 5) |
#define DMA_ENABLE (0xFF0/4) |
#define DMA_END_FLAG (1<< 1) |
#define DMA_INTERRUPT_STATUS (1<< 2) |
#define DMA_LITE_FIRST 7 |
#define DMA_LITE_MAX 0xfffc |
#define DMA_NO_WIDE_BURSTS (1<<26) |
#define DMA_PANIC_PRIORITY | ( | x | ) | ((x)<<20) |
#define DMA_PERIPHERAL_MAPPING | ( | x | ) | ((x)<<16) |
#define DMA_PRIORITY | ( | x | ) | ((x)<<16) |
#define DMA_SRC_DREQ (1<<10) |
#define DMA_SRC_IGNORE (1<<11) |
#define DMA_SRC_INC (1<< 8) |
#define DMA_SRC_WIDTH (1<< 9) |
#define DMA_WAIT_ON_WRITES (1<<28) |
#define DMA_WAIT_RESP (1<< 3) |
#define DMAI_PAGES (PAGES_PER_BLOCK * bufferBlocks) |
#define DMAO_PAGES (PAGES_PER_BLOCK * PI_WAVE_BLOCKS) |
#define DO_DBG | ( | level, | |
format, | |||
arg... | |||
) |
{ \ if ((gpioCfg.dbgLevel >= level) && \ (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))) \ fprintf(stderr, "%s %s: " format "\n" , \ myTimeStamp(), __FUNCTION__ , ## arg); \ }
#define FLUSH_PAGES 1024 |
#define GPIO_BASE (pi_peri_phys + 0x00200000) |
#define GPIO_HW_CLK 4 |
#define GPIO_HW_PWM 5 |
#define GPIO_SERVO 3 |
#define GPIO_UNDEFINED 0 |
#define GPIO_WRITE 1 |
#define LVS_PER_IPAGE 38 |
#define MAX_EMITS (PIPE_BUF / sizeof(gpioReport_t)) |
#define MAX_REPORT 250 |
#define MAX_SAMPLE 4000 |
#define MB_ALLOCATE_MEMORY_TAG 0x3000C |
#define MB_DEV_MAJOR 100 |
#define MB_END_TAG 0 |
#define MB_IOCTL _IOWR(MB_DEV_MAJOR, 0, char *) |
#define MB_LOCK_MEMORY_TAG 0x3000D |
#define MB_PROCESS_REQUEST 0 |
#define MB_RELEASE_MEMORY_TAG 0x3000F |
#define MB_UNLOCK_MEMORY_TAG 0x3000E |
#define NORMAL_DMA (DMA_NO_WIDE_BURSTS | DMA_WAIT_RESP) |
#define NUM_CBS (CBS_PER_CYCLE * bufferCycles) |
#define NUM_WAVE_CBS (DMAO_PAGES * CBS_PER_OPAGE) |
#define NUM_WAVE_OOL (DMAO_PAGES * OOL_PER_OPAGE) |
#define OFF_PER_IPAGE 38 |
#define ON_PER_IPAGE 2 |
#define OOL_PER_OPAGE 79 |
#define PAD_PER_IPAGE 7 |
#define PADS_BASE (pi_peri_phys + 0x00100000) |
#define PAGES_PER_BLOCK 53 |
#define PCM_BASE (pi_peri_phys + 0x00203000) |
#define PCM_CS_DMAEN (1 <<9) |
#define PCM_CS_RXCLR (1 <<4) |
#define PCM_CS_RXERR (1 <<16) |
#define PCM_CS_RXON (1 <<1) |
#define PCM_CS_RXSEX (1 <<23) |
#define PCM_CS_RXTHR | ( | x | ) | ((x)<<7) |
#define PCM_CS_STBY (1 <<25) |
#define PCM_CS_SYNC (1 <<24) |
#define PCM_CS_TXCLR (1 <<3) |
#define PCM_CS_TXERR (1 <<15) |
#define PCM_CS_TXON (1 <<2) |
#define PCM_CS_TXTHR | ( | x | ) | ((x)<<5) |
#define PCM_DREQ_RX_PANIC | ( | x | ) | ((x)<<16) |
#define PCM_DREQ_RX_REQ_L | ( | x | ) | ((x)<< 0) |
#define PCM_DREQ_TX_PANIC | ( | x | ) | ((x)<<24) |
#define PCM_DREQ_TX_REQ_L | ( | x | ) | ((x)<< 8) |
#define PCM_GRAY_CLR (1<<1) |
#define PCM_GRAY_EN (1<<0) |
#define PCM_GRAY_FLUSH (1<<2) |
#define PCM_INTEN_RXERR (1<<3) |
#define PCM_INTEN_RXR (1<<1) |
#define PCM_INTEN_TXERR (1<<2) |
#define PCM_INTEN_TXW (1<<0) |
#define PCM_INTSTC 7 |
#define PCM_INTSTC_RXERR (1<<3) |
#define PCM_INTSTC_RXR (1<<1) |
#define PCM_INTSTC_TXERR (1<<2) |
#define PCM_INTSTC_TXW (1<<0) |
#define PCM_MODE_CLK_DIS (1 <<28) |
#define PCM_MODE_CLKI (1 <<22) |
#define PCM_MODE_CLKM (1 <<23) |
#define PCM_MODE_FLEN | ( | x | ) | ((x)<<10) |
#define PCM_MODE_FRXP (1 <<25) |
#define PCM_MODE_FSI (1 <<20) |
#define PCM_MODE_FSLEN | ( | x | ) | ((x)<< 0) |
#define PCM_MODE_FSM (1 <<21) |
#define PCM_MODE_FTXP (1 <<24) |
#define PCM_MODE_PDME (1 <<26) |
#define PCM_MODE_PDMN (1 <<27) |
#define PCM_RXC_CH1EN (1 <<30) |
#define PCM_RXC_CH1POS | ( | x | ) | ((x)<<20) |
#define PCM_RXC_CH1WEX (1 <<31) |
#define PCM_RXC_CH1WID | ( | x | ) | ((x)<<16) |
#define PCM_RXC_CH2EN (1 <<14) |
#define PCM_RXC_CH2POS | ( | x | ) | ((x)<< 4) |
#define PCM_RXC_CH2WEX (1 <<15) |
#define PCM_RXC_CH2WID | ( | x | ) | ((x)<< 0) |
#define PCM_TXC_CH1EN (1 <<30) |
#define PCM_TXC_CH1POS | ( | x | ) | ((x)<<20) |
#define PCM_TXC_CH1WEX (1 <<31) |
#define PCM_TXC_CH1WID | ( | x | ) | ((x)<<16) |
#define PCM_TXC_CH2EN (1 <<14) |
#define PCM_TXC_CH2POS | ( | x | ) | ((x)<< 4) |
#define PCM_TXC_CH2WEX (1 <<15) |
#define PCM_TXC_CH2WID | ( | x | ) | ((x)<< 0) |
#define PI_ASPI_CE0 18 |
#define PI_ASPI_CE1 17 |
#define PI_ASPI_CE2 16 |
#define PI_ASPI_MISO 19 |
#define PI_ASPI_MOSI 20 |
#define PI_ASPI_SCLK 21 |
#define PI_FILE_CLOSED 0 |
#define PI_FILE_OPENED 2 |
#define PI_FILE_RESERVED 1 |
#define PI_I2C_CLOSED 0 |
#define PI_I2C_FUNC_SMBUS_PROC_CALL 0x00800000 |
#define PI_I2C_FUNC_SMBUS_QUICK 0x00010000 |
#define PI_I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 |
#define PI_I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
#define PI_I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 |
#define PI_I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 |
#define PI_I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 |
#define PI_I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 |
#define PI_I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 |
#define PI_I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 |
#define PI_I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 |
#define PI_I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 |
#define PI_I2C_FUNCS 0x0705 |
#define PI_I2C_OPENED 2 |
#define PI_I2C_RDWR 0x0707 |
#define PI_I2C_RESERVED 1 |
#define PI_I2C_RETRIES 0x0701 |
#define PI_I2C_SLAVE 0x0703 |
#define PI_I2C_SMBUS 0x0720 |
#define PI_I2C_SMBUS_BLOCK_DATA 5 |
#define PI_I2C_SMBUS_BLOCK_MAX 32 |
#define PI_I2C_SMBUS_BLOCK_PROC_CALL 7 |
#define PI_I2C_SMBUS_BYTE 1 |
#define PI_I2C_SMBUS_BYTE_DATA 2 |
#define PI_I2C_SMBUS_I2C_BLOCK_BROKEN 6 |
#define PI_I2C_SMBUS_I2C_BLOCK_DATA 8 |
#define PI_I2C_SMBUS_I2C_BLOCK_MAX 32 |
#define PI_I2C_SMBUS_PROC_CALL 4 |
#define PI_I2C_SMBUS_QUICK 0 |
#define PI_I2C_SMBUS_READ 1 |
#define PI_I2C_SMBUS_WORD_DATA 3 |
#define PI_I2C_SMBUS_WRITE 0 |
#define PI_I2C_TIMEOUT 0x0702 |
#define PI_MASH_MAX_FREQ 23800000 |
#define PI_MAX_PATH 512 |
#define PI_NOTIFY_CLOSED 0 |
#define PI_NOTIFY_CLOSING 2 |
#define PI_NOTIFY_OPENED 3 |
#define PI_NOTIFY_PAUSED 5 |
#define PI_NOTIFY_RESERVED 1 |
#define PI_NOTIFY_RUNNING 4 |
#define PI_PERI_BUS 0x7E000000 |
#define PI_RUNNING 1 |
#define PI_SCRIPT_DELETE 2 |
#define PI_SCRIPT_DYING 3 |
#define PI_SCRIPT_FREE 0 |
#define PI_SCRIPT_HALT 0 |
#define PI_SCRIPT_IN_USE 2 |
#define PI_SCRIPT_RESERVED 1 |
#define PI_SCRIPT_RUN 1 |
#define PI_SCRIPT_STACK_SIZE 256 |
#define PI_SER_CLOSED 0 |
#define PI_SER_OPENED 2 |
#define PI_SER_RESERVED 1 |
#define PI_SPI_CE0 8 |
#define PI_SPI_CE1 7 |
#define PI_SPI_CLOSED 0 |
#define PI_SPI_FLAGS_CHANNEL | ( | x | ) | ((x&7)<<29) |
#define PI_SPI_FLAGS_GET_3WIRE | ( | x | ) | (((x)>>9)&1) |
#define PI_SPI_FLAGS_GET_3WREN | ( | x | ) | (((x)>>10)&15) |
#define PI_SPI_FLAGS_GET_AUX_SPI | ( | x | ) | (((x)>>8)&1) |
#define PI_SPI_FLAGS_GET_BITLEN | ( | x | ) | (((x)>>16)&63) |
#define PI_SPI_FLAGS_GET_CHANNEL | ( | x | ) | (((x)>>29)&7) |
#define PI_SPI_FLAGS_GET_CPHA | ( | x | ) | ((x)&1) |
#define PI_SPI_FLAGS_GET_CPOL | ( | x | ) | ((x)&2) |
#define PI_SPI_FLAGS_GET_CSPOL | ( | x | ) | ((x)&4) |
#define PI_SPI_FLAGS_GET_CSPOLS | ( | x | ) | (((x)>>2)&7) |
#define PI_SPI_FLAGS_GET_MODE | ( | x | ) | ((x)&3) |
#define PI_SPI_FLAGS_GET_RESVD | ( | x | ) | (((x)>>5)&7) |
#define PI_SPI_FLAGS_GET_RX_LSB | ( | x | ) | (((x)>>15)&1) |
#define PI_SPI_FLAGS_GET_TX_LSB | ( | x | ) | (((x)>>14)&1) |
#define PI_SPI_MISO 9 |
#define PI_SPI_MOSI 10 |
#define PI_SPI_OPENED 2 |
#define PI_SPI_RESERVED 1 |
#define PI_SPI_SCLK 11 |
#define PI_STARTING 0 |
#define PI_THREAD_NONE 0 |
#define PI_THREAD_RUNNING 2 |
#define PI_THREAD_STARTED 1 |
#define PI_WF_MICROS 1 |
#define PI_WFRX_I2C_SCL 3 |
#define PI_WFRX_I2C_SDA 2 |
#define PI_WFRX_NONE 0 |
#define PI_WFRX_SERIAL 1 |
#define PI_WFRX_SPI_CS 7 |
#define PI_WFRX_SPI_MISO 5 |
#define PI_WFRX_SPI_MOSI 6 |
#define PI_WFRX_SPI_SCLK 4 |
#define PULSE_PER_CYCLE 25 |
#define PWM_BASE (pi_peri_phys + 0x0020C000) |
#define PWM_CTL_CLRF1 (1<<6) |
#define PWM_CTL_MODE1 (1<<1) |
#define PWM_CTL_MSEN1 (1<<7) |
#define PWM_CTL_MSEN2 (1<<15) |
#define PWM_CTL_PWEN1 (1<<0) |
#define PWM_CTL_PWEN2 (1<<8) |
#define PWM_CTL_USEF1 (1<<5) |
#define PWM_DMAC_DREQ | ( | x | ) | (x) |
#define PWM_DMAC_ENAB (1 <<31) |
#define PWM_DMAC_PANIC | ( | x | ) | ((x)<< 8) |
#define SER_CHECK_INITED CHECK_INITED |
#define SOFT_ERROR | ( | x, | |
format, | |||
arg... | |||
) |
do \ { \ DBG(DBG_ALWAYS, format, ## arg); \ return x; \ } \ while (0)
#define SPI_BASE (pi_peri_phys + 0x00204000) |
#define SPI_CS_ADCS (1<<11) |
#define SPI_CS_CLEAR | ( | x | ) | ((x)<<4) |
#define SPI_CS_CSPOL | ( | x | ) | ((x)<<6) |
#define SPI_CS_CSPOLS | ( | x | ) | ((x)<<21) |
#define SPI_CS_DMA_LEN (1<<24) |
#define SPI_CS_DMAEN (1<<8) |
#define SPI_CS_DONE (1<<16) |
#define SPI_CS_INTD (1<<9) |
#define SPI_CS_INTR (1<<10) |
#define SPI_CS_LEN (1<<13) |
#define SPI_CS_LEN_LONG (1<<25) |
#define SPI_CS_MODE | ( | x | ) | ((x)<<2) |
#define SPI_CS_REN (1<<12) |
#define SPI_CS_RXD (1<<17) |
#define SPI_CS_RXF (1<<20) |
#define SPI_CS_RXR (1<<19) |
#define SPI_CS_TXD (1<<18) |
#define SPI_DC_RDREQ | ( | x | ) | ((x)<<16) |
#define SPI_DC_RPANIC | ( | x | ) | ((x)<<24) |
#define SPI_DC_TDREQ | ( | x | ) | ((x)<<0) |
#define SPI_DC_TPANIC | ( | x | ) | ((x)<<8) |
#define SRX_BUF_SIZE 8192 |
#define STACK_SIZE (256*1024) |
#define SUPERCYCLE 800 |
#define SUPERLEVEL 20000 |
#define SYST_BASE (pi_peri_phys + 0x00003000) |
#define TCK_PER_IPAGE 2 |
#define TIMED_DMA | ( | x | ) | (DMA_DEST_DREQ | DMA_PERIPHERAL_MAPPING(x)) |
#define TIMER_ADD | ( | a, | |
b, | |||
result | |||
) |
#define TIMER_SUB | ( | a, | |
b, | |||
result | |||
) |
#define WCB_CHAIN_CBS 60 |
#define WCB_CHAIN_OOL 60 |
#define WCB_CNT_CBS 13 |
#define WCB_CNT_OOL 68 |
#define WCB_CNT_PER_PAGE 2 |
#define WCB_COUNTER_CBS (WCB_CNT_PER_PAGE * WCB_CNT_CBS) |
#define WCB_COUNTER_OOL (WCB_CNT_PER_PAGE * WCB_CNT_OOL) |
#define WCB_COUNTERS (WCB_CNT_PER_PAGE * PI_WAVE_COUNT_PAGES) |
static void _spiRXBits | ( | char * | buf, |
int | pos, | ||
int | bitlen, | ||
int | msbf, | ||
uint32_t | bits | ||
) | [static] |
static uint32_t _spiTXBits | ( | char * | buf, |
int | pos, | ||
int | bitlen, | ||
int | msbf | ||
) | [static] |
static int addrAllowed | ( | struct sockaddr * | saddr | ) | [static] |
static void alertEmit | ( | gpioSample_t * | sample, |
int | numSamples, | ||
uint32_t | changedBits, | ||
uint32_t | eTick | ||
) | [static] |
static void alertGlitchFilter | ( | gpioSample_t * | sample, |
int | numSamples | ||
) | [static] |
static void alertNoiseFilter | ( | gpioSample_t * | sample, |
int | numSamples | ||
) | [static] |
static void alertWdogCheck | ( | gpioSample_t * | sample, |
int | numSamples | ||
) | [static] |
int bbI2CClose | ( | unsigned | SDA | ) |
int bbI2COpen | ( | unsigned | SDA, |
unsigned | SCL, | ||
unsigned | baud | ||
) |
int bbI2CZip | ( | unsigned | SDA, |
char * | inBuf, | ||
unsigned | inLen, | ||
char * | outBuf, | ||
unsigned | outLen | ||
) |
int bbSPIClose | ( | unsigned | CS | ) |
int bbSPIOpen | ( | unsigned | CS, |
unsigned | MISO, | ||
unsigned | MOSI, | ||
unsigned | SCLK, | ||
unsigned | baud, | ||
unsigned | spiFlags | ||
) |
static void bbSPIStart | ( | wfRx_t * | w | ) | [static] |
int bbSPIXfer | ( | unsigned | CS, |
char * | inBuf, | ||
char * | outBuf, | ||
unsigned | count | ||
) |
static uint8_t bbSPIXferByte | ( | wfRx_t * | w, |
char | txByte | ||
) | [static] |
int bscXfer | ( | bsc_xfer_t * | xfer | ) |
static int chainGetCB | ( | int | n | ) | [static] |
static int chainGetCntCB | ( | int | counter | ) | [static] |
static uint32_t chainGetCntVal | ( | int | counter, |
int | slot | ||
) | [static] |
static uint32_t chainGetCntValPadr | ( | int | counter, |
int | slot | ||
) | [static] |
static uint32_t chainGetValPadr | ( | int | n | ) | [static] |
static void chainMakeCounter | ( | unsigned | counter, |
unsigned | blklen, | ||
unsigned | blocks, | ||
unsigned | count, | ||
uint32_t | repeat, | ||
uint32_t | next | ||
) | [static] |
static void chainSetCntVal | ( | int | counter, |
int | slot, | ||
uint32_t | value | ||
) | [static] |
static void chainSetVal | ( | int | n, |
uint32_t | val | ||
) | [static] |
static int chooseBestClock | ( | clkInf_t * | clkInf, |
unsigned | f, | ||
unsigned | numc, | ||
unsigned * | cf | ||
) | [static] |
static void clear_SCLK | ( | wfRx_t * | w | ) | [static] |
static void closeOrphanedNotifications | ( | int | slot, |
int | fd | ||
) | [static] |
static void dmaCbPrint | ( | int | pos | ) | [static] |
static unsigned dmaCurrentSlot | ( | unsigned | pos | ) | [static] |
static void dmaDelayCb | ( | int | b | ) | [static] |
static uint32_t dmaGpioOffAdr | ( | int | pos | ) | [static] |
static void dmaGpioOffCb | ( | int | b, |
int | pos | ||
) | [static] |
static uint32_t dmaGpioOnAdr | ( | int | pos | ) | [static] |
static void dmaGpioOnCb | ( | int | b, |
int | pos | ||
) | [static] |
static void dmaInitCbs | ( | void | ) | [static] |
static unsigned dmaNowAtICB | ( | void | ) | [static] |
static int dmaNowAtOCB | ( | void | ) | [static] |
static uint32_t dmaPwmDataAdr | ( | int | pos | ) | [static] |
static uint32_t dmaReadLevelsAdr | ( | int | pos | ) | [static] |
static void dmaReadLevelsCb | ( | int | b, |
int | pos | ||
) | [static] |
static uint32_t dmaTickAdr | ( | int | pos | ) | [static] |
int eventMonitor | ( | unsigned | handle, |
uint32_t | bits | ||
) |
int eventSetFunc | ( | unsigned | event, |
eventFunc_t | f | ||
) |
int eventSetFuncEx | ( | unsigned | event, |
eventFuncEx_t | f, | ||
void * | userdata | ||
) |
int eventTrigger | ( | unsigned | event | ) |
int fileApprove | ( | char * | filename | ) |
int fileRead | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int fileSeek | ( | unsigned | handle, |
int32_t | seekOffset, | ||
int | seekFrom | ||
) |
int fileWrite | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
static void flushMemory | ( | void | ) | [static] |
int getBitInBytes | ( | int | bitPos, |
char * | buf, | ||
int | numBits | ||
) |
int gpioCfgBufferSize | ( | unsigned | millis | ) |
int gpioCfgClock | ( | unsigned | micros, |
unsigned | peripheral, | ||
unsigned | source | ||
) |
int gpioCfgDMAchannel | ( | unsigned | DMAchannel | ) |
int gpioCfgDMAchannels | ( | unsigned | primaryChannel, |
unsigned | secondaryChannel | ||
) |
uint32_t gpioCfgGetInternals | ( | void | ) |
int gpioCfgInterfaces | ( | unsigned | ifFlags | ) |
int gpioCfgInternals | ( | unsigned | cfgWhat, |
unsigned | cfgVal | ||
) |
int gpioCfgMemAlloc | ( | unsigned | memAllocMode | ) |
int gpioCfgNetAddr | ( | int | numSockAddr, |
uint32_t * | sockAddr | ||
) |
int gpioCfgPermissions | ( | uint64_t | updateMask | ) |
int gpioCfgSetInternals | ( | uint32_t | cfgVal | ) |
int gpioCfgSocketPort | ( | unsigned | port | ) |
int gpioDeleteScript | ( | unsigned | script_id | ) |
int gpioGetMode | ( | unsigned | gpio | ) |
int gpioGetPad | ( | unsigned | pad | ) |
int gpioGetPWMdutycycle | ( | unsigned | gpio | ) |
int gpioGetPWMfrequency | ( | unsigned | gpio | ) |
int gpioGetPWMrange | ( | unsigned | gpio | ) |
int gpioGetPWMrealRange | ( | unsigned | gpio | ) |
int gpioGetServoPulsewidth | ( | unsigned | gpio | ) |
int gpioGlitchFilter | ( | unsigned | gpio, |
unsigned | steady | ||
) |
int gpioHardwareClock | ( | unsigned | gpio, |
unsigned | frequency | ||
) |
int gpioHardwarePWM | ( | unsigned | gpio, |
unsigned | frequency, | ||
unsigned | dutycycle | ||
) |
unsigned gpioHardwareRevision | ( | void | ) |
int gpioInitialise | ( | void | ) |
int gpioNoiseFilter | ( | unsigned | gpio, |
unsigned | steady, | ||
unsigned | active | ||
) |
int gpioNotifyBegin | ( | unsigned | handle, |
uint32_t | bits | ||
) |
int gpioNotifyClose | ( | unsigned | handle | ) |
int gpioNotifyOpen | ( | void | ) |
static int gpioNotifyOpenInBand | ( | int | fd | ) | [static] |
int gpioNotifyOpenWithSize | ( | int | bufSize | ) |
int gpioNotifyPause | ( | unsigned | handle | ) |
uint32_t gpioRead_Bits_0_31 | ( | void | ) |
uint32_t gpioRead_Bits_32_53 | ( | void | ) |
int gpioRunScript | ( | unsigned | script_id, |
unsigned | numParam, | ||
uint32_t * | param | ||
) |
int gpioScriptStatus | ( | unsigned | script_id, |
uint32_t * | param | ||
) |
int gpioSerialRead | ( | unsigned | gpio, |
void * | buf, | ||
size_t | bufSize | ||
) |
int gpioSerialReadClose | ( | unsigned | gpio | ) |
int gpioSerialReadInvert | ( | unsigned | gpio, |
unsigned | invert | ||
) |
int gpioSerialReadOpen | ( | unsigned | gpio, |
unsigned | baud, | ||
unsigned | data_bits | ||
) |
int gpioSetAlertFunc | ( | unsigned | gpio, |
gpioAlertFunc_t | f | ||
) |
int gpioSetAlertFuncEx | ( | unsigned | gpio, |
gpioAlertFuncEx_t | f, | ||
void * | userdata | ||
) |
int gpioSetGetSamplesFunc | ( | gpioGetSamplesFunc_t | f, |
uint32_t | bits | ||
) |
int gpioSetGetSamplesFuncEx | ( | gpioGetSamplesFuncEx_t | f, |
uint32_t | bits, | ||
void * | userdata | ||
) |
int gpioSetISRFunc | ( | unsigned | gpio, |
unsigned | edge, | ||
int | timeout, | ||
gpioISRFunc_t | f | ||
) |
int gpioSetISRFuncEx | ( | unsigned | gpio, |
unsigned | edge, | ||
int | timeout, | ||
gpioAlertFuncEx_t | f, | ||
void * | userdata | ||
) |
int gpioSetMode | ( | unsigned | gpio, |
unsigned | mode | ||
) |
int gpioSetPad | ( | unsigned | pad, |
unsigned | padStrength | ||
) |
int gpioSetPullUpDown | ( | unsigned | gpio, |
unsigned | pud | ||
) |
int gpioSetPWMfrequency | ( | unsigned | gpio, |
unsigned | frequency | ||
) |
int gpioSetPWMrange | ( | unsigned | gpio, |
unsigned | range | ||
) |
int gpioSetSignalFunc | ( | unsigned | signum, |
gpioSignalFunc_t | f | ||
) |
int gpioSetSignalFuncEx | ( | unsigned | signum, |
gpioSignalFuncEx_t | f, | ||
void * | userdata | ||
) |
int gpioSetTimerFunc | ( | unsigned | id, |
unsigned | millis, | ||
gpioTimerFunc_t | f | ||
) |
int gpioSetTimerFuncEx | ( | unsigned | id, |
unsigned | millis, | ||
gpioTimerFuncEx_t | f, | ||
void * | userdata | ||
) |
int gpioSetWatchdog | ( | unsigned | gpio, |
unsigned | timeout | ||
) |
int gpioSleep | ( | unsigned | timetype, |
int | seconds, | ||
int | micros | ||
) |
pthread_t* gpioStartThread | ( | gpioThreadFunc_t | f, |
void * | userdata | ||
) |
int gpioStopScript | ( | unsigned | script_id | ) |
void gpioStopThread | ( | pthread_t * | pth | ) |
int gpioStoreScript | ( | char * | script | ) |
void gpioTerminate | ( | void | ) |
int gpioTime | ( | unsigned | timetype, |
int * | seconds, | ||
int * | micros | ||
) |
int gpioTrigger | ( | unsigned | gpio, |
unsigned | pulseLen, | ||
unsigned | level | ||
) |
int gpioUpdateScript | ( | unsigned | script_id, |
unsigned | numParam, | ||
uint32_t * | param | ||
) |
unsigned gpioVersion | ( | void | ) |
int gpioWaveAddGeneric | ( | unsigned | numPulses, |
gpioPulse_t * | pulses | ||
) |
int gpioWaveAddNew | ( | void | ) |
int gpioWaveAddSerial | ( | unsigned | gpio, |
unsigned | baud, | ||
unsigned | data_bits, | ||
unsigned | stop_bits, | ||
unsigned | offset, | ||
unsigned | numBytes, | ||
char * | bstr | ||
) |
int gpioWaveChain | ( | char * | buf, |
unsigned | bufSize | ||
) |
int gpioWaveClear | ( | void | ) |
int gpioWaveCreate | ( | void | ) |
int gpioWaveDelete | ( | unsigned | wave_id | ) |
int gpioWaveGetCbs | ( | void | ) |
int gpioWaveGetHighCbs | ( | void | ) |
int gpioWaveGetHighMicros | ( | void | ) |
int gpioWaveGetHighPulses | ( | void | ) |
int gpioWaveGetMaxCbs | ( | void | ) |
int gpioWaveGetMaxMicros | ( | void | ) |
int gpioWaveGetMaxPulses | ( | void | ) |
int gpioWaveGetMicros | ( | void | ) |
int gpioWaveGetPulses | ( | void | ) |
int gpioWaveTxAt | ( | void | ) |
int gpioWaveTxBusy | ( | void | ) |
int gpioWaveTxSend | ( | unsigned | wave_id, |
unsigned | wave_mode | ||
) |
int gpioWaveTxStart | ( | unsigned | wave_mode | ) |
int gpioWaveTxStop | ( | void | ) |
int gpioWrite_Bits_0_31_Clear | ( | uint32_t | bits | ) |
int gpioWrite_Bits_0_31_Set | ( | uint32_t | bits | ) |
int gpioWrite_Bits_32_53_Clear | ( | uint32_t | bits | ) |
int gpioWrite_Bits_32_53_Set | ( | uint32_t | bits | ) |
static void I2C_clock_stretch | ( | wfRx_t * | w | ) | [static] |
int i2cBlockProcessCall | ( | unsigned | handle, |
unsigned | reg, | ||
char * | buf, | ||
unsigned | count | ||
) |
static uint8_t I2CGetByte | ( | wfRx_t * | w, |
int | nack | ||
) | [static] |
int i2cOpen | ( | unsigned | i2cBus, |
unsigned | i2cAddr, | ||
unsigned | i2cFlags | ||
) |
int i2cProcessCall | ( | unsigned | handle, |
unsigned | reg, | ||
unsigned | wVal | ||
) |
static int I2CPutByte | ( | wfRx_t * | w, |
int | byte | ||
) | [static] |
int i2cReadBlockData | ( | unsigned | handle, |
unsigned | reg, | ||
char * | buf | ||
) |
int i2cReadByte | ( | unsigned | handle | ) |
int i2cReadByteData | ( | unsigned | handle, |
unsigned | reg | ||
) |
int i2cReadDevice | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int i2cReadI2CBlockData | ( | unsigned | handle, |
unsigned | reg, | ||
char * | buf, | ||
unsigned | count | ||
) |
int i2cReadWordData | ( | unsigned | handle, |
unsigned | reg | ||
) |
int i2cSegments | ( | unsigned | handle, |
pi_i2c_msg_t * | segs, | ||
unsigned | numSegs | ||
) |
void i2cSwitchCombined | ( | int | setting | ) |
int i2cWriteBlockData | ( | unsigned | handle, |
unsigned | reg, | ||
char * | buf, | ||
unsigned | count | ||
) |
int i2cWriteByte | ( | unsigned | handle, |
unsigned | bVal | ||
) |
int i2cWriteByteData | ( | unsigned | handle, |
unsigned | reg, | ||
unsigned | bVal | ||
) |
int i2cWriteDevice | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int i2cWriteI2CBlockData | ( | unsigned | handle, |
unsigned | reg, | ||
char * | buf, | ||
unsigned | count | ||
) |
int i2cWriteQuick | ( | unsigned | handle, |
unsigned | bit | ||
) |
int i2cWriteWordData | ( | unsigned | handle, |
unsigned | reg, | ||
unsigned | wVal | ||
) |
int i2cZip | ( | unsigned | handle, |
char * | inBuf, | ||
unsigned | inLen, | ||
char * | outBuf, | ||
unsigned | outLen | ||
) |
static int initAllocDMAMem | ( | void | ) | [static] |
static void initCheckLockFile | ( | void | ) | [static] |
static int initCheckPermitted | ( | void | ) | [static] |
static void initClearGlobals | ( | void | ) | [static] |
static void initDMAgo | ( | volatile uint32_t * | dmaAddr, |
uint32_t | cbAddr | ||
) | [static] |
static int initGrabLockFile | ( | void | ) | [static] |
static void initHWClk | ( | int | clkCtl, |
int | clkDiv, | ||
int | clkSrc, | ||
int | divI, | ||
int | divF, | ||
int | MASH | ||
) | [static] |
int initInitialise | ( | void | ) |
static uint32_t* initMapMem | ( | int | fd, |
uint32_t | addr, | ||
uint32_t | len | ||
) | [static] |
static int initMboxBlock | ( | int | block | ) | [static] |
static int initPagemapBlock | ( | int | block | ) | [static] |
static int initPeripherals | ( | void | ) | [static] |
static void initReleaseResources | ( | void | ) | [static] |
static int initZaps | ( | int | pmapFd, |
void * | virtualBase, | ||
int | basePage, | ||
int | pages | ||
) | [static] |
static int intEventSetFunc | ( | unsigned | event, |
void * | f, | ||
int | user, | ||
void * | userdata | ||
) | [static] |
static int intGpioSetAlertFunc | ( | unsigned | gpio, |
void * | f, | ||
int | user, | ||
void * | userdata | ||
) | [static] |
static int intGpioSetISRFunc | ( | unsigned | gpio, |
unsigned | edge, | ||
int | timeout, | ||
void * | f, | ||
int | user, | ||
void * | userdata | ||
) | [static] |
static int intGpioSetTimerFunc | ( | unsigned | id, |
unsigned | millis, | ||
void * | f, | ||
int | user, | ||
void * | userdata | ||
) | [static] |
static void intNotifyBits | ( | void | ) | [static] |
static void intScriptBits | ( | void | ) | [static] |
static void intScriptEventBits | ( | void | ) | [static] |
static unsigned mbAllocateMemory | ( | int | fd, |
unsigned | size, | ||
unsigned | align, | ||
unsigned | flags | ||
) | [static] |
static int mbDMAAlloc | ( | DMAMem_t * | DMAMemP, |
unsigned | size, | ||
uint32_t | pi_mem_flag | ||
) | [static] |
static unsigned mbLockMemory | ( | int | fd, |
unsigned | handle | ||
) | [static] |
static void* mbMapMem | ( | unsigned | base, |
unsigned | size | ||
) | [static] |
static int mbProperty | ( | int | fd, |
void * | buf | ||
) | [static] |
static unsigned mbReleaseMemory | ( | int | fd, |
unsigned | handle | ||
) | [static] |
static unsigned mbUnlockMemory | ( | int | fd, |
unsigned | handle | ||
) | [static] |
static int mbUnmapMem | ( | void * | addr, |
unsigned | size | ||
) | [static] |
static int my_smbus_access | ( | int | fd, |
char | rw, | ||
uint8_t | cmd, | ||
int | size, | ||
union my_smbus_data * | data | ||
) | [static] |
static char* myBuf2Str | ( | unsigned | count, |
char * | buf | ||
) | [static] |
static void myClearGpioOff | ( | unsigned | gpio, |
int | pos | ||
) | [static] |
static void myClearGpioOn | ( | unsigned | gpio, |
int | pos | ||
) | [static] |
static void myCreatePipe | ( | char * | name, |
int | perm | ||
) | [static] |
static int myDoCommand | ( | uint32_t * | p, |
unsigned | bufSize, | ||
char * | buf | ||
) | [static] |
static uint32_t myGetLevel | ( | int | pos | ) | [static] |
static uint32_t myGpioDelay | ( | uint32_t | micros | ) | [static] |
static int myGpioRead | ( | unsigned | gpio | ) | [static] |
static void myGpioSetMode | ( | unsigned | gpio, |
unsigned | mode | ||
) | [static] |
static void myGpioSetPwm | ( | unsigned | gpio, |
int | oldVal, | ||
int | newVal | ||
) | [static] |
static void myGpioSetServo | ( | unsigned | gpio, |
int | oldVal, | ||
int | newVal | ||
) | [static] |
static void myGpioSleep | ( | int | seconds, |
int | micros | ||
) | [static] |
static void myGpioWrite | ( | unsigned | gpio, |
unsigned | level | ||
) | [static] |
static int myI2CGetPar | ( | char * | inBuf, |
int * | inPos, | ||
int | inLen, | ||
int * | esc | ||
) | [static] |
static void myLvsPageSlot | ( | int | pos, |
int * | page, | ||
int * | slot | ||
) | [static] |
static void myOffPageSlot | ( | int | pos, |
int * | page, | ||
int * | slot | ||
) | [static] |
int myScriptNameValid | ( | char * | name | ) |
static void mySetGpioOff | ( | unsigned | gpio, |
int | pos | ||
) | [static] |
static void mySetGpioOn | ( | unsigned | gpio, |
int | pos | ||
) | [static] |
static void myTckPageSlot | ( | int | pos, |
int * | page, | ||
int * | slot | ||
) | [static] |
static char* myTimeStamp | ( | ) | [static] |
static void notifyMutex | ( | int | lock | ) | [static] |
static void* pthAlertThread | ( | void * | x | ) | [static] |
static void* pthFifoThread | ( | void * | x | ) | [static] |
static void* pthISRThread | ( | void * | x | ) | [static] |
static void* pthSocketThread | ( | void * | x | ) | [static] |
static void* pthSocketThreadHandler | ( | void * | fdC | ) | [static] |
static void* pthTimerTick | ( | void * | x | ) | [static] |
void putBitInBytes | ( | int | bitPos, |
char * | buf, | ||
int | bit | ||
) |
void rawDumpScript | ( | unsigned | script_id | ) |
void rawDumpWave | ( | void | ) |
int rawWaveAddGeneric | ( | unsigned | numIn1, |
rawWave_t * | in1 | ||
) |
int rawWaveAddSPI | ( | rawSPI_t * | spi, |
unsigned | offset, | ||
unsigned | spiSS, | ||
char * | buf, | ||
unsigned | spiTxBits, | ||
unsigned | spiBitFirst, | ||
unsigned | spiBitLast, | ||
unsigned | spiBits | ||
) |
rawCbs_t* rawWaveCBAdr | ( | int | cbNum | ) |
uint32_t rawWaveGetIn | ( | int | pos | ) |
uint32_t rawWaveGetOOL | ( | int | pos | ) |
uint32_t rawWaveGetOut | ( | int | pos | ) |
rawWaveInfo_t rawWaveInfo | ( | int | wave_id | ) |
void rawWaveSetIn | ( | int | pos, |
uint32_t | value | ||
) |
void rawWaveSetOOL | ( | int | pos, |
uint32_t | value | ||
) |
void rawWaveSetOut | ( | int | pos, |
uint32_t | value | ||
) |
static int scrEvtWait | ( | gpioScript_t * | s, |
uint32_t | bits | ||
) | [static] |
static int scrPop | ( | gpioScript_t * | s, |
int * | SP, | ||
int * | S | ||
) | [static] |
static void scrPush | ( | gpioScript_t * | s, |
int * | SP, | ||
int * | S, | ||
int | val | ||
) | [static] |
static int scrSys | ( | char * | cmd, |
uint32_t | p1, | ||
uint32_t | p2 | ||
) | [static] |
static int scrWait | ( | gpioScript_t * | s, |
uint32_t | bits | ||
) | [static] |
int serDataAvailable | ( | unsigned | handle | ) |
int serOpen | ( | char * | tty, |
unsigned | serBaud, | ||
unsigned | serFlags | ||
) |
int serRead | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int serReadByte | ( | unsigned | handle | ) |
int serWrite | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int serWriteByte | ( | unsigned | handle, |
unsigned | bVal | ||
) |
static void sigHandler | ( | int | signum | ) | [static] |
static void sigSetHandler | ( | void | ) | [static] |
static int spiAnyOpen | ( | uint32_t | flags | ) | [static] |
static void spiGo | ( | unsigned | speed, |
uint32_t | flags, | ||
char * | txBuf, | ||
char * | rxBuf, | ||
unsigned | count | ||
) | [static] |
static void spiGoA | ( | unsigned | speed, |
uint32_t | flags, | ||
char * | txBuf, | ||
char * | rxBuf, | ||
unsigned | count | ||
) | [static] |
static void spiGoS | ( | unsigned | speed, |
uint32_t | flags, | ||
char * | txBuf, | ||
char * | rxBuf, | ||
unsigned | count | ||
) | [static] |
static void spinWhileStarting | ( | void | ) | [static] |
int spiOpen | ( | unsigned | spiChan, |
unsigned | baud, | ||
unsigned | spiFlags | ||
) |
int spiRead | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int spiWrite | ( | unsigned | handle, |
char * | buf, | ||
unsigned | count | ||
) |
int spiXfer | ( | unsigned | handle, |
char * | txBuf, | ||
char * | rxBuf, | ||
unsigned | count | ||
) |
static void stopHardwarePWM | ( | void | ) | [static] |
static void switchFunctionOff | ( | unsigned | gpio | ) | [static] |
void time_sleep | ( | double | seconds | ) |
static int wave2Cbs | ( | unsigned | wave_mode, |
int * | CB, | ||
int * | BOOL, | ||
int * | TOOL | ||
) | [static] |
static void waveBitDelay | ( | unsigned | baud, |
unsigned | bits, | ||
unsigned | stops, | ||
unsigned * | bitDelay | ||
) | [static] |
static uint32_t waveCbPOadr | ( | int | pos | ) | [static] |
static void waveCBsOOLs | ( | int * | numCBs, |
int * | numBOOLs, | ||
int * | numTOOLs | ||
) | [static] |
static int waveDelayCBs | ( | uint32_t | delay | ) | [static] |
static void waveOOLPageSlot | ( | int | pos, |
int * | page, | ||
int * | slot | ||
) | [static] |
static uint32_t waveOOLPOadr | ( | int | pos | ) | [static] |
static void waveRxBit | ( | int | gpio, |
int | level, | ||
uint32_t | tick | ||
) | [static] |
static void waveRxSerial | ( | wfRx_t * | w, |
int | level, | ||
uint32_t | tick | ||
) | [static] |
static void waveSetOOL | ( | int | pos, |
uint32_t | OOL | ||
) | [static] |
static void wfRx_unlock | ( | int | i | ) | [static] |
unsigned alert_delays[] |
unsigned bufferBlocks [static] |
unsigned bufferCycles [static] |
const uint8_t clkDef[PI_MAX_GPIO+1] [static] |
{ 0x00, 0x00, 0x00, 0x00, 0x84, 0x94, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0xA4, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }
dmaIPage_t* * dmaIBus = MAP_FAILED [static] |
dmaIPage_t* * dmaIVirt = MAP_FAILED [static] |
DMAMem_t* dmaMboxBlk = MAP_FAILED [static] |
dmaOPage_t* * dmaOBus = MAP_FAILED [static] |
dmaOPage_t* * dmaOVirt = MAP_FAILED [static] |
uintptr_t* * dmaPMapBlk = MAP_FAILED [static] |
eventAlert_t eventAlert[PI_MAX_EVENT+1] [static] |
fileInfo_t fileInfo[PI_FILE_SLOTS] [static] |
volatile uint32_t gFilterBits = 0 [static] |
gpioAlert_t gpioAlert[PI_MAX_USER_GPIO+1] [static] |
gpioGetSamples_t gpioGetSamples [static] |
gpioInfo_t gpioInfo[PI_MAX_GPIO+1] [static] |
gpioISR_t gpioISR[PI_MAX_GPIO+1] [static] |
int gpioMaskSet = 0 [static] |
gpioNotify_t gpioNotify[PI_NOTIFY_SLOTS] [static] |
gpioScript_t gpioScript[PI_MAX_SCRIPTS] [static] |
gpioSignal_t gpioSignal[PI_MAX_SIGNUM+1] [static] |
volatile gpioStats_t gpioStats [static] |
gpioTimer_t gpioTimer[PI_MAX_TIMER+1] [static] |
uint32_t hw_clk_freq[3] [static] |
uint32_t hw_pwm_duty[2] [static] |
uint32_t hw_pwm_freq[2] [static] |
uint32_t hw_pwm_real_range[2] [static] |
i2cInfo_t i2cInfo[PI_I2C_SLOTS] [static] |
int libInitialised = 0 [static] |
struct timespec libStarted [static] |
volatile uint32_t monitorBits = 0 [static] |
volatile uint32_t nFilterBits = 0 [static] |
volatile uint32_t notifyBits = 0 [static] |
int numSockNetAddr = 0 [static] |
unsigned old_mode_ace0 [static] |
unsigned old_mode_ace1 [static] |
unsigned old_mode_ace2 [static] |
unsigned old_mode_amiso [static] |
unsigned old_mode_amosi [static] |
unsigned old_mode_asclk [static] |
unsigned old_mode_ce0 [static] |
unsigned old_mode_ce1 [static] |
unsigned old_mode_miso [static] |
unsigned old_mode_mosi [static] |
unsigned old_mode_sclk [static] |
uint32_t old_spi_clk [static] |
uint32_t old_spi_cntl0 [static] |
uint32_t old_spi_cntl1 [static] |
uint32_t old_spi_cs [static] |
volatile uint32_t pi_dram_bus = 0x40000000 [static] |
volatile uint32_t pi_mem_flag = 0x0C [static] |
volatile uint32_t pi_peri_phys = 0x20000000 [static] |
int pthAlertRunning = PI_THREAD_NONE [static] |
int pthFifoRunning = PI_THREAD_NONE [static] |
int pthSocketRunning = PI_THREAD_NONE [static] |
int PWMClockInited = 0 [static] |
const uint8_t PWMDef[PI_MAX_GPIO+1] [static] |
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x94, 0x00, 0x00, 0x00, 0x00, 0x82, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x94, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x95, }
const uint16_t pwmRealRange[PWM_FREQS] [static] |
uint32_t reportedLevel = 0 [static] |
volatile int runState = PI_STARTING [static] |
volatile uint32_t scriptBits = 0 [static] |
volatile uint32_t scriptEventBits = 0 [static] |
serInfo_t serInfo[PI_SER_SLOTS] [static] |
uint32_t sockNetAddr[MAX_CONNECT_ADDRESSES] [static] |
spiInfo_t spiInfo[PI_SPI_SLOTS] [static] |
int waveClockInited = 0 [static] |
uint32_t* waveEndPtr = NULL [static] |
rawWaveInfo_t waveInfo[PI_MAX_WAVES] [static] |
int waveOutBotCB = PI_WAVE_COUNT_PAGES*CBS_PER_OPAGE [static] |
int waveOutBotOOL = PI_WAVE_COUNT_PAGES*OOL_PER_OPAGE [static] |
int waveOutCount = 0 [static] |
int waveOutTopOOL = NUM_WAVE_OOL [static] |
rawWave_t wf[3][PI_WAVE_MAX_PULSES] [static] |
wfRx_t wfRx[PI_MAX_USER_GPIO+1] [static] |
{ 0, 0, PI_WAVE_MAX_MICROS, 0, 0, PI_WAVE_MAX_PULSES, 0, 0, (DMAO_PAGES * CBS_PER_OPAGE) }