Skip to content

Commit 618bd18

Browse files
committed
Add i2c_init_direct() function to HAL API
1 parent bbd90b6 commit 618bd18

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hal/i2c_api.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ enum {
6464
I2C_ERROR_BUS_BUSY = -2
6565
};
6666

67+
typedef struct {
68+
int peripheral;
69+
PinName sda_pin;
70+
int sda_function;
71+
PinName scl_pin;
72+
int scl_function;
73+
} i2c_pinmap_t;
74+
6775
#ifdef __cplusplus
6876
extern "C" {
6977
#endif
@@ -136,6 +144,14 @@ extern "C" {
136144
*
137145
*/
138146

147+
/** Initialize the I2C peripheral. It sets the default parameters for I2C
148+
* peripheral, and configures its specifieds pins.
149+
*
150+
* @param obj The I2C object
151+
* @param pinmap Pinmap pointer to strucure which holds static pinmap
152+
*/
153+
void i2c_init_direct(i2c_t *obj, const i2c_pinmap_t *pinmap);
154+
139155
/** Initialize the I2C peripheral. It sets the default parameters for I2C
140156
* peripheral, and configures its specifieds pins.
141157
*

0 commit comments

Comments
 (0)