GY-63_MS5611/libraries/FastShiftInOut
2023-02-20 19:36:46 +01:00
..
.github 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
examples 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
test 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
.arduino-ci.yml 0.1.0 FastShiftInOut 2022-11-05 10:55:35 +01:00
CHANGELOG.md 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
FastShiftInOut.cpp 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
FastShiftInOut.h 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
keywords.txt 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
library.json 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
library.properties 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
LICENSE 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00
README.md 0.1.3 FastShiftInOut 2023-02-20 19:36:46 +01:00

Arduino CI Arduino-lint JSON check License: MIT GitHub release

FastShiftInOut

Arduino library for AVR optimized shiftInOut (simultaneously).

Related libraries

Description

FastShiftInOut is a class that can send and receive bytes simultaneously. In that sense it mimics a SPI bus.

Experimental.

Performance

performance of write()

version UNO (us) ESP32 (us)
0.1.0 181.08 4.32
0.1.1 26.84 4.32
0.1.2 26.84 no data
0.1.3 25.52 4.32

Interface

#include "FastShiftInOut.h"

Functions

bitOrder = { LSBFIRST, MSBFIRST };

  • FastShiftInOut(uint8_t dataIn, uint8_t dataOut, uint8_t clockPin, uint8_t bitOrder = LSBFIRST) Constructor.
  • uint8_t write(uint8_t data) reads and writes simultaneously.
  • uint8_t lastWritten(void) returns last byte written.
  • uint8_t lastRead(void) returns last byte read.
  • bool setBitOrder(uint8_t bitOrder) bitOrder must be LSBFIRST or MSBFIRST.
  • uint8_t getBitOrder(void) idem.
  • uint8_t writeLSBFIRST(uint8_t data) optimized version, in practice almost no difference.
  • uint8_t writeMSBFIRST(uint8_t data) optimized version, in practice almost no difference.

Future

Must

  • documentation
  • follow FastShiftIn and FastShiftOut

should

could

  • void ignoreRead()
  • add Print interface?