Hi, I'm trying to get some CC1101 Radio modules talking using the "ELECHOUSE_CC1101.h" library. Using the example code and two Nano boards, it works. When I switch to a either of my SAMD M0 boards (Adalogger Feather M0, Seeeduino XIAO) I get compilation errors (see below).
It appears that the SPCR, SPDR, and SPSR variables are not defined. Also SPE, SPIF, and MSTR are also not defined. I have been reading the spec sheet for the Seeduino XIAO chip and im not sure what to define these as. Do they need to be a hexadecimal number? i.e. 0x0D
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp: In member function 'void ELECHOUSE_CC1101::SpiMode(byte)':
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:87:3: error: 'SPCR' was not declared in this scope
SPCR = 0;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:87:3: note: suggested alternative: 'SCL'
SPCR = 0;
^~~~
SCL
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:88:32: error: 'SPE' was not declared in this scope
SPCR = (config & 0x7F) | (1<<SPE) | (1<<MSTR);
^~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:88:43: error: 'MSTR' was not declared in this scope
SPCR = (config & 0x7F) | (1<<SPE) | (1<<MSTR);
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:88:43: note: suggested alternative: 'PSTR'
SPCR = (config & 0x7F) | (1<<SPE) | (1<<MSTR);
^~~~
PSTR
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:89:9: error: 'SPSR' was not declared in this scope
tmp = SPSR;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:89:9: note: suggested alternative: 'SS'
tmp = SPSR;
^~~~
SS
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:90:9: error: 'SPDR' was not declared in this scope
tmp = SPDR;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:90:9: note: suggested alternative: 'SDA'
tmp = SPDR;
^~~~
SDA
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp: In member function 'byte ELECHOUSE_CC1101::SpiTransfer(byte)':
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:101:3: error: 'SPDR' was not declared in this scope
SPDR = value;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:101:3: note: suggested alternative: 'SDA'
SPDR = value;
^~~~
SDA
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:102:12: error: 'SPSR' was not declared in this scope
while (!(SPSR & (1<<SPIF))) ;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:102:12: note: suggested alternative: 'SS'
while (!(SPSR & (1<<SPIF))) ;
^~~~
SS
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:102:23: error: 'SPIF' was not declared in this scope
while (!(SPSR & (1<<SPIF))) ;
^~~~
C:\Users\JonathanKuhn_j4g3toa\Documents\Arduino\libraries\CC1101_arduino\ELECHOUSE_CC1101.cpp:102:23: note: suggested alternative: 'PI'
while (!(SPSR & (1<<SPIF))) ;
^~~~
PI
exit status 1
Error compiling for board Seeeduino XIAO.