eive-obsw/common/config/devConf.h
Robin Mueller 2f2d164526
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
this is crap but might just work
2023-02-12 21:27:10 +01:00

79 lines
2.8 KiB
C++

#ifndef COMMON_CONFIG_DEVCONF_H_
#define COMMON_CONFIG_DEVCONF_H_
#include <fsfw_hal/linux/serial/SerialCookie.h>
#include <cstdint>
#include "commonConfig.h"
#include "fsfw/timemanager/clockDefinitions.h"
#include "fsfw_hal/linux/serial/SerialCookie.h"
#include "fsfw_hal/linux/spi/spiDefinitions.h"
/**
* SPI configuration will be contained here to let the device handlers remain independent
* of SPI specific properties.
*/
namespace spi {
// Default values, changing them is not supported for now
static constexpr uint32_t DEFAULT_LIS3_SPEED = 976'000;
static constexpr uint32_t LIS3_TRANSITION_DELAY = 5000;
static constexpr spi::SpiModes DEFAULT_LIS3_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t DEFAULT_RM3100_SPEED = 976'000;
static constexpr uint32_t RM3100_TRANSITION_DELAY = 5000;
static constexpr spi::SpiModes DEFAULT_RM3100_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t DEFAULT_L3G_SPEED = 976'000;
static constexpr uint32_t L3G_TRANSITION_DELAY = 5000;
static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3;
/**
* Some MAX1227 could not be reached with frequencies around 4 MHz. Maybe this is caused by
* the decoder and buffer circuits. Thus frequency is here defined to 1 MHz.
*/
static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000;
static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3;
static constexpr dur_millis_t RAD_SENSOR_CS_TIMEOUT = 120;
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t PL_PCDU_MAX_1227_SPEED = 976'000;
static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000;
static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t RW_SPEED = 300'000;
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
#ifdef RELEASE_BUILD
static constexpr uint8_t CS_FACTOR = 1;
#else
static constexpr uint8_t CS_FACTOR = 3;
#endif
static constexpr dur_millis_t RTD_CS_TIMEOUT = 50 * CS_FACTOR;
static constexpr uint32_t RTD_SPEED = 2'000'000;
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
static constexpr dur_millis_t SUS_CS_TIMEOUT = 50 * CS_FACTOR;
static constexpr dur_millis_t ACS_BOARD_CS_TIMEOUT = 50 * CS_FACTOR;
} // namespace spi
namespace uart {
static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_921600;
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
} // namespace uart
#endif /* COMMON_CONFIG_DEVCONF_H_ */