Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
cpu_conf.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014-2016 Freie Universität Berlin
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
21
#ifndef CPU_CONF_H
22
#define CPU_CONF_H
23
24
#include "cpu_conf_common.h"
25
26
#if defined(CPU_SAMD10)
27
#include "vendor/samd10/include/samd10.h"
28
#elif defined(CPU_SAMD20)
29
#include "vendor/samd20/include/samd20.h"
30
#elif defined(CPU_SAMD20B)
31
#include "vendor/samd20/include_b/samd20.h"
32
#elif defined(CPU_SAMD21A)
33
#include "vendor/samd21/include_a/samd21.h"
34
#elif defined(CPU_SAMD21B)
35
#include "vendor/samd21/include_b/samd21.h"
36
#elif defined(CPU_SAMD21C)
37
#include "vendor/samd21/include_c/samd21.h"
38
#elif defined(CPU_SAMD21D)
39
#include "vendor/samd21/include_d/samd21.h"
40
#elif defined(CPU_SAMD51)
41
#include "vendor/samd51/include/samd51.h"
42
#elif defined(CPU_SAME54)
43
#include "vendor/same54/include/same54.h"
44
#elif defined(CPU_SAML10)
45
#include "vendor/saml10/include/sam.h"
46
#elif defined(CPU_SAML11)
47
#include "vendor/saml11/include/sam.h"
48
#elif defined(CPU_SAML21A)
49
#include "vendor/saml21/include/saml21.h"
50
#elif defined(CPU_SAML21B)
51
#include "vendor/saml21/include_b/saml21.h"
52
#elif defined(CPU_SAMR21)
53
#include "vendor/samr21/include/samr21.h"
54
#elif defined(CPU_SAMR30)
55
#include "vendor/samr30/include/samr30.h"
56
#elif defined(CPU_SAMR34)
57
#include "vendor/samr34/include/samr34.h"
58
#endif
59
60
#ifdef __cplusplus
61
extern
"C"
{
62
#endif
63
68
#define CPU_DEFAULT_IRQ_PRIO (1U)
69
#define CPU_IRQ_NUMOF PERIPH_COUNT_IRQn
70
#define CPU_FLASH_BASE FLASH_ADDR
71
72
#ifdef CPU_COMMON_SAML1X
73
#define CPU_FLASH_RWWEE_BASE DATAFLASH_ADDR
74
#else
75
#define CPU_FLASH_RWWEE_BASE NVMCTRL_RWW_EEPROM_ADDR
76
#endif
83
/* a flashpage in RIOT is mapped to a flash row on the SAM0s */
84
#if defined(NVMCTRL_ROW_SIZE)
85
#define FLASHPAGE_SIZE (NVMCTRL_ROW_SIZE)
86
#elif defined(NVMCTRL_BLOCK_SIZE)
87
#define FLASHPAGE_SIZE (NVMCTRL_BLOCK_SIZE)
88
#elif defined(NVMCTRL_PAGE_SIZE)
89
/* saml1x: The NVM is organized into rows, where each row contains four pages,
90
as shown in the NVM Row Organization figure. */
91
#define FLASHPAGE_SIZE (4 * NVMCTRL_PAGE_SIZE)
92
#else
93
#error "Unsupported Device"
94
#endif
95
96
/* one SAM0 row contains 4 SAM0 pages, so 4 SAM0 pages contain
97
* the amount of a RIOT flashpage
98
*/
99
#define FLASHPAGE_PAGES_PER_ROW (FLASHPAGE_SIZE/FLASH_PAGE_SIZE)
100
/* number of RIOT flashpages on device */
101
#define FLASHPAGE_NUMOF (FLASH_NB_OF_PAGES / FLASHPAGE_PAGES_PER_ROW)
102
/* The minimum block size which can be written is 16B. However, the erase
103
* block is always FLASHPAGE_SIZE (SAM0 row).
104
*/
105
#define FLASHPAGE_WRITE_BLOCK_SIZE (16)
106
/* Writing should be always 4 byte aligned */
107
#define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4)
108
/* Add RWWEE memory if supported by revision of the chip
109
* On some chips it is called RWW EEPROM while on some DATAFLASH, try to
110
* catch all without relying on the CPU model but on the named defines
111
*/
112
#ifdef NVMCTRL_RWW_EEPROM_SIZE
113
#define FLASHPAGE_RWWEE_NUMOF (NVMCTRL_RWWEE_PAGES / FLASHPAGE_PAGES_PER_ROW)
114
#endif
115
#ifdef DATAFLASH_SIZE
116
#define FLASHPAGE_RWWEE_NUMOF (DATAFLASH_NB_OF_PAGES / FLASHPAGE_PAGES_PER_ROW)
117
#endif
123
#ifdef CPU_HAS_BACKUP_RAM
124
#define NUM_HEAPS (2)
125
#endif
126
127
#ifdef __cplusplus
128
}
129
#endif
130
131
#endif
/* CPU_CONF_H */
Generated on Fri Nov 15 2024 22:46:35 by
1.9.8