SparkFun Toolkit  v1.0.5-6-g34ffa30
Core Functionality Library
Loading...
Searching...
No Matches
sfTkISPI.h
Go to the documentation of this file.
1
14#pragma once
15
16#include "sfTkIBus.h"
17
24const uint8_t ksfTkBusTypeSPI = 0x02;
25class sfTkISPI : public sfTkIBus
26{
27 public:
33 {
34 }
35
42 sfTkISPI(uint8_t csPin) : _cs{csPin}
43 {
44 }
45
52 virtual void setCS(uint8_t devCS)
53 {
54 _cs = devCS;
55 }
56
63 virtual uint8_t cs(void)
64 {
65 return _cs;
66 }
67
71 static constexpr uint8_t kNoCSPin = 0;
72
73 virtual uint8_t type(void)
74 {
75 return ksfTkBusTypeSPI;
76 }
77
78 private:
80 uint8_t _cs;
81};
82
83//};
Interface that defines the communication bus for the SparkFun Electronics Toolkit.
Definition: sfTkIBus.h:73
Definition: sfTkISPI.h:26
virtual void setCS(uint8_t devCS)
setter for the CS Pin
Definition: sfTkISPI.h:52
sfTkISPI(uint8_t csPin)
Constructor for the SPI bus.
Definition: sfTkISPI.h:42
static constexpr uint8_t kNoCSPin
A constant for no CS pin.
Definition: sfTkISPI.h:71
virtual uint8_t cs(void)
getter for the cs pin
Definition: sfTkISPI.h:63
sfTkISPI()
Constructor for the SPI bus.
Definition: sfTkISPI.h:32
virtual uint8_t type(void)
Get the type of the object.
Definition: sfTkISPI.h:73
Header file for the SparkFun Toolkit Device Bus Interface Definition.
const uint8_t ksfTkBusTypeSPI
Interface that defines the SPI communication bus for the SparkFun Electronics Toolkit.
Definition: sfTkISPI.h:24