VLCB
Toggle main menu visibility
Loading...
Searching...
No Matches
PicoCANBus.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
PicoCANBus
35
{
36
public
:
37
#ifndef ARDUINO_ARCH_RP2040
38
// If not an RPi Pico then this file shall be compilable but this class shall not be instantiatable.
39
PicoCANBus
() =
delete
;
40
#endif
41
42
static
byte
getGreenLedPin
();
43
static
byte
getYellowLedPin
();
44
static
byte
getSwitchPin
();
45
47
static
void
setupLEDUserInterface
(
VLCB::LEDUserInterface
& ledUserInterface);
48
50
bool
begin
();
51
53
CanTransport
*
getCanTransport
()
54
{
55
return
&
can2515
;
56
}
57
59
CAN2515
*
getCAN2515
()
60
{
61
return
&
can2515
;
62
}
63
64
bool
hasCanErrors
();
65
67
CAN2515
can2515
;
68
};
69
70
}
CAN2515.h
LEDUserInterface.h
VLCB::CAN2515
Transport implementation for the MCP2515/25625 CAN controllers.
Definition
CAN2515.h:29
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::PicoCANBus::setupLEDUserInterface
static void setupLEDUserInterface(VLCB::LEDUserInterface &ledUserInterface)
Setup LED and switch pins for the LEDUserInterface object.
Definition
PicoCANBus.cpp:30
VLCB::PicoCANBus::hasCanErrors
bool hasCanErrors()
Definition
PicoCANBus.cpp:46
VLCB::PicoCANBus::getYellowLedPin
static byte getYellowLedPin()
Definition
PicoCANBus.cpp:20
VLCB::PicoCANBus::getCAN2515
CAN2515 * getCAN2515()
Get the underlying CAN2515 object.
Definition
PicoCANBus.h:59
VLCB::PicoCANBus::begin
bool begin()
Prepare the board and CAN controller for operation.
Definition
PicoCANBus.cpp:37
VLCB::PicoCANBus::getCanTransport
CanTransport * getCanTransport()
Get the underlying CAN object.
Definition
PicoCANBus.h:53
VLCB::PicoCANBus::can2515
CAN2515 can2515
The underlying CAN2515 transport object.
Definition
PicoCANBus.h:67
VLCB::PicoCANBus::getSwitchPin
static byte getSwitchPin()
Definition
PicoCANBus.cpp:25
VLCB::PicoCANBus::getGreenLedPin
static byte getGreenLedPin()
Definition
PicoCANBus.cpp:15
VLCB::PicoCANBus::PicoCANBus
PicoCANBus()=delete
VLCB
Definition
AbstractEventTeachingService.cpp:13
VCAN2515
src
PicoCANBus.h
Generated by
1.18.0