stm32-rs / stm32l0xx-hal

A hardware abstraction layer (HAL) for the STM32L0 series microcontrollers written in Rust
BSD Zero Clause License
96 stars 60 forks source link

added support for Device electronic signature #165

Closed allexoll closed 3 years ago

allexoll commented 3 years ago

this was talked briefely in #120, i think @hannobraun 's idea is also the easiest to add.

code was indeed copied from stm-32-device-signature, credit to @Disasm

Disasm commented 3 years ago

Note that device_id() code for L0 is incorrect: https://github.com/stm32-rs/stm32-device-signature/issues/9

allexoll commented 3 years ago

Oh thanks for the heads up, i'll try to fix that

allexoll commented 3 years ago

according to the reference manual, it is at least coherent between x0,x1,x2,x3 family. all have the same memory layout.

I think it would be better to have the user give an array to fill then. or other possibility is doing something similar to stm32f7xx

i'll look into it tomorrow.

allexoll commented 3 years ago

this is my proposal for the UID interface. it returns the 96bit uid as a contiguous buffer, since i think it is the way that most will use this API. remarks are welcome, sorry for the multiple commits.