Skip to content

Commit 1ed18b8

Browse files
Alexander Wachternashif
authored andcommitted
drivers: hwinfo: change stm32 device id driver from HAL to LL
Use LL drivers instead of HAL driver because LL driver is available for all soc while HAL driver is not. Signed-off-by: Alexander Wachter <[email protected]>
1 parent a9090c9 commit 1ed18b8

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

drivers/hwinfo/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ config HWINFO_SHELL
2222
config HWINFO_STM32
2323
bool "STM32 hwinfo"
2424
default y
25-
depends on (SOC_SERIES_STM32F0X || SOC_SERIES_STM32F3X || \
26-
SOC_SERIES_STM32L4X || SOC_SERIES_STM32F7X)
25+
depends on SOC_FAMILY_STM32
26+
select USE_STM32_LL_UTILS
2727
help
2828
Enable STM32 hwinfo driver.
2929

drivers/hwinfo/hwinfo_stm32.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
#include <hwinfo.h>
99
#include <string.h>
1010

11-
#if !defined(CONFIG_SOC_SERIES_STM32F0X) && \
12-
!defined(CONFIG_SOC_SERIES_STM32F3X) && \
13-
!defined(CONFIG_SOC_SERIES_STM32L4X) && \
14-
!defined(CONFIG_SOC_SERIES_STM32F7X)
15-
#error ID only available on STM32F0, STM32F3, STM32L4 and STM32F7 series
16-
#endif
17-
1811
struct stm32_uid {
1912
u32_t id[3];
2013
};
@@ -23,9 +16,9 @@ ssize_t _impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
2316
{
2417
struct stm32_uid dev_id;
2518

26-
dev_id.id[0] = HAL_GetUIDw0();
27-
dev_id.id[1] = HAL_GetUIDw1();
28-
dev_id.id[2] = HAL_GetUIDw2();
19+
dev_id.id[0] = LL_GetUID_Word0();
20+
dev_id.id[1] = LL_GetUID_Word1();
21+
dev_id.id[2] = LL_GetUID_Word2();
2922

3023
if (length > sizeof(dev_id.id)) {
3124
length = sizeof(dev_id.id);

0 commit comments

Comments
 (0)