b125dd33b9
Add a .clang-format file to the LLCC68 submodule so it can be formatted consistently when edited or checked out independently from the parent repository. Reformat the tracked C and C++ driver sources with the shared style configuration.
50 lines
1.2 KiB
C
50 lines
1.2 KiB
C
#ifndef BD6F9621_EF52_430C_86CB_3BC688233342
|
|
#define BD6F9621_EF52_430C_86CB_3BC688233342
|
|
|
|
#include <zephyr/drivers/gpio.h>
|
|
#include <zephyr/drivers/spi.h>
|
|
#include <zephyr/types.h>
|
|
#include <stddef.h>
|
|
|
|
#define LLCC68_MAX_BUFFER_PAYLOAD CONFIG_LLCC68_MAX_PAYLOAD_LENGTH
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef void (*llcc68_user_dio1_handler_t)(const struct device *dev, void *user_data);
|
|
|
|
enum llcc68_rf_switch_mode {
|
|
LLCC68_RF_SWITCH_NONE = 0,
|
|
LLCC68_RF_SWITCH_GPIO_COMPLEMENTARY = 1,
|
|
LLCC68_RF_SWITCH_DIO2_SINGLE = 2,
|
|
};
|
|
|
|
struct llcc68_config {
|
|
struct spi_dt_spec spi;
|
|
struct gpio_dt_spec reset_gpio;
|
|
struct gpio_dt_spec busy_gpio;
|
|
struct gpio_dt_spec dio1_gpio;
|
|
struct gpio_dt_spec tx_enable_gpio;
|
|
struct gpio_dt_spec rx_enable_gpio;
|
|
enum llcc68_rf_switch_mode rf_switch_mode;
|
|
};
|
|
|
|
struct llcc68_data {
|
|
struct gpio_callback dio1_irq_callback;
|
|
const struct device *self;
|
|
uint8_t tx_buffer[LLCC68_MAX_BUFFER_PAYLOAD + 4];
|
|
uint8_t rx_buffer[LLCC68_MAX_BUFFER_PAYLOAD + 4];
|
|
size_t tx_xfer_size;
|
|
llcc68_user_dio1_handler_t dio1_user_handler;
|
|
void *dio1_user_data;
|
|
};
|
|
|
|
int llcc68_init(const struct device *dev);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BD6F9621_EF52_430C_86CB_3BC688233342 */
|