GithubHelp home page GithubHelp logo

gambrose / a7105 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from broderickcarlin/a7105

0.0 0.0 0.0 1.03 MB

Rust embedded-hal driver for the A7105 2.4GHz FSK/GFSK Transceiver

License: Apache License 2.0

Rust 100.00%

a7105's Introduction

a7105

Overview

a7105 is a Rust crate that provides a high-level interface for interacting with the A7105 2.4GHz FSK/GFSK Transceiver, built on top of embedded-hal traits. This crate supports both synchronous (sync) and asynchronous (async) APIs, allowing users to choose the mode that best fits their application requirements.

This crate makes no assumptions for the protocol, if any, used on top of the a7105. Instead, the responsibility of this crate end at configuring the radio and reading/writing raw bytes over the air.

Sync and Async support is through embedded-hal and embedded-hal-async, configurable through the async and blocking features. By default the crate will use async variants. If blocking APIs are preferred, the blocking feature can be specified and default features disabled.

Getting Started

Installation

Add the following line to your Cargo.toml file:

[dependencies]
a7105 = "0.1.0"

Example (Async)

This example utilizes the default async APIs. The blocking API has the exact same function signatures.

use a7105::prelude::*;

// Get a handle to the SPI peripheral attached to the A7105. This step
// will be highly specific to the hardware used and if a blocking or 
// async peripheral is being used
let spi = unimplemented!();

let mut radio = A7105::new(spi);

// It is usually a good idea to reset the radio before anything else
radio.command(Command::Reset).await.unwrap();

// Write a register, in this example setting IdData to 0x01234567
radio.write_reg(registers::IdData { 
    id: 0x01234567
}).await.unwrap();

// Read a register, in this example `DataRate`
let data_rate: registers::DataRate = radio.read_reg().await.unwrap();

// Transmit the given bytes 
radio.tx(&[0, 1, 2, 3]).await.unwrap();

// Receive a set number of bytes into the provided buffer
let mut buf = [0; 8];
radio.rx(&mut buf).await.unwrap();

// Set the radio's mode
radio.set_mode(Mode::Idle).await.unwrap();

// Destroys the radio instance and gets back the SPI peripheral
let spi = radio.destroy();

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This work is licensed under either of

at your option.

a7105's People

Contributors

broderickcarlin avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.