Zephyr Project API 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Bouffalolab BL61x GPIO FIFO / Wire Out

Interfaces for BL61x GPIO FIFO / Wire Out. More...

Files

file  gpio_bl61x_wo.h
 Bouffalolab BL61x GPIO FIFO / Wire Out device-specific API extension.

Data Structures

struct  bl61x_wo_config
 Structure holding the configuration for the GPIO FIFO pulse width, polarity, and pins. More...

Macros

#define BL61X_WO_PIN_CNT   16
 Maximum number of pin toggled at the same time.

Typedefs

typedef void(* bl61x_wo_callback_t) (void *user_data)
 Callback type used to inform user async write has completed.

Functions

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.

Detailed Description

Interfaces for BL61x GPIO FIFO / Wire Out.

Since
4.4
Version
0.1.0

Macro Definition Documentation

◆ BL61X_WO_PIN_CNT

#define BL61X_WO_PIN_CNT   16

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Maximum number of pin toggled at the same time.

Typedef Documentation

◆ bl61x_wo_callback_t

typedef void(* bl61x_wo_callback_t) (void *user_data)

#include </__w/bridle/bridle/workspace/zephyr/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_dataPointer to user data provided during callback registration

Function Documentation

◆ bl61x_wo_configure()

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 )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Configure GPIO FIFO.

Parameters
configPointer to the configuration structure
pinsUp to 16 pins
flagsFlags for the pins, will be ored with GPIO_OUTPUT
pin_cntNumber of pins to configure
Return values
0On success returns -EINVAL if configuration is invalid, or other error codes.

◆ bl61x_wo_configure_dt()

int bl61x_wo_configure_dt ( const struct bl61x_wo_config *const config,
const struct gpio_dt_spec * pins,
const size_t pin_cnt )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Configure GPIO FIFO using devicetree.

Parameters
configPointer to the configuration structure
pinsUp to 16 pins
pin_cntNumber of pins to configure
Return values
0on success
-EINVALif configuration is invalid, or other error codes.

◆ bl61x_wo_frequency_to_cycles()

uint16_t bl61x_wo_frequency_to_cycles ( const uint32_t frequency,
const bool exact )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Convert a frequency to WO clock cycles.

Parameters
frequencyFrequency in Hz
exactReturn 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()

uint16_t bl61x_wo_time_to_cycles ( const uint32_t time,
const bool exact )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Convert a time to WO clock cycles.

Parameters
timetime in nanoseconds
exactReturn 0 instead of closest value when an exact match is not possible
Returns
Number of cycles closest to time, or 0.

◆ bl61x_wo_write()

int bl61x_wo_write ( const uint16_t *const data,
const size_t len )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Write to GPIO FIFO.

Parameters
dataArray containing the sequence of toggles
lenLength of the array
Return values
0on success
-EIOor other error codes.

◆ bl61x_wo_write_async()

int bl61x_wo_write_async ( const uint16_t *const data,
const size_t len,
bl61x_wo_callback_t cb,
void * user_data )

#include </__w/bridle/bridle/workspace/zephyr/include/zephyr/drivers/gpio/gpio_bl61x_wo.h>

Write to GPIO FIFO Asynchronously.

Parameters
dataArray containing the sequence of toggles
lenLength of the array
cbFunction pointer to completion callback.
user_dataUserdata passed to callback.
Return values
0on success
-EIOor other error codes.