mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2552 from jhollister/add_cpuid
Added cpuid_get for STM boards
This commit is contained in:
commit
64410350bd
@ -1,2 +1,2 @@
|
|||||||
FEATURES_PROVIDED += periph_adc periph_gpio periph_spi periph_uart cpp
|
FEATURES_PROVIDED += periph_adc periph_gpio periph_spi periph_uart cpp periph_cpuid
|
||||||
FEATURES_MCU_GROUP = cortex_m0
|
FEATURES_MCU_GROUP = cortex_m0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FEATURES_PROVIDED += cpp
|
FEATURES_PROVIDED += cpp
|
||||||
FEATURES_PROVIDED += periph_uart periph_gpio periph_pwm periph_spi
|
FEATURES_PROVIDED += periph_uart periph_gpio periph_pwm periph_spi periph_cpuid
|
||||||
FEATURES_MCU_GROUP = cortex_m3_2
|
FEATURES_MCU_GROUP = cortex_m3_2
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FEATURES_PROVIDED += cpp
|
FEATURES_PROVIDED += cpp
|
||||||
FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm periph_random \
|
FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_i2c periph_pwm periph_random \
|
||||||
periph_adc periph_dac
|
periph_adc periph_dac periph_cpuid
|
||||||
FEATURES_MCU_GROUP = cortex_m4
|
FEATURES_MCU_GROUP = cortex_m4
|
||||||
|
@ -58,6 +58,11 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Length for reading CPU_ID
|
||||||
|
*/
|
||||||
|
#define CPUID_ID_LEN (12)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
31
cpu/stm32f0/periph/cpuid.c
Normal file
31
cpu/stm32f0/periph/cpuid.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 James Hollister
|
||||||
|
*
|
||||||
|
* 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 driver_periph
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Low-level CPUID driver implementation
|
||||||
|
*
|
||||||
|
* @author James Hollister <jhollisterjr@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cpu-conf.h"
|
||||||
|
|
||||||
|
#include "periph/cpuid.h"
|
||||||
|
|
||||||
|
#define STM32F0_CPUID_ADDR (0x1ffff7ac)
|
||||||
|
|
||||||
|
void cpuid_get(void *id)
|
||||||
|
{
|
||||||
|
memcpy(id, (void *)(STM32F0_CPUID_ADDR), CPUID_ID_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @} */
|
@ -54,6 +54,11 @@
|
|||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Length for reading CPU_ID
|
||||||
|
*/
|
||||||
|
#define CPUID_ID_LEN (12)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
31
cpu/stm32f3/periph/cpuid.c
Normal file
31
cpu/stm32f3/periph/cpuid.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 James Hollister
|
||||||
|
*
|
||||||
|
* 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 driver_periph
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Low-level CPUID driver implementation
|
||||||
|
*
|
||||||
|
* @author James Hollister <jhollisterjr@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cpu-conf.h"
|
||||||
|
|
||||||
|
#include "periph/cpuid.h"
|
||||||
|
|
||||||
|
#define STM32F3_CPUID_ADDR (0x1ffff7ac)
|
||||||
|
|
||||||
|
void cpuid_get(void *id)
|
||||||
|
{
|
||||||
|
memcpy(id, (void *)(STM32F3_CPUID_ADDR), CPUID_ID_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @} */
|
@ -53,6 +53,11 @@
|
|||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Length for reading CPU_ID
|
||||||
|
*/
|
||||||
|
#define CPUID_ID_LEN (12)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name CC110X buffer size definitions for the stm32f4
|
* @name CC110X buffer size definitions for the stm32f4
|
||||||
* @{
|
* @{
|
||||||
|
31
cpu/stm32f4/periph/cpuid.c
Normal file
31
cpu/stm32f4/periph/cpuid.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 James Hollister
|
||||||
|
*
|
||||||
|
* 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 driver_periph
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Low-level CPUID driver implementation
|
||||||
|
*
|
||||||
|
* @author James Hollister <jhollisterjr@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cpu-conf.h"
|
||||||
|
|
||||||
|
#include "periph/cpuid.h"
|
||||||
|
|
||||||
|
#define STM32F4_CPUID_ADDR (0x1fff7a10)
|
||||||
|
|
||||||
|
void cpuid_get(void *id)
|
||||||
|
{
|
||||||
|
memcpy(id, (void *)(STM32F4_CPUID_ADDR), CPUID_ID_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @} */
|
Loading…
Reference in New Issue
Block a user