OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
constants.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * constants.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
29 #ifndef FIRMWARE_SRC_CONSTANTS_H_
30 #define FIRMWARE_SRC_CONSTANTS_H_
31 
32 // *****************************************************************************
33 // USB specific constants
34 // *****************************************************************************
35 
41 #define USB_MAX_PACKET_SIZE 64u
42 
48 #define USB_READ_BUFFER_SIZE 576u
49 
55 #define USB_POLLING_INTERVAL 1u
56 
57 // *****************************************************************************
58 // Network specific constants
59 // *****************************************************************************
60 
64 enum { MAC_ADDRESS_SIZE = 6 };
65 
66 // *****************************************************************************
67 // RDM specific constants
68 // *****************************************************************************
69 
73 #define RDM_START_CODE 0xccu
74 
78 #define RDM_SUB_START_CODE 0x01u
79 
80 // *****************************************************************************
81 // Protocol specific constants
82 // *****************************************************************************
83 
87 typedef enum {
88  // Base commands
94 
100 
106 
112 
113  // User Configuration
119 
125 
131 
137 
138  // Advanced Configuration
144 
150 
156 
162 
168 
174 
180 
186 
192 
198 
199  // DMX
200  TX_DMX = 0x30,
201 
202  // RDM
208 
214 
220 
221  // Experimental / testing
222  COMMAND_ECHO = 0xf0,
223  GET_FLAGS = 0xf2,
224 } Command;
225 
229 typedef enum {
230  RC_OK = 0,
232 
239 
248 
251 } ReturnCode;
252 
256 #define START_OF_MESSAGE_ID 0x5au
257 
261 #define END_OF_MESSAGE_ID 0xa5u
262 
266 #define PAYLOAD_SIZE 513u
267 
271 #define DEFAULT_BREAK_TIME 176u
272 
276 #define DEFAULT_MARK_TIME 12u
277 
285 #define DEFAULT_RDM_BROADCAST_TIMEOUT 28u
286 
294 #define DEFAULT_RDM_RESPONSE_TIMEOUT 28u
295 
301 #define DEFAULT_RDM_DUB_RESPONSE_LIMIT 29000u
302 
309 #define DEFAULT_RDM_RESPONDER_DELAY 1760u
310 
311 #endif // FIRMWARE_SRC_CONSTANTS_H_
312 
There was an error during transceiver transmit.
Definition: constants.h:237
Set the break time of the transceiver. See Set Break Time.
Definition: constants.h:118
The command completed successfully.
Definition: constants.h:230
Get the RDM Response timeout. See Get RDM Response Timeout.
Definition: constants.h:161
The command could not be completed due to a full memory buffer.
Definition: constants.h:235
The self test failed.
Definition: constants.h:249
Data was received in response to a broadcast RDM command.
Definition: constants.h:245
Fetch the current transceiver mark-after-break time. See Get Mark Time.
Definition: constants.h:136
Get the RDM Broadcast timeout. See Get RDM Broadcast Timeout.
Definition: constants.h:149
Set the RDM responder delay. See Set RDM Responder Delay.
Definition: constants.h:179
Echo the data back. See Echo.
Definition: constants.h:222
ReturnCode
JaRule command return codes.
Definition: constants.h:229
Get the hardware info for the device.
Definition: constants.h:105
Get the RDM Response limit. See Get RDM DUB Response Limit.
Definition: constants.h:173
Transmit a DMX frame. See Transmit DMX512.
Definition: constants.h:200
Send an RDM Discovery Unique Branch and wait for a response. See Transmit RDM DUB.
Definition: constants.h:207
Set the RDM DUB Response limit. See Set RDM DUB Response Limit.
Definition: constants.h:167
Fetch the current transceiver break time. See Get Break Time.
Definition: constants.h:124
Set the mark-after-break time of the transceiver. See Set Mark Time.
Definition: constants.h:130
Set the RDM Broadcast timeout. See Set RDM Broadcast Timeout.
Definition: constants.h:143
An invalid RDM response was received.
Definition: constants.h:246
Set the RDM Response timeout. See Set RDM Response Timeout.
Definition: constants.h:155
Set the RDM responder jitter. See Set RDM Responder Jitter.
Definition: constants.h:191
Command
The Ja Rule message commands.
Definition: constants.h:87
Get the RDM responder jitter. See Get RDM Responder Jitter.
Definition: constants.h:197
Run a loopback self test.
Definition: constants.h:111
Reset the device. See Reset.
Definition: constants.h:93
Unknown command.
Definition: constants.h:231
Send a broadcast RDM command. See Transmit Broadcast RDM Get / Set.
Definition: constants.h:219
The command is invalid in the current mode.
Definition: constants.h:247
Get the flags state.
Definition: constants.h:223
Get the RDM responder delay. See Get RDM Responder Delay.
Definition: constants.h:185
No RDM response was received.
Definition: constants.h:238
The command was malformed.
Definition: constants.h:236
Send an RDM Get / Set command. See Transmit RDM Get / Set.
Definition: constants.h:213
The request was preempted or cancelled.
Definition: constants.h:250
Change the operating mode of the device.
Definition: constants.h:99