Merge pull request #7388 from francois-berder/pic32-periph-cpuid
clicker, wifire: Add CPUID support
This commit is contained in:
commit
e1bbf43705
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -26,6 +26,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))
|
||||
|
||||
/**
|
||||
|
||||
18
cpu/mips_pic32_common/periph/cpuid.c
Normal file
18
cpu/mips_pic32_common/periph/cpuid.c
Normal file
@ -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);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user