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