Bridle API 4.1.99
A Zephyr based application framework
|
#include <stdint.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/gpio/gpio_emul.h>
#include <zephyr/drivers/mfd/sc18is604.h>
#include <zephyr/drivers/mfd/sc18is604_emul.h>
#include "mfd_sc18is604.h"
#include <zephyr/logging/log.h>
Data Structures | |
struct | mfd_sc18is604_emul_data |
struct | mfd_sc18is604_emul_config |
Macros | |
#define | DT_DRV_COMPAT nxp_sc18is604 |
#define | SC18IS604_N_REGISTERS 6 /* 0x00 through 0x05 */ |
#define | MFD_SC18IS604_EMUL_DEFINE(inst) |
Functions | |
LOG_MODULE_REGISTER (mfd_sc18is604_emul, CONFIG_MFD_LOG_LEVEL) | |
int | mfd_sc18is604_emul_i2c_set_rx (const struct emul *target, uint8_t *buf, size_t len) |
Simulate the device receiving a message. | |
int | mfd_sc18is604_emul_i2c_get_last_tx (const struct emul *target, struct mfd_sc18is604_emul_transmission *transmission) |
Get the last transmission sent by the device. | |
int | mfd_sc18is604_emul_gpio_set_input (const struct emul *target, uint8_t pin, uint8_t value) |
Simulate a GPIO input pin being set to a specific value. | |
int | mfd_sc18is604_emul_gpio_get_output (const struct emul *target, uint8_t pin, uint8_t *value) |
Get the value of a GPIO output pin. | |
static void | mfd_sc18is604_emul_version_string_into_rx_buffer (const struct emul *target) |
static void | mfd_sc18is604_get_rx_buffer (const struct emul *target, uint8_t *rx_buf, size_t len) |
static uint8_t | mfd_sc18is604_get_register (const struct emul *target, uint8_t reg) |
static void | mfd_sc18is604_set_register (const struct emul *target, uint8_t reg, uint8_t val) |
static void | mfd_sc18is604_emul_read_i2c (const struct emul *target, size_t len) |
static void | mfd_sc18is604_emul_write_i2c (const struct emul *target, uint8_t addr, const uint8_t *msg, size_t len) |
static int | mfd_sc18is604_emul_io_spi (const struct emul *target, const struct spi_config *config, const struct spi_buf_set *tx_bufs, const struct spi_buf_set *rx_bufs) |
static int | mfd_sc18is604_emul_init (const struct emul *target, const struct device *parent) |
DT_INST_FOREACH_STATUS_OKAY (MFD_SC18IS604_EMUL_DEFINE) | |
Variables | |
static const uint8_t | sc18is604_reg_defaults [6] |
static struct spi_emul_api | mfd_sc18is604_emul_api |
#define DT_DRV_COMPAT nxp_sc18is604 |
#define MFD_SC18IS604_EMUL_DEFINE | ( | inst | ) |
#define SC18IS604_N_REGISTERS 6 /* 0x00 through 0x05 */ |
DT_INST_FOREACH_STATUS_OKAY | ( | MFD_SC18IS604_EMUL_DEFINE | ) |
LOG_MODULE_REGISTER | ( | mfd_sc18is604_emul | , |
CONFIG_MFD_LOG_LEVEL | |||
) |
int mfd_sc18is604_emul_gpio_get_output | ( | const struct emul * | target, |
uint8_t | pin, | ||
uint8_t * | value | ||
) |
Get the value of a GPIO output pin.
target | The emulated device to get the pin value from. | |
pin | The pin to get the value of. | |
[out] | value | The value of the pin. |
int mfd_sc18is604_emul_gpio_set_input | ( | const struct emul * | target, |
uint8_t | pin, | ||
uint8_t | value | ||
) |
Simulate a GPIO input pin being set to a specific value.
target | The emulated device to set the pin on. |
pin | The pin to set. |
value | The value to set the pin to. |
int mfd_sc18is604_emul_i2c_get_last_tx | ( | const struct emul * | target, |
struct mfd_sc18is604_emul_transmission * | transmission | ||
) |
Get the last transmission sent by the device.
target | The amulated device to get the last transmission from. | |
[out] | transmission | The transmission to fill with the last transmission. |
0 | On success |
int mfd_sc18is604_emul_i2c_set_rx | ( | const struct emul * | target, |
uint8_t * | buf, | ||
size_t | len | ||
) |
Simulate the device receiving a message.
The message will be moved to the RX buffer the next time a read is performed.
target | The emulated device to receive the message. |
buf | The message to receive. |
len | The length of the message. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |