Add i2c_init_direct() function to HAL API

pull/11892/head
Przemyslaw Stekiel 2019-08-28 13:14:54 +02:00
parent bbd90b604b
commit 618bd18ef5
1 changed files with 16 additions and 0 deletions

View File

@ -64,6 +64,14 @@ enum {
I2C_ERROR_BUS_BUSY = -2
};
typedef struct {
int peripheral;
PinName sda_pin;
int sda_function;
PinName scl_pin;
int scl_function;
} i2c_pinmap_t;
#ifdef __cplusplus
extern "C" {
#endif
@ -136,6 +144,14 @@ extern "C" {
*
*/
/** Initialize the I2C peripheral. It sets the default parameters for I2C
* peripheral, and configures its specifieds pins.
*
* @param obj The I2C object
* @param pinmap Pinmap pointer to strucure which holds static pinmap
*/
void i2c_init_direct(i2c_t *obj, const i2c_pinmap_t *pinmap);
/** Initialize the I2C peripheral. It sets the default parameters for I2C
* peripheral, and configures its specifieds pins.
*