git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15662 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2022-06-28 03:40:15 +00:00
parent 3c9f0ee67a
commit 7e4aceb4ca
5 changed files with 35 additions and 5 deletions

View File

@ -26,6 +26,18 @@
#include "startup_defs.h"
static vhal_pal_conf_t vpal_config1 = {
.nvpio = 1U,
.vpio = {
[0] = {
.permissions = VPIO_PERM_WRITE,
.port = GPIOA,
.mask = 1U,
.offset = GPIOA_LED_GREEN
}
}
};
/*===========================================================================*/
/* VFS-related. */
/*===========================================================================*/

View File

@ -57,6 +57,7 @@ typedef struct vhal_conf {
/**
* @brief VPAL configuration.
*/
const vhal_pal_conf_t *vpalconf;
#endif
} vhal_conf_t;

View File

@ -1,5 +1,6 @@
# List of the ChibiOS sandbox VHAL files.
SBVHALSRC = $(CHIBIOS)/os/sb/vhal/sbvhal.c
SBVHALSRC = $(CHIBIOS)/os/sb/vhal/sbvhal.c \
$(CHIBIOS)/os/sb/vhal/sbvhal_pal.c
SBVHALASM =

View File

@ -59,7 +59,7 @@ void sb_api_vhal_pal(struct port_extctx *ectxp) {
switch (sub) {
case 0:
palWriteBus(bus, bits);
palWriteGroup(GPIOA, 0, 0, 0);
}
ectxp->r0 = CH_RET_SUCCESS;

View File

@ -25,8 +25,8 @@
* @{
*/
#ifndef SBVHAL_H
#define SBVHAL_H
#ifndef SBVHAL_PAL_H
#define SBVHAL_PAL_H
#if (SB_CFG_ENABLE_VHAL_PAL == TRUE) || defined(__DOXYGEN__)
@ -39,6 +39,15 @@
*/
#define SB_SVC200_HANDLER sb_api_vhal_pal
/**
* @name VPIO permissions
* @{
*/
#define VPIO_PERM_READ 1U
#define VPIO_PERM_WRITE 2U
#define VPIO_PERM_CHANGEMODE 4U
/** @} */
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
@ -55,6 +64,13 @@
* @brief Type of a VHAL PAL instance configuration structure.
*/
typedef struct vhal_pal_conf {
uint32_t nvpio;
struct {
uint32_t permissions;
ioportid_t port;
ioportmask_t mask;
uint32_t offset;
} vpio[];
} vhal_pal_conf_t;
/*===========================================================================*/
@ -79,6 +95,6 @@ extern "C" {
#endif /* SB_CFG_ENABLE_VHAL == TRUE */
#endif /* SBVHAL_H */
#endif /* SBVHAL_PAL_H */
/** @} */