OPTIGA™ Trust M
Host Library Documentation
pal_i2c.h
Go to the documentation of this file.
1 
39 #ifndef _PAL_I2C_H_
40 #define _PAL_I2C_H_
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #include "pal.h"
47 
49 #define PAL_I2C_EVENT_SUCCESS (0x0000)
50 #define PAL_I2C_EVENT_ERROR (0x0001)
52 #define PAL_I2C_EVENT_BUSY (0x0002)
54 
56 typedef struct pal_i2c
57 {
61  uint8_t slave_address;
66 
68 
98 LIBRARY_EXPORTS pal_status_t pal_i2c_init(const pal_i2c_t * p_i2c_context);
99 
133 LIBRARY_EXPORTS pal_status_t pal_i2c_set_bitrate(const pal_i2c_t * p_i2c_context, uint16_t bitrate);
134 
170 LIBRARY_EXPORTS pal_status_t pal_i2c_write(const pal_i2c_t * p_i2c_context, uint8_t * p_data, uint16_t length);
171 
204 LIBRARY_EXPORTS pal_status_t pal_i2c_read(const pal_i2c_t * p_i2c_context, uint8_t * p_data, uint16_t length);
205 
233 LIBRARY_EXPORTS pal_status_t pal_i2c_deinit(const pal_i2c_t * p_i2c_context);
234 
235 #ifdef __cplusplus
236 }
237 #endif
238 
239 #endif /* _PAL_I2C_H_ */
240 
pal_status_t
uint16_t pal_status_t
PAL return status.
Definition: examples/tools/protected_update_data_set/include/pal/pal_crypt.h:54
pal_i2c_write
LIBRARY_EXPORTS pal_status_t pal_i2c_write(const pal_i2c_t *p_i2c_context, uint8_t *p_data, uint16_t length)
Writes on I2C bus.
pal_i2c_deinit
LIBRARY_EXPORTS pal_status_t pal_i2c_deinit(const pal_i2c_t *p_i2c_context)
De-initializes the I2C master.
pal_i2c::slave_address
uint8_t slave_address
I2C slave address.
Definition: pal_i2c.h:61
pal_i2c
PAL I2C context structure.
Definition: pal_i2c.h:57
pal_i2c_init
LIBRARY_EXPORTS pal_status_t pal_i2c_init(const pal_i2c_t *p_i2c_context)
Initializes the I2C master.
pal_i2c_set_bitrate
LIBRARY_EXPORTS pal_status_t pal_i2c_set_bitrate(const pal_i2c_t *p_i2c_context, uint16_t bitrate)
Sets the I2C Master bitrate.
pal_i2c::upper_layer_event_handler
void * upper_layer_event_handler
Pointer to store the callers handler.
Definition: pal_i2c.h:65
pal_i2c_read
LIBRARY_EXPORTS pal_status_t pal_i2c_read(const pal_i2c_t *p_i2c_context, uint8_t *p_data, uint16_t length)
Reads from I2C bus.
pal_i2c::p_upper_layer_ctx
void * p_upper_layer_ctx
Pointer to store the callers context information.
Definition: pal_i2c.h:63
pal.h
This file provides the prototype declarations of platform abstraction layer.
pal_i2c_t
struct pal_i2c pal_i2c_t
PAL I2C context structure.
pal_i2c::p_i2c_hw_config
void * p_i2c_hw_config
Pointer to I2C master platform specific context.
Definition: pal_i2c.h:59