8 #define BITORDER MSBFIRST 10 #if defined(USE_SOFTWARE_SPI) 12 #if defined(ARDUINO_attiny) 13 #include "Software/Serial.h" 14 Software::Serial<BOARD::D0> Serial;
35 BENCHMARK_BASELINE(1000);
49 BENCHMARK(
"1a. SPI bus manager data transfer only (1 byte)", 1000) {
53 BENCHMARK(
"1b. - transfer (10 byte)", 1000) {
57 BENCHMARK(
"1c. - transfer (100 byte)", 1000) {
61 BENCHMARK(
"1d. - read (100 byte)", 1000) {
65 BENCHMARK(
"1e. - write only (100 byte)", 1000) {
71 BENCHMARK(
"2a. SPI bus manager data transfer (1 byte)", 1000) {
79 BENCHMARK(
"2b. - transfer (10 byte)", 1000) {
87 BENCHMARK(
"2c. - transfer (100 byte)", 1000) {
95 BENCHMARK(
"2d. - read (100 byte)", 1000) {
103 BENCHMARK(
"2e. - write (100 byte)", 1000) {
106 spi.
write(dest, 100);
112 BENCHMARK(
"3a. SPI device driver data transfer only (1 byte)", 1000) {
113 dev.transfer(src[0]);
116 BENCHMARK(
"3b. - transfer (10 bytes)", 1000) {
117 dev.transfer(dest, src, 10);
120 BENCHMARK(
"3c. - transfer (100 bytes)", 1000) {
121 dev.transfer(dest, src, 100);
124 BENCHMARK(
"3d. - read (100 bytes)", 1000) {
128 BENCHMARK(
"3e. - write (100 bytes)", 1000) {
133 BENCHMARK(
"4a. SPI device driver data transfer (1 byte)", 1000) {
135 dev.transfer(src[0]);
139 BENCHMARK(
"4b. - transfer (10 bytes)", 1000) {
141 dev.transfer(dest, src, 10);
145 BENCHMARK(
"4c. - transfer (100 bytes)", 1000) {
147 dev.transfer(dest, src, 100);
151 BENCHMARK(
"4d. - read (100 bytes)", 1000) {
157 BENCHMARK(
"4e. - write (100 bytes)", 1000) {
virtual void acquire(uint8_t mode, uint8_t bitorder, uint8_t prescale)
virtual uint8_t transfer(uint8_t value)
static const uint32_t MAX_FREQ
virtual uint8_t prescale(uint32_t frequency)
virtual void write(const void *buf, size_t count)
virtual void read(void *buf, size_t count)
SPI::Device< 0, BITORDER, SPI::MAX_FREQ, BOARD::D10 > dev(spi)