Merge remote-tracking branch 'upstream/master' into ros_messagelayer_merge_attctlposctl

This commit is contained in:
Thomas Gubler
2015-01-28 16:29:14 +01:00
45 changed files with 938 additions and 347 deletions
+9 -2
View File
@@ -47,7 +47,8 @@
#ifdef CONFIG_ARCH_CHIP_STM32
#include <up_arch.h>
#define DBGMCU_IDCODE 0xE0042000
#define DBGMCU_IDCODE 0xE0042000 //STM DocID018909 Rev 8 Sect 38.18 (MCU device ID code)
#define UNIQUE_ID 0x1FFF7A10 //STM DocID018909 Rev 8 Sect 39.1 (Unique device ID Register)
#define STM32F40x_41x 0x413
#define STM32F42x_43x 0x419
@@ -57,7 +58,13 @@
#endif
/** Copy the 96bit MCU Unique ID into the provided pointer */
void mcu_unique_id(uint32_t *uid_96_bit)
{
uid_96_bit[0] = getreg32(UNIQUE_ID);
uid_96_bit[1] = getreg32(UNIQUE_ID+4);
uid_96_bit[2] = getreg32(UNIQUE_ID+8);
}
int mcu_version(char* rev, char** revstr)
{
+11
View File
@@ -33,6 +33,8 @@
#pragma once
#include <stdint.h>
/* magic numbers from reference manual */
enum MCU_REV {
MCU_REV_STM32F4_REV_A = 0x1000,
@@ -42,6 +44,15 @@ enum MCU_REV {
MCU_REV_STM32F4_REV_3 = 0x2001
};
/**
* Reports the microcontroller unique id.
*
* This ID is guaranteed to be unique for every mcu.
* @param uid_96_bit A uint32_t[3] array to copy the data to.
*/
__EXPORT void mcu_unique_id(uint32_t *uid_96_bit);
/**
* Reports the microcontroller version of the main CPU.
*