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 <string.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 | I2CBUS2_SCL_PORT NUTGPIO_PORTB |
I2CBUS2 GPIO configuartion and assignment. | |
#define | I2CBUS2_SCL_PIN 10 |
#define | I2CBUS2_SDA_PORT NUTGPIO_PORTB |
#define | I2CBUS2_SDA_PIN 11 |
#define | I2CBUS2_SMBA_PORT NUTGPIO_PORTB |
#define | I2CBUS2_SMBA_PIN 11 |
Functions | |
int | Stm32I2cBus2Recover (void) |
int | Stm32I2cBus2Init (void) |
Processor specific Hardware Initiliaization. | |
Variables | |
NUTTWIBUS | Stm32TwiBus_2 |
TWI/I2C bus structure. |
STM32F I2C bus 1 initialization.
#define I2CBUS2_SCL_PORT NUTGPIO_PORTB |
I2CBUS2 GPIO configuartion and assignment.
F1: SMBA PB12 SCL PB10 SDA PB11 L1: SMBA PB12 SCL PB10 SDA PB11 F2/F4L SMBA PB12 PF2 PH6 SCL PB10 PF1 PH4 SDA PB11 PF0 PH5
Referenced by Stm32I2cBus2Init(), and Stm32I2cBus2Recover().
#define I2CBUS2_SCL_PIN 10 |
Referenced by Stm32I2cBus2Init(), and Stm32I2cBus2Recover().
#define I2CBUS2_SDA_PORT NUTGPIO_PORTB |
Referenced by Stm32I2cBus2Init(), and Stm32I2cBus2Recover().
#define I2CBUS2_SDA_PIN 11 |
Referenced by Stm32I2cBus2Init(), and Stm32I2cBus2Recover().
#define I2CBUS2_SMBA_PORT NUTGPIO_PORTB |
Referenced by Stm32I2cBus2Init().
#define I2CBUS2_SMBA_PIN 11 |
Referenced by Stm32I2cBus2Init().
int Stm32I2cBus2Recover | ( | void | ) |
References GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GpioPinConfigSet(), GpioPinSetHigh, GpioPinSetLow, I2CBUS2_SCL_PIN, I2CBUS2_SCL_PORT, I2CBUS2_SDA_PIN, I2CBUS2_SDA_PORT, and NutMicroDelay().
int Stm32I2cBus2Init | ( | void | ) |
Processor specific Hardware Initiliaization.
References DISABLE, DMA_Disable(), DMA_Init(), ENABLE, GPIO_AF_I2C2, GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GPIO_PinAFConfig(), GpioPinConfigSet(), I2C2_DMA_CHANNEL_RX, I2C2_DMA_CHANNEL_TX, I2C2_ER_IRQn, I2C2_EV_IRQn, I2CBUS2_SCL_PIN, I2CBUS2_SCL_PORT, I2CBUS2_SDA_PIN, I2CBUS2_SDA_PORT, I2CBUS2_SMBA_PIN, I2CBUS2_SMBA_PORT, NVIC_SetPriority(), NVIC_SetPriorityGrouping(), RCC_APB1Periph_I2C2, RCC_APB1PeriphClockCmd(), and RCC_APB1PeriphResetCmd().
{ I2C2_BASE, &sig_TWI2_EV, &sig_TWI2_ER, NULL, NULL, 0, 0, Stm32I2cBus2Init, Stm32I2cBus2Recover, }
TWI/I2C bus structure.