1 /* 2 * oscilloscope.h 3 * 4 * Created on: 26 Jan 2020 5 * Author: crocoduck 6 */ 7 8 #ifndef METADATA_OSCILLOSCOPE_H_ 9 #define METADATA_OSCILLOSCOPE_H_ 10 11 namespace lsp 12 { 13 struct oscilloscope_base_metadata 14 { 15 static const plugin_metadata_t metadata; 16 17 static const float HORIZONTAL_DIVISION_MAX = 10.0f; 18 static const float HORIZONTAL_DIVISION_MIN = 1.0e-3f; 19 static const float HORIZONTAL_DIVISION_DFL = 0.5; 20 static const float HORIZONTAL_DIVISION_STEP = 1e-3f; 21 22 static const float TIME_DIVISION_MAX = 50.0f; 23 static const float TIME_DIVISION_MIN = 0.05f; 24 static const float TIME_DIVISION_DFL = 1.0f; 25 static const float TIME_DIVISION_STEP = 0.01f; 26 27 static const float TIME_POSITION_MAX = 100.0f; 28 static const float TIME_POSITION_MIN = -100.0f; 29 static const float TIME_POSITION_DFL = 0.0f; 30 static const float TIME_POSITION_STEP = 0.1f; 31 32 static const float VERTICAL_DIVISION_MAX = 10.0f; 33 static const float VERTICAL_DIVISION_MIN = 1.0e-3f; 34 static const float VERTICAL_DIVISION_DFL = 0.5; 35 static const float VERTICAL_DIVISION_STEP = 1e-3f; 36 37 static const float VERTICAL_POSITION_MAX = 100.0f; 38 static const float VERTICAL_POSITION_MIN = -100.0f; 39 static const float VERTICAL_POSITION_DFL = 0.0f; 40 static const float VERTICAL_POSITION_STEP = 0.1f; 41 42 static const size_t STROBE_HISTORY_MAX = 10; 43 static const size_t STROBE_HISTORY_MIN = 0; 44 static const size_t STROBE_HISTORY_DFL = 0; 45 static const size_t STROBE_HISTORY_STEP = 1; 46 47 static const float XY_RECORD_TIME_MAX = 50.0f; 48 static const float XY_RECORD_TIME_MIN = 1.0f; 49 static const float XY_RECORD_TIME_DFL = 10.0f; 50 static const float XY_RECORD_TIME_STEP = 0.01f; 51 52 static const float MAXDOTS_MAX = 16384.0f; 53 static const float MAXDOTS_MIN = 512.0f; 54 static const float MAXDOTS_DFL = 8192.0f; 55 static const float MAXDOTS_STEP = 0.01f; 56 57 static const float TRIGGER_HYSTERESIS_MAX = 50.0f; 58 static const float TRIGGER_HYSTERESIS_MIN = 0.0f; 59 static const float TRIGGER_HYSTERESIS_DFL = 1.0f; 60 static const float TRIGGER_HYSTERESIS_STEP = 0.01f; 61 62 static const float TRIGGER_LEVEL_MAX = 100.0f; 63 static const float TRIGGER_LEVEL_MIN = -100.0f; 64 static const float TRIGGER_LEVEL_DFL = 0.0f; 65 static const float TRIGGER_LEVEL_STEP = 0.01f; 66 67 static const float TRIGGER_HOLD_TIME_MAX = 60.0f; 68 static const float TRIGGER_HOLD_TIME_MIN = 0.0f; 69 static const float TRIGGER_HOLD_TIME_DFL = 0.0f; 70 static const float TRIGGER_HOLD_TIME_STEP = 0.01f; 71 72 enum oversampler_mode_selector_t 73 { 74 OSC_OVS_NONE, 75 OSC_OVS_2X, 76 OSC_OVS_3X, 77 OSC_OVS_4X, 78 OSC_OVS_6X, 79 OSC_OVS_8X, 80 81 OSC_OVS_DFL = OSC_OVS_8X 82 }; 83 84 enum mode_selector_t 85 { 86 MODE_XY, 87 MODE_TRIGGERED, 88 MODE_GONIOMETER, 89 90 MODE_DFL = MODE_TRIGGERED 91 }; 92 93 enum sweep_type_selector_t 94 { 95 SWEEP_TYPE_SAWTOOTH, 96 SWEEP_TYPE_TRIANGULAR, 97 SWEEP_TYPE_SINE, 98 99 SWEEP_TYPE_DFL = SWEEP_TYPE_SAWTOOTH 100 }; 101 102 enum trigger_input_selector_t 103 { 104 TRIGGER_INPUT_Y, 105 TRIGGER_INPUT_EXT, 106 107 TRIGGER_INPUT_DFL = TRIGGER_INPUT_Y 108 }; 109 110 enum trigger_mode_selector_t 111 { 112 TRIGGER_MODE_SINGLE, 113 TRIGGER_MODE_MANUAL, 114 TRIGGER_MODE_REPEAT, 115 116 TRIGGER_MODE_DFL = TRIGGER_MODE_REPEAT 117 }; 118 119 enum trigger_type_selector_t 120 { 121 TRIGGER_TYPE_NONE, 122 TRIGGER_TYPE_SIMPLE_RISING_EDGE, 123 TRIGGER_TYPE_SIMPE_FALLING_EDGE, 124 TRIGGER_TYPE_ADVANCED_RISING_EDGE, 125 TRIGGER_TYPE_ADVANCED_FALLING_EDGE, 126 127 TRIGGER_TYPE_DFL = TRIGGER_TYPE_ADVANCED_RISING_EDGE 128 }; 129 130 enum coupling_type_t 131 { 132 COUPLING_AC, 133 COUPLING_DC, 134 135 COUPLING_DFL = COUPLING_DC 136 }; 137 138 static const size_t SCOPE_MESH_SIZE = 512; 139 }; 140 141 struct oscilloscope_x1_metadata: public oscilloscope_base_metadata 142 { 143 static const plugin_metadata_t metadata; 144 }; 145 146 struct oscilloscope_x2_metadata: public oscilloscope_base_metadata 147 { 148 static const plugin_metadata_t metadata; 149 }; 150 151 struct oscilloscope_x4_metadata: public oscilloscope_base_metadata 152 { 153 static const plugin_metadata_t metadata; 154 }; 155 } 156 157 #endif /* METADATA_OSCILLOSCOPE_H_ */ 158