NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
Functions
nhal_i2c_master.h File Reference

Hardware Abstraction Layer for synchronous I2C Master mode communication. More...

#include <stdint.h>
#include <stddef.h>
#include "nhal_common.h"
#include "nhal_i2c_types.h"

Go to the source code of this file.

Functions

nhal_result_t nhal_i2c_master_init (struct nhal_i2c_context *ctx)
 
nhal_result_t nhal_i2c_master_deinit (struct nhal_i2c_context *ctx)
 
nhal_result_t nhal_i2c_master_set_config (struct nhal_i2c_context *ctx, struct nhal_i2c_config *config)
 
nhal_result_t nhal_i2c_master_get_config (struct nhal_i2c_context *ctx, struct nhal_i2c_config *config)
 
nhal_result_t nhal_i2c_master_write (struct nhal_i2c_context *ctx, nhal_i2c_address dev_address, const uint8_t *data, size_t len)
 
nhal_result_t nhal_i2c_master_read (struct nhal_i2c_context *ctx, nhal_i2c_address dev_address, uint8_t *data, size_t len)
 
nhal_result_t nhal_i2c_master_write_read_reg (struct nhal_i2c_context *ctx, nhal_i2c_address dev_address, const uint8_t *reg_address, size_t reg_len, uint8_t *data, size_t data_len)
 

Detailed Description

Hardware Abstraction Layer for synchronous I2C Master mode communication.

This file defines the API for interacting with an I2C bus in master mode. It provides functions for initialization, configuration, reading, writing, and combined operations using synchronous blocking transfers.

Synchronous mode provides blocking operations with automatic transfer optimization. The HAL automatically selects the best transfer method (CPU vs DMA) based on transfer size and hardware capabilities - applications don't need to know. All operations block until completion or timeout.

Note
For non-blocking asynchronous operations, see nhal_i2c_master_async.h

Definition in file nhal_i2c_master.h.

Function Documentation

◆ nhal_i2c_master_deinit()

nhal_result_t nhal_i2c_master_deinit ( struct nhal_i2c_context ctx)

◆ nhal_i2c_master_get_config()

nhal_result_t nhal_i2c_master_get_config ( struct nhal_i2c_context ctx,
struct nhal_i2c_config config 
)

◆ nhal_i2c_master_init()

nhal_result_t nhal_i2c_master_init ( struct nhal_i2c_context ctx)

◆ nhal_i2c_master_read()

nhal_result_t nhal_i2c_master_read ( struct nhal_i2c_context ctx,
nhal_i2c_address  dev_address,
uint8_t *  data,
size_t  len 
)

◆ nhal_i2c_master_set_config()

nhal_result_t nhal_i2c_master_set_config ( struct nhal_i2c_context ctx,
struct nhal_i2c_config config 
)

◆ nhal_i2c_master_write()

nhal_result_t nhal_i2c_master_write ( struct nhal_i2c_context ctx,
nhal_i2c_address  dev_address,
const uint8_t *  data,
size_t  len 
)

◆ nhal_i2c_master_write_read_reg()

nhal_result_t nhal_i2c_master_write_read_reg ( struct nhal_i2c_context ctx,
nhal_i2c_address  dev_address,
const uint8_t *  reg_address,
size_t  reg_len,
uint8_t *  data,
size_t  data_len 
)