cpu_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Freie Universit├Ąt Berlin
3  * 2020 Philipp-Alexander Blum <philipp-blum@jakiku.de>
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
24 #ifndef CPU_CONF_H
25 #define CPU_CONF_H
26 
27 #include "cpu_conf_common.h"
28 
29 #ifdef CPU_MODEL_NRF52832XXAA
30 #include "vendor/nrf52.h"
31 #include "vendor/nrf52_bitfields.h"
32 #include "vendor/nrf52832_peripherals.h"
33 #elif defined(CPU_MODEL_NRF52811XXAA)
34 #include "vendor/nrf52811.h"
35 #include "vendor/nrf52811_bitfields.h"
36 #include "vendor/nrf52811_peripherals.h"
37 #elif defined(CPU_MODEL_NRF52840XXAA)
38 #include "vendor/nrf52840.h"
39 #include "vendor/nrf52840_bitfields.h"
40 #include "vendor/nrf52840_peripherals.h"
41 #else
42 #error "The CPU_MODEL of your board is currently not supported"
43 #endif
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
53 #define CPU_DEFAULT_IRQ_PRIO (2U)
54 #define CPU_FLASH_BASE (0x00000000)
55 
56 #if defined(CPU_MODEL_NRF52811XXAA)
57 #define CPU_IRQ_NUMOF (29U)
58 #elif defined(CPU_MODEL_NRF52832XXAA)
59 #define CPU_IRQ_NUMOF (38U)
60 #elif defined(CPU_MODEL_NRF52840XXAA)
61 #define CPU_IRQ_NUMOF (46U)
62 #endif
63 
69 #ifdef BPROT_PRESENT
70 #define FLASHPAGE_SIZE BPROT_REGIONS_SIZE
71 #define FLASHPAGE_NUMOF BPROT_REGIONS_NUM
72 #elif defined(CPU_MODEL_NRF52840XXAA)
73 #define FLASHPAGE_SIZE (4096U)
74 #define FLASHPAGE_NUMOF (256U)
75 #endif
76 
77 /* The minimum block size which can be written is 4B. However, the erase
78  * block is always FLASHPAGE_SIZE.
79  */
80 #define FLASHPAGE_RAW_BLOCKSIZE (4U)
81 /* Writing should be always 4 bytes aligned */
82 #define FLASHPAGE_RAW_ALIGNMENT (4U)
83 
89 #ifdef SOFTDEVICE_PRESENT
90 #ifndef DONT_OVERRIDE_NVIC
91 #include "nrf_soc.h"
92 #undef NVIC_SetPriority
93 #define NVIC_SetPriority sd_nvic_SetPriority
94 #endif /* DONT_OVERRIDE_NVIC */
95 #endif /* SOFTDEVICE_PRESENT */
96 
101 static inline void nrf52_sleep(void)
102 {
103  __SEV();
104  __WFE();
105  __asm("nop");
106 }
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* CPU_CONF_H */
113 
static void nrf52_sleep(void)
SoftDevice settings.
Definition: cpu_conf.h:101