extmod/modmachine: Factor ports' machine module dict to common code.

This is a code factoring to have the dict for the machine module in one
location, and all the ports use that same dict.  The machine.soft_reset()
function implementation is also factored because it's the same for all
ports that did already implement it.  Eventually more functions/bindings
can be factored.

All ports remain functionally the same, except:
- cc3200 port: gains soft_reset, mem8, mem16, mem32, Signal; loses POWER_ON
  (which was a legacy constant, replaced long ago by PWRON_RESET)
- nrf port: gains Signal
- qemu-arm port: gains soft_reset
- unix port: gains soft_reset
- zephyr port: gains soft_reset, mem8, mem16, mem32

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-11-22 13:00:02 +11:00
parent 14432b5da0
commit 7d39db2503
44 changed files with 550 additions and 922 deletions

View File

@@ -125,7 +125,6 @@ set(MICROPY_SOURCE_PORT
machine_spi.c
machine_timer.c
main.c
modmachine.c
modrp2.c
mphalport.c
mpnetworkport.c
@@ -153,7 +152,6 @@ set(MICROPY_SOURCE_QSTR
${MICROPY_PORT_DIR}/machine_timer.c
${MICROPY_PORT_DIR}/machine_uart.c
${MICROPY_PORT_DIR}/machine_wdt.c
${MICROPY_PORT_DIR}/modmachine.c
${MICROPY_PORT_DIR}/modrp2.c
${MICROPY_PORT_DIR}/modos.c
${MICROPY_PORT_DIR}/rp2_flash.c