NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
nhal_spi_types.h
Go to the documentation of this file.
1
8#ifndef NHAL_SPI_TYPES_H
9#define NHAL_SPI_TYPES_H
10
11#include <stddef.h>
12#include <stdint.h>
13
14#include "nhal_common.h"
15
16typedef uint8_t nhal_spi_bus_id;
17
18
25
30
37
38
46 struct nhal_spi_impl_ctx * impl_ctx;
47
48 // Async extensions handled separately in async context
49};
50
52 const uint8_t *data;
53 size_t data_size;
55};
56
62
69
70#endif /* NHAL_SPI_TYPES_H */
uint8_t nhal_spi_bus_id
nhal_spi_bit_order_t
@ NHAL_SPI_BIT_ORDER_MSB_FIRST
Most significant bit first.
@ NHAL_SPI_BIT_ORDER_LSB_FIRST
Least significant bit first.
nhal_spi_mode_t
@ NHAL_SPI_MODE_2
CPOL=1, CPHA=0: Clock idle high, data sampled on falling edge.
@ NHAL_SPI_MODE_1
CPOL=0, CPHA=1: Clock idle low, data sampled on falling edge.
@ NHAL_SPI_MODE_3
CPOL=1, CPHA=1: Clock idle high, data sampled on rising edge.
@ NHAL_SPI_MODE_0
CPOL=0, CPHA=0: Clock idle low, data sampled on rising edge.
nhal_spi_mode_t mode
uint32_t frequency_hz
nhal_spi_bit_order_t bit_order
struct nhal_spi_impl_config * impl_config
Base SPI context - always present, minimal footprint.
uint32_t actual_frequency_hz
Actual configured frequency (may differ from requested)
nhal_spi_bus_id spi_bus_id
struct nhal_spi_impl_ctx * impl_ctx
struct nhal_spi_config basic_config
uint8_t bits_per_device
Bits per device (must be same for all devices in chain)
uint8_t num_devices
Number of devices in the daisy chain.
struct nhal_spi_context basic_ctx
uint8_t num_devices
Number of devices in the daisy chain.
uint8_t bits_per_device
Bits per device.
size_t total_chain_bits
Total bits in the entire chain.
size_t data_size
Size of data for this device in bytes.
const uint8_t * data
Data buffer for this device.
uint8_t bits_per_device
Number of bits per device (typically 8, 16, or 32)