mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
machine/stm32f4, stm32f7, stm32l4: implement TRNG for randomness
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//go:build stm32f4
|
||||
// +build stm32f4
|
||||
|
||||
package machine
|
||||
@@ -586,3 +587,8 @@ const (
|
||||
ARR_MAX = 0x10000
|
||||
PSC_MAX = 0x10000
|
||||
)
|
||||
|
||||
func initRNG() {
|
||||
stm32.RCC.AHB2ENR.SetBits(stm32.RCC_AHB2ENR_RNGEN)
|
||||
stm32.RNG.CR.SetBits(stm32.RNG_CR_RNGEN)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user