mirror of https://github.com/ARMmbed/mbed-os.git
Changes in pin mapping in order to build the STM32F410RB Nucelo target.
Target can be built, but not verified due to Flashing problems.pull/1412/head
parent
5061da03db
commit
cc593f0992
libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4
|
@ -53,16 +53,13 @@ typedef enum {
|
|||
typedef enum {
|
||||
SPI_1 = (int)SPI1_BASE,
|
||||
SPI_2 = (int)SPI2_BASE,
|
||||
// SPI_3 = (int)SPI3_BASE,
|
||||
// SPI_4 = (int)SPI4_BASE,
|
||||
SPI_5 = (int)SPI5_BASE
|
||||
} SPIName;
|
||||
|
||||
typedef enum {
|
||||
I2C_1 = (int)I2C1_BASE,
|
||||
I2C_2 = (int)I2C2_BASE,
|
||||
// I2C_3 = (int)I2C3_BASE
|
||||
I2C_LAST
|
||||
I2C_2 = (int)I2C2_BASE
|
||||
// I2C_3 = (int)FMPI2C1_BASE /* is it a normal i2c? */
|
||||
} I2CName;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -158,7 +158,7 @@ const PinMap PinMap_SPI_MOSI[] = {
|
|||
{PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO
|
||||
{PA_10, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI5)},
|
||||
// {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
|
||||
//rf {PB_5, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
//rf {PB_5, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI5)},
|
||||
{PB_8, SPI_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI5)},
|
||||
{PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
{PC_3, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#define DEVICE_I2C 1
|
||||
#define DEVICE_I2CSLAVE 1
|
||||
|
||||
#define DEVICE_SPI 0
|
||||
#define DEVICE_SPI 1
|
||||
#define DEVICE_SPISLAVE 1
|
||||
|
||||
#define DEVICE_RTC 1
|
||||
|
|
|
@ -77,6 +77,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
|
|||
pin_mode(sda, OpenDrain);
|
||||
pin_mode(scl, OpenDrain);
|
||||
}
|
||||
#if defined I2C3_BASE
|
||||
// Enable I2C3 clock and pinout if not done
|
||||
if ((obj->i2c == I2C_3) && !i2c3_inited) {
|
||||
i2c3_inited = 1;
|
||||
|
@ -87,7 +88,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
|
|||
pin_mode(sda, OpenDrain);
|
||||
pin_mode(scl, OpenDrain);
|
||||
}
|
||||
|
||||
#endif
|
||||
// Reset to clear pending flags if any
|
||||
i2c_reset(obj);
|
||||
|
||||
|
@ -315,10 +316,12 @@ void i2c_reset(i2c_t *obj)
|
|||
__I2C2_FORCE_RESET();
|
||||
__I2C2_RELEASE_RESET();
|
||||
}
|
||||
#if defined I2C3_BASE
|
||||
if (obj->i2c == I2C_3) {
|
||||
__I2C3_FORCE_RESET();
|
||||
__I2C3_RELEASE_RESET();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if DEVICE_I2CSLAVE
|
||||
|
|
|
@ -88,9 +88,11 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
|
|||
__HAL_RCC_SPI2_CLK_ENABLE();
|
||||
}
|
||||
|
||||
#if defined SPI3_BASE
|
||||
if (obj->spi == SPI_3) {
|
||||
__HAL_RCC_SPI3_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined SPI4_BASE
|
||||
if (obj->spi == SPI_4) {
|
||||
|
@ -143,12 +145,13 @@ void spi_free(spi_t *obj)
|
|||
__HAL_RCC_SPI2_RELEASE_RESET();
|
||||
__HAL_RCC_SPI2_CLK_DISABLE();
|
||||
}
|
||||
|
||||
#if defined SPI3_BASE
|
||||
if (obj->spi == SPI_3) {
|
||||
__HAL_RCC_SPI3_FORCE_RESET();
|
||||
__HAL_RCC_SPI3_RELEASE_RESET();
|
||||
__HAL_RCC_SPI3_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined SPI4_BASE
|
||||
if (obj->spi == SPI_4) {
|
||||
|
|
Loading…
Reference in New Issue