VLCB
Toggle main menu visibility
Loading...
Searching...
No Matches
CANSHIELD.h
Go to the documentation of this file.
1
// Copyright (C) Sven Rosvall (sven@rosvall.ie)
2
// This file is part of VLCB-Arduino project on https://github.com/SvenRosvall/VLCB-Arduino
3
// Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
4
// The full licence can be found at: http://creativecommons.org/licenses/by-nc-sa/4.0/
5
6
#pragma once
7
8
#include <Arduino.h>
9
#include <
LEDUserInterface.h
>
10
11
#include "
CAN2515.h
"
12
13
namespace
VLCB
14
{
34
class
CANSHIELD
35
{
36
public
:
37
#ifdef ARDUINO_ARCH_RP2040
38
// If this is an RPi Pico then this file shall be compilable but this class shall not be instantiatable.
39
// The RPi Pico has a different SPI class and a different way to set the SPI pins. This is why this class
40
// is not useful for use with RPi Pico.
41
CANSHIELD
() =
delete
;
42
#endif
43
44
static
byte
getGreenLedPin
();
45
static
byte
getYellowLedPin
();
46
static
byte
getSwitchPin
();
47
49
static
void
setupLEDUserInterface
(
VLCB::LEDUserInterface
& ledUserInterface);
50
52
bool
begin
();
53
55
CanTransport
*
getCanTransport
()
56
{
57
return
&
can2515
;
58
}
59
61
CAN2515
*
getCAN2515
()
62
{
63
return
&
can2515
;
64
}
65
66
bool
hasCanErrors
();
67
69
CAN2515
can2515
;
70
};
71
72
}
CAN2515.h
LEDUserInterface.h
VLCB::CAN2515
Transport implementation for the MCP2515/25625 CAN controllers.
Definition
CAN2515.h:29
VLCB::CANSHIELD
Set up functions for the CANSHIELD board.
Definition
CANSHIELD.h:35
VLCB::CANSHIELD::getSwitchPin
static byte getSwitchPin()
Definition
CANSHIELD.cpp:25
VLCB::CANSHIELD::getCAN2515
CAN2515 * getCAN2515()
Get the underlying CAN2515 object.
Definition
CANSHIELD.h:61
VLCB::CANSHIELD::getYellowLedPin
static byte getYellowLedPin()
Definition
CANSHIELD.cpp:20
VLCB::CANSHIELD::hasCanErrors
bool hasCanErrors()
Definition
CANSHIELD.cpp:47
VLCB::CANSHIELD::getGreenLedPin
static byte getGreenLedPin()
Definition
CANSHIELD.cpp:15
VLCB::CANSHIELD::setupLEDUserInterface
static void setupLEDUserInterface(VLCB::LEDUserInterface &ledUserInterface)
Setup LED and switch pins for the LEDUserInterface object.
Definition
CANSHIELD.cpp:30
VLCB::CANSHIELD::getCanTransport
CanTransport * getCanTransport()
Get the underlying CAN object.
Definition
CANSHIELD.h:55
VLCB::CANSHIELD::begin
bool begin()
Prepare the board and CAN controller for operation.
Definition
CANSHIELD.cpp:37
VLCB::CANSHIELD::can2515
CAN2515 can2515
The underlying CAN2515 transport object.
Definition
CANSHIELD.h:69
VLCB::CanTransport
Interface base class for CAN transport implementations.
Definition
CanTransport.h:35
VLCB::LEDUserInterface
User interface "service" that communicates with LEDs and a push button.
Definition
LEDUserInterface.h:23
VLCB
Definition
AbstractEventTeachingService.cpp:13
VCAN2515
src
CANSHIELD.h
Generated by
1.18.0