From 35a98377f52caf5ac37c2e932b9f2d4c9196c195 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 25 Dec 2021 18:09:33 +0100 Subject: Remove esp8266 support in favor of ESP8266 RTOS SDK --- include/arch/esp8266/driver/counter.h | 46 -------------------------- include/arch/esp8266/driver/gpio.h | 35 -------------------- include/arch/esp8266/driver/stdin.h | 29 ----------------- include/arch/esp8266/driver/stdout.h | 61 ----------------------------------- include/arch/esp8266/driver/uptime.h | 34 ------------------- include/arch/esp8266/user_config.h | 10 ------ 6 files changed, 215 deletions(-) delete mode 100644 include/arch/esp8266/driver/counter.h delete mode 100644 include/arch/esp8266/driver/gpio.h delete mode 100644 include/arch/esp8266/driver/stdin.h delete mode 100644 include/arch/esp8266/driver/stdout.h delete mode 100644 include/arch/esp8266/driver/uptime.h delete mode 100644 include/arch/esp8266/user_config.h (limited to 'include/arch') diff --git a/include/arch/esp8266/driver/counter.h b/include/arch/esp8266/driver/counter.h deleted file mode 100644 index 8c2d22f..0000000 --- a/include/arch/esp8266/driver/counter.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#ifndef COUNTER_H -#define COUNTER_H - -extern "C" { -#include "osapi.h" -#include "user_interface.h" -} -#include "c_types.h" - -typedef uint32_t counter_value_t; -typedef uint32_t counter_overflow_t; - -class Counter { - private: - Counter(const Counter ©); - uint32_t start_cycles; - - public: - uint32_t value; - uint32_t overflow; - - Counter() : start_cycles(0), value(0), overflow(0) {} - - inline void start() { - asm volatile ("esync; rsr %0,ccount":"=a" (start_cycles)); - } - - inline void stop() { - uint32_t stop_cycles; - asm volatile ("esync; rsr %0,ccount":"=a" (stop_cycles)); - if (stop_cycles > start_cycles) { - value = stop_cycles - start_cycles; - } else { - overflow = 1; - } - } -}; - -extern Counter counter; - -#endif diff --git a/include/arch/esp8266/driver/gpio.h b/include/arch/esp8266/driver/gpio.h deleted file mode 100644 index 29e7950..0000000 --- a/include/arch/esp8266/driver/gpio.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#ifndef GPIO_H -#define GPIO_H - -class GPIO { - private: - GPIO(const GPIO ©); - - public: - GPIO () {} - - enum Pin : unsigned char { - d3 = 0, tx, d4, rx, d2, d1, - d6 = 12, d7, d5, d8, - d0 = 16 - }; - - void setup(); - void led_on(unsigned char id = 0); - void led_off(unsigned char id = 0); - void led_toggle(unsigned char id = 0); - void input(unsigned char const pin); - void input(unsigned char const pin, bool pullup); - void output(unsigned char const pin); - unsigned char read(unsigned char const pin); - void write(unsigned char const pin, unsigned char value); -}; - -extern GPIO gpio; - -#endif diff --git a/include/arch/esp8266/driver/stdin.h b/include/arch/esp8266/driver/stdin.h deleted file mode 100644 index 1085111..0000000 --- a/include/arch/esp8266/driver/stdin.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#ifndef STANDARDINPUT_H -#define STANDARDINPUT_H - -class StandardInput { - private: - StandardInput(const StandardInput ©); - char buffer[8]; - unsigned char write_pos, read_pos; - - public: - StandardInput() : write_pos(0), read_pos(0) {} - void setup(); - bool hasKey(); - char getKey(); - - inline void addKey(char key) { - buffer[write_pos++] = key; - write_pos %= 8; - } -}; - -extern StandardInput kin; - -#endif diff --git a/include/arch/esp8266/driver/stdout.h b/include/arch/esp8266/driver/stdout.h deleted file mode 100644 index 2484cee..0000000 --- a/include/arch/esp8266/driver/stdout.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#ifndef STANDARDOUTPUT_H -#define STANDARDOUTPUT_H - -class StandardOutput { - private: - StandardOutput(const StandardOutput ©); - char digit_buffer[sizeof(long long) * 8]; - unsigned char base; - - public: - StandardOutput() : base(10) {}; - void setup(); - - void put(char c); - void write(const char *s); - void flush() {} - void printf_uint8(unsigned char num); - void printf_float(float num); - - StandardOutput & operator<<(char c); - StandardOutput & operator<<(unsigned char c); - StandardOutput & operator<<(unsigned short number); - StandardOutput & operator<<(short number); - StandardOutput & operator<<(unsigned int number); - StandardOutput & operator<<(int number); - StandardOutput & operator<<(unsigned long number); - StandardOutput & operator<<(long number); - StandardOutput & operator<<(unsigned long long number); - StandardOutput & operator<<(long long number); - StandardOutput & operator<<(float number); - StandardOutput & operator<<(double number); - StandardOutput & operator<<(void *pointer); - StandardOutput & operator<<(const char *text); - StandardOutput & operator<<(StandardOutput & (*fun) (StandardOutput &)); - - void setBase(unsigned char b); -}; - - -StandardOutput & endl(StandardOutput & os); - -StandardOutput & bin(StandardOutput & os); - -StandardOutput & oct(StandardOutput & os); - -StandardOutput & dec(StandardOutput & os); - -StandardOutput & hex(StandardOutput & os); - -StandardOutput & flush(StandardOutput & os); - -StandardOutput & term(StandardOutput & os); - -extern StandardOutput kout; - -#endif diff --git a/include/arch/esp8266/driver/uptime.h b/include/arch/esp8266/driver/uptime.h deleted file mode 100644 index f3e2f23..0000000 --- a/include/arch/esp8266/driver/uptime.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#ifndef UPTIME_H -#define UPTIME_H - -extern "C" { -#include "osapi.h" -#include "user_interface.h" -} -#include "c_types.h" - -class Uptime { - private: - Uptime(const Uptime ©); - - public: - Uptime () {} - inline uint32_t get_us() { return system_get_time(); } - inline uint32_t get_s() { return system_get_time() / 1000000; } - - inline uint32_t get_cycles() - { - uint32_t ccount; - asm volatile ("esync; rsr %0,ccount":"=a" (ccount)); - return ccount; - } -}; - -extern Uptime uptime; - -#endif diff --git a/include/arch/esp8266/user_config.h b/include/arch/esp8266/user_config.h deleted file mode 100644 index bbd7001..0000000 --- a/include/arch/esp8266/user_config.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright 2020 Daniel Friesel - * - * SPDX-License-Identifier: CC0-1.0 - */ -/* - * required by ESP8266 SDK's osapi.h - * - * Intentionally left blank. - */ -- cgit v1.2.3