no-OS
chibios_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef CHIBIOS_I2C_H_
34 #define CHIBIOS_I2C_H_
35 
36 #include <stdint.h>
37 #include "no_os_i2c.h"
38 #include "hal.h"
39 
40 #if (HAL_USE_I2C==TRUE)
41 
48  I2CDriver *hi2c;
50  I2CConfig *i2ccfg;
52  uint16_t i2caddr;
53 };
54 
62  I2CDriver *hi2c;
64  I2CConfig *i2ccfg;
65 };
66 
70 extern const struct no_os_i2c_platform_ops chibios_i2c_ops;
71 
76 static uint8_t* chI2CBuffer;
77 static uint16_t buffSize;
78 
79 #endif // HAL_USE_I2C==TRUE
80 
81 #endif // CHIBIOS_I2C_H_
no_os_alloc.h
chibios_i2c_desc::hi2c
I2CDriver * hi2c
Definition: chibios_i2c.h:48
chibios_i2c_init_param
ChibiOS i2c param struct.
Definition: chibios_i2c.h:60
chibios_i2c_desc::i2caddr
uint16_t i2caddr
Definition: chibios_i2c.h:52
chibios_i2c_write
int chibios_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: chibios_i2c.c:124
no_os_i2c_init_param::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:70
chibios_i2c_init
int chibios_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: chibios_i2c.c:49
no_os_i2c_desc::device_id
uint32_t device_id
Definition: no_os_i2c.h:105
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
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:109
chibios_i2c_init_param::hi2c
I2CDriver * hi2c
Definition: chibios_i2c.h:62
chibios_i2c_desc
chibios platform specific I2C descriptor iwth config and slave address parameters
Definition: chibios_i2c.h:46
no_os_i2c_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:68
chibios_i2c_ops
const struct no_os_i2c_platform_ops chibios_i2c_ops
chibios specific I2C platform ops structure
Definition: chibios_i2c.c:194
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
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
chibios_i2c_read
int chibios_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: chibios_i2c.c:162
chibios_i2c_init_param::i2ccfg
I2CConfig * i2ccfg
Definition: chibios_i2c.h:64
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
no_os_i2c.h
Header file of I2C Interface.
chibios_i2c_ops
const struct no_os_i2c_platform_ops chibios_i2c_ops
chibios platform specific I2C platform ops structure
Definition: chibios_i2c.c:194
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
chibios_i2c_desc::i2ccfg
I2CConfig * i2ccfg
Definition: chibios_i2c.h:50
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
chibios_i2c_remove
int chibios_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: chibios_i2c.c:101
no_os_util.h
Header file of utility functions.
no_os_i2c_desc::extra
void * extra
Definition: no_os_i2c.h:113
chibios_i2c.h
Header file for the chibios i2c driver.
no_os_i2c_init_param::device_id
uint32_t device_id
Definition: no_os_i2c.h:66
errno.h
Error macro definition for ARM Compiler.