Arduino C++ Library for VLCB
Loading...
Searching...
No Matches
VLCB.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 <Controller.h> // Controller class
9#include <Switch.h> // pushbutton switch
10#include <LED.h> // VLCB LEDs
11#include <Configuration.h> // module configuration
12#include <Parameters.h> // VLCB parameters
13#include <vlcbdefs.hpp> // VLCB constants
14#include <LEDUserInterface.h>
15#include <MinimumNodeServiceWithDiagnostics.h>
16#include <CanServiceWithDiagnostics.h>
17#include <NodeVariableService.h>
18#include <EventConsumerServiceWithDiagnostics.h>
19#include <EventProducerServiceWithDiagnostics.h>
21#include <EventTeachingServiceWithDiagnostics.h>
23#include <LongMessageService.h>
24#include <SerialUserInterface.h>
25
49namespace VLCB
50{
51
54
61void checkStartupAction(byte greenLedPin, byte yellowLedPin, byte pushButtonPin);
62
66void begin();
68
71
80
83void setVersion(char maj, char min, char patch);
84
93void setModuleId(byte manu, byte moduleId);
94
97void setName(char *mname);
98
101
103void setEventsStart(byte n);
104
106void setMaxEvents(byte n);
107
111
114
116byte getCANID();
117unsigned int getNodeNum();
118unsigned int getFreeEEPROMbase();
119byte readNV(byte nv);
120void writeNV(byte nv, byte val);
121byte getEventEVval(byte idx, byte evnum);
122byte findExistingEventByEv(int evIndex, byte value);
123byte findExistingEvent(unsigned int nn, unsigned int en);
124bool isEventIndexValid(byte eventIndex);
125bool doesEventExistAtIndex(byte eventIndex);
127void createEventAtIndex(byte eventIndex, unsigned int nn, unsigned int en);
128void writeEventVariable(byte eventIndex, byte evIndex, byte value);
129
132bool sendMessageWithNN(VlcbOpCodes opc, byte b1, byte b2);
133bool sendMessageWithNN(VlcbOpCodes opc, byte b1, byte b2, byte b3);
134bool sendMessageWithNN(VlcbOpCodes opc, byte b1, byte b2, byte b3, byte b4);
135bool sendMessageWithNN(VlcbOpCodes opc, byte b1, byte b2, byte b3, byte b4, byte b5);
136
138
140
142
145
149void process();
150
152}
Definition TimedResponse.h:26
Convenience class for use with initializer lists, i.e. bracketed list of items: { a,...
Definition initializer_list.h:19
Definition VLCB.h:50
void setServices(std::initializer_list< Service * > services)
void setEventsStart(byte n)
Optional: Sets the address where event data starts in the EEPROM.
void setVersion(char maj, char min, char patch)
void writeNV(byte nv, byte val)
void setMaxEvents(byte n)
Set the max number of events the module can handle.
byte findExistingEventByEv(int evIndex, byte value)
bool sendMessageWithNN(VlcbOpCodes opc)
bool doesEventExistAtIndex(byte eventIndex)
unsigned int getFreeEEPROMbase()
void createEventAtIndex(byte eventIndex, unsigned int nn, unsigned int en)
void setNumEventVariables(byte n)
Set the number of event variables that are used by each stored event.
byte findExistingEvent(unsigned int nn, unsigned int en)
void resetModule()
void addTimedResponse(TimedResponse::Task *task)
void setName(char *mname)
byte readNV(byte nv)
void begin()
void setModuleId(byte manu, byte moduleId)
bool isEventIndexValid(byte eventIndex)
void checkStartupAction(byte greenLedPin, byte yellowLedPin, byte pushButtonPin)
void writeEventVariable(byte eventIndex, byte evIndex, byte value)
void setNumNodeVariables(byte n)
Set number of node variables that the module will use.
unsigned int getNodeNum()
byte findEmptyEventSpace()
void process()
byte getEventEVval(byte idx, byte evnum)
VlcbModeParams getCurrentMode()
byte getCANID()
VlcbModeParams
Definition vlcbdefs.hpp:562
VlcbOpCodes
Definition vlcbdefs.hpp:188