-
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
16 changed files
with
1,609 additions
and
13 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
embedded-hal = "1.0.0" |
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,52 @@ | ||
/// Power Amplifier level. The units dBm (decibel-milliwatts or dB<sub>mW</sub>) | ||
/// represents a logarithmic signal loss. | ||
pub enum PaLevel { | ||
/// | nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0 | | ||
/// | :-------:|:-----------------------------:|:-----------------------------:| | ||
/// | -18 dBm | -6 dBm | -12 dBm | | ||
MIN, | ||
/// | nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0 | | ||
/// | :-------:|:-----------------------------:|:-----------------------------:| | ||
/// | -12 dBm | 0 dBm | -4 dBm | | ||
LOW, | ||
/// | nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0 | | ||
/// | :-------:|:-----------------------------:|:-----------------------------:| | ||
/// | -6 dBm | 3 dBm | 1 dBm | | ||
HIGH, | ||
/// | nRF24L01 | Si24R1 with<br>lnaEnabled = 1 | Si24R1 with<br>lnaEnabled = 0 | | ||
/// | :-------:|:-----------------------------:|:-----------------------------:| | ||
/// | 0 dBm | 7 dBm | 4 dBm | | ||
MAX, | ||
} | ||
|
||
/// How fast data moves through the air. Units are in bits per second (bps). | ||
pub enum DataRate { | ||
/// represents 1 Mbps | ||
Mbps1, | ||
/// represents 2 Mbps | ||
Mbps2, | ||
/// represents 250 Kbps | ||
Kbps250, | ||
} | ||
|
||
/// The length of a CRC checksum that is used (if any). | ||
/// | ||
/// Cyclical Redundancy Checking (CRC) is commonly used to ensure data integrity. | ||
pub enum CrcLength { | ||
/// represents no CRC checksum is used | ||
DISABLED, | ||
/// represents CRC 8 bit checksum is used | ||
BIT8, | ||
/// represents CRC 16 bit checksum is used | ||
BIT16, | ||
} | ||
|
||
/// The possible states of a FIFO. | ||
pub enum FifoState { | ||
/// Represent the state of a FIFO when it is full. | ||
Full, | ||
/// Represent the state of a FIFO when it is empty. | ||
Empty, | ||
/// Represent the state of a FIFO when it is not full but not empty either. | ||
Occupied, | ||
} |
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,14 +1,16 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
#![doc( | ||
html_logo_url = "https://raw.githubusercontent.com/nRF24/RF24/master/docs/sphinx/_static/Logo%20large.png" | ||
)] | ||
#![doc( | ||
html_favicon_url = "https://github.com/nRF24/RF24/raw/master/docs/sphinx/_static/new_favicon.ico" | ||
)] | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} | ||
mod enums; | ||
pub use enums::{CrcLength, DataRate, FifoState, PaLevel}; | ||
pub use radio::{ | ||
EsbAutoAck, EsbChannel, EsbCrcLength, EsbDataRate, EsbFifo, EsbPaLevel, EsbPayloadLength, | ||
EsbPipe, EsbPower, EsbRadio, EsbStatus, | ||
}; | ||
mod radio; | ||
#[doc(inline)] | ||
pub use radio::{Nrf24Error, RF24}; |
Oops, something went wrong.