• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

README.mdD11-Mar-20241.8 KiB3730

nrf_aar.cD11-Mar-20242.2 KiB7557

nrf_ccm.cD11-Mar-20242.3 KiB8061

nrf_clock.cD11-Mar-20243.3 KiB128100

nrf_dppi.cD11-Mar-20244.3 KiB139102

nrf_ecb.cD11-Mar-20242.1 KiB7557

nrf_egu.cD11-Mar-20242.2 KiB8055

nrf_gpio.cD11-Mar-20248.5 KiB242158

nrf_gpiote.cD11-Mar-20246.4 KiB163105

nrf_hal_originals.cD11-Mar-20243.3 KiB223158

nrf_nvmc.cD11-Mar-20243 KiB12185

nrf_ppi.cD11-Mar-20242.3 KiB8264

nrf_radio.cD11-Mar-20243.4 KiB12499

nrf_rng.cD11-Mar-20242.2 KiB7758

nrf_rtc.cD11-Mar-20243.9 KiB135108

nrf_temp.cD11-Mar-20242.2 KiB7557

nrf_timer.cD11-Mar-20243.9 KiB12298

README.md

1## nRFx HAL
2
3The HAL source files provided with these models implement
4some modifications to [the real nRFx HAL](https://github.com/NordicSemiconductor/nrfx/)
5needed due to the HW models peculiarities.
6Its main purpose is to allow unmodified embedded code to run directly
7using this repository HW models.
8
9There is two main differences in this HAL compared to the real one:
10
11* The peripherals base addresses point to the HW models register IF
12  instead of to hardcoded HW addresses.<br>
13  For example `NRF_PPI_BASE` is defined as `(&NRF_PPI_regs)`, where
14  `NRF_PPI_regs` is the HW models structure containing the PPI model
15  registers
16
17* When a HW register with sideeffects is written, the appropriate
18  HW model function is called to trigger that sideeffect.<br>
19  A sideeffect should be understood as some activity beyond the modification
20  of the register itself. For example, in real HW, writting a `1` to
21  `NRF_RNG->TASKS_START` will start the random number generation.
22  When using the HW models, doing this write in itself would only change
23  that memory location content. To trigger the actual sideeffect the
24  function `nrf_rng_regw_sideeffects_TASK_START()` needs to be called.
25  This replacement HAL functions take care of that.
26
27The original implementation of the HAL APIs from the real nrfx is included in
28`nrf_hal_originals.c`.
29All these functions are labelled as weak, so they can be replaced as needed with content
30of `src/nrfx/hal/`. This removes the need for duplicating code.
31
32Note that this replacement HAL only provides the necessary replacements for the subset of the
33nRFx API corresponding to the peripherals included in these models.
34Note also that for these, not necessarily all nRFx functions which could need replacing are
35included. Though those used by Zephyr should be included.
36It is certainly possible to expand it to cover the whole API.
37