Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit b07ccce

Browse files
rugeGerritsenwopu-ot
authored andcommitted
gpio: Add simple stubs of GPIO and GPIOTE
The peripherals are not simulated, just simple stubs Signed-off-by: Rubin Gerritsen <[email protected]>
1 parent 91e1104 commit b07ccce

File tree

7 files changed

+95
-0
lines changed

7 files changed

+95
-0
lines changed

src/HW_models/NRF_GPIO.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "NRF_GPIO.h"
7+
8+
/*
9+
* This is only a stub of the register interface with no functionality behind
10+
*/
11+
12+
NRF_GPIO_Type NRF_P0_regs = {0};

src/HW_models/NRF_GPIO.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef _NRF_HW_MODEL_GPIO_H
7+
#define _NRF_HW_MODEL_GPIO_H
8+
9+
#include "NRF_regs.h"
10+
11+
#ifdef __cplusplus
12+
extern "C"{
13+
#endif
14+
15+
extern NRF_GPIO_Type NRF_P0_regs;
16+
17+
#ifdef __cplusplus
18+
}
19+
#endif
20+
21+
#endif

src/HW_models/NRF_GPIOTE.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "NRF_GPIOTE.h"
7+
8+
/*
9+
* This is only a stub of the register interface with no functionality behind
10+
*/
11+
12+
NRF_GPIOTE_Type NRF_GPIOTE_regs = {0};

src/HW_models/NRF_GPIOTE.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef _NRF_HW_MODEL_GPIOTE_H
7+
#define _NRF_HW_MODEL_GPIOTE_H
8+
9+
#include "NRF_regs.h"
10+
11+
#ifdef __cplusplus
12+
extern "C"{
13+
#endif
14+
15+
extern NRF_GPIOTE_Type NRF_GPIOTE_regs;
16+
17+
#ifdef __cplusplus
18+
}
19+
#endif
20+
21+
#endif

src/nrfx/hal/nrf_gpio.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef BS_NRF_GPIO_H__
7+
#define BS_NRF_GPIO_H__
8+
9+
#include "../drivers/nrfx_common.h"
10+
11+
#endif /* BS_NRF_GPIO_H__ */

src/nrfx/hal/nrf_gpiote.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2020 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef BS_NRF_GPIOTE_H__
7+
#define BS_NRF_GPIOTE_H__
8+
9+
#include "../drivers/nrfx_common.h"
10+
11+
#endif /* BS_NRF_TIMER_H__ */

src/nrfx/hal/nrf_soc_if.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ extern NRF_TIMER_Type NRF_TIMER_regs[];
7575
#define NRF_TIMER4_BASE (&NRF_TIMER_regs[4])
7676
extern NRF_POWER_Type NRF_POWER_regs;
7777
#define NRF_POWER_BASE (&NRF_POWER_regs)
78+
extern NRF_GPIO_Type NRF_P0_regs;
79+
#undef NRF_P0_BASE
80+
#define NRF_P0_BASE (&NRF_P0_regs)
81+
extern NRF_GPIOTE_Type NRF_GPIOTE_regs;
82+
#undef NRF_GPIOTE_BASE
83+
#define NRF_GPIOTE_BASE (&NRF_GPIOTE_regs)
84+
7885

7986
/**
8087
* Note that the model of the CPU & IRQ controller driver must provide

0 commit comments

Comments
 (0)