package embox.driver.sd

@BuildDepends(third_party.bsp.st_bsp_api)
module stm32f4_sd {
	option string log_level="LOG_ERR"

	option number dma_sdmmc_irq = 40
	option number dma_rx_irq    = 59
	option number dma_tx_irq    = 69

/* use noirq version only with -Os compiler flag optimization.
 * It seems CPU could not read from SD FIFO fast enough */
	option boolean use_irq = true
	option boolean use_local_buf=true
	option number sd_buf_size=4096

	@IncludeExport(target_name="stm32cube_bsp_sd.h")
	source "stm32f4_discovery_sd.h"

	source "stm32cube_bsp_sd.c"

	depends embox.driver.block_dev
	depends third_party.bsp.st_bsp_api
}

@BuildDepends(third_party.bsp.st_bsp_api)
module stm32f746g_discovery_sd {
	option string log_level="LOG_ERR"

	option number dma_sdmmc_irq = 49
	option number dma_rx_irq    = 59
	option number dma_tx_irq    = 69

/* use noirq version only with -Os compiler flag optimization and cache.
 * It seems CPU could not read from SD FIFO fast enough */
	option boolean use_irq = true
	option boolean use_local_buf = true
	option number sd_buf_size = 4096

	@IncludeExport(target_name="stm32cube_bsp_sd.h")
	source "stm32f746g_discovery_sd.h"

	source "stm32cube_bsp_sd.c"

	depends embox.driver.block_dev
	depends third_party.bsp.st_bsp_api
}

@BuildDepends(third_party.bsp.st_bsp_api)
module stm32f769i_discovery_sd {
	option string log_level="LOG_ERR"

	option number dma_sdmmc_irq = 103
	option number dma_rx_irq    = 56
	option number dma_tx_irq    = 68
	
/* use noirq version only with -Os compiler flag optimization and cache.
 * It seems CPU could not read from SD FIFO fast enough */ 
	option boolean use_irq = true
	option boolean use_local_buf=true
	option number sd_buf_size=4096

	@IncludeExport(target_name="stm32cube_bsp_sd.h")
	source "stm32f769i_discovery_sd.h"

	source "stm32cube_bsp_sd.c"

	depends embox.driver.block_dev
	depends third_party.bsp.st_bsp_api
}
