PER Firmware
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1
10#ifndef MAIN_H
11#define MAIN_H
12
14#include "sd_card.h"
15#include "spmc.h"
16
17// Pinouts
18// LEDs
19#define HEARTBEAT_LED_PORT (GPIOD)
20#define HEARTBEAT_LED_PIN (13)
21#define CONNECTION_LED_PORT (GPIOD)
22#define CONNECTION_LED_PIN (14)
23#define ERROR_LED_PORT (GPIOD)
24#define ERROR_LED_PIN (15)
25
26// SD Card SDIO
27#define SD_ACTIVITY_LED_PORT (GPIOA)
28#define SD_ACTIVITY_LED_PIN (9)
29#define SD_ERROR_LED_PORT (GPIOA)
30#define SD_ERROR_LED_PIN (8)
31#define SD_DETECT_LED_PORT (GPIOA)
32#define SD_DETECT_LED_PIN (10)
33#define SD_CD_PORT (GPIOD)
34#define SD_CD_PIN (4)
35
36// W5500 ETH SPI1
37#define ETH_CS_PORT (GPIOA)
38#define ETH_CS_PIN (4)
39#define ETH_SCK_PORT (GPIOA)
40#define ETH_SCK_PIN (5)
41#define ETH_MISO_PORT (GPIOA)
42#define ETH_MISO_PIN (6)
43#define ETH_MOSI_PORT (GPIOA)
44#define ETH_MOSI_PIN (7)
45#define ETH_RST_PORT (GPIOE)
46#define ETH_RST_PIN (3)
47
48// MISC
49#define PWR_LOSS_PORT (GPIOE)
50#define PWR_LOSS_PIN (15)
51#define LOG_ENABLE_PORT (GPIOC)
52#define LOG_ENABLE_PIN (15)
53
54#define PER 1
55#define GREAT PER
56static_assert(PER == GREAT); // Long live daq loop
57
58#define SD_BLOCKING_TIMEOUT_MS (5000)
59constexpr TickType_t SD_BLOCKING_TIMEOUT_TICKS = pdMS_TO_TICKS(SD_BLOCKING_TIMEOUT_MS);
60
61extern SemaphoreHandle_t spi1_lock;
62
63void HardFault_Handler();
64
65#endif // MAIN_H
Wrapper macros for FreeRTOS constructs (tasks, queues, semaphores) to simplify static memory allocati...
Logging of received bus messages onto an SD card.
Custom SPMC designed for high throughput handling of CAN message streams.