APM:Libraries
Classes | Namespaces | Macros | Variables
bxcan.h File Reference
#include <uavcan/uavcan.hpp>
#include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h>
#include <chip/stm32_tim.h>
#include <syslog.h>
#include <nuttx/config.h>
#include <nuttx/fs/fs.h>
#include <nuttx/irq.h>
#include <nuttx/mm.h>
#include <pthread.h>
Include dependency graph for bxcan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  VRBRAIN::bxcan::TxMailboxType
 
struct  VRBRAIN::bxcan::RxMailboxType
 
struct  VRBRAIN::bxcan::FilterRegisterType
 
struct  VRBRAIN::bxcan::CanType
 

Namespaces

 VRBRAIN
 
 VRBRAIN::bxcan
 

Macros

#define CAN_IRQ_ATTACH(irq, handler)
 

Variables

CanType *const VRBRAIN::bxcan::Can [2] = { reinterpret_cast<CanType*>(STM32_CAN1_BASE), reinterpret_cast<CanType*>(STM32_CAN2_BASE) }
 
constexpr unsigned long VRBRAIN::bxcan::MCR_INRQ = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_SLEEP = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_TXFP = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_RFLM = (1U << 3)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_NART = (1U << 4)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_AWUM = (1U << 5)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_ABOM = (1U << 6)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_TTCM = (1U << 7)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_RESET = (1U << 15)
 
constexpr unsigned long VRBRAIN::bxcan::MCR_DBF = (1U << 16)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_INAK = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_SLAK = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_ERRI = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_WKUI = (1U << 3)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_SLAKI = (1U << 4)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_TXM = (1U << 8)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_RXM = (1U << 9)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_SAMP = (1U << 10)
 
