-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBt_Spi.hpp
44 lines (32 loc) · 1.07 KB
/
Bt_Spi.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//*************************************************************************************************
//
// BITTAILOR.CH - BtMqttSn, an Arduino library for MQTT-SN over nRF24L01+
//
//-------------------------------------------------------------------------------------------------
//
// Bt::Spi
//
//*************************************************************************************************
#ifndef INC__Bt_Spi__hpp
#define INC__Bt_Spi__hpp
#include "Bt_Pin.hpp"
namespace Bt {
class Spi
{
public:
enum BitOrder {BIT_ORDER_LSBFIRST , BIT_ORDER_MSBFIRST};
enum Mode {MODE_0,MODE_1,MODE_2,MODE_3};
enum Speed {SPEED_4_MHZ, SPEED_8_MHZ};
Spi(BitOrder iBitOrder, Mode iSpiMode, Speed iSpeed, Pin& iChipSelectPin);
~Spi();
void chipSelect(bool iSelect);
uint8_t transfer(uint8_t iData);
private:
// Constructor to prohibit copy construction.
Spi(const Spi&);
// Operator= to prohibit copy assignment
Spi& operator=(const Spi&);
Pin* mChipSelectPin;
};
} // namespace Bt
#endif // INC__Bt_Spi__hpp