Arduino-SPI
Serial Peripheral Interface (SPI) library for Arduino
SPI.h
Go to the documentation of this file.
1 
19 #ifndef HARDWARE_SAM_SPI_H
20 #define HARDWARE_SAM_SPI_H
21 
22 #include "GPIO.h"
23 #include "SPI.h"
24 
28 namespace Hardware {
29 
30 class SPI : public ::SPI {
31 public:
35  SPI() : ::SPI() {}
36 
44  virtual void acquire(uint8_t mode, uint8_t bitorder, uint8_t scale)
45  {
46  (void) mode;
47  (void) bitorder;
48  (void) scale;
49  }
50 
57  virtual uint8_t transfer(uint8_t value)
58  __attribute__((always_inline))
59  {
60  (void) value;
61  return (0);
62  }
63 
72  virtual void transfer(void* dest, const void* src, size_t count)
73  {
74  if (count == 0 || dest == NULL || src == NULL) return;
75  }
76 
83  virtual void read(void* buf, size_t count)
84  {
85  if (count == 0 || buf == NULL) return;
86  }
87 
94  virtual void write(const void* buf, size_t count)
95  {
96  if (count == 0 || buf == NULL) return;
97  }
98 
99 protected:
100 };
101 };
102 #endif
Definition: SPI.h:27
virtual void acquire(uint8_t mode, uint8_t bitorder, uint8_t scale)
Definition: SPI.h:44
Definition: SPI.h:28
virtual void transfer(void *dest, const void *src, size_t count)
Definition: SPI.h:72
virtual uint8_t transfer(uint8_t value)
Definition: SPI.h:57
virtual void write(const void *buf, size_t count)
Definition: SPI.h:94
virtual void read(void *buf, size_t count)
Definition: SPI.h:83