no-OS
stm32_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef STM32_I2C_H_
34 #define STM32_I2C_H_
35 
36 #include <stdint.h>
37 #include "no_os_i2c.h"
38 #include "stm32_hal.h"
39 
46  I2C_HandleTypeDef hi2c;
47 };
48 
56  uint32_t i2c_timing;
57 };
58 
62 extern const struct no_os_i2c_platform_ops stm32_i2c_ops;
63 
64 #endif // STM32_I2C_H_
stm32_i2c_ops
const struct no_os_i2c_platform_ops stm32_i2c_ops
stm32 specific I2C platform ops structure
Definition: stm32_i2c.c:222
no_os_alloc.h
stm32_i2c.h
Header file for the stm32 i2c driver.
no_os_i2c_init_param::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:70
stm32_i2c_desc::hi2c
I2C_HandleTypeDef hi2c
Definition: stm32_i2c.h:46
no_os_i2c_desc::device_id
uint32_t device_id
Definition: no_os_i2c.h:105
stm32_i2c_read
int32_t stm32_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C read transaction as master.
Definition: stm32_i2c.c:191
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
no_os_i2c_init_param::extra
void * extra
Definition: no_os_i2c.h:74
stm32_i2c_init_param
Structure holding the initialization parameters for stm32 platform specific I2C parameters.
Definition: stm32_i2c.h:54
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:109
no_os_i2c_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:68
stm32_i2c_ops
const struct no_os_i2c_platform_ops stm32_i2c_ops
stm32 platform specific I2C platform ops structure
Definition: stm32_i2c.c:222
no_os_i2c_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:107
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:121
stm32_i2c_remove
int32_t stm32_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: stm32_i2c.c:132
no_os_i2c_platform_ops::i2c_ops_init
int32_t(* i2c_ops_init)(struct no_os_i2c_desc **, const struct no_os_i2c_init_param *)
Definition: no_os_i2c.h:123
stm32_i2c_init
int32_t stm32_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: stm32_i2c.c:46
stm32_i2c_init_param::i2c_timing
uint32_t i2c_timing
Definition: stm32_i2c.h:56
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
no_os_i2c.h
Header file of I2C Interface.
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
stm32_i2c_desc
stm32 platform specific I2C descriptor
Definition: stm32_i2c.h:44
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
NULL
#define NULL
Definition: wrapper.h:64
stm32_i2c_write
int32_t stm32_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C write transaction as master.
Definition: stm32_i2c.c:154
no_os_util.h
Header file of utility functions.
no_os_i2c_desc::extra
void * extra
Definition: no_os_i2c.h:113
no_os_i2c_init_param::device_id
uint32_t device_id
Definition: no_os_i2c.h:66
stm32_hal.h
errno.h
Error macro definition for ARM Compiler.