35#ifndef _FREERTOS_DRIVERS_PIC32MX_PIC32MXCAN_HXX_
36#define _FREERTOS_DRIVERS_PIC32MX_PIC32MXCAN_HXX_
40#include "GenericTypeDefs.h"
43#include "peripheral/CAN.h"
44#include "peripheral/int.h"
63 Pic32mxCan(CAN_MODULE module,
const char *dev,
unsigned irq_vector);
71 if ((CANGetModuleEvent(
hw_) & CAN_RX_EVENT) != 0)
89 CANEnableChannelEvent(
90 hw_, CAN_CHANNEL1, CAN_RX_CHANNEL_NOT_EMPTY, FALSE);
93 if ((CANGetModuleEvent(
hw_) & CAN_TX_EVENT) != 0)
97 CANEnableChannelEvent(
98 hw_, CAN_CHANNEL0, CAN_TX_CHANNEL_NOT_FULL, FALSE);
109 ssize_t
read(
File *file,
void *buf,
size_t count);
110 ssize_t
write(
File *file,
const void *buf,
size_t count);
123 return (INT_SOURCE)(INT_SOURCE_CAN(
hw_));
130 return (INT_VECTOR)(INT_VECTOR_CAN(
hw_));
CAN-bus device driver for the Pic32MX.
unsigned irqVector_
Hardware interrupt vector number. Do not delete!
void * messageFifoArea_
Points to the shared RAM area between the hardware and the driver.
void isr()
Implementation of the interrupt handler.
ssize_t read(File *file, void *buf, size_t count)
Read from a file or device.
CAN_MODULE hw_
Hardware (enumeration value).
bool select(File *file, int mode) OVERRIDE
Device select method.
void disable()
function to disable device
ssize_t write(File *file, const void *buf, size_t count)
Write to a file or device.
void enable()
function to enable device
void flush_buffers() OVERRIDE
function to disable device
int overrunCount_
How many times did we drop a frame because we did not have enough hardware buffers.
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Select wakeup information.
static void select_wakeup_from_isr(SelectInfo *info, int *woken)
Wakeup the list of clients needing woken.