Documentation ¶
Overview ¶
Package sys wraps necessary linux syscalls to implement GPIO interface.
Index ¶
Constants ¶
View Source
const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 GPIO_GET_LINEINFO_IOCTL = 0xc048b402 GPIO_GET_LINEHANDLE_IOCTL = 0xc16cb403 GPIOHANDLE_SET_LINE_VALUES_IOCTL = 0xc040b409 GPIOHANDLE_GET_LINE_VALUES_IOCTL = 0xc040b408 GPIO_GET_LINEEVENT_IOCTL = 0xc030b404 )
View Source
const ( GPIOLINE_FLAG_KERNEL = 1 << 0 GPIOLINE_FLAG_IS_OUT = 1 << 1 GPIOLINE_FLAG_ACTIVE_LOW = 1 << 2 GPIOLINE_FLAG_OPEN_DRAIN = 1 << 3 GPIOLINE_FLAG_OPEN_SOURCE = 1 << 4 )
View Source
const ( GPIOHANDLE_REQUEST_INPUT = 1 << 0 GPIOHANDLE_REQUEST_OUTPUT = 1 << 1 GPIOHANDLE_REQUEST_ACTIVE_LOW = 1 << 2 GPIOHANDLE_REQUEST_OPEN_DRAIN = 1 << 3 GPIOHANDLE_REQUEST_OPEN_SOURCE = 1 << 4 )
https://www.kernel.org/doc/Documentation/gpio/gpio.txt https://embeddedartistry.com/blog/2018/6/4/demystifying-microcontroller-gpio-settings#open-drain-output
View Source
const ( GPIOEVENT_REQUEST_RISING_EDGE = 1 << 0 GPIOEVENT_REQUEST_FALLING_EDGE = 1 << 1 GPIOEVENT_REQUEST_BOTH_EDGES = GPIOEVENT_REQUEST_RISING_EDGE | GPIOEVENT_REQUEST_FALLING_EDGE )
View Source
const ( GPIOEVENT_EVENT_RISING_EDGE = 0x01 GPIOEVENT_EVENT_FALLING_EDGE = 0x02 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GPIOChipInfo ¶
gpiochip_info
type GPIOEventData ¶
gpioevent_data
type GPIOEventRequest ¶
type GPIOEventRequest struct { LineOffset uint32 HandleFlags uint32 EventFlags uint32 ConsumerLabel [32]byte Fd int32 }
gpioevent_request
Click to show internal directories.
Click to hide internal directories.