SdSpiSoftDriver< MisoPin, MosiPin, SckPin > Class Template Reference

Software SPI class for access to SD and SDHC flash memory cards. More...

`#include <SdSpiDriver.h>`

Inheritance diagram for SdSpiSoftDriver< MisoPin, MosiPin, SckPin >:
[legend]
Collaboration diagram for SdSpiSoftDriver< MisoPin, MosiPin, SckPin >:
[legend]

## Public Member Functions

void | activate ()
void | begin (uint8_t csPin)
void | deactivate ()
uint8_t | receive ()
uint8_t | receive (uint8_t *buf, size_t n)
void | select ()
void | send (uint8_t data)
void | send (const uint8_t *buf, size_t n)
void | setSpiSettings (SPISettings spiSettings)
void | unselect ()

## Detailed Description

### template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>
class SdSpiSoftDriver< MisoPin, MosiPin, SckPin >

Software SPI class for access to SD and SDHC flash memory cards.

## Member Function Documentation

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::activate | ( |  | ) |

inlinevirtual

Dummy activate SPI hardware for software SPI

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::begin | ( | uint8_t | csPin | ) |

inlinevirtual

Initialize the SPI bus.

Parameters

  [in] | csPin | SD card chip select pin.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::deactivate | ( |  | ) |

inlinevirtual

Dummy deactivate SPI hardware for software SPI

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

uint8_t SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::receive | ( |  | ) |

inlinevirtual

Receive a byte.

Returns
  The byte.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

uint8_t SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::receive | ( | uint8_t * | buf,
|  | size_t | n
| ) |  |

inlinevirtual

Receive multiple bytes.

Parameters

  [out] | buf | Buffer to receive the data.
  [in] | n | Number of bytes to receive.

Returns
  Zero for no error or nonzero error code.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::select | ( |  | ) |

inlinevirtual

Set CS low.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::send | ( | uint8_t | data | ) |

inlinevirtual

Send a byte.

Parameters

  [in] | data | Byte to send

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::send | ( | const uint8_t * | buf,
|  | size_t | n
| ) |  |

inlinevirtual

Send multiple bytes.

Parameters

  [in] | buf | Buffer for data to be sent.
  [in] | n | Number of bytes to send.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::setSpiSettings | ( | SPISettings | spiSettings | ) |

inlinevirtual

Save SPISettings.

Parameters

  [in] | spiSettings | SPI speed, mode, and byte order.

Implements SdSpiBaseDriver.

template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>

void SdSpiSoftDriver< MisoPin, MosiPin, SckPin >::unselect | ( |  | ) |

inlinevirtual

Set CS high.

Implements SdSpiBaseDriver.

The documentation for this class was generated from the following file:

- Arduino/libraries/SdFat/src/SdSpiDriver.h