OpenLCP/protocol/esta/rdm/E1.37-1.h

305 lines
8.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
E1.37-1.h.h
Copyright (c) 2021 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#include <cstdint>
#include "parameterdescription.h"
/**
* \ingroup RDM
* \details ANSI E1.37-1 2012 (R2017)
* Additional Message Sets for ANSI E1.20 (RDM) Part 1,
* Dimmer Message Sets
*/
namespace RDM {
// Appendix A: Defined Parameters (Normative)
// Table A-1: RDM Parameter ID Defines
// Category DMX512 Setup
/// \cite e137-1 3.3 Get/Set DMX512 Block Address (DMX_BLOCK_ADDRESS)
constexpr ParameterDescription DMX_BLOCK_ADDRESS = {
.pid = 0x0140,
.pdl = {
.get_response = 4,
.set = 2,
},
.command_class = CC_GET_SET,
.description = "DMX512 Block Address",
};
/// \cite e137-1 3.4 Get/Set DMX512 Fail Mode (DMX_FAIL_MODE)
constexpr ParameterDescription DMX_FAIL_MODE = {
.pid = 0x0141,
.pdl = {
.get_response = 7,
.set = 7,
},
.command_class = CC_GET_SET,
.description = "DMX512 Fail Mode",
};
/// \cite e137-1 3.5 Get/Set DMX512 Startup Mode (DMX_STARTUP_MODE)
constexpr ParameterDescription DMX_STARTUP_MODE = {
.pid = 0x0142,
.pdl = {
.get_response = 7,
.set = 7,
},
.command_class = CC_GET_SET,
.description = "DMX512 Startup Mode",
};
// Category Dimmer Settings
/// \cite e137-1 4.3 Get Dimmer Info (DIMMER_INFO)
constexpr ParameterDescription DIMMER_INFO = {
.pid = 0x0340,
.pdl = {
.get_response = 0x0b,
},
.command_class = CC_GET,
.description = "Dimmer Info",
};
/// \cite e137-1 4.4 Get/Set Minimum Level (MINIMUM_LEVEL)
constexpr ParameterDescription MINIMUM_LEVEL = {
.pid = 0x0341,
.pdl = {
.get_response = 5,
.set = 5,
},
.command_class = CC_GET_SET,
.description = "Minimum Level",
};
/// \cite e137-1 4.5 Get/Set Maximum Level (MAXIMUM_LEVEL)
constexpr ParameterDescription MAXIMUM_LEVEL = {
.pid = 0x0342,
.pdl = {
.get_response = 2,
.set = 2,
},
.command_class = CC_GET_SET,
.description = "Maximum Level",
};
/// \cite e137-1 4.6 Get/Set Curve (CURVE)
constexpr ParameterDescription CURVE = {
.pid = 0x0343,
.pdl = {
.get_response = 2,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Curve",
};
/// \cite e137-1 4.7 Get Curve Description (CURVE_DESCRIPTION)
constexpr ParameterDescription CURVE_DESCRIPTION = {
.pid = 0x0344,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET,
.description = "Curve Description",
};
/// \cite e137-1 4.8 Get/Set Output Response Time (OUTPUT_RESPONSE_TIME)
constexpr ParameterDescription OUTPUT_RESPONSE_TIME = {
.pid = 0x0345,
.pdl = {
.get_response = 2,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Output Response Time",
};
/// \cite e137-1 4.9 Get Response Time Description (OUTPUT_RESPONSE_TIME_DESCRIPTION)
constexpr ParameterDescription OUTPUT_RESPONSE_TIME_DESCRIPTION = {
.pid = 0x0346,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET,
.description = "Response Time Description",
};
/// \cite e137-1 4.10 Get/Set Modulation Frequency (MODULATION_FREQUENCY)
constexpr ParameterDescription MODULATION_FREQUENCY = {
.pid = 0x0347,
.pdl = {
.get_response = 2,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Modulation Frequency",
};
/// \cite e137-1 4.11 Get Modulation Frequency Description (MODULATION_FREQUENCY_DESCRIPTION)
constexpr ParameterDescription MODULATION_FREQUENCY_DESCRIPTION = {
.pid = 0x0348,
.pdl = {
.get_response = 5,
.set = 1,
},
.command_class = CC_GET,
.description = "Modulation Frequency Descripti",
};
// Category Power/Lamp Settings
/// \cite e137-1 3.10 Get/Set Burn-In (BURN_IN)
constexpr ParameterDescription BURN_IN = {
.pid = 0x0440,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Burn-In",
};
// Category Configuration
/// \cite e137-1 3.9 Get/Set Lock PIN (LOCK_PIN)
constexpr ParameterDescription LOCK_PIN = {
.pid = 0x0640,
.pdl = {
.get_response = 2,
.set = 4,
},
.command_class = CC_GET_SET,
.description = "Lock PIN",
};
/// \cite e137-1 3.7 Get/Set Lock State (LOCK_STATE)
constexpr ParameterDescription LOCK_STATE = {
.pid = 0x0641,
.pdl = {
.get_response = 2,
.set = 3,
},
.command_class = CC_GET_SET,
.description = "Lock State",
};
/// \cite e137-1 3.8 Get Lock State Description (LOCK_STATE_DESCRIPTION)
constexpr ParameterDescription LOCK_STATE_DESCRIPTION = {
.pid = 0x0642,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET,
.description = "Lock State Description",
};
// Category Control
/// \cite e137-1 3.2 Get/Set Identify Mode (IDENTIFY_MODE)
constexpr ParameterDescription IDENTIFY_MODE = {
.pid = 0x1040,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Identify Mode",
};
/// \cite e137-1 5.2 Get Preset Info (PRESET_INFO)
constexpr ParameterDescription PRESET_INFO = {
.pid = 0x1041,
.pdl = {
.get_response = 0x20,
},
.command_class = CC_GET,
.description = "Preset Info",
};
/// \cite e137-1 5.3 Get/Set Preset Status (PRESET_STATUS)
constexpr ParameterDescription PRESET_STATUS = {
.pid = 0x1042,
.pdl = {
.get = 2,
.get_response = 9,
.set = 9,
},
.command_class = CC_GET_SET,
.description = "Preset Status",
};
/// \cite e137-1 5.4 Get/Set Preset Merge Mode (PRESET_MERGEMODE)
constexpr ParameterDescription PRESET_MERGEMODE = {
.pid = 0x1043,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Preset Merge Mode",
};
/// \cite e137-1 3.6 Get/Set Power-On Self Test (POWER_ON_SELF_TEST)
constexpr ParameterDescription POWER_ON_SELF_TEST = {
.pid = 0x1044,
.pdl = {
.get_response = 1,
.set = 1,
},
.command_class = CC_GET_SET,
.description = "Power-On Self Test",
};
/// \cite e137-1 Table A-1: RDM Parameter ID Defines
constexpr const ParameterDescription *PIDs_E137_1[] =
{
// DMX512 Setup
&DMX_BLOCK_ADDRESS,
&DMX_FAIL_MODE,
&DMX_STARTUP_MODE,
// Dimmer Settings
&DIMMER_INFO,
&MINIMUM_LEVEL,
&MAXIMUM_LEVEL,
&CURVE,
&CURVE_DESCRIPTION,
&OUTPUT_RESPONSE_TIME,
&OUTPUT_RESPONSE_TIME_DESCRIPTION,
&MODULATION_FREQUENCY,
&MODULATION_FREQUENCY_DESCRIPTION,
// Power/Lamp Settings
&BURN_IN,
// Configuration
&LOCK_PIN,
&LOCK_STATE,
&LOCK_STATE_DESCRIPTION,
// Control
&IDENTIFY_MODE,
&PRESET_INFO,
&PRESET_STATUS,
&PRESET_MERGEMODE,
&POWER_ON_SELF_TEST,
};
// Preset Programmed Defines
static const uint8_t PRESET_NOT_PROGRAMMED = 0x00;
static const uint8_t PRESET_PROGRAMMED = 0x01;
static const uint8_t PRESET_PROGRAMMED_READ_ONLY = 0x02;
// Merge Mode Defines
static const uint8_t MERGEMODE_DEFAULT = 0x00;
static const uint8_t MERGEMODE_HTP = 0x01;
static const uint8_t MERGEMODE_LTP = 0x02;
static const uint8_t MERGEMODE_DMX_ONLY = 0x03;
static const uint8_t MERGEMODE_OTHER = 0xFF;
} // namespace RDM