nrfxlib API 3.3.99
Loading...
Searching...
No Matches
softperipheral_regif.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef SOFTPERIPHERAL_REGIF_H__
8#define SOFTPERIPHERAL_REGIF_H__
9
10/* Shared between Host and Service, varies between platforms. */
11#if defined (NRF54L05_XXAA) || defined (NRF54L09_ENGA_XXAA) || defined (NRF54L10_XXAA) || \
12 defined (NRF54L15_XXAA) || defined (NRF54LM20A_ENGA_XXAA) || \
13 defined (NRF54LV10A_XXAA) || defined (NRF54LM20A_XXAA)
14#define SP_VPR_EVENT_IDX 20
15#define NRF_VPR NRF_VPR00
16#define SP_VPR_TASK_DPPI_0_IDX 16 // Channel 0
17#define SP_VPR_TASK_CONFIG_IDX 17
18#define SP_VPR_TASK_ACTION_IDX 18
19#define SP_VPR_TASK_STOP_IDX 19
20#define SP_VPR_IRQHandler VPR00_IRQHandler
21#define SP_VPR_IRQn VPR00_IRQn
22#define SP_VPR_BASE_FREQ_HZ 128000000
23#elif defined(NRF54H20_XXAA)
24#define SP_VPR_EVENT_IDX 28
25#define NRF_VPR NRF_VPR121
26#define SP_VPR_TASK_DPPI_0_IDX 24 // Channel 0
27#define SP_VPR_TASK_CONFIG_IDX 25
28#define SP_VPR_TASK_ACTION_IDX 26
29#define SP_VPR_TASK_STOP_IDX 27
30#define SP_VPR_IRQHandler VPR121_IRQHandler
31#define SP_VPR_IRQn VPR121_IRQn
32#define SP_VPR_BASE_FREQ_HZ 320000000
33#else
34#pragma warning "Processor not defined."
35#endif
36
37#if defined(NRF_APPLICATION)
38
39#ifndef SP_VPR_FIRMWARE_ADDRESS
40#define SP_VPR_FIRMWARE_ADDRESS 0x00040000
41#endif
42
43/* Config Synchronization Barrier (ASB). */
44#if 1
45#define __XSBx(R, P, T) \
46 do { \
47 sp_handshake_set(R, m_task_count, 0); \
48 nrf_vpr_task_trigger(P, (nrf_vpr_task_t)offsetof(NRF_VPR_Type, TASKS_TRIGGER[T])); \
49 while (sp_handshake_get(R, 0) != sp_handshake_get(R, 1)) { \
50 __NOP(); \
51 __NOP(); \
52 __NOP(); \
53 } \
54 m_task_count++; \
55 } while (0);
56#else
57#define __XSBx(R, P, T) \
58 do { \
59 nrf_vpr_task_trigger(P, (nrf_vpr_task_t)offsetof(NRF_VPR_Type, TASKS_TRIGGER[T])); \
60 } while (0);
61#endif
62
63#define __CSB(R) __XSBx(R, NRF_VPR, SP_VPR_TASK_CONFIG_IDX);
64#define __ASB(R) __XSBx(R, NRF_VPR, SP_VPR_TASK_ACTION_IDX);
65#define __SSB(R) __XSBx(R, NRF_VPR, SP_VPR_TASK_STOP_IDX);
66
67#endif // NRF_APPLICATION
68#endif // SOFTPERIPHERAL_REGIF_H__