![]() |
WL865E4-P
36.07.001
|
This section describes the M2MB APIs to perform various GPIO operations. More...
This section describes the M2MB APIs to perform various GPIO operations.
typedef uint32_t M2MB_GPIO_ID_T |
SoC pin access ID.
This is a unique ID provided by the module to the client. Clients must pass this ID as a token with subsequent calls. Note that the clients should cache the ID.
Definition at line 91 of file m2mb_gpio.h.
typedef enum M2MB_GPIO_IOCTL_REQUEST M2MB_GPIO_IOCTL_REQUEST_T |
typedef uint32_t M2MB_GPIO_PIN_T |
Definition at line 93 of file m2mb_gpio.h.
typedef uint32_t M2MB_GPIOINT_CALLBACK_DATA_T |
GPIO interrupt callback data type.
This is the data type of the argument passed into the callback that is registered with the GPIO interrupt module. The value to pass will be given by the client at registration time.
Definition at line 218 of file m2mb_gpio.h.
typedef void(* M2MB_GPIOINT_CB_T) (M2MB_GPIOINT_CALLBACK_DATA_T) |
GPIO interrupt callback function definition.
GPIO interrupt clients will pass a function pointer of this format into the registration API.
Definition at line 226 of file m2mb_gpio.h.
typedef void* M2MB_GPIOINT_ID_T |
Definition at line 95 of file m2mb_gpio.h.
typedef enum M2MB_GPIOINT_IOCTL_REQUEST M2MB_GPIOINT_IOCTL_REQUEST_T |
typedef uint32_t M2MB_GPIOINT_PIN_T |
GPIO pin no.
This is a GPIO pin no to be configured for Interrupt
Definition at line 101 of file m2mb_gpio.h.
Pin direction enumeration, which is used to specify the direction while configuring a GPIO pin.
Enumerator | |
---|---|
M2MB_GPIO_INPUT_E | Specify pin as an INPUT to the SoC. |
M2MB_GPIO_OUTPUT_E | Specify pin as an OUTPUT to the SoC. |
M2MB_GPIO_INVALID_DIR_E |
Definition at line 107 of file m2mb_gpio.h.
enum M2MB_GPIO_DRIVE_T |
GPIO pin drive strength.
This enumeration specifies the drive strength to use when specifying the configuration of a GPIO pin.
Enumerator | |
---|---|
M2MB_GPIO_1P6MA_E | Specify a 1.6 mA drive. |
M2MB_GPIO_2P7MA_E | Specify a 2.7 mA drive. |
M2MB_GPIO_4P0MA_E | Specify a 4.0 mA drive. |
M2MB_GPIO_INVALID_STRENGTH_E | Placeholder - Do not use |
Definition at line 138 of file m2mb_gpio.h.
Enumerator | |
---|---|
M2MB_GPIO_IOCTL_SET_CFG | set gpio device configuration |
M2MB_GPIO_IOCTL_GET_CFG | get gpio device configuration |
Definition at line 57 of file m2mb_gpio.h.
enum M2MB_GPIO_PULL_T |
GPIO pin pull type.
This enumeration specifies the type of pull (if any) to use when specifying the configuration for a GPIO pin.
Enumerator | |
---|---|
M2MB_GPIO_NO_PULL_E | Specify no pull. |
M2MB_GPIO_PULL_DOWN_E | Pull the GPIO down. |
M2MB_GPIO_PULL_UP_E | Pull the GPIO up. |
M2MB_GPIO_INVALID_PULL_E |
Definition at line 122 of file m2mb_gpio.h.
enum M2MB_GPIO_VALUE_T |
GPIO output state specification.
This enumeration specifies the value to write to a GPIO pin configured as an OUTPUT. This functionality is also known as bit banging.
Enumerator | |
---|---|
M2MB_GPIO_LOW_VALUE_E | Drive the output |
M2MB_GPIO_HIGH_VALUE_E | Drive the output |
M2MB_GPIO_INVALID_VALUE_E |
Definition at line 154 of file m2mb_gpio.h.
GPIO Interrupt Maskable type enumeration, which is used to specify if the GPIO interrupt is Maskable or not.
Enumerator | |
---|---|
M2MB_GPIOINT_INTERRUPT_MASKABLE_E | Interrupt is Makable. |
M2MB_GPIOINT_INTERRUPT_NONMASKABLE_E | Interrupt is Non-Makable. |
M2MB_GPIOINT_INTERRUPT_MASK_INVALID_E | Placeholder - Do not use |
Definition at line 200 of file m2mb_gpio.h.
GPIO Interrupt Priority type enumeration, which is used to specify the different level of the interrupt in the GPIO interrupt.
Definition at line 184 of file m2mb_gpio.h.
Definition at line 63 of file m2mb_gpio.h.
GPIO Trigger type enumeration, which is used to specify the trigger type to be used in the GPIO pin interrupt.
Definition at line 168 of file m2mb_gpio.h.
Closes a GPIO port.
This API closes the requested GPIO port
[in] | fd | File Descriptor of GPIO port |
Example
INT32 m2mb_gpio_ioctl | ( | INT32 | fd, |
M2MB_GPIO_IOCTL_REQUEST_T | request, | ||
... | |||
) |
Configure the GPIO port.
This API set/get the GPIO port configuration
[in] | fd | File Descriptor of GPIO port |
[in] | request | required operation set/get configuration(see M2MB_GPIO_IOCTL_REQUEST) |
Example
Open a GPIO port.
This API opens the requested GPIO port
[in] | path | Pointer to GPIO device to open |
[in] | flags | Currently unused |
Example
Read the GPIO port.
This API reads the data byte from the GPIO port
[in] | fd | File Descriptor of GPIO port |
[in,out] | buf | reference to the data to be read |
[in] | nbyte | number of data bytes to be read (always 1 byte) |
Example
Write to GPIO port.
This API writes the data byte to the GPIO port
[in] | fd | File Descriptor of GPIO port |
[in] | buf | reference to the data to be written |
[in] | nbyte | number of data bytes to be write (always 1 byte) |
Example
Closes a GPIO port.
This API closes the requested interrupt enabledGPIO port
[in] | fd | File Descriptor of GPIO port |
Example
INT32 m2mb_gpioint_ioctl | ( | INT32 | fd, |
M2MB_GPIOINT_IOCTL_REQUEST_T | request, | ||
... | |||
) |
Configure the GPIO port.
This API set/get the GPIO port Interrupt configuration
[in] | fd | File Descriptor of GPIO port |
[in] | request | required operation set/get configuration(see M2MB_GPIOINT_IOCTL_REQUEST) |
Example
Open a GPIO port and enable the interrupt.
This API opens the requested GPIO port as input with the required configuration and enables the Interrupt
[in] | path | pointer to GPIO device to open |
[in] | cfg | configuration to be configured |
Example