You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "DSP2833x_Device.h"
|
|
|
|
#include "DSP28x_Project.h"
|
|
|
|
|
|
|
|
namespace canSpace {
|
|
|
|
|
|
|
|
enum CAN_VARIANT{
|
|
|
|
NONE = 0,
|
|
|
|
CANA,
|
|
|
|
CANB
|
|
|
|
};
|
|
|
|
|
|
|
|
class CAN{
|
|
|
|
public:
|
|
|
|
CAN();
|
|
|
|
|
|
|
|
void initGpio(CAN_VARIANT canVarinat);
|
|
|
|
void config(CAN_VARIANT canVarinat, Uint16 baudrate);
|
|
|
|
void configRxMBoxes();
|
|
|
|
void configTxMBoxes();
|
|
|
|
|
|
|
|
void transmitMsg(Uint16 boxNumber, const MBOX& message);
|
|
|
|
void receiveMsg(Uint16 boxNumber);
|
|
|
|
|
|
|
|
private:
|
|
|
|
volatile ECAN_REGS* p_CanRegs_;
|
|
|
|
ECAN_REGS CanShadow_;
|
|
|
|
volatile ECAN_MBOXES* p_CanMBoxes_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // canSpace
|