Skip to content

Commit

Permalink
hw/mcu/nordic: Add common GPIO HAL for nRF MCUs
Browse files Browse the repository at this point in the history
Common HAL package will be extended in the future
to provide common HAL API for other peripherals.
This also makes GPIO HAL use the API provided by nrfx,
instead of using MCUs registers directly.
  • Loading branch information
m-gorecki committed Jun 17, 2024
1 parent 7803945 commit 7f9be90
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 2,208 deletions.
14 changes: 1 addition & 13 deletions hw/mcu/nordic/nrf51xxx/include/mcu/nrf51_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,7 @@
extern "C" {
#endif

/* Helper functions to enable/disable interrupts. */
#define __HAL_DISABLE_INTERRUPTS(x) \
do { \
x = __get_PRIMASK(); \
__disable_irq(); \
} while(0);

#define __HAL_ENABLE_INTERRUPTS(x) \
do { \
if (!x) { \
__enable_irq(); \
} \
} while(0);
#include 'nrf_hal.h'

struct nrf51_uart_cfg {
int8_t suc_pin_tx; /* pins for IO */
Expand Down
3 changes: 1 addition & 2 deletions hw/mcu/nordic/nrf51xxx/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ pkg.keywords:

pkg.deps:
- "@apache-mynewt-core/hw/mcu/nordic"
- "@apache-mynewt-core/hw/cmsis-core"
- "@apache-mynewt-core/hw/hal"
- "@apache-mynewt-core/hw/mcu/nordic/nrf_common"

pkg.ign_files.'!MCU_COMMON_STARTUP || SPLIT_LOADER':
- gcc_startup_cm0.s
Expand Down
351 changes: 0 additions & 351 deletions hw/mcu/nordic/nrf51xxx/src/hal_gpio.c

This file was deleted.

Loading

0 comments on commit 7f9be90

Please sign in to comment.