no-OS
stm32_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef STM32_I2C_H_
40 #define STM32_I2C_H_
41 
42 #include <stdint.h>
43 #include "no_os_i2c.h"
44 #include "stm32_hal.h"
45 
52  I2C_HandleTypeDef hi2c;
53 };
54 
62  uint32_t i2c_timing;
63 };
64 
68 extern const struct no_os_i2c_platform_ops stm32_i2c_ops;
69 
70 #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:228
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:76
stm32_i2c_desc::hi2c
I2C_HandleTypeDef hi2c
Definition: stm32_i2c.h:52
no_os_i2c_desc::device_id
uint32_t device_id
Definition: no_os_i2c.h:111
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:197
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:60
no_os_i2c_init_param::extra
void * extra
Definition: no_os_i2c.h:80
stm32_i2c_init_param
Structure holding the initialization parameters for stm32 platform specific I2C parameters.
Definition: stm32_i2c.h:60
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:115
no_os_i2c_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:74
stm32_i2c_ops
const struct no_os_i2c_platform_ops stm32_i2c_ops
stm32 platform specific I2C platform ops structure
Definition: stm32_i2c.c:228
no_os_i2c_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:113
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:127
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:138
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:129
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:52
stm32_i2c_init_param::i2c_timing
uint32_t i2c_timing
Definition: stm32_i2c.h:62
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:107
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:75
stm32_i2c_desc
stm32 platform specific I2C descriptor
Definition: stm32_i2c.h:50
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:70
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:160
no_os_util.h
Header file of utility functions.
no_os_i2c_desc::extra
void * extra
Definition: no_os_i2c.h:119
no_os_i2c_init_param::device_id
uint32_t device_id
Definition: no_os_i2c.h:72
stm32_hal.h
errno.h
Error macro definition for ARM Compiler.