diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 14:29:17 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 14:29:17 +0000 |
commit | aa431f4c1029cb75e70368b83b8af2803a186b35 (patch) | |
tree | be013b427c8359e8e58e51dcc5b25bca27a5491e /os | |
parent | d3f5e53d03b3288568f1d591ee16f662a630f127 (diff) | |
download | ChibiOS-aa431f4c1029cb75e70368b83b8af2803a186b35.tar.gz ChibiOS-aa431f4c1029cb75e70368b83b8af2803a186b35.tar.bz2 ChibiOS-aa431f4c1029cb75e70368b83b8af2803a186b35.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7731 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/include/sdc.h | 17 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/sdc_lld.h | 19 | ||||
-rw-r--r-- | os/hal/templates/sdc_lld.c | 3 | ||||
-rw-r--r-- | 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 @@ -182,23 +182,6 @@ /*===========================================================================*/
/**
- * @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.
*/
typedef uint32_t sdcmode_t;
@@ -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 @@ -50,15 +50,6 @@ /*===========================================================================*/
/**
- * @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.
*/
typedef uint32_t sdcmode_t;
@@ -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);
|