Browse Source

restructuring again

stable
Penguin 1 year ago
parent
commit
27165f7fa2
12 changed files with 53 additions and 93 deletions
  1. +1
    -0
      .#epenguin.hpp
  2. +1
    -1
      .gitignore
  3. +1
    -0
      arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp
  4. +0
    -35
      arch/arm/common/inc/hal_arm.h
  5. +39
    -0
      arch/arm/common/inc/hal_arm.hpp
  6. +0
    -40
      conf/epenguin_master.h
  7. +10
    -0
      epenguin.hpp
  8. +1
    -2
      epenguin_hal.hpp
  9. +0
    -6
      inc/epenguin_hal.h
  10. +0
    -9
      inc/mcu.h
  11. +0
    -0
      test/Makefile
  12. +0
    -0
      test/conf/epenguin_conf.h

+ 1
- 0
.#epenguin.hpp View File

@@ -0,0 +1 @@
penguin@penguin-pc.12922:1592934912

+ 1
- 1
.gitignore View File

@@ -1,5 +1,5 @@
GTAGS
GPATH
GRTAGS
.clang_complete
.clang*


+ 1
- 0
arch/arm/SAM_D2X/hal/.#hal_sam_d2x.hpp View File

@@ -0,0 +1 @@
penguin@penguin-pc.12922:1592934912

+ 0
- 35
arch/arm/common/inc/hal_arm.h View File

@@ -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 <stdint.h>
#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

+ 39
- 0
arch/arm/common/inc/hal_arm.hpp View File

@@ -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 <stdint.h>
#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

+ 0
- 40
conf/epenguin_master.h View File

@@ -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

+ 10
- 0
epenguin.hpp View File

@@ -0,0 +1,10 @@
#ifndef _EPENGUIN_HPP_
#define _EPENGUIN_HPP_

#include "epenguin_conf.h"
#include "epenguin_hal.hpp"




#endif

inc/epenguin.h → epenguin_hal.hpp View File

@@ -1,8 +1,7 @@
#ifndef _EPENGUIN_H_
#define _EPENGUIN_H_

#include "mcu.h"

namespace hal{};


#endif

+ 0
- 6
inc/epenguin_hal.h View File

@@ -1,6 +0,0 @@
#ifndef _EPENGUIN_HAL_H_
#define _EPENGUIN_HAL_H_


#endif


+ 0
- 9
inc/mcu.h View File

@@ -1,9 +0,0 @@
#ifndef __MCU_H__
#define __MCU_H__

#include "epenguin_conf.h"


#endif



+ 0
- 0
test/Makefile View File


conf/epenguin_conf.h → test/conf/epenguin_conf.h View File


Loading…
Cancel
Save