mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
DeviceID (#1314)
* Ability to print hex * Add device ID getter * Refactor debug menu * No longer need patch * Update make_translation.py * Fix typo * Fix hex drawing
This commit is contained in:
@@ -282,5 +282,9 @@ bool isTipDisconnected() {
|
||||
return tipTemp > tipDisconnectedThres;
|
||||
}
|
||||
|
||||
void setStatusLED(const enum StatusLED state) {}
|
||||
uint8_t preStartChecks() { return 0; }
|
||||
void setStatusLED(const enum StatusLED state) {}
|
||||
uint8_t preStartChecks() { return 0; }
|
||||
uint64_t getDeviceID() {
|
||||
//
|
||||
return HAL_GetUIDw0() | ((uint64_t)HAL_GetUIDw1() << 32);
|
||||
}
|
||||
|
||||
@@ -310,6 +310,9 @@ void HAL_ResumeTick(void);
|
||||
uint32_t HAL_GetHalVersion(void);
|
||||
uint32_t HAL_GetREVID(void);
|
||||
uint32_t HAL_GetDEVID(void);
|
||||
uint32_t HAL_GetUIDw0(void);
|
||||
uint32_t HAL_GetUIDw1(void);
|
||||
uint32_t HAL_GetUIDw2(void);
|
||||
void HAL_DBGMCU_EnableDBGSleepMode(void);
|
||||
void HAL_DBGMCU_DisableDBGSleepMode(void);
|
||||
void HAL_DBGMCU_EnableDBGStopMode(void);
|
||||
|
||||
@@ -513,6 +513,24 @@ void HAL_GetUID(uint32_t *UID) {
|
||||
UID[2] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns first word of the unique device identifier (UID based on 96 bits)
|
||||
* @retval Device identifier
|
||||
*/
|
||||
uint32_t HAL_GetUIDw0(void) { return (READ_REG(*((uint32_t *)UID_BASE))); }
|
||||
|
||||
/**
|
||||
* @brief Returns second word of the unique device identifier (UID based on 96 bits)
|
||||
* @retval Device identifier
|
||||
*/
|
||||
uint32_t HAL_GetUIDw1(void) { return (READ_REG(*((uint32_t *)(UID_BASE + 4U)))); }
|
||||
|
||||
/**
|
||||
* @brief Returns third word of the unique device identifier (UID based on 96 bits)
|
||||
* @retval Device identifier
|
||||
*/
|
||||
uint32_t HAL_GetUIDw2(void) { return (READ_REG(*((uint32_t *)(UID_BASE + 8U)))); }
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user