-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samr21: cpuid implemented by reading 128 bits from flash
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
FEATURES_PROVIDED += periph_gpio cpp | ||
FEATURES_PROVIDED += periph_gpio periph_cpuid cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
#include <string.h> | ||
|
||
#include "cpu-conf.h" | ||
#include "periph/cpuid.h" | ||
|
||
#define Word0 (*(volatile uint32_t *)0x0080A00C) | ||
#define Word1 (*(volatile uint32_t *)0x0080A040) | ||
#define Word2 (*(volatile uint32_t *)0x0080A044) | ||
#define Word3 (*(volatile uint32_t *)0x0080A048) | ||
|
||
|
||
void cpuid_get(void *id) | ||
{ | ||
uint32_t source_address[] = {Word0, Word1, Word2, Word3}; | ||
memcpy(id, (void*) source_address, CPUID_ID_LEN); | ||
} |