Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Stm32Can.hxx
Go to the documentation of this file.
1
34#ifndef _FREERTOS_DRIVERS_ST_STM32F0XXCAN_HXX_
35#define _FREERTOS_DRIVERS_ST_STM32F0XXCAN_HXX_
36
37#include <cstdint>
38
39#ifdef ARDUINO
40#include <Arduino.h>
42#else
44#endif
45
46#include "stm32f_hal_conf.hxx"
47
50class Stm32Can : public Can
51{
52public:
56 Stm32Can(const char *name);
57
61 {
62 }
63
70
72 static Stm32Can *instances[1];
73
74private:
75#ifndef ARDUINO
81 int ioctl(File *file, unsigned long int key, unsigned long data) override;
82#endif
83
84 void enable() override;
85 void disable() override;
86 void tx_msg() override;
91 static unsigned int intCount;
92
93 uint8_t state_;
94
98
100};
101
102#ifdef ARDUINO
103
104extern void arduino_can_pinmap(PinName tx_pin, PinName rx_pin);
105
106#endif
107
108#endif /* _FREERTOS_DRIVERS_ST_STM32F0XXCAN_HXX_ */
Base class for a CAN device for the Arduino environment.
const char * name
device name
Definition Devtab.hxx:266
Specialization of CAN driver for LPC17xx and LPC40xx CAN.
Definition Stm32Can.hxx:51
int ioctl(File *file, unsigned long int key, unsigned long data) override
Request an ioctl transaction.
Definition Stm32Can.cxx:139
void enable() override
function to enable device
Definition Stm32Can.cxx:152
uint8_t state_
present bus state
Definition Stm32Can.hxx:93
~Stm32Can()
Destructor.
Definition Stm32Can.hxx:60
void sce_interrupt_handler()
Handle an interrupt.
Definition Stm32Can.cxx:444
void rx_interrupt_handler()
Handle an interrupt.
Definition Stm32Can.cxx:304
void tx_interrupt_handler()
Handle an interrupt.
Definition Stm32Can.cxx:366
Stm32Can()
Default constructor.
static Stm32Can * instances[1]
Instance pointers help us get context from the interrupt handler(s)
Definition Stm32Can.hxx:97
void disable() override
function to disable device
Definition Stm32Can.cxx:203
void tx_msg() override
function to try and transmit a message
Definition Stm32Can.cxx:220
static unsigned int intCount
one interrupt vector is shared between two CAN controllers, so we need to keep track of the number of...
Definition Stm32Can.hxx:91
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Definition macros.h:171
File information.
Definition Devtab.hxx:52