1
0
forked from me/IronOS
* 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:
Ben V. Brown
2022-06-16 21:39:53 +10:00
committed by GitHub
parent 165a9952c2
commit 078b8f5626
12 changed files with 104 additions and 38 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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)))); }
/**
* @}
*/