machine/stm32, nrf: flash API (#3472)

machine/stm32, nrf: implement machine.Flash

Implements the machine.Flash interface using the same definition as the tinyfs BlockDevice.

This implementation covers the stm32f4, stm32l4, stm32wlx, nrf51, nrf52, and nrf528xx processors.
This commit is contained in:
Ron Evans
2023-02-27 13:55:38 +01:00
committed by GitHub
parent 8bf94b9231
commit 6e1b8a54aa
12 changed files with 817 additions and 0 deletions
+6
View File
@@ -6,6 +6,12 @@ import (
"device/nrf"
)
const eraseBlockSizeValue = 1024
func eraseBlockSize() int64 {
return eraseBlockSizeValue
}
// Get peripheral and pin number for this GPIO pin.
func (p Pin) getPortPin() (*nrf.GPIO_Type, uint32) {
return nrf.GPIO, uint32(p)