NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
Data Fields
nhal_i2c_transfer_op_t Struct Reference

Structure describing a single I2C message segment within a transaction. More...

#include <nhal_i2c_types.h>

Data Fields

nhal_i2c_address address
 7-bit or 10-bit address for this message segment.
 
uint16_t flags
 Combination of nhal_i2c_transfer_bit_flags_t for this segment.
 
union { 
 
   struct { 
 
      uint8_t *   buffer 
 Pointer to buffer for received data (must be writable). More...
 
      size_t   length 
 Number of bytes to read into the buffer. More...
 
   }   read 
 Parameters for I2C read operations. More...
 
   struct { 
 
      const uint8_t *   bytes 
 Pointer to data to send (must be readable). More...
 
      size_t   length 
 Number of bytes to write from the bytes. More...
 
   }   write 
 Parameters for I2C write operations. More...
 
};  
 Union to hold data specific to either a read or a write operation.
 

Detailed Description

Structure describing a single I2C message segment within a transaction.

A full I2C transaction can consist of one or more such messages.

Definition at line 52 of file nhal_i2c_types.h.

Field Documentation

◆ [union]

union { ... } nhal_i2c_transfer_op_t

Union to hold data specific to either a read or a write operation.

Only one of these members should be accessed based on the flags.

◆ address

nhal_i2c_address nhal_i2c_transfer_op_t::address

7-bit or 10-bit address for this message segment.

The high bit (0x80) is not used for 7-bit addresses here; it's strictly the 7-bit address (0-127).

Definition at line 53 of file nhal_i2c_types.h.

◆ buffer

uint8_t* nhal_i2c_transfer_op_t::buffer

Pointer to buffer for received data (must be writable).

Definition at line 67 of file nhal_i2c_types.h.

◆ bytes

const uint8_t* nhal_i2c_transfer_op_t::bytes

Pointer to data to send (must be readable).

Definition at line 74 of file nhal_i2c_types.h.

◆ flags

uint16_t nhal_i2c_transfer_op_t::flags

Combination of nhal_i2c_transfer_bit_flags_t for this segment.

Definition at line 56 of file nhal_i2c_types.h.

◆ length

size_t nhal_i2c_transfer_op_t::length

Number of bytes to read into the buffer.

Number of bytes to write from the bytes.

Definition at line 68 of file nhal_i2c_types.h.

◆ [struct]

struct { ... } nhal_i2c_transfer_op_t::read

Parameters for I2C read operations.

◆ [struct]

struct { ... } nhal_i2c_transfer_op_t::write

Parameters for I2C write operations.


The documentation for this struct was generated from the following file: