no-OS
mbed_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
38 #ifndef MBED_I2C_H_
39 #define MBED_I2C_H_
40 
41 // Platform support needs to be C-compatible to work with other drivers
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 /******************************************************************************/
48 /***************************** Include Files **********************************/
49 /******************************************************************************/
50 
51 #include <stdio.h>
52 
53 /******************************************************************************/
54 /********************** Variables and User defined data types *****************/
55 /******************************************************************************/
56 
57 /*
58  * Note: The structure members are not strongly typed, as this file is included
59  * in application specific '.c' files. The mbed code structure does not
60  * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
61  * All the members are hence typecasted to mbed specific type during
62  * i2c init and read/write operations.
63  **/
64 
70  uint16_t i2c_sda_pin; // I2C SDA pin (PinName)
71  uint16_t i2c_scl_pin; // I2C SCL pin (PinName)
72 };
73 
78 struct mbed_i2c_desc {
79  void *i2c_port; // I2C port instance (mbed::I2C)
80 };
81 
85 extern const struct no_os_i2c_platform_ops mbed_i2c_ops;
86 
87 /******************************************************************************/
88 /************************ Functions Declarations ******************************/
89 /******************************************************************************/
90 
91 #ifdef __cplusplus // Closing extern c
92 }
93 #endif
94 
95 #endif /* MBED_I2C_H_ */
mbed_i2c_ops
const struct no_os_i2c_platform_ops mbed_i2c_ops
Mbed specific I2C platform ops structure.
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:127
mbed_i2c_desc::i2c_port
void * i2c_port
Definition: mbed_i2c.h:79
mbed_i2c_init_param
Structure holding the I2C init parameters for mbed platform.
Definition: mbed_i2c.h:69
mbed_i2c_desc
I2C specific descriptor for the mbed platform.
Definition: mbed_i2c.h:78
mbed_i2c_init_param::i2c_sda_pin
uint16_t i2c_sda_pin
Definition: mbed_i2c.h:70
mbed_i2c_init_param::i2c_scl_pin
uint16_t i2c_scl_pin
Definition: mbed_i2c.h:71