Transplantation from Arduino MCP2515 Library which is made by Kyle Crockett. http://code.google.com/p/canduino/source/browse/trunk/Library/CAN/CAN.h?r=24

Dependents:   DISCO-F746NG_rtos_test

Committer:
FalconOnishi
Date:
Fri Jan 18 17:00:28 2013 +0000
Revision:
0:b65cb1bbf0ce
Add some utility methods

Who changed what in which revision?

UserRevisionLine numberNew contents of line
FalconOnishi 0:b65cb1bbf0ce 1 #include "mbed.h"
FalconOnishi 0:b65cb1bbf0ce 2
FalconOnishi 0:b65cb1bbf0ce 3 /*
FalconOnishi 0:b65cb1bbf0ce 4 Created by: Kyle Crockett
FalconOnishi 0:b65cb1bbf0ce 5 For MCP2515duino with 16MHz oscillator.
FalconOnishi 0:b65cb1bbf0ce 6 CNFx register values.
FalconOnishi 0:b65cb1bbf0ce 7 use preprocessor command "_XXkbps"
FalconOnishi 0:b65cb1bbf0ce 8 "XX" is the baud rate.
FalconOnishi 0:b65cb1bbf0ce 9
FalconOnishi 0:b65cb1bbf0ce 10 10 kbps
FalconOnishi 0:b65cb1bbf0ce 11 CNF1/BRGCON1 b'00110001' 0x31
FalconOnishi 0:b65cb1bbf0ce 12 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 13 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 14
FalconOnishi 0:b65cb1bbf0ce 15 20 kbps
FalconOnishi 0:b65cb1bbf0ce 16 CNF1/BRGCON1 b'00011000' 0x18
FalconOnishi 0:b65cb1bbf0ce 17 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 18 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 19
FalconOnishi 0:b65cb1bbf0ce 20 50 kbps
FalconOnishi 0:b65cb1bbf0ce 21 CNF1/BRGCON1 b'00001001' 0x09
FalconOnishi 0:b65cb1bbf0ce 22 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 23 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 24
FalconOnishi 0:b65cb1bbf0ce 25 100 kbps
FalconOnishi 0:b65cb1bbf0ce 26 CNF1/BRGCON1 b'00000100' 0x04
FalconOnishi 0:b65cb1bbf0ce 27 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 28 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 29
FalconOnishi 0:b65cb1bbf0ce 30 125 kbps
FalconOnishi 0:b65cb1bbf0ce 31 CNF1/BRGCON1 b'00000011' 0x03
FalconOnishi 0:b65cb1bbf0ce 32 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 33 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 34
FalconOnishi 0:b65cb1bbf0ce 35 250 kbps
FalconOnishi 0:b65cb1bbf0ce 36 CNF1/BRGCON1 b'00000001' 0x01
FalconOnishi 0:b65cb1bbf0ce 37 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 38 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 39
FalconOnishi 0:b65cb1bbf0ce 40 500 kbps
FalconOnishi 0:b65cb1bbf0ce 41 CNF1/BRGCON1 b'00000000' 0x00
FalconOnishi 0:b65cb1bbf0ce 42 CNF2/BRGCON2 b'10111000' 0xB8
FalconOnishi 0:b65cb1bbf0ce 43 CNF3/BRGCON3 b'00000101' 0x05
FalconOnishi 0:b65cb1bbf0ce 44
FalconOnishi 0:b65cb1bbf0ce 45 800 kbps
FalconOnishi 0:b65cb1bbf0ce 46 Not yet supported
FalconOnishi 0:b65cb1bbf0ce 47
FalconOnishi 0:b65cb1bbf0ce 48 1000 kbps
FalconOnishi 0:b65cb1bbf0ce 49 Settings added by Patrick Cruce(pcruce_at_igpp.ucla.edu)
FalconOnishi 0:b65cb1bbf0ce 50 CNF1=b'10000000'=0x80 = SJW = 3 Tq. & BRP = 0
FalconOnishi 0:b65cb1bbf0ce 51 CNF2=b'10010000'=0x90 = BLTMode = 1 & SAM = 0 & PS1 = 3 & PR = 1
FalconOnishi 0:b65cb1bbf0ce 52 CNF3=b'00000010'=0x02 = SOF = 0 & WAKFIL = 0 & PS2 = 3
FalconOnishi 0:b65cb1bbf0ce 53
FalconOnishi 0:b65cb1bbf0ce 54 */
FalconOnishi 0:b65cb1bbf0ce 55 #ifndef MCP2515_h
FalconOnishi 0:b65cb1bbf0ce 56 #define MCP2515_h
FalconOnishi 0:b65cb1bbf0ce 57
FalconOnishi 0:b65cb1bbf0ce 58 #define SCK 13 //spi
FalconOnishi 0:b65cb1bbf0ce 59 #define MISO 12
FalconOnishi 0:b65cb1bbf0ce 60 #define MOSI 11
FalconOnishi 0:b65cb1bbf0ce 61 #define SS 10
FalconOnishi 0:b65cb1bbf0ce 62 #define RESET 2//reset pin
FalconOnishi 0:b65cb1bbf0ce 63
FalconOnishi 0:b65cb1bbf0ce 64 #define RESET_REG 0xc0
FalconOnishi 0:b65cb1bbf0ce 65 #define READ 0x03
FalconOnishi 0:b65cb1bbf0ce 66 #define WRITE 0x02 //read and write comands for SPI
FalconOnishi 0:b65cb1bbf0ce 67
FalconOnishi 0:b65cb1bbf0ce 68 #define READ_RX_BUF_0_ID 0x90
FalconOnishi 0:b65cb1bbf0ce 69 #define READ_RX_BUF_0_DATA 0x92
FalconOnishi 0:b65cb1bbf0ce 70 #define READ_RX_BUF_1_ID 0x94
FalconOnishi 0:b65cb1bbf0ce 71 #define READ_RX_BUF_1_DATA 0x96 //SPI commands for reading MCP2515 RX buffers
FalconOnishi 0:b65cb1bbf0ce 72
FalconOnishi 0:b65cb1bbf0ce 73 #define LOAD_TX_BUF_0_ID 0x40
FalconOnishi 0:b65cb1bbf0ce 74 #define LOAD_TX_BUF_0_DATA 0x41
FalconOnishi 0:b65cb1bbf0ce 75 #define LOAD_TX_BUF_1_ID 0x42
FalconOnishi 0:b65cb1bbf0ce 76 #define LOAD_TX_BUF_1_DATA 0x43
FalconOnishi 0:b65cb1bbf0ce 77 #define LOAD_TX_BUF_2_ID 0x44
FalconOnishi 0:b65cb1bbf0ce 78 #define LOAD_TX_BUF_2_DATA 0x45 //SPI commands for loading MCP2515 TX buffers
FalconOnishi 0:b65cb1bbf0ce 79
FalconOnishi 0:b65cb1bbf0ce 80 #define SEND_TX_BUF_0 0x81
FalconOnishi 0:b65cb1bbf0ce 81 #define SEND_TX_BUF_1 0x82
FalconOnishi 0:b65cb1bbf0ce 82 #define SEND_TX_BUF_2 0x83 //SPI commands for transmitting MCP2515 TX buffers
FalconOnishi 0:b65cb1bbf0ce 83
FalconOnishi 0:b65cb1bbf0ce 84 #define READ_STATUS 0xA0
FalconOnishi 0:b65cb1bbf0ce 85 #define RX_STATUS 0xB0
FalconOnishi 0:b65cb1bbf0ce 86 #define BIT_MODIFY 0x05 //Other commands
FalconOnishi 0:b65cb1bbf0ce 87
FalconOnishi 0:b65cb1bbf0ce 88
FalconOnishi 0:b65cb1bbf0ce 89 //Registers
FalconOnishi 0:b65cb1bbf0ce 90 #define CNF0 0x2A
FalconOnishi 0:b65cb1bbf0ce 91 #define CNF1 0x29
FalconOnishi 0:b65cb1bbf0ce 92 #define CNF2 0x28
FalconOnishi 0:b65cb1bbf0ce 93 #define TXB0CTRL 0x30
FalconOnishi 0:b65cb1bbf0ce 94 #define TXB1CTRL 0x40
FalconOnishi 0:b65cb1bbf0ce 95 #define TXB2CTRL 0x50 //TRANSMIT BUFFER CONTROL REGISTER
FalconOnishi 0:b65cb1bbf0ce 96 #define TXB0DLC 0x35 //Data length code registers
FalconOnishi 0:b65cb1bbf0ce 97 #define TXB1DLC 0x45
FalconOnishi 0:b65cb1bbf0ce 98 #define TXB2DLC 0x55
FalconOnishi 0:b65cb1bbf0ce 99 #define MCP2515CTRL 0x0F //Mode control register
FalconOnishi 0:b65cb1bbf0ce 100 #define MCP2515STAT 0x0E //Mode status register
FalconOnishi 0:b65cb1bbf0ce 101
FalconOnishi 0:b65cb1bbf0ce 102 //------------------------------------------------------------------------------
FalconOnishi 0:b65cb1bbf0ce 103 //Added for ram
FalconOnishi 0:b65cb1bbf0ce 104 // Register Bit Masks
FalconOnishi 0:b65cb1bbf0ce 105 // MCP2515STAT
FalconOnishi 0:b65cb1bbf0ce 106 #define MODE_CONFIG 0x80
FalconOnishi 0:b65cb1bbf0ce 107 #define MODE_LISTEN 0x60
FalconOnishi 0:b65cb1bbf0ce 108 #define MODE_LOOPBACK 0x40
FalconOnishi 0:b65cb1bbf0ce 109 #define MODE_SLEEP 0x20
FalconOnishi 0:b65cb1bbf0ce 110 #define MODE_NORMAL 0x00
FalconOnishi 0:b65cb1bbf0ce 111
FalconOnishi 0:b65cb1bbf0ce 112 //MCP2515 bus error counter
FalconOnishi 0:b65cb1bbf0ce 113 #define TEC 0x1C
FalconOnishi 0:b65cb1bbf0ce 114 #define REC 0x1D
FalconOnishi 0:b65cb1bbf0ce 115
FalconOnishi 0:b65cb1bbf0ce 116 //Mask 0
FalconOnishi 0:b65cb1bbf0ce 117 #define RXM0SIDH 0x20 //Mask0 normal ID high
FalconOnishi 0:b65cb1bbf0ce 118 #define RXM0SIDL 0x21 //Mask0 normal ID low
FalconOnishi 0:b65cb1bbf0ce 119 #define RXM0EID8 0x22 //Mask0 extended ID high
FalconOnishi 0:b65cb1bbf0ce 120 #define RXM0EID0 0x23 //Mask0 extended ID low
FalconOnishi 0:b65cb1bbf0ce 121
FalconOnishi 0:b65cb1bbf0ce 122 //Mask 1
FalconOnishi 0:b65cb1bbf0ce 123 #define RXM1SIDH 0x24 //Mask1 normal ID high
FalconOnishi 0:b65cb1bbf0ce 124 #define RXM1SIDL 0x25 //Mask1 normal ID low
FalconOnishi 0:b65cb1bbf0ce 125 #define RXM1EID8 0x26 //Mask1 extended ID high
FalconOnishi 0:b65cb1bbf0ce 126 #define RXM1EID0 0x27 //Mask1 extended ID low
FalconOnishi 0:b65cb1bbf0ce 127
FalconOnishi 0:b65cb1bbf0ce 128 #define MCP2515INTE 0x2B //Interept permission
FalconOnishi 0:b65cb1bbf0ce 129 #define MCP2515INTF 0x2C //Interept flag
FalconOnishi 0:b65cb1bbf0ce 130 #define EFLG 0x2D //Error flag
FalconOnishi 0:b65cb1bbf0ce 131
FalconOnishi 0:b65cb1bbf0ce 132 #define MASK_SID_ALL_HIT 0x0000 //Mask all
FalconOnishi 0:b65cb1bbf0ce 133 #define MASK_SID_CPL_MATCH 0x07FF //Disable mask
FalconOnishi 0:b65cb1bbf0ce 134
FalconOnishi 0:b65cb1bbf0ce 135
FalconOnishi 0:b65cb1bbf0ce 136 #define MCP2515_RTS 0x80
FalconOnishi 0:b65cb1bbf0ce 137 #define MCP2515_READ_BUFFER 0x90
FalconOnishi 0:b65cb1bbf0ce 138 #define MCP2515_LOAD_BUFFER 0X40
FalconOnishi 0:b65cb1bbf0ce 139
FalconOnishi 0:b65cb1bbf0ce 140 //..............................................................................
FalconOnishi 0:b65cb1bbf0ce 141 //test
FalconOnishi 0:b65cb1bbf0ce 142 // MCP2515INTF
FalconOnishi 0:b65cb1bbf0ce 143 #define RX0IF 0x01
FalconOnishi 0:b65cb1bbf0ce 144 #define RX1IF 0x02
FalconOnishi 0:b65cb1bbf0ce 145 #define TX0IF 0x04
FalconOnishi 0:b65cb1bbf0ce 146 #define TX1IF 0x08
FalconOnishi 0:b65cb1bbf0ce 147 #define TX2IF 0x10
FalconOnishi 0:b65cb1bbf0ce 148 #define ERRIF 0x20
FalconOnishi 0:b65cb1bbf0ce 149 #define WAKIF 0x40
FalconOnishi 0:b65cb1bbf0ce 150 #define MERRF 0x80
FalconOnishi 0:b65cb1bbf0ce 151
FalconOnishi 0:b65cb1bbf0ce 152 // Configuration Registers
FalconOnishi 0:b65cb1bbf0ce 153 #define BFPCTRL 0x0C
FalconOnishi 0:b65cb1bbf0ce 154 #define TXRTSCTRL 0x0D
FalconOnishi 0:b65cb1bbf0ce 155
FalconOnishi 0:b65cb1bbf0ce 156 // TX Buffer 0
FalconOnishi 0:b65cb1bbf0ce 157 #define TXB0CTRL 0x30
FalconOnishi 0:b65cb1bbf0ce 158 #define TXB0SIDH 0x31
FalconOnishi 0:b65cb1bbf0ce 159 #define TXB0SIDL 0x32
FalconOnishi 0:b65cb1bbf0ce 160 #define TXB0EID8 0x33
FalconOnishi 0:b65cb1bbf0ce 161 #define TXB0EID0 0x34
FalconOnishi 0:b65cb1bbf0ce 162 #define TXB0DLC 0x35
FalconOnishi 0:b65cb1bbf0ce 163
FalconOnishi 0:b65cb1bbf0ce 164 // TX Buffer 1
FalconOnishi 0:b65cb1bbf0ce 165 #define TXB1CTRL 0x40
FalconOnishi 0:b65cb1bbf0ce 166 #define TXB1SIDH 0x41
FalconOnishi 0:b65cb1bbf0ce 167 #define TXB1SIDL 0x42
FalconOnishi 0:b65cb1bbf0ce 168 #define TXB1EID8 0x43
FalconOnishi 0:b65cb1bbf0ce 169 #define TXB1EID0 0x44
FalconOnishi 0:b65cb1bbf0ce 170 #define TXB1DLC 0x45
FalconOnishi 0:b65cb1bbf0ce 171
FalconOnishi 0:b65cb1bbf0ce 172 // TX Buffer 2
FalconOnishi 0:b65cb1bbf0ce 173 #define TXB2CTRL 0x50
FalconOnishi 0:b65cb1bbf0ce 174 #define TXB2SIDH 0x51
FalconOnishi 0:b65cb1bbf0ce 175 #define TXB2SIDL 0x52
FalconOnishi 0:b65cb1bbf0ce 176 #define TXB2EID8 0x53
FalconOnishi 0:b65cb1bbf0ce 177 #define TXB2EID0 0x54
FalconOnishi 0:b65cb1bbf0ce 178 #define TXB2DLC 0x55
FalconOnishi 0:b65cb1bbf0ce 179
FalconOnishi 0:b65cb1bbf0ce 180 // RX Buffer 0
FalconOnishi 0:b65cb1bbf0ce 181 #define RXB0CTRL 0x60
FalconOnishi 0:b65cb1bbf0ce 182 #define RXB0SIDH 0x61
FalconOnishi 0:b65cb1bbf0ce 183 #define RXB0SIDL 0x62
FalconOnishi 0:b65cb1bbf0ce 184 #define RXB0EID8 0x63
FalconOnishi 0:b65cb1bbf0ce 185 #define RXB0EID0 0x64
FalconOnishi 0:b65cb1bbf0ce 186 #define RXB0DLC 0x65
FalconOnishi 0:b65cb1bbf0ce 187
FalconOnishi 0:b65cb1bbf0ce 188 // RX Buffer 1
FalconOnishi 0:b65cb1bbf0ce 189 #define RXB1CTRL 0x70
FalconOnishi 0:b65cb1bbf0ce 190 #define RXB1SIDH 0x71
FalconOnishi 0:b65cb1bbf0ce 191 #define RXB1SIDL 0x72
FalconOnishi 0:b65cb1bbf0ce 192 #define RXB1EID8 0x73
FalconOnishi 0:b65cb1bbf0ce 193 #define RXB1EID0 0x74
FalconOnishi 0:b65cb1bbf0ce 194 #define RXB1DLC 0x75
FalconOnishi 0:b65cb1bbf0ce 195
FalconOnishi 0:b65cb1bbf0ce 196 // Buffer Bit Masks
FalconOnishi 0:b65cb1bbf0ce 197 #define RXB0 0x00
FalconOnishi 0:b65cb1bbf0ce 198 #define RXB1 0x02
FalconOnishi 0:b65cb1bbf0ce 199 #define TXB0 0x01
FalconOnishi 0:b65cb1bbf0ce 200 #define TXB1 0x02
FalconOnishi 0:b65cb1bbf0ce 201 #define TXB2 0x04
FalconOnishi 0:b65cb1bbf0ce 202 #define TXB_ALL TXB0 | TXB1 | TXB2
FalconOnishi 0:b65cb1bbf0ce 203
FalconOnishi 0:b65cb1bbf0ce 204 #define RXB_RX_STDEXT 0x00
FalconOnishi 0:b65cb1bbf0ce 205 #define RXB_RX_MASK 0x60
FalconOnishi 0:b65cb1bbf0ce 206 #define RXB_BUKT_MASK (1<<2)
FalconOnishi 0:b65cb1bbf0ce 207
FalconOnishi 0:b65cb1bbf0ce 208 typedef unsigned char byte;
FalconOnishi 0:b65cb1bbf0ce 209
FalconOnishi 0:b65cb1bbf0ce 210 enum MCP2515Mode {CONFIGURATION,NORMAL,SLEEP,LISTEN,LOOPBACK};
FalconOnishi 0:b65cb1bbf0ce 211
FalconOnishi 0:b65cb1bbf0ce 212 class MCP2515
FalconOnishi 0:b65cb1bbf0ce 213 {
FalconOnishi 0:b65cb1bbf0ce 214 public:
FalconOnishi 0:b65cb1bbf0ce 215 MCP2515(SPI& spi, PinName cs);
FalconOnishi 0:b65cb1bbf0ce 216 //void begin();//sets up MCP2515
FalconOnishi 0:b65cb1bbf0ce 217 void baudConfig(int bitRate);//sets up baud
FalconOnishi 0:b65cb1bbf0ce 218
FalconOnishi 0:b65cb1bbf0ce 219 //Method added to enable testing in loopback mode.(pcruce_at_igpp.ucla.edu)
FalconOnishi 0:b65cb1bbf0ce 220 void setMode(MCP2515Mode mode) ;//put MCP2515 controller in one of five modes
FalconOnishi 0:b65cb1bbf0ce 221
FalconOnishi 0:b65cb1bbf0ce 222 void send_0();//request to transmit buffer X
FalconOnishi 0:b65cb1bbf0ce 223 void send_1();
FalconOnishi 0:b65cb1bbf0ce 224 void send_2();
FalconOnishi 0:b65cb1bbf0ce 225
FalconOnishi 0:b65cb1bbf0ce 226 char readID_0();//read ID/DATA of recieve buffer X
FalconOnishi 0:b65cb1bbf0ce 227 char readID_1();
FalconOnishi 0:b65cb1bbf0ce 228
FalconOnishi 0:b65cb1bbf0ce 229 char readDATA_0();
FalconOnishi 0:b65cb1bbf0ce 230 char readDATA_1();
FalconOnishi 0:b65cb1bbf0ce 231
FalconOnishi 0:b65cb1bbf0ce 232 //extending MCP2515 data read to full frames(pcruce_at_igpp.ucla.edu)
FalconOnishi 0:b65cb1bbf0ce 233 //data_out should be array of 8-bytes or frame length.
FalconOnishi 0:b65cb1bbf0ce 234 void readDATA_ff_0(byte* length_out,byte *data_out,unsigned short *id_out);
FalconOnishi 0:b65cb1bbf0ce 235 void readDATA_ff_1(byte* length_out,byte *data_out,unsigned short *id_out);
FalconOnishi 0:b65cb1bbf0ce 236
FalconOnishi 0:b65cb1bbf0ce 237 //Adding MCP2515 to read status register(pcruce_at_igpp.ucla.edu)
FalconOnishi 0:b65cb1bbf0ce 238 //MCP2515 be used to determine whether a frame was received.
FalconOnishi 0:b65cb1bbf0ce 239 //(readStatus() & 0x80) == 0x80 means frame in buffer 0
FalconOnishi 0:b65cb1bbf0ce 240 //(readStatus() & 0x40) == 0x40 means frame in buffer 1
FalconOnishi 0:b65cb1bbf0ce 241 byte readStatus();
FalconOnishi 0:b65cb1bbf0ce 242
FalconOnishi 0:b65cb1bbf0ce 243 void load_0(byte identifier, byte data);//load transmit buffer X
FalconOnishi 0:b65cb1bbf0ce 244 void load_1(byte identifier, byte data);
FalconOnishi 0:b65cb1bbf0ce 245 void load_2(byte identifier, byte data);
FalconOnishi 0:b65cb1bbf0ce 246
FalconOnishi 0:b65cb1bbf0ce 247 //extending MCP2515 write to full frame(pcruce_at_igpp.ucla.edu)
FalconOnishi 0:b65cb1bbf0ce 248 //Identifier should be a value between 0 and 2^11-1, longer identifiers will be truncated(ie does not support extended frames)
FalconOnishi 0:b65cb1bbf0ce 249 void load_ff_0(byte length,unsigned short identifier,byte *data);
FalconOnishi 0:b65cb1bbf0ce 250 void load_ff_1(byte length,unsigned short identifier,byte *data);
FalconOnishi 0:b65cb1bbf0ce 251 void load_ff_2(byte length,unsigned short identifier,byte *data);
FalconOnishi 0:b65cb1bbf0ce 252
FalconOnishi 0:b65cb1bbf0ce 253 //--------------------------------------------------------------------------
FalconOnishi 0:b65cb1bbf0ce 254 //Added for ram
FalconOnishi 0:b65cb1bbf0ce 255 void writeRegister(byte address, byte data);
FalconOnishi 0:b65cb1bbf0ce 256 void readRegister(byte address, byte *data_out);
FalconOnishi 0:b65cb1bbf0ce 257 void reset();
FalconOnishi 0:b65cb1bbf0ce 258 byte readRXStatus();
FalconOnishi 0:b65cb1bbf0ce 259 void bitModify(byte address, byte mask, byte data);
FalconOnishi 0:b65cb1bbf0ce 260 void setMask(unsigned short identifier);
FalconOnishi 0:b65cb1bbf0ce 261 void setMask_0(unsigned short identifier);
FalconOnishi 0:b65cb1bbf0ce 262 void setMask_1(unsigned short identifier);
FalconOnishi 0:b65cb1bbf0ce 263 private:
FalconOnishi 0:b65cb1bbf0ce 264 DigitalOut cs;
FalconOnishi 0:b65cb1bbf0ce 265 SPI &spi;
FalconOnishi 0:b65cb1bbf0ce 266 };
FalconOnishi 0:b65cb1bbf0ce 267
FalconOnishi 0:b65cb1bbf0ce 268 #endif