This is a .NET library for RaspberryPi to communicate with CC1101 Tranceivers.
Please make sure to first enable the
SPI-Interface on your RPi.
- Raspberry PI (or similar) with a Linux Distribution of your choice
- .NET 8 Runtime
TODO: Maybe checker whether to add dotnet to path variable is required - probably needed so this program can run with dotnet..
Please refer to the Raspberry Pi Documentation for the GPIO Header scheme
The default settings for this library are listed here:
Either use
CC1101 | Raspberry Pi |
---|---|
Vdd | 3.3V (01) |
SI | MOSI (19) - GPIO10 |
SO | MISO (21) - GPIO09 |
CS | CEO (24) - GPIO08 |
SCLK | SCK (23) - GPIO11 |
GDO2 | GPIO (22) - GPIO25 |
GDO0 | not used |
GND | GND (25) |
OR
CC1101 | Raspberry Pi |
---|---|
Vdd | 3.3V (17) |
SI | MOSI (38) - GPIO20 |
SO | MISO (35) - GPIO19 |
CS | CEO (12) - GPIO18 |
SCLK | SCK (40) - GPIO21 |
GDO2 | GPIO (22) - GPIO25 |
GDO0 | not used |
GND | GND (34) |
OR
If you really need to, you can also supply your own ConnectionConfiguration when instantiating the CC1101 library.
Make sure the configured PIN supports the specific SPI operation (see Raspberry Pi Documentation) for predefined buses.
Read up on Device Trees and the Raspberry SPI
CC1101 |
---|
SI |
SO |
CS |
SCLK |
GDO2 (whatever GPIO Pin you like) |
Instantiate a new 'CC1101Controller', if you go with the default configuration (Bus 00, see 'Wiring' for more details ) you don't need to specify anything.
If you want to choose a different Bus, you can create supply a 'ConnectionConfiguration' with your own settings.
When doing so, you need to specify the logical Pin number, not the physical Pin from the header.
After creating the controller, you have to call "Init" and initially set a DeviceAddress (whatever you like).
This method returns a CC1101 object which allows you to talk with your CC1101 module.
Example:
var controller = new CC1101Controller();
var cc1101 = controller.Initialize(0x03);
This project uses System.Device.Gpio
This is still work in progress and pretty much untested.
Also, at this point in time, the exposed interfaces might change...
Thanks to SpaceTeddy to share his C++ Project - i ported this library to this .NET library:
https://github.com/SpaceTeddy/CC1101