parent
f2938ffe72
commit
41c5a352b8
|
@ -0,0 +1,20 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
### Security
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
This project uses semantic versioning and KeepAChangelog format. Always update
|
||||||
|
CHANGELOG.md.
|
||||||
|
|
||||||
|
## API Documentation
|
||||||
|
|
||||||
|
### Style
|
||||||
|
|
||||||
|
All method documentation is written in the present tense. For example, "Creates a new..."
|
||||||
|
rather than "Create a new...".
|
|
@ -0,0 +1,31 @@
|
||||||
|
# RN2903
|
||||||
|
## A Rusty interface for the RN2903 serial protocol
|
||||||
|
|
||||||
|
The RN2903 is a LoRa and FSK transciever for the 915MHz ISM band, commonly used in USB
|
||||||
|
devices like the LoStik.
|
||||||
|
|
||||||
|
This crate provides a safe, idiomatic interface using cross-platform native serial
|
||||||
|
functionality via `serialport`. This supports, for instance, a LoStik connected to a USB
|
||||||
|
TTY or virtual COM port, or a RN2903 connected via a TTL serial interface.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
For instance, here is a simple program which blinks the LoStik's LED using the RN2903's
|
||||||
|
GPIO functionality.
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use rn2903::Rn2903;
|
||||||
|
use std::time::Duration;
|
||||||
|
use std::thread;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut txvr = Rn2903::new_at("/dev/ttyUSB0")
|
||||||
|
.expect("Could not open device. Error");
|
||||||
|
loop {
|
||||||
|
txvr.transact(b"radio set pindig GPIO10 0").unwrap();
|
||||||
|
thread::sleep(Duration::from_millis(1000));
|
||||||
|
txvr.transact(b"radio set pindig GPIO10 1").unwrap();
|
||||||
|
thread::sleep(Duration::from_millis(1000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in New Issue