Merge remote-tracking branch 'origin/main' into mueller/relicensing
This commit is contained in:
commit
46aec1f62f
@ -14,6 +14,7 @@ categories = ["embedded", "no-std", "hardware-support"]
|
||||
cortex-m = "0.7.3"
|
||||
cortex-m-rt = "0.7.0"
|
||||
embedded-hal = "0.2.6"
|
||||
dummy-pin = "0.1.1"
|
||||
|
||||
[dependencies.max116xx-10bit]
|
||||
path = "../max116xx-10bit"
|
||||
|
@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! - [Button Blinky with Interrupts](https://github.com/robamu-org/vorago-reb1-rs/blob/main/examples/blinky-button-irq.rs)
|
||||
//! - [Button Blinky with Interrupts using RTIC](https://github.com/robamu-org/vorago-reb1-rs/blob/main/examples/blinky-button-rtic.rs)
|
||||
//! - [Button Blinky with IRQs](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/blinky-button-irq.rs)
|
||||
//! - [Button Blinky with IRQs and RTIC](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/blinky-button-rtic.rs)
|
||||
use va108xx_hal::{
|
||||
gpio::{FilterClkSel, FilterType, InputFloating, InterruptEdge, InterruptLevel, Pin, PA11},
|
||||
pac,
|
||||
|
@ -2,7 +2,9 @@
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! - [LED example](https://github.com/robamu-org/vorago-reb1-rs/blob/main/examples/blinky-leds.rs)
|
||||
//! - [LED example](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/blinky-leds.rs)
|
||||
//! - [Button Blinky using IRQs](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/blinky-button-irq.rs)
|
||||
//! - [Button Blinky using IRQs and RTIC](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/blinky-button-rtic.rs)
|
||||
use va108xx_hal::{
|
||||
gpio::dynpins::DynPin,
|
||||
gpio::pins::{Pin, PushPullOutput, PA10, PA6, PA7},
|
||||
|
@ -1,3 +1,11 @@
|
||||
//! This module provides a thin REB1 specific layer on top of the `max116xx_10bit` driver crate
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! - [ADC example](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/max11619-adc.rs)
|
||||
use core::convert::Infallible;
|
||||
|
||||
use dummy_pin::DummyPin;
|
||||
use embedded_hal::{blocking::spi::Transfer, spi::FullDuplex};
|
||||
use max116xx_10bit::{
|
||||
Error, ExternallyClocked, InternallyClockedInternallyTimedSerialInterface, Max11619,
|
||||
@ -6,9 +14,10 @@ use max116xx_10bit::{
|
||||
use va108xx_hal::gpio::{Floating, Input, Pin, PA14};
|
||||
|
||||
pub type Max11619ExternallyClocked<SPI> =
|
||||
Max116xx10Bit<SPI, Max11619, ExternallyClocked, WithoutWakeupDelay>;
|
||||
Max116xx10Bit<SPI, DummyPin, Max11619, ExternallyClocked, WithoutWakeupDelay>;
|
||||
pub type Max11619InternallyClocked<SPI> = Max116xx10Bit<
|
||||
SPI,
|
||||
DummyPin,
|
||||
Max11619,
|
||||
InternallyClockedInternallyTimedSerialInterface,
|
||||
WithoutWakeupDelay,
|
||||
@ -22,26 +31,35 @@ pub const POTENTIOMETER_CHANNEL: u8 = 3;
|
||||
|
||||
pub fn max11619_externally_clocked<SpiE, SPI>(
|
||||
spi: SPI,
|
||||
) -> Result<Max11619ExternallyClocked<SPI>, Error<SpiE>>
|
||||
) -> Result<Max11619ExternallyClocked<SPI>, Error<SpiE, Infallible>>
|
||||
where
|
||||
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
|
||||
{
|
||||
let adc: Max116xx10Bit<SPI, Max11619, ExternallyClocked, WithoutWakeupDelay> =
|
||||
Max116xx10Bit::new(spi, RefMode::ExternalSingleEndedNoWakeupDelay)?;
|
||||
let adc: Max116xx10Bit<SPI, DummyPin, Max11619, ExternallyClocked, WithoutWakeupDelay> =
|
||||
Max116xx10Bit::new(
|
||||
spi,
|
||||
DummyPin::new_low(),
|
||||
RefMode::ExternalSingleEndedNoWakeupDelay,
|
||||
)?;
|
||||
Ok(adc)
|
||||
}
|
||||
|
||||
pub fn max11619_internally_clocked<SpiE, SPI>(
|
||||
spi: SPI,
|
||||
) -> Result<Max11619InternallyClocked<SPI>, Error<SpiE>>
|
||||
) -> Result<Max11619InternallyClocked<SPI>, Error<SpiE, Infallible>>
|
||||
where
|
||||
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
|
||||
{
|
||||
let adc: Max116xx10Bit<
|
||||
SPI,
|
||||
DummyPin,
|
||||
Max11619,
|
||||
InternallyClockedInternallyTimedSerialInterface,
|
||||
WithoutWakeupDelay,
|
||||
> = Max116xx10Bit::new(spi, RefMode::ExternalSingleEndedNoWakeupDelay)?;
|
||||
> = Max116xx10Bit::new(
|
||||
spi,
|
||||
DummyPin::new_low(),
|
||||
RefMode::ExternalSingleEndedNoWakeupDelay,
|
||||
)?;
|
||||
Ok(adc)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! - [Temperature Sensor example](https://github.com/robamu-org/vorago-reb1-rs/blob/main/examples/temp-sensor.rs)
|
||||
//! - [Temperature Sensor example](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/adt75-temp-sensor.rs)
|
||||
use cortex_m::prelude::_embedded_hal_blocking_i2c_Write;
|
||||
use embedded_hal::blocking::i2c::{Read, SevenBitAddress};
|
||||
use va108xx_hal::{
|
||||
|
Reference in New Issue
Block a user