Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clicker, wifire: Add CPUID support #7388

Merged
merged 3 commits into from Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/pic32-clicker/Makefile.features
@@ -1,4 +1,5 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
Expand Down
1 change: 1 addition & 0 deletions boards/pic32-wifire/Makefile.features
@@ -1,4 +1,5 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
Expand Down
5 changes: 5 additions & 0 deletions cpu/mips_pic32_common/include/periph_cpu_common.h
Expand Up @@ -25,6 +25,11 @@
extern "C" {
#endif

/**
* @brief Length of the CPU_ID in bytes
*/
#define CPUID_LEN (4U)

#define GPIO_PIN(x,y) ((x << 4) | (y & 0xf))

/**
Expand Down
18 changes: 18 additions & 0 deletions cpu/mips_pic32_common/periph/cpuid.c
@@ -0,0 +1,18 @@
/*
* Copyright(C) 2017 Francois Berder <fberder@outlook.fr>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
*/

#include <stdint.h>
#include <string.h>
#include "board.h"
#include "periph/cpuid.h"

void cpuid_get(void *id)
{
memcpy(id, (uint32_t*)&DEVID, CPUID_LEN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is DEVID coming from the vendor header file ?
+no newline @ eof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes DEVID comes from the vendor file

}