NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
|
Hardware Abstraction Layer for SPI daisy chain communication. More...
Go to the source code of this file.
Functions | |
nhal_result_t | nhal_spi_daisy_init (struct nhal_spi_daisy_context *daisy_ctx) |
Initialize SPI daisy chain context. | |
nhal_result_t | nhal_spi_daisy_deinit (struct nhal_spi_daisy_context *daisy_ctx) |
Deinitialize SPI daisy chain context. | |
nhal_result_t | nhal_spi_daisy_set_config (struct nhal_spi_daisy_context *daisy_ctx, struct nhal_spi_daisy_config *config) |
Set SPI daisy chain configuration. | |
nhal_result_t | nhal_spi_daisy_get_config (struct nhal_spi_daisy_context *daisy_ctx, struct nhal_spi_daisy_config *config) |
Get current SPI daisy chain configuration. | |
nhal_result_t | nhal_spi_daisy_write_chain (struct nhal_spi_daisy_context *daisy_ctx, const struct nhal_spi_daisy_device *devices, size_t num_devices) |
Write data to daisy chain with per-device data specification. | |
nhal_result_t | nhal_spi_daisy_read_chain (struct nhal_spi_daisy_context *daisy_ctx, struct nhal_spi_daisy_device *devices, size_t num_devices) |
Read data from daisy chain with per-device data specification. | |
nhal_result_t | nhal_spi_daisy_write_uniform (struct nhal_spi_daisy_context *daisy_ctx, const uint8_t *data, size_t data_per_device) |
Write uniform data to all devices in daisy chain. | |
nhal_result_t | nhal_spi_daisy_read_uniform (struct nhal_spi_daisy_context *daisy_ctx, uint8_t *data, size_t data_per_device) |
Read uniform data from all devices in daisy chain. | |
Hardware Abstraction Layer for SPI daisy chain communication.
This file defines the API for interacting with SPI devices connected in a daisy chain configuration. In daisy chain mode, devices are connected MOSI->Device1_MISO->Device2_MISO->... with a shared clock and chip select, forming a single large shift register.
Definition in file nhal_spi_daisy_chain.h.
nhal_result_t nhal_spi_daisy_deinit | ( | struct nhal_spi_daisy_context * | daisy_ctx | ) |
Deinitialize SPI daisy chain context.
daisy_ctx | Pointer to SPI daisy chain context structure |
nhal_result_t nhal_spi_daisy_get_config | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
struct nhal_spi_daisy_config * | config | ||
) |
Get current SPI daisy chain configuration.
daisy_ctx | Pointer to SPI daisy chain context structure |
config | Pointer to daisy chain configuration structure to fill |
nhal_result_t nhal_spi_daisy_init | ( | struct nhal_spi_daisy_context * | daisy_ctx | ) |
Initialize SPI daisy chain context.
daisy_ctx | Pointer to SPI daisy chain context structure |
nhal_result_t nhal_spi_daisy_read_chain | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
struct nhal_spi_daisy_device * | devices, | ||
size_t | num_devices | ||
) |
Read data from daisy chain with per-device data specification.
daisy_ctx | Pointer to SPI daisy chain context structure |
devices | Array of device structures to receive data from each device |
num_devices | Number of devices in the chain |
timeout | Timeout in milliseconds |
nhal_result_t nhal_spi_daisy_read_uniform | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
uint8_t * | data, | ||
size_t | data_per_device | ||
) |
Read uniform data from all devices in daisy chain.
daisy_ctx | Pointer to SPI daisy chain context structure |
data | Pointer to buffer for received data from all devices |
data_per_device | Number of bytes to read from each device |
timeout | Timeout in milliseconds |
nhal_result_t nhal_spi_daisy_set_config | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
struct nhal_spi_daisy_config * | config | ||
) |
Set SPI daisy chain configuration.
daisy_ctx | Pointer to SPI daisy chain context structure |
config | Pointer to daisy chain configuration structure |
nhal_result_t nhal_spi_daisy_write_chain | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
const struct nhal_spi_daisy_device * | devices, | ||
size_t | num_devices | ||
) |
Write data to daisy chain with per-device data specification.
daisy_ctx | Pointer to SPI daisy chain context structure |
devices | Array of device structures containing data for each device |
num_devices | Number of devices in the chain |
timeout | Timeout in milliseconds |
nhal_result_t nhal_spi_daisy_write_uniform | ( | struct nhal_spi_daisy_context * | daisy_ctx, |
const uint8_t * | data, | ||
size_t | data_per_device | ||
) |
Write uniform data to all devices in daisy chain.
daisy_ctx | Pointer to SPI daisy chain context structure |
data | Pointer to data to write to each device |
data_per_device | Number of bytes to write to each device |
timeout | Timeout in milliseconds |