[DISCO_F469NI] enhance files to pass pin out tests

pull/1392/head
dbestm 2015-11-05 17:30:17 +01:00
parent 8c549f9b9a
commit 306f1290fe
5 changed files with 63 additions and 1 deletions

View File

@ -55,6 +55,9 @@ void pwmout_init(pwmout_t* obj, PinName pin)
if (obj->pwm == PWM_2) __HAL_RCC_TIM2_CLK_ENABLE();
if (obj->pwm == PWM_3) __HAL_RCC_TIM3_CLK_ENABLE();
if (obj->pwm == PWM_4) __HAL_RCC_TIM4_CLK_ENABLE();
#if defined(TIM5_BASE)
if (obj->pwm == PWM_5) __HAL_RCC_TIM5_CLK_ENABLE();
#endif
#if defined(TIM8_BASE)
if (obj->pwm == PWM_8) __HAL_RCC_TIM8_CLK_ENABLE();
#endif

View File

@ -353,6 +353,47 @@ void spi_frequency(spi_t *obj, int hz)
obj->br_presc = SPI_BAUDRATEPRESCALER_2; // 22.5 MHz
}
}
#elif defined(TARGET_STM32F469NI)
// Values depend of PCLK2: 84 MHz
if ((obj->spi == SPI_1) || (obj->spi == SPI_4)) {
if (hz < 600000) {
obj->br_presc = SPI_BAUDRATEPRESCALER_256; // 328 kHz
} else if ((hz >= 600000) && (hz < 1000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_128; // 656 kHz
} else if ((hz >= 1000000) && (hz < 2000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_64; // 1.31 MHz
} else if ((hz >= 2000000) && (hz < 5000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_32; // 2.63 MHz
} else if ((hz >= 5000000) && (hz < 10000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_16; // 5.25 MHz
} else if ((hz >= 10000000) && (hz < 20000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_8; // 10.5 MHz
} else if ((hz >= 20000000) && (hz < 40000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_4; // 21 MHz
} else { // >= 40000000
obj->br_presc = SPI_BAUDRATEPRESCALER_2; // 42 MHz
}
}
// Values depend of PCLK1: 42 MHz
if ((obj->spi == SPI_2) || (obj->spi == SPI_3)) {
if (hz < 300000) {
obj->br_presc = SPI_BAUDRATEPRESCALER_256; // 164 kHz
} else if ((hz >= 300000) && (hz < 600000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_128; // 328 kHz
} else if ((hz >= 600000) && (hz < 1000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_64; // 656 kHz
} else if ((hz >= 1000000) && (hz < 2000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_32; // 1.31 MHz
} else if ((hz >= 2000000) && (hz < 5000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_16; // 2.63 MHz
} else if ((hz >= 5000000) && (hz < 10000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_8; // 5.25 MHz
} else if ((hz >= 10000000) && (hz < 20000000)) {
obj->br_presc = SPI_BAUDRATEPRESCALER_4; // 10.5 MHz
} else { // >= 20000000
obj->br_presc = SPI_BAUDRATEPRESCALER_2; // 21 MHz
}
}
#endif
init_spi(obj);
}

View File

@ -50,6 +50,10 @@ AnalogOut out(PA_4);
AnalogIn in(PC_3);
AnalogOut out(PA_5);
#elif defined(TARGET_DISCO_F469NI)
AnalogIn in(PC_5);
AnalogOut out(PA_4);
#elif defined(TARGET_MAX32600MBED)
AnalogIn in(AIN_7P);
AnalogOut out(AOUT_DO);

View File

@ -10,6 +10,10 @@ DigitalIn in(dp2);
DigitalOut out(D7);
DigitalIn in(D2);
#elif defined(TARGET_DISCO_F469NI)
DigitalOut out(PB_1);
DigitalIn in(PG_9);
#elif defined(TARGET_NUCLEO_F030R8) || \
defined(TARGET_NUCLEO_F070RB) || \
defined(TARGET_NUCLEO_F072RB) || \

View File

@ -81,6 +81,16 @@
#define P2_2 (1 << 6) // P4_6
#define PORT_2 Port4
#elif defined(TARGET_DISCO_F469NI)
#define P1_1 (1 << 2) // PC_2
#define P1_2 (1 << 3) // PC_3
#define PORT_1 PortC
#define P2_1 (1 << 1) // PA_1
#define P2_2 (1 << 2) // PA_2
#define PORT_2 PortA
#elif defined(TARGET_NUCLEO_F030R8) || \
defined(TARGET_NUCLEO_F070RB) || \
defined(TARGET_NUCLEO_F072RB) || \