Permalink
Browse files

Moving select/deselect to SPIUart

  • Loading branch information...
1 parent d5f85dd commit b75a0e0fdc1ccd96e421bf714456fe033d9dce08 @bobbrez bobbrez committed Feb 23, 2012
Showing with 10 additions and 20 deletions.
  1. +8 −0 SpiUart.cpp
  2. +2 −0 SpiUart.h
  3. +0 −17 _Spi.cpp
  4. +0 −3 _Spi.h
View
@@ -87,6 +87,14 @@ void SpiUartDevice::begin(unsigned long baudrate /* default value */) {
initUart(baudrate);
}
+void SpiUartDevice::deselect() {
+ digitalWrite(SS, HIGH);
+}
+
+
+void SpiUartDevice::select() {
+ digitalWrite(SS, LOW);
+}
void SpiUartDevice::initUart(unsigned long baudrate) {
/*
View
@@ -81,6 +81,8 @@ class SpiUartDevice : public SpiDevice, public Stream {
void ioSetState(unsigned char bits);
private:
+ void deselect();
+ void select();
void writeRegister(byte registerAddress, byte data);
byte readRegister(byte registerAddress);
void initUart(unsigned long baudrate);
View
@@ -7,24 +7,7 @@ SpiDevice::SpiDevice() {
}
-void SpiDevice::deselect() {
- /*
-
- Deselect the SPI device.
-
- */
- digitalWrite(SS, HIGH);
-}
-
-void SpiDevice::select() {
- /*
-
- Select the SPI device.
-
- */
- digitalWrite(SS, LOW);
-}
byte SpiDevice::transfer(volatile byte data) {
View
3 _Spi.h
@@ -19,9 +19,6 @@ class SpiDevice {
public:
SpiDevice();
- void deselect();
- void select();
-
byte transfer(volatile byte data);
void transfer_bulk(const uint8_t* srcptr, unsigned long int length);
};

0 comments on commit b75a0e0

Please sign in to comment.