diff --git a/stm32f4/include/Legacy/stm32_hal_legacy.h b/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h similarity index 100% rename from stm32f4/include/Legacy/stm32_hal_legacy.h rename to STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h diff --git a/stm32f4/include/stm32_assert_template.h b/STM32F4xx_HAL_Driver/Inc/stm32_assert_template.h similarity index 100% rename from stm32f4/include/stm32_assert_template.h rename to STM32F4xx_HAL_Driver/Inc/stm32_assert_template.h diff --git a/stm32f4/include/stm32f411xe.h b/STM32F4xx_HAL_Driver/Inc/stm32f411xe.h similarity index 100% rename from stm32f4/include/stm32f411xe.h rename to STM32F4xx_HAL_Driver/Inc/stm32f411xe.h diff --git a/stm32f4/include/stm32f4xx.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx.h similarity index 100% rename from stm32f4/include/stm32f4xx.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx.h diff --git a/stm32f4/include/stm32f4xx_hal.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h diff --git a/stm32f4/include/stm32f4xx_hal_adc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_adc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h diff --git a/stm32f4/include/stm32f4xx_hal_adc_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_adc_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_can.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_can.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h diff --git a/stm32f4/include/stm32f4xx_hal_cec.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cec.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_cec.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cec.h diff --git a/stm32f4/include/stm32f4xx_hal_conf.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_conf.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_conf.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_conf.h diff --git a/stm32f4/include/stm32f4xx_hal_conf_template.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_conf_template.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_conf_template.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_conf_template.h diff --git a/stm32f4/include/stm32f4xx_hal_cortex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_cortex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h diff --git a/stm32f4/include/stm32f4xx_hal_crc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_crc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_crc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_crc.h diff --git a/stm32f4/include/stm32f4xx_hal_cryp.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cryp.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_cryp.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cryp.h diff --git a/stm32f4/include/stm32f4xx_hal_cryp_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cryp_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_cryp_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cryp_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_dac.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dac.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac.h diff --git a/stm32f4/include/stm32f4xx_hal_dac_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dac_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dac_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_dcmi.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dcmi.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dcmi.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dcmi.h diff --git a/stm32f4/include/stm32f4xx_hal_dcmi_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dcmi_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dcmi_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dcmi_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_def.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_def.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h diff --git a/stm32f4/include/stm32f4xx_hal_dfsdm.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dfsdm.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dfsdm.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dfsdm.h diff --git a/stm32f4/include/stm32f4xx_hal_dma.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dma.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h diff --git a/stm32f4/include/stm32f4xx_hal_dma2d.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma2d.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dma2d.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma2d.h diff --git a/stm32f4/include/stm32f4xx_hal_dma_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dma_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_dsi.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dsi.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_dsi.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dsi.h diff --git a/stm32f4/include/stm32f4xx_hal_eth.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_eth.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_eth.h diff --git a/stm32f4/include/stm32f4xx_hal_flash.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_flash.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h diff --git a/stm32f4/include/stm32f4xx_hal_flash_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_flash_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_flash_ramfunc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_flash_ramfunc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h diff --git a/stm32f4/include/stm32f4xx_hal_fmpi2c.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_fmpi2c.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_fmpi2c.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_fmpi2c.h diff --git a/stm32f4/include/stm32f4xx_hal_fmpi2c_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_fmpi2c_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_fmpi2c_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_fmpi2c_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_gpio.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_gpio.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h diff --git a/stm32f4/include/stm32f4xx_hal_gpio_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_gpio_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_hash.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hash.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_hash.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hash.h diff --git a/stm32f4/include/stm32f4xx_hal_hash_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hash_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_hash_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hash_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_hcd.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hcd.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_hcd.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_hcd.h diff --git a/stm32f4/include/stm32f4xx_hal_i2c.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_i2c.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h diff --git a/stm32f4/include/stm32f4xx_hal_i2c_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_i2c_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_i2s.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_i2s.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h diff --git a/stm32f4/include/stm32f4xx_hal_i2s_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_i2s_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_irda.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_irda.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_irda.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_irda.h diff --git a/stm32f4/include/stm32f4xx_hal_iwdg.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_iwdg.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_iwdg.h diff --git a/stm32f4/include/stm32f4xx_hal_lptim.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_lptim.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_lptim.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_lptim.h diff --git a/stm32f4/include/stm32f4xx_hal_ltdc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ltdc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_ltdc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ltdc.h diff --git a/stm32f4/include/stm32f4xx_hal_ltdc_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ltdc_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_ltdc_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ltdc_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_mmc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_mmc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_mmc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_mmc.h diff --git a/stm32f4/include/stm32f4xx_hal_nand.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_nand.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_nand.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_nand.h diff --git a/stm32f4/include/stm32f4xx_hal_nor.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_nor.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_nor.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_nor.h diff --git a/stm32f4/include/stm32f4xx_hal_pccard.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pccard.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_pccard.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pccard.h diff --git a/stm32f4/include/stm32f4xx_hal_pcd.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_pcd.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h diff --git a/stm32f4/include/stm32f4xx_hal_pcd_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_pcd_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_pwr.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_pwr.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h diff --git a/stm32f4/include/stm32f4xx_hal_pwr_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_pwr_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_qspi.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_qspi.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_qspi.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_qspi.h diff --git a/stm32f4/include/stm32f4xx_hal_rcc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_rcc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h diff --git a/stm32f4/include/stm32f4xx_hal_rcc_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_rcc_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_rng.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rng.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_rng.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rng.h diff --git a/stm32f4/include/stm32f4xx_hal_rtc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_rtc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h diff --git a/stm32f4/include/stm32f4xx_hal_rtc_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_rtc_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_sai.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sai.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_sai.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sai.h diff --git a/stm32f4/include/stm32f4xx_hal_sai_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sai_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_sai_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sai_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_sd.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_sd.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sd.h diff --git a/stm32f4/include/stm32f4xx_hal_sdram.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sdram.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_sdram.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sdram.h diff --git a/stm32f4/include/stm32f4xx_hal_smartcard.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_smartcard.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_smartcard.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_smartcard.h diff --git a/stm32f4/include/stm32f4xx_hal_spdifrx.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spdifrx.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_spdifrx.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spdifrx.h diff --git a/stm32f4/include/stm32f4xx_hal_spi.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_spi.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h diff --git a/stm32f4/include/stm32f4xx_hal_sram.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_sram.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h diff --git a/stm32f4/include/stm32f4xx_hal_tim.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_tim.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h diff --git a/stm32f4/include/stm32f4xx_hal_tim_ex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_tim_ex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h diff --git a/stm32f4/include/stm32f4xx_hal_uart.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_uart.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h diff --git a/stm32f4/include/stm32f4xx_hal_usart.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_usart.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_usart.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_usart.h diff --git a/stm32f4/include/stm32f4xx_hal_wwdg.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_wwdg.h similarity index 100% rename from stm32f4/include/stm32f4xx_hal_wwdg.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_wwdg.h diff --git a/stm32f4/include/stm32f4xx_ll_adc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_adc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_adc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_adc.h diff --git a/stm32f4/include/stm32f4xx_ll_bus.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_bus.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h diff --git a/stm32f4/include/stm32f4xx_ll_cortex.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_cortex.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h diff --git a/stm32f4/include/stm32f4xx_ll_crc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_crc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_crc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_crc.h diff --git a/stm32f4/include/stm32f4xx_ll_dac.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dac.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_dac.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dac.h diff --git a/stm32f4/include/stm32f4xx_ll_dma.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_dma.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h diff --git a/stm32f4/include/stm32f4xx_ll_dma2d.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma2d.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_dma2d.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma2d.h diff --git a/stm32f4/include/stm32f4xx_ll_exti.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_exti.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h diff --git a/stm32f4/include/stm32f4xx_ll_fmc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fmc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_fmc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fmc.h diff --git a/stm32f4/include/stm32f4xx_ll_fsmc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_fsmc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h diff --git a/stm32f4/include/stm32f4xx_ll_gpio.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_gpio.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h diff --git a/stm32f4/include/stm32f4xx_ll_i2c.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_i2c.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_i2c.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_i2c.h diff --git a/stm32f4/include/stm32f4xx_ll_iwdg.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_iwdg.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_iwdg.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_iwdg.h diff --git a/stm32f4/include/stm32f4xx_ll_lptim.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_lptim.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_lptim.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_lptim.h diff --git a/stm32f4/include/stm32f4xx_ll_pwr.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_pwr.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h diff --git a/stm32f4/include/stm32f4xx_ll_rcc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_rcc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h diff --git a/stm32f4/include/stm32f4xx_ll_rng.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rng.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_rng.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rng.h diff --git a/stm32f4/include/stm32f4xx_ll_rtc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rtc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_rtc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rtc.h diff --git a/stm32f4/include/stm32f4xx_ll_sdmmc.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_sdmmc.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_sdmmc.h diff --git a/stm32f4/include/stm32f4xx_ll_spi.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_spi.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h diff --git a/stm32f4/include/stm32f4xx_ll_system.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_system.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h diff --git a/stm32f4/include/stm32f4xx_ll_tim.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_tim.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h diff --git a/stm32f4/include/stm32f4xx_ll_usart.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_usart.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h diff --git a/stm32f4/include/stm32f4xx_ll_usb.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_usb.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h diff --git a/stm32f4/include/stm32f4xx_ll_utils.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_utils.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h diff --git a/stm32f4/include/stm32f4xx_ll_wwdg.h b/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_wwdg.h similarity index 100% rename from stm32f4/include/stm32f4xx_ll_wwdg.h rename to STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_wwdg.h diff --git a/stm32f4/src/stm32f4xx_hal.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c diff --git a/stm32f4/src/stm32f4xx_hal_adc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_adc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c diff --git a/stm32f4/src/stm32f4xx_hal_adc_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_adc_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_can.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_can.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c diff --git a/stm32f4/src/stm32f4xx_hal_cec.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_cec.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c diff --git a/stm32f4/src/stm32f4xx_hal_cortex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_cortex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c diff --git a/stm32f4/src/stm32f4xx_hal_crc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_crc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c diff --git a/stm32f4/src/stm32f4xx_hal_cryp.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_cryp.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c diff --git a/stm32f4/src/stm32f4xx_hal_cryp_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_cryp_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_dac.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dac.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c diff --git a/stm32f4/src/stm32f4xx_hal_dac_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dac_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_dcmi.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dcmi.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c diff --git a/stm32f4/src/stm32f4xx_hal_dcmi_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dcmi_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_dfsdm.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dfsdm.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dfsdm.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dfsdm.c diff --git a/stm32f4/src/stm32f4xx_hal_dma.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dma.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c diff --git a/stm32f4/src/stm32f4xx_hal_dma2d.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dma2d.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c diff --git a/stm32f4/src/stm32f4xx_hal_dma_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dma_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_dsi.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_dsi.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c diff --git a/stm32f4/src/stm32f4xx_hal_eth.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_eth.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c diff --git a/stm32f4/src/stm32f4xx_hal_flash.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_flash.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c diff --git a/stm32f4/src/stm32f4xx_hal_flash_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_flash_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_flash_ramfunc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_flash_ramfunc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c diff --git a/stm32f4/src/stm32f4xx_hal_fmpi2c.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_fmpi2c.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c diff --git a/stm32f4/src/stm32f4xx_hal_fmpi2c_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_fmpi2c_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_gpio.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_gpio.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c diff --git a/stm32f4/src/stm32f4xx_hal_hash.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_hash.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash.c diff --git a/stm32f4/src/stm32f4xx_hal_hash_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_hash_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_hcd.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_hcd.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c diff --git a/stm32f4/src/stm32f4xx_hal_i2c.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_i2c.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c diff --git a/stm32f4/src/stm32f4xx_hal_i2c_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_i2c_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_i2s.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_i2s.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c diff --git a/stm32f4/src/stm32f4xx_hal_i2s_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_i2s_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_irda.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_irda.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_irda.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_irda.c diff --git a/stm32f4/src/stm32f4xx_hal_iwdg.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_iwdg.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c diff --git a/stm32f4/src/stm32f4xx_hal_lptim.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_lptim.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c diff --git a/stm32f4/src/stm32f4xx_hal_ltdc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_ltdc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c diff --git a/stm32f4/src/stm32f4xx_hal_ltdc_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_ltdc_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_mmc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_mmc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_mmc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_mmc.c diff --git a/stm32f4/src/stm32f4xx_hal_msp_template.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_msp_template.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_msp_template.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_msp_template.c diff --git a/stm32f4/src/stm32f4xx_hal_nand.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_nand.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c diff --git a/stm32f4/src/stm32f4xx_hal_nor.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_nor.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c diff --git a/stm32f4/src/stm32f4xx_hal_pccard.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_pccard.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c diff --git a/stm32f4/src/stm32f4xx_hal_pcd.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_pcd.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c diff --git a/stm32f4/src/stm32f4xx_hal_pcd_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_pcd_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_pwr.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_pwr.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c diff --git a/stm32f4/src/stm32f4xx_hal_pwr_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_pwr_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_qspi.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_qspi.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c diff --git a/stm32f4/src/stm32f4xx_hal_rcc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_rcc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c diff --git a/stm32f4/src/stm32f4xx_hal_rcc_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_rcc_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_rng.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_rng.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c diff --git a/stm32f4/src/stm32f4xx_hal_rtc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_rtc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c diff --git a/stm32f4/src/stm32f4xx_hal_rtc_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_rtc_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_sai.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_sai.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c diff --git a/stm32f4/src/stm32f4xx_hal_sai_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_sai_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_sd.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_sd.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c diff --git a/stm32f4/src/stm32f4xx_hal_sdram.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_sdram.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c diff --git a/stm32f4/src/stm32f4xx_hal_smartcard.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smartcard.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_smartcard.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smartcard.c diff --git a/stm32f4/src/stm32f4xx_hal_spdifrx.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spdifrx.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_spdifrx.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spdifrx.c diff --git a/stm32f4/src/stm32f4xx_hal_spi.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_spi.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c diff --git a/stm32f4/src/stm32f4xx_hal_sram.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_sram.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c diff --git a/stm32f4/src/stm32f4xx_hal_tim.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_tim.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c diff --git a/stm32f4/src/stm32f4xx_hal_tim_ex.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_tim_ex.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c diff --git a/stm32f4/src/stm32f4xx_hal_timebase_rtc_alarm_template.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_rtc_alarm_template.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_timebase_rtc_alarm_template.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_rtc_alarm_template.c diff --git a/stm32f4/src/stm32f4xx_hal_timebase_rtc_wakeup_template.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_rtc_wakeup_template.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_timebase_rtc_wakeup_template.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_rtc_wakeup_template.c diff --git a/stm32f4/src/stm32f4xx_hal_timebase_tim_template.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_tim_template.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_timebase_tim_template.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_timebase_tim_template.c diff --git a/stm32f4/src/stm32f4xx_hal_uart.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_uart.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c diff --git a/stm32f4/src/stm32f4xx_hal_usart.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_usart.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c diff --git a/stm32f4/src/stm32f4xx_hal_wwdg.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c similarity index 100% rename from stm32f4/src/stm32f4xx_hal_wwdg.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c diff --git a/stm32f4/src/stm32f4xx_ll_adc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_adc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c diff --git a/stm32f4/src/stm32f4xx_ll_crc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_crc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_crc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_crc.c diff --git a/stm32f4/src/stm32f4xx_ll_dac.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dac.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_dac.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dac.c diff --git a/stm32f4/src/stm32f4xx_ll_dma.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_dma.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c diff --git a/stm32f4/src/stm32f4xx_ll_dma2d.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma2d.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_dma2d.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma2d.c diff --git a/stm32f4/src/stm32f4xx_ll_exti.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_exti.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c diff --git a/stm32f4/src/stm32f4xx_ll_fmc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_fmc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c diff --git a/stm32f4/src/stm32f4xx_ll_fsmc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_fsmc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c diff --git a/stm32f4/src/stm32f4xx_ll_gpio.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_gpio.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c diff --git a/stm32f4/src/stm32f4xx_ll_i2c.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_i2c.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c diff --git a/stm32f4/src/stm32f4xx_ll_lptim.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_lptim.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_lptim.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_lptim.c diff --git a/stm32f4/src/stm32f4xx_ll_pwr.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_pwr.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_pwr.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_pwr.c diff --git a/stm32f4/src/stm32f4xx_ll_rcc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_rcc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c diff --git a/stm32f4/src/stm32f4xx_ll_rng.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rng.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_rng.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rng.c diff --git a/stm32f4/src/stm32f4xx_ll_rtc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rtc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_rtc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rtc.c diff --git a/stm32f4/src/stm32f4xx_ll_sdmmc.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_sdmmc.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c diff --git a/stm32f4/src/stm32f4xx_ll_spi.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_spi.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c diff --git a/stm32f4/src/stm32f4xx_ll_tim.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_tim.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_tim.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_tim.c diff --git a/stm32f4/src/stm32f4xx_ll_usart.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_usart.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c diff --git a/stm32f4/src/stm32f4xx_ll_usb.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_usb.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c diff --git a/stm32f4/src/stm32f4xx_ll_utils.c b/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c similarity index 100% rename from stm32f4/src/stm32f4xx_ll_utils.c rename to STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c diff --git a/libEZS/drivers/i386/ezs_adc.c b/libEZS/drivers/i386/ezs_adc.c old mode 100755 new mode 100644 diff --git a/libEZS/drivers/i386/ezs_counter.c b/libEZS/drivers/i386/ezs_counter.c old mode 100755 new mode 100644 diff --git a/libEZS/drivers/i386/ezs_dac.c b/libEZS/drivers/i386/ezs_dac.c old mode 100755 new mode 100644 diff --git a/libEZS/drivers/i386/ezs_keycodes.c b/libEZS/drivers/i386/ezs_keycodes.c old mode 100755 new mode 100644 diff --git a/libEZS/drivers/i386/ezs_tracer.cpp b/libEZS/drivers/i386/ezs_tracer.cpp old mode 100755 new mode 100644 diff --git a/libEZS/drivers/stm32f4/ezs_counter.cpp b/libEZS/drivers/stm32f4/ezs_counter.cpp old mode 100755 new mode 100644 diff --git a/libEZS/drivers/stm32f4/ezs_dac.cpp b/libEZS/drivers/stm32f4/ezs_dac.cpp old mode 100755 new mode 100644 index 1da95da15ea85cd123c57f58add7fe7799dddeb2..3983771a0f7404a1f7632d3532d36e5647eb1c17 --- a/libEZS/drivers/stm32f4/ezs_dac.cpp +++ b/libEZS/drivers/stm32f4/ezs_dac.cpp @@ -1,119 +1,132 @@ -#define EZS_PWM CYGHWR_HAL_STM32_PIN_ALTFN_OUT(D, 15, 2, PUSHPULL, NONE, LOW) +/*! + * @file ezs_dac.c + * @brief A C wrapper for the stm32 pwm driver + * @author Florian Jung + * \ingroup dac + */ + +#define EZS_PWM CYGHWR_HAL_STM32_PIN_ALTFN_OUT(D,15, 2, PUSHPULL,NONE,LOW) #include <cyg/hal/hal_arch.h> +#include <libopencm3/stm32/f4/memorymap.h> #include <libopencm3/cm3/common.h> -#include <libopencm3/stm32/timer.h> #include <libopencm3/stm32/f4/rcc.h> #include <libopencm3/stm32/f4/gpio.h> +#include <libopencm3/stm32/timer.h> + +#include <stdint.h> -/// The timer ticks per microsecond. Can be adjusted by measuring PWM on an Oscilloscope + +/// The timer ticks per microsecond. Can be adjusting by measuring +/// pwm on o-scope #define PWM_TIMER_TICKS_PER_MICROSECOND 84.0 /// PWM Frequency, default is 62 kHz -#define PWM_FREQUENCY_kHz 25 +#define PWM_FREQUENCY_kHz 162.0 /// PWM Period, set automatically by the options above -#define PWM_PERIOD ((1.0/PWM_FREQUENCY_kHz) * 1000.0 * PWM_TIMER_TICKS_PER_MICROSECOND / 2) +#define PWM_PERIOD ((1.0/PWM_FREQUENCY_kHz) * 1000.0 \ + * PWM_TIMER_TICKS_PER_MICROSECOND / 2) + +/* + --- FTFM (with edits) --- +Bullet points are the steps needed. +Pulse width modulation mode allows you to generate a signal with a frequency determined +by the value of the TIMx_ARR register (the period) and a duty cycle determined by the value of the +TIMx_CCRx register (the output compare value). + -- Set TIMx_ARR to desired frequency + -- Set TIMx_CCRx to desired duty cycle +The PWM mode can be selected independently on each channel (one PWM per OCx +output) by writing 110 (PWM mode 1) or ‘111 (PWM mode 2) in the OCxM bits in the +TIMx_CCMRx register. + -- Write PWM Mode 1 or PWM Mode 2 to OCxM bits in TIMx_CCMRx register +You must enable the corresponding preload register by setting the +OCxPE bit in the TIMx_CCMRx register, and eventually the auto-reload preload register by +setting the ARPE bit in the TIMx_CR1 register. + -- Set corresponding OCxPE bit in TIMx_CCMRx register + -- Set ARPE bit in TIMx_CR1 +As the preload registers are transferred to the shadow registers only when an update event +occurs, before starting the counter, you have to initialize all the registers by setting the UG +bit in the TIMx_EGR register. + -- set UG bit in TIMx_EGR register +OCx polarity is software programmable using the CCxP bit in the TIMx_CCER register. It +can be programmed as active high or active low. OCx output is enabled by the CCxE bit in +the TIMx_CCER register. Refer to the TIMx_CCERx register description for more details. + -- set desired polarity in TIMx_CCER + -- set CCxE bit in TIMx_CCER (enable output) +*/ static void pwm_init(uint32_t timer, uint8_t channel, uint32_t period) { - // Function stolen from somewhere on stackoverflow - - // Convert channel number to internal rep - enum tim_oc_id chan; - switch (channel) { - case 1: - chan = TIM_OC1; - break; - case 2: - chan = TIM_OC2; - break; - case 3: - chan = TIM_OC3; - break; - case 4: - chan = TIM_OC4; - break; - default: - chan = TIM_OC4; - break; - } +// function stolen from somewhere on stackoverflow - // Timer Base Configuration - // timer_reset(timer); - timer_set_mode(timer, TIM_CR1_CKD_CK_INT, // clock division - TIM_CR1_CMS_EDGE, // Center-aligned mode selection - TIM_CR1_DIR_UP); // TIMx_CR1 DIR: Direction - timer_continuous_mode(timer); // Disables TIM_CR1_OPM (One pulse mode) - timer_set_period(timer, period); // Sets TIMx_ARR - timer_set_prescaler(timer, 1); // Adjusts speed of timer - timer_set_clock_division(timer, 0); // Adjusts speed of timer - timer_set_master_mode(timer, TIM_CR2_MMS_UPDATE); // Master Mode Selection - timer_enable_preload(timer); // Set ARPE bit in TIMx_CR1 - - // Channel-specific settings - timer_set_oc_value(timer, chan, 0); // sets TIMx_CCRx - timer_set_oc_mode(timer, chan, TIM_OCM_PWM1); // Sets PWM Mode 1 - timer_enable_oc_preload(timer, chan); // Sets OCxPE in TIMx_CCMRx - timer_set_oc_polarity_high(timer, chan); // set desired polarity in TIMx_CCER - timer_enable_oc_output(timer, chan); // set CCxE bit in TIMx_CCER (enable output) - - // Initialize all counters in the register - switch (timer) { - case TIM1: - TIM1_EGR |= TIM_EGR_UG; - break; - case TIM2: - TIM2_EGR |= TIM_EGR_UG; - break; - case TIM3: - TIM3_EGR |= TIM_EGR_UG; - break; - case TIM4: - TIM4_EGR |= TIM_EGR_UG; - break; - case TIM5: - TIM5_EGR |= TIM_EGR_UG; - break; - case TIM6: - TIM6_EGR |= TIM_EGR_UG; - break; - case TIM7: - TIM7_EGR |= TIM_EGR_UG; - break; - case TIM8: - TIM8_EGR |= TIM_EGR_UG; - break; + // Convert channel number to internal rep + enum tim_oc_id chan; + switch (channel) { + case 1: chan = TIM_OC1; break; + case 2: chan = TIM_OC2; break; + case 3: chan = TIM_OC3; break; + case 4: chan = TIM_OC4; break; + default: chan = TIM_OC4; break; + } + + // Timer Base Configuration + // timer_reset(timer); + timer_set_mode(timer, TIM_CR1_CKD_CK_INT, // clock division + TIM_CR1_CMS_EDGE, // Center-aligned mode selection + TIM_CR1_DIR_UP); // TIMx_CR1 DIR: Direction + timer_continuous_mode(timer); // Disables TIM_CR1_OPM (One pulse mode) + timer_set_period(timer, period); // Sets TIMx_ARR + timer_set_prescaler(timer, 1); // Adjusts speed of timer + timer_set_clock_division(timer, 0); // Adjusts speed of timer + timer_set_master_mode(timer, TIM_CR2_MMS_UPDATE); // Master Mode Selection + timer_enable_preload(timer); // Set ARPE bit in TIMx_CR1 + + // Channel-specific settings + timer_set_oc_value(timer, chan, 0); // sets TIMx_CCRx + timer_set_oc_mode(timer, chan, TIM_OCM_PWM1); // Sets PWM Mode 1 + timer_enable_oc_preload(timer, chan); // Sets OCxPE in TIMx_CCMRx + timer_set_oc_polarity_high(timer, chan); // set desired polarity in TIMx_CCER + timer_enable_oc_output(timer, chan); // set CCxE bit in TIMx_CCER (enable output) + + // Initialize all counters in the register + switch (timer) { + case TIM1: TIM1_EGR |= TIM_EGR_UG; break; + case TIM2: TIM2_EGR |= TIM_EGR_UG; break; + case TIM3: TIM3_EGR |= TIM_EGR_UG; break; + case TIM4: TIM4_EGR |= TIM_EGR_UG; break; + case TIM5: TIM5_EGR |= TIM_EGR_UG; break; + case TIM6: TIM6_EGR |= TIM_EGR_UG; break; + case TIM7: TIM7_EGR |= TIM_EGR_UG; break; + case TIM8: TIM8_EGR |= TIM_EGR_UG; break; } } static void pwm_setup(void) { - rcc_periph_clock_enable(RCC_TIM4); - pwm_init(TIM4, 1, PWM_PERIOD); - pwm_init(TIM4, 2, PWM_PERIOD); - pwm_init(TIM4, 3, PWM_PERIOD); - pwm_init(TIM4, 4, PWM_PERIOD); - - // LED channels = PD12..15 - // AHB1-bus ? _ gpIO Port D ENable - rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN); - - // AF = alternate function - gpio_mode_setup(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, - GPIO12 | GPIO13 | GPIO14 | GPIO15); - // AF2 = TIM4_CH1..4 - gpio_set_af(GPIOD, GPIO_AF2, GPIO12 | GPIO13 | GPIO14 | GPIO15); - timer_enable_counter(TIM4); + rcc_periph_clock_enable(RCC_TIM4); + //pwm_init(TIM4, 1, PWM_PERIOD); + pwm_init(TIM4, 2, PWM_PERIOD); + pwm_init(TIM4, 3, PWM_PERIOD); + pwm_init(TIM4, 4, PWM_PERIOD); + + // LED channels = PD12..15 + rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN); + + gpio_mode_setup(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE, + GPIO13 | GPIO14 | GPIO15); + // AF2 = TIM4_CH1..4 + gpio_set_af(GPIOD, GPIO_AF2, GPIO13 | GPIO14 | GPIO15); + timer_enable_counter(TIM4); } extern "C" void ezs_dac_init() { - pwm_setup(); - CYGHWR_HAL_STM32_GPIO_SET(EZS_PWM); + pwm_setup(); + CYGHWR_HAL_STM32_GPIO_SET(EZS_PWM); } extern "C" void ezs_dac_write(uint8_t value) { - timer_set_oc_value(TIM4, TIM_OC1, value * PWM_PERIOD / 255); - timer_set_oc_value(TIM4, TIM_OC2, value * PWM_PERIOD / 255); - timer_set_oc_value(TIM4, TIM_OC3, value * PWM_PERIOD / 255); - timer_set_oc_value(TIM4, TIM_OC4, value * PWM_PERIOD / 255); + timer_set_oc_value(TIM4, TIM_OC2, value*PWM_PERIOD / 256); + timer_set_oc_value(TIM4, TIM_OC3, value*PWM_PERIOD / 256); + timer_set_oc_value(TIM4, TIM_OC4, value*PWM_PERIOD / 256); } + diff --git a/libEZS/drivers/stm32f4/ezs_gpio.c b/libEZS/drivers/stm32f4/ezs_gpio.c old mode 100755 new mode 100644 index b165e62fbdf5bb3b42f87f597531fbbbf7e0ca6b..8001a1436fc114452477d44aa568955dbc0ca307 --- a/libEZS/drivers/stm32f4/ezs_gpio.c +++ b/libEZS/drivers/stm32f4/ezs_gpio.c @@ -1,25 +1,14 @@ #include <cyg/hal/hal_arch.h> #include "ezs_gpio.h" -#define GPIO_D10 CYGHWR_HAL_STM32_PIN_OUT( D, 10, PUSHPULL, NONE, LOW ) -#define GPIO_D11 CYGHWR_HAL_STM32_PIN_OUT( D, 11, PUSHPULL, NONE, LOW ) +#define EZS_GPIO CYGHWR_HAL_STM32F4DISCOVERY_LED1 void ezs_gpio_init(void) { - CYGHWR_HAL_STM32_GPIO_SET(GPIO_D10); - CYGHWR_HAL_STM32_GPIO_SET(GPIO_D11); + CYGHWR_HAL_STM32_GPIO_SET(EZS_GPIO); } -void ezs_gpio_set(int pin, bool enable) +void ezs_gpio_set(bool enable) { - switch(pin) { - case 10: - CYGHWR_HAL_STM32_GPIO_OUT(GPIO_D10, enable != 0); - break; - case 11: - CYGHWR_HAL_STM32_GPIO_OUT(GPIO_D11, enable != 0); - break; - default: - break; - } + CYGHWR_HAL_STM32_GPIO_OUT(EZS_GPIO, enable!=0); } diff --git a/libEZS/drivers/stm32f4/ezs_serial.cpp b/libEZS/drivers/stm32f4/ezs_serial.cpp old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_adc.h b/libEZS/include/ezs_adc.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_common.h b/libEZS/include/ezs_common.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_counter.h b/libEZS/include/ezs_counter.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_dac.h b/libEZS/include/ezs_dac.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_delay.h b/libEZS/include/ezs_delay.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_fft.h b/libEZS/include/ezs_fft.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_gcd.h b/libEZS/include/ezs_gcd.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_gpio.h b/libEZS/include/ezs_gpio.h old mode 100755 new mode 100644 index c300eecc8d313e1c3797dda5cf2fe5f5133c1c6a..9532d9745674cbc9b7cfa5def0a77d0ea652eb14 --- a/libEZS/include/ezs_gpio.h +++ b/libEZS/include/ezs_gpio.h @@ -19,6 +19,6 @@ void ezs_gpio_init(void); * \brief Sets the GPIO pin to high (enabled == true) or low (enabled == * false). */ -void ezs_gpio_set(int, bool); +void ezs_gpio_set(bool /* enabled */); #endif // EZS_GPIO_H_INCLUDED diff --git a/libEZS/include/ezs_interpolation.h b/libEZS/include/ezs_interpolation.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_io.h b/libEZS/include/ezs_io.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_io_fel.h b/libEZS/include/ezs_io_fel.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_keycodes.h b/libEZS/include/ezs_keycodes.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_sensor.h b/libEZS/include/ezs_sensor.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_serial.h b/libEZS/include/ezs_serial.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_trace.h b/libEZS/include/ezs_trace.h old mode 100755 new mode 100644 diff --git a/libEZS/include/ezs_window.h b/libEZS/include/ezs_window.h old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_common.c b/libEZS/src/ezs_common.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_dac.c b/libEZS/src/ezs_dac.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_delay.c b/libEZS/src/ezs_delay.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_fft.c b/libEZS/src/ezs_fft.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_gcd.c b/libEZS/src/ezs_gcd.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_impure_ptr.c b/libEZS/src/ezs_impure_ptr.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_interpolation.c b/libEZS/src/ezs_interpolation.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_io.c b/libEZS/src/ezs_io.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_io_fel.c b/libEZS/src/ezs_io_fel.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_sensor.c b/libEZS/src/ezs_sensor.c old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_tracer.cpp b/libEZS/src/ezs_tracer.cpp old mode 100755 new mode 100644 diff --git a/libEZS/src/ezs_window.c b/libEZS/src/ezs_window.c old mode 100755 new mode 100644