stm32: add more MCUs with h/w RNG
Этот коммит содержится в:
родитель
61be9189f1
коммит
5c3ad004ab
5 изменённых файлов: 21 добавлений и 5 удалений
|
@ -1 +1 @@
|
|||
Subproject commit 5f417214efe79598eadd38f68b4432384ca57456
|
||||
Subproject commit e6db8e32d5d42293a528434ec12e7f88479a8649
|
|
@ -1,5 +1,5 @@
|
|||
//go:build stm32wlx || stm32f4 || stm32f7 || stm32l4 || (sam && atsamd51) || (sam && atsame5x)
|
||||
// +build stm32wlx stm32f4 stm32f7 stm32l4 sam,atsamd51 sam,atsame5x
|
||||
//go:build stm32 || (sam && atsamd51) || (sam && atsame5x)
|
||||
// +build stm32 sam,atsamd51 sam,atsame5x
|
||||
|
||||
package rand
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//go:build stm32f4 || stm32f7 || stm32l4 || stm32wlx
|
||||
// +build stm32f4 stm32f7 stm32l4 stm32wlx
|
||||
//go:build stm32 && !(stm32f103 || stm32l0x1)
|
||||
// +build stm32,!stm32f103,!stm32l0x1
|
||||
|
||||
package machine
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build stm32l0x2
|
||||
// +build stm32l0x2
|
||||
|
||||
package machine
|
||||
|
@ -252,3 +253,8 @@ const (
|
|||
ARR_MAX = 0x10000
|
||||
PSC_MAX = 0x10000
|
||||
)
|
||||
|
||||
func initRNG() {
|
||||
stm32.RCC.AHBENR.SetBits(stm32.RCC_AHBENR_RNGEN)
|
||||
stm32.RNG.CR.SetBits(stm32.RNG_CR_RNGEN)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build stm32l5
|
||||
// +build stm32l5
|
||||
|
||||
package machine
|
||||
|
@ -546,3 +547,12 @@ const (
|
|||
ARR_MAX = 0x10000
|
||||
PSC_MAX = 0x10000
|
||||
)
|
||||
|
||||
func initRNG() {
|
||||
stm32.RCC.CRRCR.SetBits(stm32.RCC_CRRCR_HSI48ON)
|
||||
for !stm32.RCC.CRRCR.HasBits(stm32.RCC_CRRCR_HSI48RDY) {
|
||||
}
|
||||
|
||||
stm32.RCC.AHB2ENR.SetBits(stm32.RCC_AHB2ENR_RNGEN)
|
||||
stm32.RNG.CR.SetBits(stm32.RNG_CR_RNGEN)
|
||||
}
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче