Skip to content

Commit

Permalink
doc string fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Feb 3, 2024
1 parent ba05528 commit fe7edeb
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/hardware/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Adc {
Ok(adc)
}

/// Setup all ADCs to the specifies [config].
/// Setup all ADCs to the specifies [AdcConfig].
fn setup(&mut self, delay: &mut impl DelayUs<u16>, config: AdcConfig) -> Result<(), Error> {
// deassert all CS first
for pin in self.cs.iter_mut() {
Expand Down
8 changes: 4 additions & 4 deletions src/hardware/dac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//!
//! The 4 channel DAC ICs share an SPI bus and are addressed using individual "sync"
//! signals, similar to a chip select signal.
//! DAC datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5680.pdf
//! TEC driver datasheet: https://datasheets.maximintegrated.com/en/ds/MAX1968-MAX1969.pdf
//! DAC datasheet: `<https://www.analog.com/media/en/technical-documentation/data-sheets/AD5680.pdf>`
//! TEC driver datasheet: `<https://datasheets.maximintegrated.com/en/ds/MAX1968-MAX1969.pdf>`
//!
use super::hal::{
Expand Down Expand Up @@ -71,8 +71,8 @@ impl From<DacCode> for u32 {

/// DAC gpio pins.
///
/// sync[<n>] - DAC IC adressing signals
/// * <n> specifies Thermostat output channel
/// `sync[n]` - DAC IC adressing signals
/// where `n` specifies Thermostat output channel
pub struct DacPins {
pub sync: [gpio::ErasedPin<gpio::Output>; 4],
}
Expand Down
8 changes: 4 additions & 4 deletions src/hardware/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ pub enum Error {

/// Pwm pins.
///
/// voltage<n> - voltage limit pin
/// positive_current<n> - positive current limit pin
/// negative_current<n> - negative current limit pin
/// * <n> specifies Thermostat output channel
/// `voltage.<n>` - voltage limit pin
/// `positive_current.<n>` - positive current limit pin
/// `negative_current.<n>` - negative current limit pin
/// * `<n>` specifies Thermostat output channel
#[allow(clippy::type_complexity)]
pub struct PwmPins {
pub voltage: (
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Settings {
///
/// # Path
/// `output_channel/<n>`
/// * <n> specifies which channel to configure. <n> := [0, 1, 2, 3]
/// * `<n> := [0, 1, 2, 3]` specifies which channel to configure.
///
/// # Value
/// See [output_channel::OutputChannel]
Expand All @@ -62,7 +62,7 @@ pub struct Settings {
///
/// # Value
/// See [Alarm]
#[tree(depth(5))]
#[tree(depth(3))]
alarm: Alarm,
}

Expand All @@ -89,7 +89,7 @@ pub struct Monitor {
output_current: [f32; 4],
/// Measurement of the output voltages.
output_voltage: [f32; 4],
/// See [PoEPower]
/// See [PoePower]
poe: PoePower,
/// Overtemperature status.
overtemp: bool,
Expand All @@ -100,9 +100,9 @@ pub struct Monitor {
pub struct Telemetry {
/// see [Monitor]
monitor: Monitor,
/// [<adc>][<channel>] array of [Statistics]. 'None' for disabled channels.
/// `[<adc>][<channel>]` array of [Statistics]. `None` for disabled channels.
statistics: [[Option<Statistics>; 4]; 4],
/// Alarm status for each enabled input channel. 'None' for disabled channels.
/// Alarm status for each enabled input channel. `None` for disabled channels.
alarm: [[Option<bool>; 4]; 4],
/// Output current in Amperes for each Thermostat output channel.
output_current: [f32; 4],
Expand All @@ -117,7 +117,7 @@ mod app {

#[shared]
struct Shared {
network: NetworkUsers<Settings, Telemetry, 6>,
network: NetworkUsers<Settings, Telemetry, 5>,
settings: Settings,
telemetry: Telemetry,
gpio: Gpio,
Expand Down
18 changes: 9 additions & 9 deletions src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ pub fn get_device_prefix(app: &str, id: &str) -> String<128> {
}

/// Miniconf settings for the MQTT alarm.
/// The alarm simply publishes "false" onto its [target] as long as all the channels are
/// within their [temperature_limits] (aka logical OR of all channels).
/// The alarm simply publishes "false" onto its `target` as long as all the channels are
/// within their `temperature_limits`` (aka logical OR of all channels).
/// Otherwise it publishes "true" (aka true, there is an alarm).
///
/// The publishing interval is given by [period_ms].
/// The publishing interval is given by `period_ms`.
///
/// The alarm is non-latching. If alarm was "true" for a while and the temperatures come within
/// limits again, alarm will be "false" again.
#[derive(Clone, Debug, Tree)]
pub struct Alarm {
/// Set the alarm to armed (true) or disarmed (false).
/// If the alarm is armed, the device will publish it's alarm state onto the [target].
/// If the alarm is armed, the device will publish it's alarm state onto the `target`.
///
/// # Value
/// True to arm, false to disarm.
Expand Down Expand Up @@ -245,12 +245,12 @@ pub struct Alarm {
///
/// # Path
/// `temperature_limits/<adc>/<channel>`
/// * <adc> specifies which adc to configure. <adc> := [0, 1, 2, 3]
/// * <channel> specifies which channel of an ADC to configure. Only the enabled channels for the specific ADC are available.
/// * `<adc> := [0, 1, 2, 3]` specifies which adc to configure.
/// * `<channel>` specifies which channel of an ADC to configure. Only the enabled channels for the specific ADC are available.
///
/// # Value
/// [f32, f32]
#[tree(depth(4))]
/// `[f32, f32]` or `None`
#[tree(depth(2))]
pub temperature_limits: [[Option<[f32; 2]>; 4]; 4],
}

Expand All @@ -260,7 +260,7 @@ impl Default for Alarm {
armed: false,
target: Default::default(),
period: 1.0,
temperature_limits: [[Some([f32::NEG_INFINITY, f32::INFINITY]); 4]; 4],
temperature_limits: Default::default(),
}
}
}
2 changes: 1 addition & 1 deletion src/net/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<T: Serialize> TelemetryClient<T> {
}

/// A secondary functionality tugged onto the telemetry client that publishes onto another
/// [alarm_topic].
/// `alarm_topic`.
pub fn publish_alarm(&mut self, alarm_topic: &String<128>, alarm: &bool) {
self.mqtt
.client()
Expand Down
6 changes: 3 additions & 3 deletions src/output_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct OutputChannel {
/// The y limits will be clamped to the maximum output current of +-3 A.
///
/// # Value
/// See [iir::IIR#tree]
/// See [iir::Biquad]
pub iir: iir::Biquad<f64>,

/// Thermostat input channel weights. Each input temperature of an enabled channel
Expand All @@ -40,8 +40,8 @@ pub struct OutputChannel {
///
/// # Path
/// `weights/<adc>/<channel>`
/// * <adc> specifies which adc to configure. <adc> := [0, 1, 2, 3]
/// * <channel> specifies which channel of an ADC to configure. Only the enabled channels for the specific ADC are available.
/// * `<adc> := [0, 1, 2, 3]` specifies which adc to configure.
/// * `<channel>` specifies which channel of an ADC to configure. Only the enabled channels for the specific ADC are available.
///
/// # Value
/// f32
Expand Down

0 comments on commit fe7edeb

Please sign in to comment.