/* * SPDX-FileCopyrightText: 2018 RWTH Aachen, Josua Arndt, Steffen Robertz * SPDX-License-Identifier: LGPL-2.1-only */ /** * @ingroup cpu_atmega_common * @{ * * @file * @brief Low-level CPUID driver implementation * * @author Steffen Robertz * @author Josua Arndt * * @} */ #include #include "avr/boot.h" /* * This uses the RC calibration byte as CPU ID, so it may not be very unique. * The first three bytes are constant across different MCUs of the same series. */ void cpuid_get(void *id) { uint8_t *out = id; out[0] = boot_signature_byte_get(0x00); /* Atmel manufacturer ID (0x1E) */ out[1] = boot_signature_byte_get(0x02); /* Part Number high byte */ out[2] = boot_signature_byte_get(0x04); /* Part Number low byte */ out[3] = boot_signature_byte_get(0x01); /* internal RC calibration byte */ }