STM32F I2C bus 1 initialization. More...
#include <cfg/os.h>#include <cfg/clock.h>#include <cfg/arch.h>#include <cfg/twi.h>#include <cfg/arch/gpio.h>#include <sys/atom.h>#include <sys/event.h>#include <sys/timer.h>#include <dev/irqreg.h>#include <dev/gpio.h>#include <dev/twif.h>#include <arch/cm3/stm/stm32xxxx.h>#include <arch/cm3/stm/stm32xxxx_gpio.h>#include <arch/cm3/stm/stm32xxxx_rcc.h>#include <arch/cm3/stm/stm32_twi.h>Defines | |
| #define | I2C_PORT NUTGPIO_PORTB |
| I2CBUS1 GPIO configuartion and assignment. F1/L1/F2/F4: SMBA PB5 SCL PB6 PB8 SDA PB7 PB9. | |
| #define | I2CBUS1_SDA_PIN 7 |
| #define | I2CBUS1_SCL_PIN 6 |
Functions | |
| int | Stm32I2cBus1Recover (void) |
| Unlock a broken slave by clocking 8 SCL pulses manually. | |
| int | Stm32I2cBus1Init (void) |
| Processor specific Hardware Initiliaization. | |
Variables | |
| NUTTWIBUS | Stm32TwiBus_1 |
| TWI/I2C bus structure. | |
STM32F I2C bus 1 initialization.
| #define I2C_PORT NUTGPIO_PORTB |
I2CBUS1 GPIO configuartion and assignment. F1/L1/F2/F4: SMBA PB5 SCL PB6 PB8 SDA PB7 PB9.
Referenced by Stm32I2cBus1Init(), and Stm32I2cBus1Recover().
| #define I2CBUS1_SDA_PIN 7 |
Referenced by Stm32I2cBus1Init(), and Stm32I2cBus1Recover().
| #define I2CBUS1_SCL_PIN 6 |
Referenced by Stm32I2cBus1Init(), and Stm32I2cBus1Recover().
| int Stm32I2cBus1Recover | ( | void | ) |
Unlock a broken slave by clocking 8 SCL pulses manually.
References _BV, GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GpioPinSetHigh, GpioPinSetLow, GpioPortConfigSet(), I2C_PORT, I2CBUS1_SCL_PIN, I2CBUS1_SDA_PIN, and NutMicroDelay().
| int Stm32I2cBus1Init | ( | void | ) |
Processor specific Hardware Initiliaization.
References _BV, DISABLE, DMA_Disable(), DMA_Init(), ENABLE, GPIO_AF_I2C1, GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GPIO_PinAFConfig(), GPIO_PinRemapConfig(), GPIO_Remap_I2C1, GpioPortConfigSet(), I2C1_DMA_CHANNEL_RX, I2C1_DMA_CHANNEL_TX, I2C1_ER_IRQn, I2C1_EV_IRQn, I2C_PORT, I2CBUS1_SCL_PIN, I2CBUS1_SDA_PIN, NVIC_SetPriority(), NVIC_SetPriorityGrouping(), RCC_APB1Periph_I2C1, RCC_APB1PeriphClockCmd(), and RCC_APB1PeriphResetCmd().
{
I2C1_BASE,
&sig_TWI1_EV,
&sig_TWI1_ER,
NULL,
NULL,
0,
0,
Stm32I2cBus1Init,
Stm32I2cBus1Recover,
}
TWI/I2C bus structure.