git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7731 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
d3f5e53d03
commit
aa431f4c10
|
@ -105,6 +105,23 @@
|
||||||
/* Driver data structures and types. */
|
/* 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"
|
#include "sdc_lld.h"
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -181,23 +181,6 @@
|
||||||
/* Driver data structures and types. */
|
/* 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.
|
* @brief Type of card flags.
|
||||||
*/
|
*/
|
||||||
|
@ -227,11 +210,11 @@ typedef struct {
|
||||||
* afterward it can be reused for other purposes.
|
* afterward it can be reused for other purposes.
|
||||||
*/
|
*/
|
||||||
uint8_t *scratchpad;
|
uint8_t *scratchpad;
|
||||||
/* End of the mandatory fields.*/
|
|
||||||
/**
|
/**
|
||||||
* @brief Bus width.
|
* @brief Bus width.
|
||||||
*/
|
*/
|
||||||
sdcbusmode_t bus_width;
|
sdcbusmode_t bus_width;
|
||||||
|
/* End of the mandatory fields.*/
|
||||||
} SDCConfig;
|
} SDCConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -114,9 +114,10 @@ void sdc_lld_start_clk(SDCDriver *sdcp) {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
void sdc_lld_set_data_clk(SDCDriver *sdcp) {
|
void sdc_lld_set_data_clk(SDCDriver *sdcp, sdcbusclk_t clk) {
|
||||||
|
|
||||||
(void)sdcp;
|
(void)sdcp;
|
||||||
|
(void)clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,15 +49,6 @@
|
||||||
/* Driver data structures and types. */
|
/* 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.
|
* @brief Type of card flags.
|
||||||
*/
|
*/
|
||||||
|
@ -86,6 +77,11 @@ typedef struct {
|
||||||
* afterward it can be reused for other purposes.
|
* afterward it can be reused for other purposes.
|
||||||
*/
|
*/
|
||||||
uint8_t *scratchpad;
|
uint8_t *scratchpad;
|
||||||
|
/**
|
||||||
|
* @brief Bus width.
|
||||||
|
*/
|
||||||
|
sdcbusmode_t bus_width;
|
||||||
|
/* End of the mandatory fields.*/
|
||||||
} SDCConfig;
|
} SDCConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,7 +146,7 @@ extern "C" {
|
||||||
void sdc_lld_start(SDCDriver *sdcp);
|
void sdc_lld_start(SDCDriver *sdcp);
|
||||||
void sdc_lld_stop(SDCDriver *sdcp);
|
void sdc_lld_stop(SDCDriver *sdcp);
|
||||||
void sdc_lld_start_clk(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_stop_clk(SDCDriver *sdcp);
|
||||||
void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode);
|
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);
|
void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg);
|
||||||
|
@ -160,10 +156,12 @@ extern "C" {
|
||||||
uint32_t *resp);
|
uint32_t *resp);
|
||||||
bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
|
bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
|
||||||
uint32_t *resp);
|
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,
|
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,
|
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_sync(SDCDriver *sdcp);
|
||||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp);
|
bool sdc_lld_is_card_inserted(SDCDriver *sdcp);
|
||||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp);
|
bool sdc_lld_is_write_protected(SDCDriver *sdcp);
|
||||||
|
|
Loading…
Reference in New Issue