Merge pull request #7388 from francois-berder/pic32-periph-cpuid

clicker, wifire: Add CPUID support
This commit is contained in:
neiljay 2017-09-08 10:42:07 +01:00 committed by GitHub
commit e1bbf43705
4 changed files with 25 additions and 0 deletions

View File

@ -1,4 +1,5 @@
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_uart

View File

@ -1,4 +1,5 @@
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_uart

View File

@ -26,6 +26,11 @@
extern "C" { extern "C" {
#endif #endif
/**
* @brief Length of the CPU_ID in bytes
*/
#define CPUID_LEN (4U)
#define GPIO_PIN(x,y) ((x << 4) | (y & 0xf)) #define GPIO_PIN(x,y) ((x << 4) | (y & 0xf))
/** /**

View 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);
}