Skip to content
Snippets Groups Projects
Commit 45ff806e authored by Matteo Pignataro's avatar Matteo Pignataro
Browse files

Merge branch 'canConfig-dev' into 'main'

[CanConfig] Added message definition

See merge request avn/swd/obsw!12
parents 4d4e5867 4bc6a495
No related branches found
No related tags found
No related merge requests found
/* Copyright (c) 2023 Skyward Experimental Rocketry
* Author: Federico Mandelli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
#include <common/Events.h>
#include <common/Topics.h>
#include <stdint.h>
#include <map>
namespace Common
{
namespace CanConfig
{
constexpr uint32_t BAUD_RATE = 500 * 1000;
constexpr float SAMPLE_POINT = 87.5f / 100.0f;
enum class Priority : uint8_t
{
CRITICAL = 0,
HIGH,
MEDIUM,
LOW
};
enum class PrimaryType : uint8_t
{
EVENTS = 0,
SENSORS,
STATUS,
COMMAND
};
// Used for source and destination
enum class Board : uint8_t
{
BROADCAST = 0,
RIG,
MAIN,
PAYLOAD,
MOTOR
};
enum class ServoID : uint8_t
{
VENTING = 0,
FEED_LINE
};
enum class SensorId : uint8_t
{
PITOT,
CC_PRESSURE,
BOTTOM_TANK_PRESSURE,
TOP_TANK_PRESSURE,
TANK_TEMPERATURE
};
enum class EventId : uint8_t
{
FORCE_INIT = 0,
ARM,
ENTER_TEST_MODE,
EXIT_TEST_MODE,
CALIBRATE,
DISARM,
LIFTOFF,
APOGEE_DETECTED,
};
static const std::map<Common::CanConfig::EventId, Common::Events> eventToEvent{
{Common::CanConfig::EventId::ARM, Common::CAN_ARM},
{Common::CanConfig::EventId::DISARM, Common::CAN_DISARM},
{Common::CanConfig::EventId::CALIBRATE, Common::CAN_CALIBRATE},
{Common::CanConfig::EventId::LIFTOFF, Common::CAN_LIFTOFF},
{Common::CanConfig::EventId::FORCE_INIT, Common::CAN_FORCE_INIT},
{Common::CanConfig::EventId::ENTER_TEST_MODE, Common::CAN_ENTER_TEST_MODE},
{Common::CanConfig::EventId::EXIT_TEST_MODE, Common::CAN_EXIT_TEST_MODE},
{Common::CanConfig::EventId::APOGEE_DETECTED, Common::CAN_APOGEE_DETECTED},
};
} // namespace CanConfig
} // namespace Common
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment