Nut/OS  5.0.5
API Reference
stm32_twi1.c File Reference

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>
Include dependency graph for stm32_twi1.c:

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.

Detailed Description

STM32F I2C bus 1 initialization.


Define Documentation

#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
#define I2CBUS1_SCL_PIN   6

Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Variable Documentation

Initial value:

TWI/I2C bus structure.