]>
Commit | Line | Data |
---|---|---|
673b2d42 JS |
1 | /* |
2 | * Nordic Semiconductor nRF51 SoC | |
3 | * | |
4 | * Copyright 2018 Joel Stanley <[email protected]> | |
5 | * | |
6 | * This code is licensed under the GPL version 2 or later. See | |
7 | * the COPYING file in the top-level directory. | |
8 | */ | |
9 | ||
10 | #ifndef NRF51_SOC_H | |
11 | #define NRF51_SOC_H | |
12 | ||
13 | #include "hw/sysbus.h" | |
14 | #include "hw/arm/armv7m.h" | |
b0014913 | 15 | #include "hw/char/nrf51_uart.h" |
f30890de | 16 | #include "hw/misc/nrf51_rng.h" |
bb42c4cb | 17 | #include "hw/gpio/nrf51_gpio.h" |
4d744b25 | 18 | #include "hw/nvram/nrf51_nvm.h" |
60facd90 | 19 | #include "hw/timer/nrf51_timer.h" |
673b2d42 JS |
20 | |
21 | #define TYPE_NRF51_SOC "nrf51-soc" | |
22 | #define NRF51_SOC(obj) \ | |
23 | OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC) | |
24 | ||
60facd90 SG |
25 | #define NRF51_NUM_TIMERS 3 |
26 | ||
673b2d42 JS |
27 | typedef struct NRF51State { |
28 | /*< private >*/ | |
29 | SysBusDevice parent_obj; | |
30 | ||
31 | /*< public >*/ | |
32 | ARMv7MState cpu; | |
33 | ||
b0014913 | 34 | NRF51UARTState uart; |
f30890de | 35 | NRF51RNGState rng; |
4d744b25 | 36 | NRF51NVMState nvm; |
bb42c4cb | 37 | NRF51GPIOState gpio; |
60facd90 | 38 | NRF51TimerState timer[NRF51_NUM_TIMERS]; |
b0014913 | 39 | |
673b2d42 JS |
40 | MemoryRegion iomem; |
41 | MemoryRegion sram; | |
42 | MemoryRegion flash; | |
b39dced6 | 43 | MemoryRegion clock; |
9d68bf56 | 44 | MemoryRegion twi; |
673b2d42 JS |
45 | |
46 | uint32_t sram_size; | |
47 | uint32_t flash_size; | |
48 | ||
49 | MemoryRegion *board_memory; | |
50 | ||
51 | MemoryRegion container; | |
52 | ||
53 | } NRF51State; | |
54 | ||
55 | #endif | |
56 |