From 3fddb519f01ca53f1fd6f5c24e154912b25d1138 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 17 Jul 2018 09:57:10 +0200 Subject: Move include/$arch to include/arch/$arch to be consistent with src/ hierarchy --- include/esp8266/driver/gpio.h | 30 -------------------- include/esp8266/driver/stdin.h | 24 ---------------- include/esp8266/driver/stdout.h | 61 ----------------------------------------- include/esp8266/driver/uptime.h | 28 ------------------- include/esp8266/user_config.h | 5 ---- 5 files changed, 148 deletions(-) delete mode 100644 include/esp8266/driver/gpio.h delete mode 100644 include/esp8266/driver/stdin.h delete mode 100644 include/esp8266/driver/stdout.h delete mode 100644 include/esp8266/driver/uptime.h delete mode 100644 include/esp8266/user_config.h (limited to 'include/esp8266') diff --git a/include/esp8266/driver/gpio.h b/include/esp8266/driver/gpio.h deleted file mode 100644 index 3db5d9d..0000000 --- a/include/esp8266/driver/gpio.h +++ /dev/null @@ -1,30 +0,0 @@ -#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); - void led_off(unsigned char id); - void led_toggle(unsigned char id); - 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/esp8266/driver/stdin.h b/include/esp8266/driver/stdin.h deleted file mode 100644 index 6462e0c..0000000 --- a/include/esp8266/driver/stdin.h +++ /dev/null @@ -1,24 +0,0 @@ -#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/esp8266/driver/stdout.h b/include/esp8266/driver/stdout.h deleted file mode 100644 index 038de2e..0000000 --- a/include/esp8266/driver/stdout.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef STANDARDOUTPUT_H -#define STANDARDOUTPUT_H - -class StandardOutput { - private: - StandardOutput(const StandardOutput ©); - char digit_buffer[sizeof(long long) * 8]; - unsigned char base; - - public: - StandardOutput (); - 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<<(void *pointer); - StandardOutput & operator<<(const char *text); - StandardOutput & operator<<(StandardOutput & (*fun) (StandardOutput &)); - - void setBase(unsigned char b); -}; - - -// ENDL: new line character (and flush) -StandardOutput & endl(StandardOutput & os); - -// BIN: print numbers in binary form. -StandardOutput & bin(StandardOutput & os); - -// OCT: print numbers in octal form. -StandardOutput & oct(StandardOutput & os); - -// DEC: print numbers in decimal form. -StandardOutput & dec(StandardOutput & os); - -// HEX: print numbers in hexadecimal form. -StandardOutput & hex(StandardOutput & os); - -// FLUSH: flush StandardOutput buffer -StandardOutput & flush(StandardOutput & os); - -// TERM: zero-termination -StandardOutput & term(StandardOutput & os); - -extern StandardOutput kout; - -#endif diff --git a/include/esp8266/driver/uptime.h b/include/esp8266/driver/uptime.h deleted file mode 100644 index 21740c9..0000000 --- a/include/esp8266/driver/uptime.h +++ /dev/null @@ -1,28 +0,0 @@ -#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_cycles() - { - uint32_t ccount; - asm volatile ("esync; rsr %0,ccount":"=a" (ccount)); - return ccount; - } -}; - -extern Uptime uptime; - -#endif diff --git a/include/esp8266/user_config.h b/include/esp8266/user_config.h deleted file mode 100644 index 529fb46..0000000 --- a/include/esp8266/user_config.h +++ /dev/null @@ -1,5 +0,0 @@ -/* - * required by ESP8266 SDK's osapi.h - * - * Intentionally left blank. - */ -- cgit v1.2.3