mirror of https://github.com/ARMmbed/mbed-os.git
Added constructor parameter for frequency
parent
b11b635775
commit
97248873a4
|
@ -232,7 +232,7 @@
|
||||||
#define SPI_READ_ERROR_ECC_C (0x1 << 2) /*!< Card ECC failed */
|
#define SPI_READ_ERROR_ECC_C (0x1 << 2) /*!< Card ECC failed */
|
||||||
#define SPI_READ_ERROR_OFR (0x1 << 3) /*!< Out of Range */
|
#define SPI_READ_ERROR_OFR (0x1 << 3) /*!< Out of Range */
|
||||||
|
|
||||||
SDBlockDevice::SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName cs)
|
SDBlockDevice::SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName cs, uint64_t hz)
|
||||||
: _spi(mosi, miso, sclk), _cs(cs), _is_initialized(0)
|
: _spi(mosi, miso, sclk), _cs(cs), _is_initialized(0)
|
||||||
{
|
{
|
||||||
_cs = 1;
|
_cs = 1;
|
||||||
|
@ -240,7 +240,7 @@ SDBlockDevice::SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName c
|
||||||
|
|
||||||
// Set default to 100kHz for initialisation and 1MHz for data transfer
|
// Set default to 100kHz for initialisation and 1MHz for data transfer
|
||||||
_init_sck = 100000;
|
_init_sck = 100000;
|
||||||
_transfer_sck = 1000000;
|
_transfer_sck = hz;
|
||||||
|
|
||||||
// Only HC block size is supported.
|
// Only HC block size is supported.
|
||||||
_block_size = BLOCK_SIZE_HC;
|
_block_size = BLOCK_SIZE_HC;
|
||||||
|
|
|
@ -50,7 +50,7 @@ class SDBlockDevice : public BlockDevice {
|
||||||
public:
|
public:
|
||||||
/** Lifetime of an SD card
|
/** Lifetime of an SD card
|
||||||
*/
|
*/
|
||||||
SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName cs);
|
SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName cs, uint64_t hz=1000000);
|
||||||
virtual ~SDBlockDevice();
|
virtual ~SDBlockDevice();
|
||||||
|
|
||||||
/** Initialize a block device
|
/** Initialize a block device
|
||||||
|
|
Loading…
Reference in New Issue