K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
Hardware identity

Macros

#define KFSW_HARDWARE_ID_MAX_BYTES   16U
 
#define KFSW_HARDWARE_ID_TEXT_SIZE   ((KFSW_HARDWARE_ID_MAX_BYTES * 2U) + 1U)
 

Functions

int kfsw_platform_get_hardware_id (char *text, size_t size)
 

Description

Macro Documentation

◆ KFSW_HARDWARE_ID_MAX_BYTES

#define KFSW_HARDWARE_ID_MAX_BYTES   16U

#include <hardware.h>

Longest identifier read, in bytes.

The Kinetis family reports 128 bits.

◆ KFSW_HARDWARE_ID_TEXT_SIZE

#define KFSW_HARDWARE_ID_TEXT_SIZE   ((KFSW_HARDWARE_ID_MAX_BYTES * 2U) + 1U)

#include <hardware.h>

Buffer size that always holds a formatted identifier and its terminator.

Function Documentation

◆ kfsw_platform_get_hardware_id()

int kfsw_platform_get_hardware_id ( char *  text,
size_t  size 
)

#include <hardware.h>

Read the chip's unique ID as lowercase hex, most significant byte first.

Parameters
[out]textBuffer receiving the NUL-terminated identifier.
sizeBytes available in text; KFSW_HARDWARE_ID_TEXT_SIZE is always enough.
Return values
0The identifier was read and formatted.
-EINVALtext is NULL.
-ENOSPCsize is too small for this SoC's identifier. Nothing is written.
-ENOTSUPThis SoC does not report one.