mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
i2c: allow i2c adapters to remap pin functions
Allows us to support more complex pin configurations for i2c.
This commit is contained in:
parent
a51bf72bc7
commit
ec6d550225
@ -891,6 +891,10 @@ int32_t PIOS_I2C_Init(uint32_t * i2c_id, const struct pios_i2c_adapter_cfg * cfg
|
||||
break;
|
||||
}
|
||||
|
||||
if (i2c_adapter->cfg->remap) {
|
||||
GPIO_PinRemapConfig(i2c_adapter->cfg->remap, ENABLE);
|
||||
}
|
||||
|
||||
/* Initialize the state machine */
|
||||
i2c_adapter_fsm_init(i2c_adapter);
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct pios_i2c_adapter_cfg {
|
||||
uint32_t transfer_timeout_ms;
|
||||
struct stm32_gpio scl;
|
||||
struct stm32_gpio sda;
|
||||
uint32_t remap;
|
||||
struct stm32_irq event;
|
||||
struct stm32_irq error;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user