reflow-oven-control-sw/stm-firmware/stm-periph/unique-id.c

36 lines
1.2 KiB
C
Raw Normal View History

2020-02-15 22:09:55 +01:00
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
2020-02-15 22:09:55 +01:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stm-periph/unique-id.h>
#define LOW_WORD_ADDR (0x1FFF7A10UL)
#define MID_WORD_ADDR (LOW_WORD_ADDR+4U)
#define HIGH_WORD_ADDR (LOW_WORD_ADDR+8U)
void unique_id_get(uint32_t *high, uint32_t *mid, uint32_t *low)
{
if (!high || !mid || !low)
return;
*low = *((uint32_t *)LOW_WORD_ADDR);
*mid = *((uint32_t *)MID_WORD_ADDR);
*high = *((uint32_t *)HIGH_WORD_ADDR);
}