-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
454 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#define main arm_cmsis_dsp_example | ||
#define std var_std | ||
#define while return ARM_MATH_SUCCESS; void // has no status variable | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_class_marks_example/arm_class_marks_example_f32.c" | ||
#undef while | ||
#undef main | ||
#undef std | ||
|
||
#define example_name "class_marks" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/class_marks</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:matrix</module> | ||
<module>modm:cmsis:dsp:statistics</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wsign-compare" | ||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_convolution_example/math_helper.h" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_convolution_example/math_helper.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_convolution_example/arm_convolution_example_f32.c" | ||
#undef while | ||
#undef main | ||
#pragma GCC diagnostic pop | ||
|
||
#define example_name "convolution" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Empty file to satisfy CPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/convolution</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:transform</module> | ||
<module>modm:cmsis:dsp:support</module> | ||
<module>modm:cmsis:dsp:complex_math</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#define main arm_cmsis_dsp_example | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_dotproduct_example/arm_dotproduct_example_f32.c" | ||
#undef while | ||
#undef main | ||
|
||
#define example_name "dotproduct" | ||
#include "../runner.cpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/dotproduct</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:transform</module> | ||
<module>modm:cmsis:dsp:basic_math</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fft_bin_example/arm_fft_bin_data.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fft_bin_example/arm_fft_bin_example_f32.c" | ||
#undef while | ||
#undef main | ||
|
||
#define example_name "fft_bin" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/fft_bin</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:transform</module> | ||
<module>modm:cmsis:dsp:complex_math</module> | ||
<module>modm:cmsis:dsp:statistics</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wsign-compare" | ||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fir_example/math_helper.h" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fir_example/math_helper.c" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fir_example/arm_fir_data.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_fir_example/arm_fir_example_f32.c" | ||
#undef while | ||
#undef main | ||
#pragma GCC diagnostic pop | ||
|
||
#define example_name "fir" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Empty file to satisfy CPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/fir</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:filtering</module> | ||
</modules> | ||
</library> |
28 changes: 28 additions & 0 deletions
28
examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wsign-compare" | ||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_graphic_equalizer_example/math_helper.h" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_graphic_equalizer_example/math_helper.c" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_graphic_equalizer_example/arm_graphic_equalizer_data.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_graphic_equalizer_example/arm_graphic_equalizer_example_q31.c" | ||
#undef while | ||
#undef main | ||
#pragma GCC diagnostic pop | ||
|
||
#define example_name "graphic_equalizer" | ||
#include "../runner.cpp" |
1 change: 1 addition & 0 deletions
1
examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/math_helper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Empty file to satisfy CPP |
11 changes: 11 additions & 0 deletions
11
examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/project.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/graphic_equalizer</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:filtering</module> | ||
<module>modm:cmsis:dsp:basic_math</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wsign-compare" | ||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/math_helper.h" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/math_helper.c" | ||
/* `float arm_linear_interep_table[188495]` is 736kB large and MUST be placed in Flash | ||
* memory NOT SRAM otherwise it won't fit on the device. Since we don't want (=cannot) | ||
* to change the example, we need to take drastic measures... */ | ||
#define float const float | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/arm_linear_interp_data.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/arm_linear_interp_example_f32.c" | ||
#undef while | ||
#undef float | ||
#undef main | ||
#pragma GCC diagnostic pop | ||
|
||
#define example_name "linear_interp" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Empty file to satisfy CPP |
14 changes: 14 additions & 0 deletions
14
examples/nucleo_f429zi/cmsis_dsp/linear_interp/project.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/linear_interp</option> | ||
</options> | ||
<collectors> | ||
<!-- We need to cast `&arm_linear_interep_table[0]` to (float*), but cannot change the example... --> | ||
<collect name="modm:build:cxxflags">-fpermissive</collect> | ||
</collectors> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:fast_math</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
#include <modm/board.hpp> | ||
#include <arm_math.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wsign-compare" | ||
#define main arm_cmsis_dsp_example | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_matrix_example/math_helper.h" | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_matrix_example/math_helper.c" | ||
#define while return status; void | ||
#include "../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_matrix_example/arm_matrix_example_f32.c" | ||
#undef while | ||
#undef main | ||
#pragma GCC diagnostic pop | ||
|
||
#define example_name "matrix" | ||
#include "../runner.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Empty file to satisfy CPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<library> | ||
<extends>modm:nucleo-f429zi</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../../build/nucleo_f429zi/cmsis_dsp/matrix</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:cmsis:dsp:matrix</module> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2019, Niklas Hauser | ||
* | ||
* This file is part of the modm project. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
// ---------------------------------------------------------------------------- | ||
|
||
int main() | ||
{ | ||
Board::initialize(); | ||
|
||
const uint32_t start{DWT->CYCCNT}; | ||
const int status = arm_cmsis_dsp_example(); | ||
const uint32_t diff{DWT->CYCCNT - start}; | ||
|
||
if (status != ARM_MATH_TEST_FAILURE) { | ||
MODM_LOG_INFO << "Example '" << example_name << "' passed in ~" << (diff / modm::clock::fcpu_MHz) << "us!" << modm::endl; | ||
} else { | ||
MODM_LOG_ERROR << "Example '" << example_name << "' failed!" << modm::endl; | ||
} | ||
|
||
while(1) { | ||
if (status != ARM_MATH_TEST_FAILURE) { | ||
Board::LedBlue::toggle(); | ||
} else { | ||
Board::LedRed::toggle(); | ||
} | ||
modm::delayMilliseconds(1000); | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.