123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #pragma once
- #include "AP_HAL_ChibiOS.h"
- #if HAL_WITH_UAVCAN
- #if defined(STM32H7XX)
- #include <uavcan/uavcan.hpp>
- #include <stdint.h>
- #ifndef UAVCAN_CPP_VERSION
- # error UAVCAN_CPP_VERSION
- #endif
- #if UAVCAN_CPP_VERSION < UAVCAN_CPP11
- # define constexpr const
- #endif
- namespace ChibiOS_CAN
- {
- namespace fdcan
- {
- typedef FDCAN_GlobalTypeDef CanType;
- constexpr unsigned long IDE = (0x40000000U);
- constexpr unsigned long STID_MASK = (0x1FFC0000U);
- constexpr unsigned long EXID_MASK = (0x1FFFFFFFU);
- constexpr unsigned long RTR = (0x20000000U);
- constexpr unsigned long DLC_MASK = (0x000F0000U);
- CanType* const Can[UAVCAN_STM32_NUM_IFACES] = {
- reinterpret_cast<CanType*>(FDCAN1_BASE)
- #if UAVCAN_STM32_NUM_IFACES > 1
- ,
- reinterpret_cast<CanType*>(FDCAN2_BASE)
- #endif
- };
- }
- }
- #if UAVCAN_CPP_VERSION < UAVCAN_CPP11
- # undef constexpr
- #endif
- #endif
- #endif
|