stable
Penguin 4 years ago
commit bbab8bdaee

5
.gitignore vendored

@ -0,0 +1,5 @@
GTAGS
GPATH
GRTAGS
.clang_complete

@ -0,0 +1 @@
# ePenguin Software Framework

@ -0,0 +1,18 @@
#ifndef _HAL_CACHE_H_
#define _HAL_CACHE_H_
#ifdef HAL_CACHE_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif

@ -0,0 +1,13 @@
#ifndef _HAL_CLOCK_H_
#define _HAL_CLOCK_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,14 @@
#ifndef _HAL_GPIO_H_
#define _HAL_GPIO_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,9 @@
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

@ -0,0 +1,8 @@
#ifndef _SAMD2X_HPP_
#define _SAMD2X_HPP_
#endif

@ -0,0 +1,7 @@
#include <iostream>
int main()
{
USART_Async x;
}

@ -0,0 +1,20 @@
#ifndef _MCU_H_
#define _MCU_H_
#define MCU_ARCH_ARM (0)
#define MCU_ARCH_ARM64 (1)
#define MCU_ARCH_AVR (2)
#define MCU_MANUF_MICROCHIP (0)
#define MCU_TYPE atsamd2x
#define MCU_ARCH MCU_ARCH_ARM
#define MCU_MANUF MCU_MANUF_MICROCHIP
#if MCU_ARCH == MCU_ARCH_ARM
typedef mcu
#elif
#endif

@ -0,0 +1,31 @@
I2C - Software Addressed Protocol
Clocked Protocol
Pins: SDA = Serial Data
SCL = Serial Clock
Speeds up to 400Khz, 1 Mhz
SPI - Serial Protocol Interface
Hardware Addressed Protocol
Clocked Protocol
Pins: MOSI (Master Out Slave In)
MISO (Master In Slave Out)
SCL Serial Clock
SS or nCS (Slave Select or not Chip Select)
Up to 20Mhz
USART Two Wire, Non Clocked Protocol
Pins:
TX: Transmit
RX: Receive
Baudrate = bits per second (sorta)
frequency = 100 / 1 time in seconds
9600
115200
38400

@ -0,0 +1,18 @@
#ifndef _USART_H_
#define _USART_H_
class Usart
{
public:
Usart();
~Usart();
void Write(const char* arr);
void Read(char* arr, int max_len);
private:
hal_usart _usart;
};
#endif

@ -0,0 +1,13 @@
#ifndef _EPENGUIN_CONF_H_
#define _EPENGUIN_CONF_H_
#include "epenguin_master.h"
#define EP_UARCH __UARCH_ARM__
#define EP_MCU_FAMILY __SAM_D2X__
#define EP_MCU __ATSAMD21J18A__
#define EP_DRIVERS (0)
#endif

@ -0,0 +1,40 @@
/* -- 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

@ -0,0 +1,7 @@
#ifndef _EPENGUIN_H_
#define _EPENGUIN_H_
#include "mcu.h"
#endif

35
mcu.h

@ -0,0 +1,35 @@
#ifndef __MCU_H__
#define __MCU_H__
#include "epenguin_conf.h"
#ifndef EP_UARCH
#error You must specify an architecture!
#elifndef EP_MCU_FAMILY
#error You must specify a mcu family!
#elifndef EP_MCU
#error You must specify a mcu!
#else
#if EP_UARCH == __UARCH_ARM__
#if EP_MCU_FAMILY == __SAM_D2X__
#if EP_MCU == __ATSAMD21J18A__
#else
#endif
#elif EP_MCU
#endif
#elif EP_UARCH == __UARCH_ARM64__
#elif EP_UARCH == __UARCH_AVR__
#elif EP_UARCH == __UARCH_AVR32__
#elif EP_UARCH == __UARCH_RISCV__
#elif EP_UARCH == __UARCH_X86__
#else
#error Selected uarch not found! Try again =(
#endif
#endif
#endif
Loading…
Cancel
Save