Merge pull request #6861 from gebart/pr/cpuid-generic
cpuid: Unify implementations for the simplest casespr/rotary
commit
bca6190e3c
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Loci Controls Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_cc2538
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief CPU-ID driver implementation
|
||||
*
|
||||
* The CC2538 provides a 64-bit unique identifier, that is unique for each shipped unit.
|
||||
*
|
||||
* @author Ian Martin <ian@locicontrols.com>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
uint8_t *dest = (uint8_t *)id;
|
||||
|
||||
/**
|
||||
* The byte-order is big-endian but the word order is little endian.
|
||||
* Make some sense of it:
|
||||
*/
|
||||
dest[0] = IEEE_ADDR_MSWORD >> (3 * sizeof(uint8_t));
|
||||
dest[1] = IEEE_ADDR_MSWORD >> (2 * sizeof(uint8_t));
|
||||
dest[2] = IEEE_ADDR_MSWORD >> (1 * sizeof(uint8_t));
|
||||
dest[3] = IEEE_ADDR_MSWORD >> (0 * sizeof(uint8_t));
|
||||
dest[4] = IEEE_ADDR_LSWORD >> (3 * sizeof(uint8_t));
|
||||
dest[5] = IEEE_ADDR_LSWORD >> (2 * sizeof(uint8_t));
|
||||
dest[6] = IEEE_ADDR_LSWORD >> (1 * sizeof(uint8_t));
|
||||
dest[7] = IEEE_ADDR_LSWORD >> (0 * sizeof(uint8_t));
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Leon George
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_cc26x0
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief cpuid implementation for the CC26x0
|
||||
*
|
||||
* @author Leon M. George <leon@georgemail.eu>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
memcpy(id, (void *) &FCFG->MAC_BLE_0, CPUID_LEN);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2016 Freie Universität Berlin
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup cpu_ezr32wg
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Low-level CPUID driver implementation
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
uint32_t tmp;
|
||||
uint8_t *res = (uint8_t *)id;
|
||||
|
||||
tmp = DEVINFO->UNIQUEL;
|
||||
memcpy((res + 4), &tmp, sizeof(uint32_t));
|
||||
tmp = DEVINFO->UNIQUEH;
|
||||
memcpy(res, &tmp, sizeof(uint32_t));
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 PHYTEC Messtechnik GmbH
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_kinetis_common_cpuid
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Low-level CPUID driver implementation
|
||||
*
|
||||
* @author Johann Fischer <j.fischer@phytec.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
memcpy(id, (void *)&(SIM_UIDH), CPUID_LEN);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Rakendra Thapa <rakendrathapa@gmail.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup cpu_lm4f120
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Low-level CPUID driver implementation
|
||||
*
|
||||
* @author Rakendra Thapa <rakendrathapa@gmail.com>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
memcpy(id, (void *)(NVIC_CPUID), CPUID_LEN);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2016 Freie Universität Berlin
|
||||
* 2015 Jan Wagner <mail@jwagner.eu>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_nrf5x_common
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief CPUID interface implementation
|
||||
*
|
||||
* The NRF52832 provides a 64-bit unique identifier that is unique for each
|
||||
* shipped unit.
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
* @author Jan Wagner <mail@jwagner.eu>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "periph/cpuid.h"
|
||||
|
||||
void cpuid_get(void *id)
|
||||
{
|
||||
memcpy(id, (void *)NRF_FICR->DEVICEID, CPUID_LEN);
|
||||
}
|
Loading…
Reference in New Issue