aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp
diff options
context:
space:
mode:
authorbarthess <barthess@yandex.ru>2015-02-24 00:10:02 +0300
committerbarthess <barthess@yandex.ru>2015-02-24 00:10:02 +0300
commit33f1b2541ef3a15b4ed5875f741d71a19e773217 (patch)
tree7539444eeae1f9fc15986901a8ac37fec041d3e0 /testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp
parenta1822c490d9eff67917a8cca2defeff3487b627d (diff)
downloadChibiOS-Contrib-33f1b2541ef3a15b4ed5875f741d71a19e773217.tar.gz
ChibiOS-Contrib-33f1b2541ef3a15b4ed5875f741d71a19e773217.tar.bz2
ChibiOS-Contrib-33f1b2541ef3a15b4ed5875f741d71a19e773217.zip
FSMC_SRAM testhal. Added memtest and membench.
Diffstat (limited to 'testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp')
-rw-r--r--testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp b/testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp
new file mode 100644
index 0000000..8b21e94
--- /dev/null
+++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/memtest.hpp
@@ -0,0 +1,55 @@
+#ifndef MEMTEST_HPP_
+#define MEMTEST_HPP_
+
+#define MEMTEST_WALKING_ONE (1 << 0)
+#define MEMTEST_WALKING_ZERO (1 << 1)
+#define MEMTEST_OWN_ADDRESS (1 << 2)
+#define MEMTEST_MOVING_INVERSION (1 << 3)
+#define MEMTEST_MOVING_INVERSION_RAND (1 << 4)
+
+#define MEMTEST_RUN_ALL (MEMTEST_WALKING_ONE | \
+ MEMTEST_WALKING_ZERO | \
+ MEMTEST_OWN_ADDRESS | \
+ MEMTEST_MOVING_INVERSION | \
+ MEMTEST_MOVING_INVERSION_RAND)
+
+typedef struct memtest_t memtest_t;
+typedef uint32_t testtype_t;
+
+/*
+ * Error call back.
+ */
+typedef void (*memtestecb_t)(memtest_t *memp, testtype_t e, size_t address);
+
+/*
+ *
+ */
+typedef enum {
+ MEMTEST_WIDTH_8,
+ MEMTEST_WIDTH_16,
+ MEMTEST_WIDTH_32
+} memtest_bus_width_t;
+
+/*
+ *
+ */
+struct memtest_t {
+ void *start;
+ size_t size;
+ memtest_bus_width_t width;
+ memtestecb_t ecb;
+ unsigned int rand_seed;
+};
+
+/*
+ *
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void memtest_run(memtest_t *memp, uint32_t testmask);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MEMTEST_HPP_ */