no-OS
mbed_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
32 #ifndef MBED_I2C_H_
33 #define MBED_I2C_H_
34 
35 // Platform support needs to be C-compatible to work with other drivers
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 /******************************************************************************/
42 /***************************** Include Files **********************************/
43 /******************************************************************************/
44 
45 #include <stdio.h>
46 
47 /******************************************************************************/
48 /********************** Variables and User defined data types *****************/
49 /******************************************************************************/
50 
51 /*
52  * Note: The structure members are not strongly typed, as this file is included
53  * in application specific '.c' files. The mbed code structure does not
54  * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
55  * All the members are hence typecasted to mbed specific type during
56  * i2c init and read/write operations.
57  **/
58 
64  uint16_t i2c_sda_pin; // I2C SDA pin (PinName)
65  uint16_t i2c_scl_pin; // I2C SCL pin (PinName)
66 };
67 
72 struct mbed_i2c_desc {
73  void *i2c_port; // I2C port instance (mbed::I2C)
74 };
75 
79 extern const struct no_os_i2c_platform_ops mbed_i2c_ops;
80 
81 /******************************************************************************/
82 /************************ Functions Declarations ******************************/
83 /******************************************************************************/
84 
85 #ifdef __cplusplus // Closing extern c
86 }
87 #endif
88 
89 #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:121
mbed_i2c_desc::i2c_port
void * i2c_port
Definition: mbed_i2c.h:73
mbed_i2c_init_param
Structure holding the I2C init parameters for mbed platform.
Definition: mbed_i2c.h:63
mbed_i2c_desc
I2C specific descriptor for the mbed platform.
Definition: mbed_i2c.h:72
mbed_i2c_init_param::i2c_sda_pin
uint16_t i2c_sda_pin
Definition: mbed_i2c.h:64
mbed_i2c_init_param::i2c_scl_pin
uint16_t i2c_scl_pin
Definition: mbed_i2c.h:65