From 27165f7fa2617d773495bead2ea3db1e16a26ac8 Mon Sep 17 00:00:00 2001 From: Penguin Date: Tue, 23 Jun 2020 17:30:34 -0500 Subject: [PATCH] restructuring again --- .#epenguin.hpp | 1 + .gitignore | 2 +- arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp | 1 + arch/arm/common/inc/hal_arm.h | 35 ---------------------- arch/arm/common/inc/hal_arm.hpp | 39 +++++++++++++++++++++++++ conf/epenguin_master.h | 40 -------------------------- epenguin.hpp | 10 +++++++ inc/epenguin.h => epenguin_hal.hpp | 3 +- inc/epenguin_hal.h | 6 ---- inc/mcu.h | 9 ------ test/Makefile | 0 {conf => test/conf}/epenguin_conf.h | 0 12 files changed, 53 insertions(+), 93 deletions(-) create mode 120000 .#epenguin.hpp create mode 120000 arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp delete mode 100644 arch/arm/common/inc/hal_arm.h create mode 100644 arch/arm/common/inc/hal_arm.hpp delete mode 100644 conf/epenguin_master.h create mode 100644 epenguin.hpp rename inc/epenguin.h => epenguin_hal.hpp (74%) delete mode 100644 inc/epenguin_hal.h delete mode 100644 inc/mcu.h create mode 100644 test/Makefile rename {conf => test/conf}/epenguin_conf.h (100%) diff --git a/.#epenguin.hpp b/.#epenguin.hpp new file mode 120000 index 00000000..cb7e426e --- /dev/null +++ b/.#epenguin.hpp @@ -0,0 +1 @@ +penguin@penguin-pc.12922:1592934912 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5659db0d..96f661c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ GTAGS GPATH GRTAGS -.clang_complete +.clang* diff --git a/arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp b/arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp new file mode 120000 index 00000000..cb7e426e --- /dev/null +++ b/arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp @@ -0,0 +1 @@ +penguin@penguin-pc.12922:1592934912 \ No newline at end of file diff --git a/arch/arm/common/inc/hal_arm.h b/arch/arm/common/inc/hal_arm.h deleted file mode 100644 index e11b65be..00000000 --- a/arch/arm/common/inc/hal_arm.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _HAL_ARM_H_ -#define _HAL_ARM_H_ - -#include "epenguin_conf.h" - -#if !(EP_UARCH == __UARCH_ARM__) - #error This shouldn't be included unless arm is the uarch of choice! -#endif - - -#if !(defined(__ASSEMBLY__)) -#include -#ifndef __cplusplus - typedef volatile const uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) - typedef volatile const uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) - typedef volatile const uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) -#else - typedef volatile uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) - typedef volatile uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) - typedef volatile uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) -#endif - typedef volatile uint32_t WoReg; // Write only 32-bit register (volatile unsigned int) - typedef volatile uint16_t WoReg16; // Write only 16-bit register (volatile unsigned int) - typedef volatile uint16_t WoReg8; // Write only 8-bit register (volatile unsigned int) - typedef volatile uint32_t RwReg; // Write only 32-bit register (volatile unsigned int) - typedef volatile uint16_t RwReg16; // Write only 16-bit register (volatile unsigned int) - typedef volatile uint8_t RwReg8; // Write only 8-bit register (volatile unsigned int) -#define CAST(type, value) ((type*)(value)) -#define REG_ACCESS(type, address) (*(type*)(address)) -#else -#define CAST(type, value) (value) -#define REG_ACCESS(type, address) (address) -#endif - -#endif diff --git a/arch/arm/common/inc/hal_arm.hpp b/arch/arm/common/inc/hal_arm.hpp new file mode 100644 index 00000000..a86c3d9c --- /dev/null +++ b/arch/arm/common/inc/hal_arm.hpp @@ -0,0 +1,39 @@ +#ifndef _HAL_ARM_HPP_ +#define _HAL_ARM_HPP_ + +#include "epenguin_conf.h" + +#if !(EP_UARCH == __UARCH_ARM__) + #error This shouldn't be included unless arm is the uarch of choice! +#endif + + +#if !(defined(__ASSEMBLY__)) +#include +#ifndef __cplusplus +// typedef volatile const uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) +// typedef volatile const uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) +// typedef volatile const uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) +// #else +// typedef volatile uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) +// typedef volatile uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) +// typedef volatile uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) +// #endif +typedef volatile const uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) +typedef volatile const uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) +typedef volatile const uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int Ts) +typedef volatile uint32_t WoReg; // Write only 32-bit register (volatile unsigned int) +typedef volatile uint16_t WoReg16; // Write only 16-bit register (volatile unsigned int) +typedef volatile uint16_t WoReg8; // Write only 8-bit register (volatile unsigned int) +typedef volatile uint32_t RwReg; // Write only 32-bit register (volatile unsigned int) +typedef volatile uint16_t RwReg16; // Write only 16-bit register (volatile unsigned int) +typedef volatile uint8_t RwReg8; // Write only 8-bit register (volatile unsigned int) +#define CAST(type, value) ((type*)(value)) +#define REG_ACCESS(type, address) (*(type*)(address)) +#else +#define CAST(type, value) (value) +#define REG_ACCESS(type, address) (address) +#endif + +namespace hal::arm{}; +#endif diff --git a/conf/epenguin_master.h b/conf/epenguin_master.h deleted file mode 100644 index e3d3c39b..00000000 --- a/conf/epenguin_master.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -- ePenguin Master -- - - This master file dictates all supported hardware. It lists supported - architectures, mcu families, and specific mcus. This software framework - targets hardware at the mcu level--not at the board level. Board layers can - be applied, but this framework targets the mcu and the mcu alone. - -*/ -#ifndef _EPENGUIN_MASTER_H_ -#define _EPENGUIN_MASTER_H_ - -#ifndef __UARCHITECTURES__ -#define __UARCHITECTURES__ - #define __UARCH_ARM__ (0) - #define __UARCH_ARM64__ (1) - #define __UARCH_AVR__ (2) - #define __UARCH_AVR32__ (3) - #define __UARCH_X86__ (4) - #define __UARCH_RISCV__ (5) -#endif - -#ifndef __UFAMILIES__ -#define __UFAMILIES__ - /* Support ARM MCU Families */ - - /* Microchip */ - #define __SAM_D1X__ (0) - #define __SAM_C1X__ (1) - #define __SAM_D2X__ (2) - #define __SAM_E_D5X__ (3) - #define __SAM_C2X__ (4) - #define __SAM_L2X__ (5) - - /* STMicroelectronics */ - - /* NXP */ - -#endif - -#endif diff --git a/epenguin.hpp b/epenguin.hpp new file mode 100644 index 00000000..53d9d5a7 --- /dev/null +++ b/epenguin.hpp @@ -0,0 +1,10 @@ +#ifndef _EPENGUIN_HPP_ +#define _EPENGUIN_HPP_ + +#include "epenguin_conf.h" +#include "epenguin_hal.hpp" + + + + +#endif diff --git a/inc/epenguin.h b/epenguin_hal.hpp similarity index 74% rename from inc/epenguin.h rename to epenguin_hal.hpp index 7c0fd4ea..21b49a08 100644 --- a/inc/epenguin.h +++ b/epenguin_hal.hpp @@ -1,8 +1,7 @@ #ifndef _EPENGUIN_H_ #define _EPENGUIN_H_ -#include "mcu.h" - +namespace hal{}; #endif diff --git a/inc/epenguin_hal.h b/inc/epenguin_hal.h deleted file mode 100644 index 39830af5..00000000 --- a/inc/epenguin_hal.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _EPENGUIN_HAL_H_ -#define _EPENGUIN_HAL_H_ - - -#endif - diff --git a/inc/mcu.h b/inc/mcu.h deleted file mode 100644 index 980beba1..00000000 --- a/inc/mcu.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __MCU_H__ -#define __MCU_H__ - -#include "epenguin_conf.h" - - -#endif - - diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 00000000..e69de29b diff --git a/conf/epenguin_conf.h b/test/conf/epenguin_conf.h similarity index 100% rename from conf/epenguin_conf.h rename to test/conf/epenguin_conf.h