diff options
author | JanHenrik <janhenrik@janhenrik.org> | 2020-04-01 00:40:03 +0200 |
---|---|---|
committer | JanHenrik <janhenrik@janhenrik.org> | 2020-04-01 00:40:03 +0200 |
commit | f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126 (patch) | |
tree | 78465e38a01011dc9f17eb73416011310532017f /hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests | |
parent | 3ec13d81e70e52246545c720abe756ccf09fb231 (diff) | |
download | minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.tar.gz minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.tar.bz2 minikbd-f7de54fc6fa6b40dfa2dfbe4c2a8ee933affa126.zip |
added files
Diffstat (limited to 'hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests')
4 files changed, 99 insertions, 0 deletions
diff --git a/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_templates.h b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_templates.h new file mode 100644 index 0000000..f7956fb --- /dev/null +++ b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_templates.h @@ -0,0 +1,46 @@ +#ifndef _CONTROLLER_TEMPLATES_H_
+#define _CONTROLLER_TEMPLATES_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Includes */
+/*--------------------------------------------------------------------------------*/
+
+#include "test_templates.h"
+#include <string.h> /* memcpy() */
+
+/*--------------------------------------------------------------------------------*/
+/* Group Specific Templates */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * Comparison SNR thresholds for the data types used in transform_tests.
+ */
+#define CONTROLLER_SNR_THRESHOLD_float32_t 110
+#define CONTROLLER_SNR_THRESHOLD_q31_t 100
+#define CONTROLLER_SNR_THRESHOLD_q15_t 45
+
+/**
+ * Compare the outputs from the function under test and the reference
+ * function using SNR.
+ */
+#define CONTROLLER_SNR_COMPARE_INTERFACE(block_size, \
+ output_type) \
+ do \
+ { \
+ TEST_CONVERT_AND_ASSERT_SNR( \
+ controller_output_f32_ref, \
+ (output_type *) controller_output_ref, \
+ controller_output_f32_fut, \
+ (output_type *) controller_output_fut, \
+ block_size, \
+ output_type, \
+ CONTROLLER_SNR_THRESHOLD_##output_type \
+ ); \
+ } while (0)
+
+
+/*--------------------------------------------------------------------------------*/
+/* TEST Templates */
+/*--------------------------------------------------------------------------------*/
+
+#endif /* _CONTROLLER_TEMPLATES_H_ */
diff --git a/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_data.h b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_data.h new file mode 100644 index 0000000..5aa63eb --- /dev/null +++ b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_data.h @@ -0,0 +1,33 @@ +#ifndef _CONTROLLER_TEST_DATA_H_
+#define _CONTROLLER_TEST_DATA_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Includes */
+/*--------------------------------------------------------------------------------*/
+
+#include "arm_math.h"
+
+/*--------------------------------------------------------------------------------*/
+/* Macros and Defines */
+/*--------------------------------------------------------------------------------*/
+
+#define CONTROLLER_MAX_LEN 1024
+#define CONTROLLER_MAX_COEFFS_LEN (12 * 3)
+#define TRANFORM_BIGGEST_INPUT_TYPE float32_t
+
+/*--------------------------------------------------------------------------------*/
+/* Variable Declarations */
+/*--------------------------------------------------------------------------------*/
+
+extern float32_t controller_output_fut[CONTROLLER_MAX_LEN];
+extern float32_t controller_output_ref[CONTROLLER_MAX_LEN];
+extern float32_t controller_output_f32_fut[CONTROLLER_MAX_LEN];
+extern float32_t controller_output_f32_ref[CONTROLLER_MAX_LEN];
+extern const float32_t controller_f32_inputs[CONTROLLER_MAX_LEN];
+extern const q31_t controller_q31_inputs[CONTROLLER_MAX_LEN];
+extern const q15_t * controller_q15_inputs;
+extern const float32_t controller_f32_coeffs[CONTROLLER_MAX_COEFFS_LEN];
+extern const q31_t controller_q31_coeffs[CONTROLLER_MAX_COEFFS_LEN];
+extern const q15_t controller_q15_coeffs[CONTROLLER_MAX_COEFFS_LEN];
+
+#endif /* _CONTROLLER_TEST_DATA_H_ */
diff --git a/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_group.h b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_group.h new file mode 100644 index 0000000..baead25 --- /dev/null +++ b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_test_group.h @@ -0,0 +1,9 @@ +#ifndef _CONTROLLER_TEST_GROUP_H_
+#define _CONTROLLER_TEST_GROUP_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Declare Test Group */
+/*--------------------------------------------------------------------------------*/
+JTEST_DECLARE_GROUP(controller_tests);
+
+#endif /* _CONTROLLER_TEST_GROUP_H_ */
diff --git a/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_tests.h b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_tests.h new file mode 100644 index 0000000..41996a8 --- /dev/null +++ b/hid-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/inc/controller_tests/controller_tests.h @@ -0,0 +1,11 @@ +#ifndef _CONTROLLER_TESTS_H_
+#define _CONTROLLER_TESTS_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Test/Group Declarations */
+/*--------------------------------------------------------------------------------*/
+JTEST_DECLARE_GROUP(pid_reset_tests);
+JTEST_DECLARE_GROUP(sin_cos_tests);
+JTEST_DECLARE_GROUP(pid_tests);
+
+#endif /* _CONTROLLER_TESTS_H_ */
|