NHAL Interface
v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
include
nhal_i2c_master.h
Go to the documentation of this file.
1
16
#ifndef NHAL_I2C_MASTER_H
17
#define NHAL_I2C_MASTER_H
18
19
#include <stdint.h>
20
#include <stddef.h>
21
22
#include "
nhal_common.h
"
23
#include "
nhal_i2c_types.h
"
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
nhal_result_t
nhal_i2c_master_init
(
struct
nhal_i2c_context
* ctx);
30
nhal_result_t
nhal_i2c_master_deinit
(
struct
nhal_i2c_context
*ctx);
31
nhal_result_t
nhal_i2c_master_set_config
(
struct
nhal_i2c_context
*ctx,
struct
nhal_i2c_config
*config);
32
nhal_result_t
nhal_i2c_master_get_config
(
struct
nhal_i2c_context
*ctx,
struct
nhal_i2c_config
*config);
33
34
nhal_result_t
nhal_i2c_master_write
(
35
struct
nhal_i2c_context
*ctx,
36
nhal_i2c_address
dev_address,
37
const
uint8_t *data,
size_t
len
38
);
39
40
nhal_result_t
nhal_i2c_master_read
(
41
struct
nhal_i2c_context
*ctx,
42
nhal_i2c_address
dev_address,
43
uint8_t *data,
size_t
len
44
);
45
46
nhal_result_t
nhal_i2c_master_write_read_reg
(
47
struct
nhal_i2c_context
*ctx,
48
nhal_i2c_address
dev_address,
49
const
uint8_t *reg_address,
size_t
reg_len,
50
uint8_t *data,
size_t
data_len
51
);
52
53
#ifdef __cplusplus
54
}
55
#endif
56
57
#endif
nhal_common.h
nhal_result_t
nhal_result_t
Unified HAL result type for all peripheral operations.
Definition
nhal_common.h:22
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_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_get_config
nhal_result_t nhal_i2c_master_get_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)
nhal_i2c_master_init
nhal_result_t nhal_i2c_master_init(struct nhal_i2c_context *ctx)
nhal_i2c_master_deinit
nhal_result_t nhal_i2c_master_deinit(struct nhal_i2c_context *ctx)
nhal_i2c_types.h
Defines common types and structures for the I2C Hardware Abstraction Layer (HAL).
nhal_i2c_address
uint16_t nhal_i2c_address
Definition
nhal_i2c_types.h:17
nhal_i2c_config
Definition
nhal_i2c_types.h:19
nhal_i2c_context
Base I2C context - always present, minimal footprint.
Definition
nhal_i2c_types.h:27
Generated by
1.9.8