2022-11-30 14:15:09 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2017-06-27 19:27:24 -07:00
|
|
|
|
|
|
|
|
//#define DEBUG
|
2019-10-04 13:28:56 -07:00
|
|
|
//#define DEBUG_UART
|
2017-06-27 19:27:24 -07:00
|
|
|
//#define DEBUG_USB
|
2017-07-24 12:31:47 -07:00
|
|
|
//#define DEBUG_SPI
|
2019-11-27 18:11:21 -08:00
|
|
|
//#define DEBUG_FAULTS
|
2022-11-10 21:34:43 -08:00
|
|
|
//#define DEBUG_COMMS
|
2017-06-27 19:27:24 -07:00
|
|
|
|
2022-11-30 14:15:09 -08:00
|
|
|
#define CAN_INIT_TIMEOUT_MS 500U
|
2022-03-07 14:24:04 -08:00
|
|
|
#define DEEPSLEEP_WAKEUP_DELAY 3U
|
2022-11-30 14:15:09 -08:00
|
|
|
#define USBPACKET_MAX_SIZE 0x40U
|
|
|
|
|
#define MAX_CAN_MSGS_PER_BULK_TRANSFER 51U
|
2022-03-07 14:24:04 -08:00
|
|
|
|
2022-11-30 14:15:09 -08:00
|
|
|
// USB definitions
|
|
|
|
|
#define USB_VID 0xBBAAU
|
2017-07-21 11:48:03 -07:00
|
|
|
|
2022-11-30 14:15:09 -08:00
|
|
|
#ifdef BOOTSTUB
|
|
|
|
|
#define USB_PID 0xDDEEU
|
|
|
|
|
#else
|
|
|
|
|
#define USB_PID 0xDDCCU
|
|
|
|
|
#endif
|
2020-03-11 17:30:30 -07:00
|
|
|
|
2022-11-30 14:15:09 -08:00
|
|
|
// platform includes
|
2021-08-02 20:26:15 -07:00
|
|
|
#ifdef STM32H7
|
|
|
|
|
#include "stm32h7/stm32h7_config.h"
|
2022-11-30 14:15:09 -08:00
|
|
|
#elif defined(STM32F2) || defined(STM32F4)
|
2021-08-02 20:26:15 -07:00
|
|
|
#include "stm32fx/stm32fx_config.h"
|
2022-11-30 14:15:09 -08:00
|
|
|
#else
|
|
|
|
|
// TODO: uncomment this, cppcheck complains
|
|
|
|
|
// building for tests
|
|
|
|
|
//#include "fake_stm.h"
|
2017-06-27 19:27:24 -07:00
|
|
|
#endif
|