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.
Toggle main menu visibility
Loading...
Searching...
No Matches
SdSpiSoftDriver.h
Go to the documentation of this file.
1
29
#ifndef SdSpiSoftDriver_h
30
#define SdSpiSoftDriver_h
31
#include "
../DigitalIO/SoftSPI.h
"
36
class
SdSpiSoftDriver
37
{
38
public
:
40
void
activate
()
41
{
42
}
43
44
virtual
void
begin
() = 0;
49
void
begin
(
SdSpiConfig
spiConfig)
50
{
51
(void)spiConfig;
52
begin
();
53
}
54
55
void
deactivate
()
56
{
57
}
58
62
virtual
uint8_t
receive
() = 0;
70
uint8_t
receive
(uint8_t *buf,
size_t
count)
71
{
72
for
(
size_t
i = 0; i < count; i++)
73
{
74
buf[i] =
receive
();
75
}
76
return
0;
77
}
78
82
virtual
void
send
(uint8_t data) = 0;
88
void
send
(
const
uint8_t *buf,
size_t
count)
89
{
90
for
(
size_t
i = 0; i < count; i++)
91
{
92
send
(buf[i]);
93
}
94
}
95
99
void
setSckSpeed
(uint32_t maxSck)
100
{
101
(void)maxSck;
102
}
103
};
104
//------------------------------------------------------------------------------
109
template
<u
int
8_t MisoPin, u
int
8_t MosiPin, u
int
8_t SckPin>
class
SoftSpiDriver
:
public
SdSpiSoftDriver
110
{
111
public
:
113
void
begin
()
114
{
115
m_spi
.begin();
116
}
117
121
uint8_t
receive
()
122
{
123
return
m_spi
.receive();
124
}
125
129
void
send
(uint8_t data)
130
{
131
m_spi
.send(data);
132
}
133
134
private
:
135
SoftSPI<MisoPin, MosiPin, SckPin, 0>
m_spi
;
136
};
137
139
typedef
SdSpiSoftDriver
SdSpiDriver
;
140
#endif
// SdSpiSoftDriver_h
SdSpiDriver
SdSpiArduinoDriver SdSpiDriver
Definition
SdSpiArduinoDriver.h:91
SoftSPI.h
Software SPI.
SdSpiConfig
SPI card configuration.
Definition
SdSpiDriver.h:112
SdSpiSoftDriver
Base class for external soft SPI.
Definition
SdSpiSoftDriver.h:37
SdSpiSoftDriver::deactivate
void deactivate()
Definition
SdSpiSoftDriver.h:55
SdSpiSoftDriver::receive
virtual uint8_t receive()=0
SdSpiSoftDriver::send
void send(const uint8_t *buf, size_t count)
Definition
SdSpiSoftDriver.h:88
SdSpiSoftDriver::setSckSpeed
void setSckSpeed(uint32_t maxSck)
Definition
SdSpiSoftDriver.h:99
SdSpiSoftDriver::send
virtual void send(uint8_t data)=0
SdSpiSoftDriver::receive
uint8_t receive(uint8_t *buf, size_t count)
Definition
SdSpiSoftDriver.h:70
SdSpiSoftDriver::activate
void activate()
Definition
SdSpiSoftDriver.h:40
SdSpiSoftDriver::begin
virtual void begin()=0
SdSpiSoftDriver::begin
void begin(SdSpiConfig spiConfig)
Definition
SdSpiSoftDriver.h:49
SoftSPI
Fast software SPI.
Definition
SoftSPI.h:49
SoftSpiDriver
Class for external soft SPI.
Definition
SdSpiSoftDriver.h:110
SoftSpiDriver::receive
uint8_t receive()
Definition
SdSpiSoftDriver.h:121
SoftSpiDriver::begin
void begin()
Definition
SdSpiSoftDriver.h:113
SoftSpiDriver::m_spi
SoftSPI< MisoPin, MosiPin, SckPin, 0 > m_spi
Definition
SdSpiSoftDriver.h:135
SoftSpiDriver::send
void send(uint8_t data)
Definition
SdSpiSoftDriver.h:129
src
SpiDriver
SdSpiSoftDriver.h
Generated on
for Soldered SD Card Arduino Library by
1.17.0. Dark theme by
Tilen Majerle
. All rights reserved. Copyright:
Soldered