Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
SdSpiArduinoDriver Class Reference

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

#include <SdSpiArduinoDriver.h>

Public Member Functions

void activate ()
 
void begin (SdSpiConfig spiConfig)
 
void deactivate ()
 
void end ()
 
uint8_t receive ()
 
uint8_t receive (uint8_t *buf, size_t count)
 
void send (uint8_t data)
 
void send (const uint8_t *buf, size_t count)
 
void setSckSpeed (uint32_t maxSck)
 

Private Attributes

SPIClass * m_spi
 
SPISettings m_spiSettings
 

Detailed Description

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

Member Function Documentation

◆ activate()

void SdSpiArduinoDriver::activate ( )
inline

Activate SPI hardware.

Copyright (c) 2011-2020 Bill Greiman This file is part of the SdFat library for SD memory cards.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

◆ begin()

void SdSpiArduinoDriver::begin ( SdSpiConfig  spiConfig)
inline

Initialize the SPI bus.

Parameters
[in]spiConfigSD card configuration.

◆ deactivate()

void SdSpiArduinoDriver::deactivate ( )
inline

Deactivate SPI hardware.

◆ end()

void SdSpiArduinoDriver::end ( )

End use of SPI driver after begin() call.

◆ receive() [1/2]

uint8_t SdSpiArduinoDriver::receive ( )
inline

Receive a byte.

Returns
The byte.

◆ receive() [2/2]

uint8_t SdSpiArduinoDriver::receive ( uint8_t *  buf,
size_t  count 
)
inline

Receive multiple bytes.

Parameters
[out]bufBuffer to receive the data.
[in]countNumber of bytes to receive.
Returns
Zero for no error or nonzero error code.

◆ send() [1/2]

void SdSpiArduinoDriver::send ( const uint8_t *  buf,
size_t  count 
)
inline

Send multiple bytes.

Parameters
[in]bufBuffer for data to be sent.
[in]countNumber of bytes to send.

◆ send() [2/2]

void SdSpiArduinoDriver::send ( uint8_t  data)
inline

Send a byte.

Parameters
[in]dataByte to send

◆ setSckSpeed()

void SdSpiArduinoDriver::setSckSpeed ( uint32_t  maxSck)
inline

Save high speed SPISettings after SD initialization.

Parameters
[in]maxSckMaximum SCK frequency.

Member Data Documentation

◆ m_spi

SPIClass* SdSpiArduinoDriver::m_spi
private

◆ m_spiSettings

SPISettings SdSpiArduinoDriver::m_spiSettings
private

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