eive-obsw/common/config/devConf.h

79 lines
2.8 KiB
C
Raw Normal View History

2021-08-17 17:11:59 +02:00
#ifndef COMMON_CONFIG_DEVCONF_H_
#define COMMON_CONFIG_DEVCONF_H_
2021-03-07 14:06:29 +01:00
#include <fsfw_hal/linux/serial/SerialCookie.h>
2022-05-17 13:40:19 +02:00
#include <cstdint>
2023-02-12 21:27:10 +01:00
#include "commonConfig.h"
2022-05-26 11:46:28 +02:00
#include "fsfw/timemanager/clockDefinitions.h"
2022-11-10 18:07:59 +01:00
#include "fsfw_hal/linux/serial/SerialCookie.h"
2022-05-26 11:46:28 +02:00
#include "fsfw_hal/linux/spi/spiDefinitions.h"
2021-03-07 14:06:29 +01:00
/**
* SPI configuration will be contained here to let the device handlers remain independent
* of SPI specific properties.
*/
namespace spi {
2021-09-23 15:20:55 +02:00
// Default values, changing them is not supported for now
2021-09-15 18:50:23 +02:00
static constexpr uint32_t DEFAULT_LIS3_SPEED = 976'000;
2021-12-17 14:20:22 +01:00
static constexpr uint32_t LIS3_TRANSITION_DELAY = 5000;
2021-03-07 14:06:29 +01:00
static constexpr spi::SpiModes DEFAULT_LIS3_MODE = spi::SpiModes::MODE_3;
static constexpr uint32_t DEFAULT_RM3100_SPEED = 976'000;
2021-12-17 14:20:22 +01:00
static constexpr uint32_t RM3100_TRANSITION_DELAY = 5000;
2021-03-07 14:06:29 +01:00
static constexpr spi::SpiModes DEFAULT_RM3100_MODE = spi::SpiModes::MODE_3;
2021-09-15 18:50:23 +02:00
static constexpr uint32_t DEFAULT_L3G_SPEED = 976'000;
2021-12-17 14:20:22 +01:00
static constexpr uint32_t L3G_TRANSITION_DELAY = 5000;
2021-03-07 14:06:29 +01:00
static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3;
2022-02-22 20:44:23 +01:00
/**
* 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;
2022-03-22 11:57:48 +01:00
static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3;
2022-02-22 20:44:23 +01:00
static constexpr dur_millis_t RAD_SENSOR_CS_TIMEOUT = 120;
2022-02-22 20:44:23 +01:00
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
2021-05-02 13:48:39 +02:00
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
2022-03-04 15:26:36 +01:00
static constexpr uint32_t PL_PCDU_MAX_1227_SPEED = 976'000;
2021-05-24 01:20:44 +02:00
static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000;
static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3;
2021-03-07 14:06:29 +01:00
2021-09-16 17:24:34 +02:00
static constexpr uint32_t RW_SPEED = 300'000;
2021-06-21 09:50:26 +02:00
static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
2023-02-12 21:27:10 +01:00
#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;
2021-09-16 17:24:34 +02:00
static constexpr uint32_t RTD_SPEED = 2'000'000;
2021-10-29 19:15:14 +02:00
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
2021-08-17 19:50:48 +02:00
2023-02-12 21:27:10 +01:00
static constexpr dur_millis_t SUS_CS_TIMEOUT = 50 * CS_FACTOR;
static constexpr dur_millis_t ACS_BOARD_CS_TIMEOUT = 50 * CS_FACTOR;
2023-02-12 20:41:20 +01:00
2022-05-17 13:40:19 +02:00
} // namespace spi
2021-03-07 14:06:29 +01:00
2023-03-22 02:20:14 +01:00
namespace serial {
2021-08-17 17:11:59 +02:00
static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
2022-04-14 07:52:21 +02:00
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
2022-11-21 13:37:05 +01:00
static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_115200;
2022-04-14 07:52:21 +02:00
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
2022-11-28 18:31:44 +01:00
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_921600;
2022-04-14 07:52:21 +02:00
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
2021-08-17 17:48:51 +02:00
2023-03-22 02:20:14 +01:00
} // namespace serial
2021-08-17 17:11:59 +02:00
#endif /* COMMON_CONFIG_DEVCONF_H_ */