summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-06-28 15:23:36 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-06-28 15:23:36 +0200
commit0a9bce42c0e09432cd34b415f106621c851bb8a6 (patch)
tree15ca8a1cfb743c5eb81daa7f63b977c71432d20e /include
parent5c82c62dd7975e4cd914c61a9d8cc7a31469f9d1 (diff)
add TC1796 and TC397 mock architectures
only usable for ELF benchmarks, flashing is not supported
Diffstat (limited to 'include')
-rw-r--r--include/arch/infineon-tc1796-starter-kit/driver/counter.h31
-rw-r--r--include/arch/infineon-tc1796-starter-kit/driver/gpio.h47
-rw-r--r--include/arch/infineon-tc1796-starter-kit/driver/stdout.h24
-rw-r--r--include/arch/infineon-tc1796-starter-kit/driver/uptime.h32
-rw-r--r--include/arch/infineon-tc397-tft-kit/driver/counter.h31
-rw-r--r--include/arch/infineon-tc397-tft-kit/driver/gpio.h47
-rw-r--r--include/arch/infineon-tc397-tft-kit/driver/stdout.h24
-rw-r--r--include/arch/infineon-tc397-tft-kit/driver/uptime.h32
8 files changed, 268 insertions, 0 deletions
diff --git a/include/arch/infineon-tc1796-starter-kit/driver/counter.h b/include/arch/infineon-tc1796-starter-kit/driver/counter.h
new file mode 100644
index 0000000..b7330db
--- /dev/null
+++ b/include/arch/infineon-tc1796-starter-kit/driver/counter.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef COUNTER_H
+#define COUNTER_H
+
+typedef unsigned int counter_value_t;
+typedef unsigned int counter_overflow_t;
+
+class Counter {
+ private:
+ Counter(const Counter &copy);
+
+ public:
+ counter_value_t value;
+ volatile counter_overflow_t overflow;
+
+ Counter() : overflow(0) {}
+
+ inline void start() {
+ }
+
+ inline void stop() {
+ }
+};
+
+extern Counter counter;
+
+#endif
diff --git a/include/arch/infineon-tc1796-starter-kit/driver/gpio.h b/include/arch/infineon-tc1796-starter-kit/driver/gpio.h
new file mode 100644
index 0000000..83689b6
--- /dev/null
+++ b/include/arch/infineon-tc1796-starter-kit/driver/gpio.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef GPIO_H
+#define GPIO_H
+
+class GPIO {
+ private:
+ GPIO(const GPIO &copy);
+
+ public:
+ GPIO () {}
+
+ enum Pin : unsigned char {
+ PIN_INVALID
+ };
+
+ inline void setup() {
+ }
+ inline void led_on(unsigned char id = 0) {
+ }
+ inline void led_off(unsigned char id = 0) {
+ }
+ inline void led_toggle(unsigned char id = 0) {
+ }
+ inline void input(unsigned char const pin) {
+ }
+ inline void input(unsigned char const pin, unsigned char const pull) {
+ }
+ inline void output(unsigned char const pin) {
+ }
+ inline void output(unsigned char const pin, unsigned char const value) {
+ }
+ inline unsigned char read(unsigned char const pin) {
+ return 0;
+ }
+ inline void write(unsigned char const pin, unsigned char value) {
+ }
+ inline void write_mask(unsigned char const pin_base, unsigned char set_mask, unsigned char clear_mask) {
+ }
+};
+
+extern GPIO gpio;
+
+#endif
diff --git a/include/arch/infineon-tc1796-starter-kit/driver/stdout.h b/include/arch/infineon-tc1796-starter-kit/driver/stdout.h
new file mode 100644
index 0000000..b701dc1
--- /dev/null
+++ b/include/arch/infineon-tc1796-starter-kit/driver/stdout.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef STANDARDOUTPUT_H
+#define STANDARDOUTPUT_H
+
+#include "object/outputstream.h"
+
+class StandardOutput : public OutputStream {
+ private:
+ StandardOutput(const StandardOutput &copy);
+
+ public:
+ StandardOutput () {}
+ void setup();
+
+ virtual void put(char c) override;
+};
+
+extern StandardOutput kout;
+
+#endif
diff --git a/include/arch/infineon-tc1796-starter-kit/driver/uptime.h b/include/arch/infineon-tc1796-starter-kit/driver/uptime.h
new file mode 100644
index 0000000..6f52f8f
--- /dev/null
+++ b/include/arch/infineon-tc1796-starter-kit/driver/uptime.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef UPTIME_H
+#define UPTIME_H
+
+class Uptime {
+ private:
+ Uptime(const Uptime &copy);
+#ifdef TIMER_S
+ uint16_t seconds;
+#endif
+
+ public:
+#ifdef TIMER_S
+ Uptime () : seconds(0) {}
+#else
+ Uptime () {}
+#endif
+ inline uint16_t get_us() { return 0; }
+ inline uint16_t get_cycles() { return 0; }
+#ifdef TIMER_S
+ inline uint16_t get_s() { return seconds; }
+ inline void tick_s() { seconds++; }
+#endif
+};
+
+extern Uptime uptime;
+
+#endif
diff --git a/include/arch/infineon-tc397-tft-kit/driver/counter.h b/include/arch/infineon-tc397-tft-kit/driver/counter.h
new file mode 100644
index 0000000..b7330db
--- /dev/null
+++ b/include/arch/infineon-tc397-tft-kit/driver/counter.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef COUNTER_H
+#define COUNTER_H
+
+typedef unsigned int counter_value_t;
+typedef unsigned int counter_overflow_t;
+
+class Counter {
+ private:
+ Counter(const Counter &copy);
+
+ public:
+ counter_value_t value;
+ volatile counter_overflow_t overflow;
+
+ Counter() : overflow(0) {}
+
+ inline void start() {
+ }
+
+ inline void stop() {
+ }
+};
+
+extern Counter counter;
+
+#endif
diff --git a/include/arch/infineon-tc397-tft-kit/driver/gpio.h b/include/arch/infineon-tc397-tft-kit/driver/gpio.h
new file mode 100644
index 0000000..83689b6
--- /dev/null
+++ b/include/arch/infineon-tc397-tft-kit/driver/gpio.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef GPIO_H
+#define GPIO_H
+
+class GPIO {
+ private:
+ GPIO(const GPIO &copy);
+
+ public:
+ GPIO () {}
+
+ enum Pin : unsigned char {
+ PIN_INVALID
+ };
+
+ inline void setup() {
+ }
+ inline void led_on(unsigned char id = 0) {
+ }
+ inline void led_off(unsigned char id = 0) {
+ }
+ inline void led_toggle(unsigned char id = 0) {
+ }
+ inline void input(unsigned char const pin) {
+ }
+ inline void input(unsigned char const pin, unsigned char const pull) {
+ }
+ inline void output(unsigned char const pin) {
+ }
+ inline void output(unsigned char const pin, unsigned char const value) {
+ }
+ inline unsigned char read(unsigned char const pin) {
+ return 0;
+ }
+ inline void write(unsigned char const pin, unsigned char value) {
+ }
+ inline void write_mask(unsigned char const pin_base, unsigned char set_mask, unsigned char clear_mask) {
+ }
+};
+
+extern GPIO gpio;
+
+#endif
diff --git a/include/arch/infineon-tc397-tft-kit/driver/stdout.h b/include/arch/infineon-tc397-tft-kit/driver/stdout.h
new file mode 100644
index 0000000..b701dc1
--- /dev/null
+++ b/include/arch/infineon-tc397-tft-kit/driver/stdout.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef STANDARDOUTPUT_H
+#define STANDARDOUTPUT_H
+
+#include "object/outputstream.h"
+
+class StandardOutput : public OutputStream {
+ private:
+ StandardOutput(const StandardOutput &copy);
+
+ public:
+ StandardOutput () {}
+ void setup();
+
+ virtual void put(char c) override;
+};
+
+extern StandardOutput kout;
+
+#endif
diff --git a/include/arch/infineon-tc397-tft-kit/driver/uptime.h b/include/arch/infineon-tc397-tft-kit/driver/uptime.h
new file mode 100644
index 0000000..6f52f8f
--- /dev/null
+++ b/include/arch/infineon-tc397-tft-kit/driver/uptime.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2022 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef UPTIME_H
+#define UPTIME_H
+
+class Uptime {
+ private:
+ Uptime(const Uptime &copy);
+#ifdef TIMER_S
+ uint16_t seconds;
+#endif
+
+ public:
+#ifdef TIMER_S
+ Uptime () : seconds(0) {}
+#else
+ Uptime () {}
+#endif
+ inline uint16_t get_us() { return 0; }
+ inline uint16_t get_cycles() { return 0; }
+#ifdef TIMER_S
+ inline uint16_t get_s() { return seconds; }
+ inline void tick_s() { seconds++; }
+#endif
+};
+
+extern Uptime uptime;
+
+#endif