Interfaces for BL61x GPIO FIFO / Wire Out .
More...
|
| file | gpio_bl61x_wo.h |
| | Bouffalolab BL61x GPIO FIFO / Wire Out device-specific API extension.
|
| |
|
| struct | bl61x_wo_config |
| | Structure holding the configuration for the GPIO FIFO pulse width, polarity, and pins. More...
|
| |
|
| typedef void(* | bl61x_wo_callback_t) (void *user_data) |
| | Callback type used to inform user async write has completed.
|
| |
|
| uint16_t | bl61x_wo_frequency_to_cycles (const uint32_t frequency, const bool exact) |
| | Convert a frequency to WO clock cycles.
|
| |
| uint16_t | bl61x_wo_time_to_cycles (const uint32_t time, const bool exact) |
| | Convert a time to WO clock cycles.
|
| |
| int | bl61x_wo_configure (const struct bl61x_wo_config *const config, const uint8_t *pins, const gpio_flags_t *flags, const size_t pin_cnt) |
| | Configure GPIO FIFO.
|
| |
| int | bl61x_wo_configure_dt (const struct bl61x_wo_config *const config, const struct gpio_dt_spec *pins, const size_t pin_cnt) |
| | Configure GPIO FIFO using devicetree.
|
| |
| int | bl61x_wo_write (const uint16_t *const data, const size_t len) |
| | Write to GPIO FIFO.
|
| |
| int | bl61x_wo_write_async (const uint16_t *const data, const size_t len, bl61x_wo_callback_t cb, void *user_data) |
| | Write to GPIO FIFO Asynchronously.
|
| |
Interfaces for BL61x GPIO FIFO / Wire Out .
- Since
- 4.4
- Version
- 0.1.0
◆ BL61X_WO_PIN_CNT
| #define BL61X_WO_PIN_CNT 16 |
◆ bl61x_wo_callback_t
| typedef void(* bl61x_wo_callback_t) (void *user_data) |
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Callback type used to inform user async write has completed.
This callback is called from IRQ context. WO write cannot fail, only data is provided.
- Parameters
-
| user_data | Pointer to user data provided during callback registration |
◆ bl61x_wo_configure()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Configure GPIO FIFO.
- Parameters
-
| config | Pointer to the configuration structure |
| pins | Up to 16 pins |
| flags | Flags for the pins, will be ored with GPIO_OUTPUT |
| pin_cnt | Number of pins to configure |
- Return values
-
| 0 | On success returns -EINVAL if configuration is invalid, or other error codes. |
◆ bl61x_wo_configure_dt()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Configure GPIO FIFO using devicetree.
- Parameters
-
| config | Pointer to the configuration structure |
| pins | Up to 16 pins |
| pin_cnt | Number of pins to configure |
- Return values
-
| 0 | on success |
| -EINVAL | if configuration is invalid, or other error codes. |
◆ bl61x_wo_frequency_to_cycles()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Convert a frequency to WO clock cycles.
- Parameters
-
| frequency | Frequency in Hz |
| exact | Return 0 instead of closest value when an exact match is not possible |
- Returns
- Number of cycles closest to frequency, or 0.
◆ bl61x_wo_time_to_cycles()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Convert a time to WO clock cycles.
- Parameters
-
| time | time in nanoseconds |
| exact | Return 0 instead of closest value when an exact match is not possible |
- Returns
- Number of cycles closest to time, or 0.
◆ bl61x_wo_write()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Write to GPIO FIFO.
- Parameters
-
| data | Array containing the sequence of toggles |
| len | Length of the array |
- Return values
-
| 0 | on success |
| -EIO | or other error codes. |
◆ bl61x_wo_write_async()
#include <zephyr/drivers/gpio/gpio_bl61x_wo.h>
Write to GPIO FIFO Asynchronously.
- Parameters
-
| data | Array containing the sequence of toggles |
| len | Length of the array |
| cb | Function pointer to completion callback. |
| user_data | Userdata passed to callback. |
- Return values
-
| 0 | on success |
| -EIO | or other error codes. |