ReduxLib C++ 2025.0.0-beta2
Loading...
Searching...
No Matches
CanandmagStatus.h
1// Copyright (c) Redux Robotics and other contributors.
2// This is open source and can be modified and shared under the 3-clause BSD license.
3
4#pragma once
5#include <units/temperature.h>
6#include "redux/sensors/canandmag/CanandmagFaults.h"
7
9
10/**
11 * Struct class representing a Canandmag's status.
12*/
14 /**
15 * Constructor for CanandmagStatus
16 * @param activeFaultsRaw raw uint8_t field
17 * @param stickyFaultsRaw raw uint8_t field
18 * @param faultsValid whether the faults fields have valid adata
19 * @param temp MCU temp
20 * @param magnetInRange whether the encoder magnet is in range
21 */
22 constexpr CanandmagStatus(uint8_t activeFaultsRaw, uint8_t stickyFaultsRaw, bool faultsValid, units::celsius_t temp, bool magnetInRange): \
23 activeFaults{activeFaultsRaw, faultsValid}, stickyFaults{stickyFaultsRaw, faultsValid}, temperature{temp}, magnetInRange{magnetInRange} {};
24 public:
25 /** Active faults. */
27 /** Sticky faults. */
29 /** Encoder MCU temperature (celsius). */
30 units::celsius_t temperature;
31 /** Whether the magnet is in range. */
33};
34}
Definition: CanandmagFaults.h:13
Definition: CanandmagSettings.h:12
Definition: CanandmagStatus.h:13
units::celsius_t temperature
Definition: CanandmagStatus.h:30
CanandmagFaults stickyFaults
Definition: CanandmagStatus.h:28
constexpr CanandmagStatus(uint8_t activeFaultsRaw, uint8_t stickyFaultsRaw, bool faultsValid, units::celsius_t temp, bool magnetInRange)
Definition: CanandmagStatus.h:22
CanandmagFaults activeFaults
Definition: CanandmagStatus.h:26
bool magnetInRange
Definition: CanandmagStatus.h:32