Bridle API 4.1.99
A Zephyr based application framework
Loading...
Searching...
No Matches
sc18is604_emul.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <zephyr/drivers/emul.h>

Go to the source code of this file.

Data Structures

struct  mfd_sc18is604_emul_transmission
 

Macros

#define SC18IS604_BUFFER_SIZE   255
 

Functions

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.
 

Macro Definition Documentation

◆ SC18IS604_BUFFER_SIZE

#define SC18IS604_BUFFER_SIZE   255

Function Documentation

◆ mfd_sc18is604_emul_gpio_get_output()

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.

Parameters
targetThe emulated device to get the pin value from.
pinThe pin to get the value of.
[out]valueThe value of the pin.
Returns
0 On success.
A negative error code on failure.

◆ mfd_sc18is604_emul_gpio_set_input()

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.

Parameters
targetThe emulated device to set the pin on.
pinThe pin to set.
valueThe value to set the pin to.
Returns
0 On success.
A negative error code on failure.

◆ mfd_sc18is604_emul_i2c_get_last_tx()

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.

Parameters
targetThe amulated device to get the last transmission from.
[out]transmissionThe transmission to fill with the last transmission.
Return values
0On success
Returns
A negative error code on failure.

◆ mfd_sc18is604_emul_i2c_set_rx()

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.

Parameters
targetThe emulated device to receive the message.
bufThe message to receive.
lenThe length of the message.
Returns
The number of bytes received, or a negative error code on failure.