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>
17#include <NodeVariableService.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
79void setServices(std::initializer_list<Service *> services);
80
83void setVersion(char maj, char min, char patch);
84
93void setModuleId(byte manu, byte moduleId);
94
97void setName(char *mname);
98
100void setNumNodeVariables(byte n);
101
103void setEventsStart(byte n);
104
106void setMaxEvents(byte n);
107
109void setNumEventVariables(byte n);
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
131bool sendMessageWithNN(VlcbOpCodes opc, byte b1);
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
139void resetModule();
140
142
145
149void process();
150
152}
Definition TimedResponse.h:26
Definition AbstractEventTeachingService.cpp:13
void setServices(std::initializer_list< Service * > services)
Definition VLCB.cpp:31
void setEventsStart(byte n)
Optional: Sets the address where event data starts in the EEPROM.
Definition VLCB.cpp:61
void setVersion(char maj, char min, char patch)
Definition VLCB.cpp:41
void writeNV(byte nv, byte val)
Definition VLCB.cpp:91
void setMaxEvents(byte n)
Set the max number of events the module can handle.
Definition VLCB.cpp:56
byte findExistingEventByEv(int evIndex, byte value)
Definition VLCB.cpp:101
bool sendMessageWithNN(VlcbOpCodes opc)
Definition VLCB.cpp:141
bool doesEventExistAtIndex(byte eventIndex)
Definition VLCB.cpp:116
unsigned int getFreeEEPROMbase()
Definition VLCB.cpp:171
void createEventAtIndex(byte eventIndex, unsigned int nn, unsigned int en)
Definition VLCB.cpp:126
void setNumEventVariables(byte n)
Set the number of event variables that are used by each stored event.
Definition VLCB.cpp:66
byte findExistingEvent(unsigned int nn, unsigned int en)
Definition VLCB.cpp:106
void resetModule()
Definition VLCB.cpp:176
void setName(char *mname)
Definition VLCB.cpp:36
byte readNV(byte nv)
Definition VLCB.cpp:86
void begin()
Definition VLCB.cpp:181
void setModuleId(byte manu, byte moduleId)
Definition VLCB.cpp:46
bool isEventIndexValid(byte eventIndex)
Definition VLCB.cpp:111
void checkStartupAction(byte greenLedPin, byte yellowLedPin, byte pushButtonPin)
Definition VLCB.cpp:16
void writeEventVariable(byte eventIndex, byte evIndex, byte value)
Definition VLCB.cpp:136
void setNumNodeVariables(byte n)
Set number of node variables that the module will use.
Definition VLCB.cpp:51
void addTimedResponseTask(TimedResponse::Task *task)
Definition VLCB.cpp:166
unsigned int getNodeNum()
Definition VLCB.cpp:81
byte findEmptyEventSpace()
Definition VLCB.cpp:121
void process()
Definition VLCB.cpp:187
byte getEventEVval(byte idx, byte evnum)
Definition VLCB.cpp:96
VlcbModeParams getCurrentMode()
Definition VLCB.cpp:71
byte getCANID()
Definition VLCB.cpp:76
VlcbModeParams
Definition vlcbdefs.hpp:562
VlcbOpCodes
Definition vlcbdefs.hpp:188