1
0
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:
Stacey Sheldon 2011-11-12 21:34:47 -05:00
parent a51bf72bc7
commit ec6d550225
2 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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;
};