-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
158 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Samana network components | ||
|
||
This repository contains transmitters and receivers implemented using [nRF24L01+](https://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01P) wireless chip. | ||
|
||
Implementation for Raspberry PI can be found in the [rpi](rpi/) directory, and (tiny)[tiny/] directory contains implementation for ATtiny85 MCU. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
#ifndef RECEIVER_H | ||
#define RECEIVER_H | ||
|
||
/** | ||
* Configure prx specific registers. | ||
*/ | ||
void prx(); | ||
|
||
/** | ||
* Clean RX Data Ready interrupt flag. | ||
*/ | ||
void clean_rx_dr_int(); | ||
|
||
/** | ||
* A loop where receiver puts ACK payloads and handles received messages. | ||
*/ | ||
void receiver_loop() __attribute__ ((noreturn)); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Building | ||
|
||
Make sure `bcm2835` symlink is pointing to a directory which contains [bcm2835](http://www.airspayce.com/mikem/bcm2835/) library. By default symlink points to a sibling directory of this repository. Version of the library is specified in the contents of the symlink. | ||
|
||
Build both transmitter and receiver binaries by running `build.sh`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../bcm2835-1.38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Building | ||
|
||
Make sure `tinytemplate` symlink is pointing to a directory which contains checked out [tinytemplate](https://github.com/thegaragelab/tinytemplate) repository. By default symlink points to a sibling directory of this repository. Commit id of the repository is specified in the contents of symplink. | ||
|
||
Makefile accepts the following arguments: | ||
|
||
|Argument|Possible Values|Notes | | ||
|--------|---------------|-------------------------------------------------------------------| | ||
|name |ptx|prx |Binary (primary transmitter or primary receiver) to build | | ||
|avrType |attiny85|attiny2313|Controller type. Tested only with attiny85 | | ||
|dudeHost|alarmpi|... |When specified runs `avrdude` on the specified host | | ||
|
||
Most common make commands are `elf` (compile) and `flash` (compile and write to MCU). Flashing is done using a Raspberry Pi which has MCU connected via SPI. | ||
|
||
For example, the following command would compile primary transmitter and flash it to ATtiny85 connected to Raspberry PI running as alarmpi2: | ||
|
||
``` bash | ||
make name=ptx avrType=attiny85 dudeHost=alarmpi2 flash | ||
``` | ||
|
||
## Hardware | ||
|
||
Code assumes [three wire](http://nerdralph.blogspot.com/2014/01/nrf24l01-control-with-3-attiny85-pins.html) setup where CSN clock is held by a capacitor and is controlled by SCK pin before and after transfers. | ||
|
||
Logging is enabled via UART on `PB4`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,5 @@ void spi_transfern(uint8_t *buf, uint8_t n) | |
|
||
void ce_high() | ||
{ | ||
// CE is conntected to VCC. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../tinytemplate-2db013c |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters