From aa431f4c1029cb75e70368b83b8af2803a186b35 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 7 Mar 2015 14:29:17 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7731 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/sdc.h | 17 +++++++++++++++++ os/hal/ports/STM32/LLD/sdc_lld.h | 19 +------------------ os/hal/templates/sdc_lld.c | 3 ++- os/hal/templates/sdc_lld.h | 22 ++++++++++------------ 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/os/hal/include/sdc.h b/os/hal/include/sdc.h index 7cd7a3e53..ebeb1ea88 100644 --- a/os/hal/include/sdc.h +++ b/os/hal/include/sdc.h @@ -105,6 +105,23 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief Type of SDIO bus mode. + */ +typedef enum { + SDC_MODE_1BIT = 0, + SDC_MODE_4BIT, + SDC_MODE_8BIT +} sdcbusmode_t; + +/** + * @brief Max supported clock. + */ +typedef enum { + SDC_CLK_25MHz = 0, + SDC_CLK_50MHz, +} sdcbusclk_t; + #include "sdc_lld.h" /*===========================================================================*/ diff --git a/os/hal/ports/STM32/LLD/sdc_lld.h b/os/hal/ports/STM32/LLD/sdc_lld.h index 295ac5d24..719fe90fa 100644 --- a/os/hal/ports/STM32/LLD/sdc_lld.h +++ b/os/hal/ports/STM32/LLD/sdc_lld.h @@ -181,23 +181,6 @@ /* Driver data structures and types. */ /*===========================================================================*/ -/** - * @brief Type of SDIO bus mode. - */ -typedef enum { - SDC_MODE_1BIT = 0, - SDC_MODE_4BIT, - SDC_MODE_8BIT -} sdcbusmode_t; - -/** - * @brief Max supported clock. - */ -typedef enum { - SDC_CLK_25MHz = 0, - SDC_CLK_50MHz, -} sdcbusclk_t; - /** * @brief Type of card flags. */ @@ -227,11 +210,11 @@ typedef struct { * afterward it can be reused for other purposes. */ uint8_t *scratchpad; - /* End of the mandatory fields.*/ /** * @brief Bus width. */ sdcbusmode_t bus_width; + /* End of the mandatory fields.*/ } SDCConfig; /** diff --git a/os/hal/templates/sdc_lld.c b/os/hal/templates/sdc_lld.c index dfc59b4b3..10ca534cd 100644 --- a/os/hal/templates/sdc_lld.c +++ b/os/hal/templates/sdc_lld.c @@ -114,9 +114,10 @@ void sdc_lld_start_clk(SDCDriver *sdcp) { * * @notapi */ -void sdc_lld_set_data_clk(SDCDriver *sdcp) { +void sdc_lld_set_data_clk(SDCDriver *sdcp, sdcbusclk_t clk) { (void)sdcp; + (void)clk; } /** diff --git a/os/hal/templates/sdc_lld.h b/os/hal/templates/sdc_lld.h index 4828149d2..8378750a1 100644 --- a/os/hal/templates/sdc_lld.h +++ b/os/hal/templates/sdc_lld.h @@ -49,15 +49,6 @@ /* Driver data structures and types. */ /*===========================================================================*/ -/** - * @brief Type of SDIO bus mode. - */ -typedef enum { - SDC_MODE_1BIT = 0, - SDC_MODE_4BIT, - SDC_MODE_8BIT -} sdcbusmode_t; - /** * @brief Type of card flags. */ @@ -86,6 +77,11 @@ typedef struct { * afterward it can be reused for other purposes. */ uint8_t *scratchpad; + /** + * @brief Bus width. + */ + sdcbusmode_t bus_width; + /* End of the mandatory fields.*/ } SDCConfig; /** @@ -150,7 +146,7 @@ extern "C" { void sdc_lld_start(SDCDriver *sdcp); void sdc_lld_stop(SDCDriver *sdcp); void sdc_lld_start_clk(SDCDriver *sdcp); - void sdc_lld_set_data_clk(SDCDriver *sdcp); + void sdc_lld_set_data_clk(SDCDriver *sdcp, sdcbusclk_t clk); void sdc_lld_stop_clk(SDCDriver *sdcp); void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode); void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg); @@ -160,10 +156,12 @@ extern "C" { uint32_t *resp); bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg, uint32_t *resp); + bool sdc_lld_read_special(SDCDriver *sdcp, uint8_t *buf, size_t bytes, + uint8_t cmd, uint32_t argument); bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, - uint8_t *buf, uint32_t n); + uint8_t *buf, uint32_t blocks); bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, - const uint8_t *buf, uint32_t n); + const uint8_t *buf, uint32_t blocks); bool sdc_lld_sync(SDCDriver *sdcp); bool sdc_lld_is_card_inserted(SDCDriver *sdcp); bool sdc_lld_is_write_protected(SDCDriver *sdcp);