constexpr unsigned long VRBRAIN::bxcan::MSR_RX = (1U << 11)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_RQCP0 = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TXOK0 = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ALST0 = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TERR0 = (1U << 3)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ABRQ0 = (1U << 7)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_RQCP1 = (1U << 8)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TXOK1 = (1U << 9)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ALST1 = (1U << 10)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TERR1 = (1U << 11)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ABRQ1 = (1U << 15)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_RQCP2 = (1U << 16)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TXOK2 = (1U << 17)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ALST2 = (1U << 18)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TERR2 = (1U << 19)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_ABRQ2 = (1U << 23)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_CODE_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_CODE_MASK = (3U << TSR_CODE_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TME0 = (1U << 26)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TME1 = (1U << 27)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_TME2 = (1U << 28)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_LOW0 = (1U << 29)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_LOW1 = (1U << 30)
 
constexpr unsigned long VRBRAIN::bxcan::TSR_LOW2 = (1U << 31)
 
constexpr unsigned long VRBRAIN::bxcan::RFR_FMP_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::RFR_FMP_MASK = (3U << RFR_FMP_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RFR_FULL = (1U << 3)
 
constexpr unsigned long VRBRAIN::bxcan::RFR_FOVR = (1U << 4)
 
constexpr unsigned long VRBRAIN::bxcan::RFR_RFOM = (1U << 5)
 
constexpr unsigned long VRBRAIN::bxcan::IER_TMEIE = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FMPIE0 = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FFIE0 = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FOVIE0 = (1U << 3)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FMPIE1 = (1U << 4)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FFIE1 = (1U << 5)
 
constexpr unsigned long VRBRAIN::bxcan::IER_FOVIE1 = (1U << 6)
 
constexpr unsigned long VRBRAIN::bxcan::IER_EWGIE = (1U << 8)
 
constexpr unsigned long VRBRAIN::bxcan::IER_EPVIE = (1U << 9)
 
constexpr unsigned long VRBRAIN::bxcan::IER_BOFIE = (1U << 10)
 
constexpr unsigned long VRBRAIN::bxcan::IER_LECIE = (1U << 11)
 
constexpr unsigned long VRBRAIN::bxcan::IER_ERRIE = (1U << 15)
 
constexpr unsigned long VRBRAIN::bxcan::IER_WKUIE = (1U << 16)
 
constexpr unsigned long VRBRAIN::bxcan::IER_SLKIE = (1U << 17)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_EWGF = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_EPVF = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_BOFF = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_LEC_SHIFT = (4U)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_LEC_MASK = (7U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_NOERROR = (0U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_STUFFERROR = (1U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_FORMERROR = (2U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_ACKERROR = (3U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_BRECERROR = (4U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_BDOMERROR = (5U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_CRCERRPR = (6U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_SWERROR = (7U << ESR_LEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_TEC_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_TEC_MASK = (0xFFU << ESR_TEC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_REC_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::ESR_REC_MASK = (0xFFU << ESR_REC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_BRP_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_BRP_MASK = (0x03FFU << BTR_BRP_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TS1_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TS1_MASK = (0x0FU << BTR_TS1_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TS2_SHIFT = (20U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TS2_MASK = (7U << BTR_TS2_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_SJW_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_SJW_MASK = (3U << BTR_SJW_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_LBKM = (1U << 30)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_SILM = (1U << 31)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_BRP_MAX = (1024U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TSEG1_MAX = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::BTR_TSEG2_MAX = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_TXRQ = (1U << 0)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_RTR = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_IDE = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_EXID_SHIFT = (3U)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_EXID_MASK = (0x1FFFFFFFU << TIR_EXID_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_STID_SHIFT = (21U)
 
constexpr unsigned long VRBRAIN::bxcan::TIR_STID_MASK = (0x07FFU << TIR_STID_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDTR_DLC_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::TDTR_DLC_MASK = (0x0FU << TDTR_DLC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDTR_TGT = (1U << 8)
 
constexpr unsigned long VRBRAIN::bxcan::TDTR_TIME_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::TDTR_TIME_MASK = (0xFFFFU << TDTR_TIME_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA0_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA0_MASK = (0xFFU << TDLR_DATA0_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA1_SHIFT = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA1_MASK = (0xFFU << TDLR_DATA1_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA2_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA2_MASK = (0xFFU << TDLR_DATA2_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA3_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::TDLR_DATA3_MASK = (0xFFU << TDLR_DATA3_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA4_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA4_MASK = (0xFFU << TDHR_DATA4_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA5_SHIFT = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA5_MASK = (0xFFU << TDHR_DATA5_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA6_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA6_MASK = (0xFFU << TDHR_DATA6_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA7_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::TDHR_DATA7_MASK = (0xFFU << TDHR_DATA7_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_RTR = (1U << 1)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_IDE = (1U << 2)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_EXID_SHIFT = (3U)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_EXID_MASK = (0x1FFFFFFFU << RIR_EXID_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_STID_SHIFT = (21U)
 
constexpr unsigned long VRBRAIN::bxcan::RIR_STID_MASK = (0x07FFU << RIR_STID_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_DLC_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_DLC_MASK = (0x0FU << RDTR_DLC_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_FM_SHIFT = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_FM_MASK = (0xFFU << RDTR_FM_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_TIME_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::RDTR_TIME_MASK = (0xFFFFU << RDTR_TIME_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA0_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA0_MASK = (0xFFU << RDLR_DATA0_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA1_SHIFT = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA1_MASK = (0xFFU << RDLR_DATA1_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA2_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA2_MASK = (0xFFU << RDLR_DATA2_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA3_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::RDLR_DATA3_MASK = (0xFFU << RDLR_DATA3_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA4_SHIFT = (0U)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA4_MASK = (0xFFU << RDHR_DATA4_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA5_SHIFT = (8U)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA5_MASK = (0xFFU << RDHR_DATA5_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA6_SHIFT = (16U)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA6_MASK = (0xFFU << RDHR_DATA6_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA7_SHIFT = (24U)
 
constexpr unsigned long VRBRAIN::bxcan::RDHR_DATA7_MASK = (0xFFU << RDHR_DATA7_SHIFT)
 
constexpr unsigned long VRBRAIN::bxcan::FMR_FINIT = (1U << 0)
 

Macro Definition Documentation

◆ CAN_IRQ_ATTACH

#define CAN_IRQ_ATTACH (   irq,
  handler 
)
Value:
do { \
const int res = irq_attach(irq, handler); \
(void)res; \
assert(res >= 0); \
up_enable_irq(irq); \
} while(0)

Definition at line 36 of file bxcan.h.