HAL inside Chibi

This commit is contained in:
Andrey 2023-05-31 17:39:36 -04:00
parent 48f3dc1814
commit 87437c43eb
9 changed files with 2 additions and 144 deletions

View File

@ -1,9 +0,0 @@
PLATFORMSRC_CONTRIB := ${ARTERY_CONTRIB}/os/hal/ports/ARTERY/hal_lld.c \
${ARTERY_CONTRIB}/os/hal/ports/ARTERY/hal_pal_lld.c \
${ARTERY_CONTRIB}/os/hal/ports/ARTERY/hal_st_lld.c
PLATFORMINC_CONTRIB := ${ARTERY_CONTRIB}/os/hal/ports/ARTERY
# Shared variables
ALLCSRC += $(PLATFORMSRC_CONTRIB)
ALLINC += $(PLATFORMINC_CONTRIB)

View File

@ -1,8 +0,0 @@
#include <stdint.h>
#include "hal.h"
void hal_lld_init(void) {
}
void boardInit(void) {
}

View File

@ -1,12 +0,0 @@
#ifndef HAL_LLD_H_
#define HAL_LLD_H_
#ifdef __cplusplus
extern "C" {
#endif
void hal_lld_init(void);
#ifdef __cplusplus
}
#endif
#endif /* HAL_LLD_H_ */

View File

@ -1,11 +0,0 @@
#include "osal.h"
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
void pal_lld_init(void) {
// todo
}
#endif /* HAL_USE_PAL */

View File

@ -1,63 +0,0 @@
/**
* @brief Width, in bits, of an I/O port.
*/
#define PAL_IOPORTS_WIDTH 16
/**
* @name Line handling macros
* @{
*/
/**
* @brief Forms a line identifier.
* @details A port/pad pair are encoded into an @p ioline_t type. The encoding
* of this type is platform-dependent.
* @note In this driver the pad number is encoded in the lower 4 bits of
* the GPIO address which are guaranteed to be zero.
*/
#define PAL_LINE(port, pad) \
((ioline_t)((uint32_t)(port)) | ((uint32_t)(pad)))
/* Specifies palInit() without parameter, required until all platforms will
be updated to the new style.*/
#define PAL_NEW_INIT
/**
* @brief Digital I/O port sized unsigned type.
*/
typedef uint32_t ioportmask_t;
/**
* @brief Digital I/O modes.
*/
typedef uint32_t iomode_t;
/**
* @brief Type of an I/O line.
*/
typedef uint32_t ioline_t;
/**
* @brief Type of an event mode.
*/
typedef uint32_t ioeventmode_t;
typedef gpio_type *ioportid_t;
/**
* @brief Type of an pad identifier.
*/
typedef uint32_t iopadid_t;
#ifdef __cplusplus
extern "C" {
#endif
void pal_lld_init(void);
#ifdef __cplusplus
}
#endif
//typedef struct {
//} PALConfig;
//extern const PALConfig pal_default_config;

View File

@ -1,12 +0,0 @@
#include "hal.h"
#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) || defined(__DOXYGEN__)
void st_lld_init(void) {
#if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC
//todo
#endif /* OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC */
}
#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */

View File

@ -1,14 +0,0 @@
#ifndef HAL_ST_LLD_H_
#define HAL_ST_LLD_H_
#include "mcuconf.h"
#ifdef __cplusplus
extern "C" {
#endif
void st_lld_init(void);
#ifdef __cplusplus
}
#endif
#endif /* HAL_ST_LLD_H_ */

View File

@ -1,13 +0,0 @@
#pragma once
#define US_TO_NT_MULTIPLIER (CORE_CLOCK / 1000000)
// todo: huh? is this universal?
typedef enum {
BOR_Level_None = 0,
BOR_Level_1 = 1,
BOR_Level_2 = 2,
BOR_Level_3 = 3
} BOR_Level_t;
#define PORT_SIZE 16

View File

@ -1,3 +1,3 @@
CPU_STARTUP_DIR = $(ARTERY_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_at32f435.mk
CPU_PLATFORM = $(ARTERY_CONTRIB)/os/hal/ports/ARTERY/AT32F435.mk
CPU_STARTUP_DIR = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk
CPU_PLATFORM = $(CHIBIOS)/os/hal/ports/AT32/AT32F4xx/platform.mk
CPU_HWLAYER = ../../../../hw_layer_at