FPIOA Manager
fpioa_manager
: referred to as fm
, this module is used to register internal functions and pins of the chip, to help users manage internal functions and pins. If the functions and pins are already registered, the internal functions and pins will not be available.
Actually fm
is global variable define with Fpioa_Manager
class, written by Micropython
and integrated to firmware, source code see board.py
1. method
1.1. Registration function
Register pins and functions
fm.register(pin,function)
Parameters
This method must pass in 2 parameters, otherwise it will return a null value.
pin
: function mapping pinfunction
: chip function
return value
This method has 2 return values.
- Parameter error returns
None,None
- Set the success to return
pin, function
- Setting fails to return
reg_pin, reg_func
, indicating the pins and functions that have been registered
1.2. Logout function
Logout pin and function
fm.unregister(pin,function)
Parameters
This method can pass 1 or 2 parameters. When passing in 1 parameter, you need to add a parameter keyword. If it is 1 parameter, its pins and functions will be logged out.
pin
: function mapping pinfunction
: chip function
return value
- Parameter error returns
None,None
- Set successfully returns
pin, function
, indicating the pin and function being logged out - Set failure to return
0,0
2. Routine
from fpioa_manager import fm, board_info
fm.register(board_info.WIFI_RX,fm.fpioa.UART2_TX)
fm.register(board_info.WIFI_RX,fm.fpioa.UART2_TX)#Register again
fm.register(board_info.WIFI_RX,fm.fpioa.SPI0_SS0)#Register the same pin
fm.register(board_info.WIFI_RX,fm.fpioa.SPI0_SS0)#Register the same function
fm.unregister(board_info.WIFI_RX, fm.fpioa.UART2_TX)#Logout function and pin
fm.register(board_info.WIFI_RX,fm.fpioa.UART2_TX)
fm.unregister(function = fm.fpioa.UART2_TX)#Logout function
fm.register(board_info.WIFI_RX,fm.fpioa.UART2_TX)
fm.unregister(pin = board_info.WIFI_RX)#Logout pin
3. Appendix
The following pins have been registered when MaxiPy is powered on. Please pay attention to the user.
3.1. SD card
Function
: SPI1_SCLK/SPI1_D0/SPI1_D1/GPIOHS7/SPI0_SS1Pin
: PIN25/PIN26/PIN27/PIN28/PIN29
3.2. LCD
Function
: SPI0_SS3/SPI0_SCLK/GPIOHS1/GPIOHS2Pin
: PIN36/PIN37/PIN38/PIN39
3.3. sensor
Function
: SCCB_SDA/SCCB_SCLK/CMOS_RST/CMOS_VSYNC/CMOS_PWDN/CMOS_HREF/CMOS_XCLK/CMOS_PCLKPin
: PIN40/PIN41/PIN42/PIN43/PIN44/PIN45/PIN46/PIN47
3.4. REPL
Function
: UARTHS_RX/UARTHS_TXPin
: PIN4/PIN5