AT command set for driving peripherals ================================================== This chapter introduces the AT command set of the drive peripherals. This AT command set will be adapted differently for different modules. For specific differences, please move to:doc::doc:`../instruction/other/firmware_differences`. - :ref:`AT+SYSIOMAP `: query or set IO mapping table - :ref:`AT+SYSGPIOWRITE `:set GPIO output level - :ref:`AT+SYSGPIOREAD `:read GPIO level - :ref:`AT+PWMCFG `:configure PWM function - :ref:`AT+PWMCFG `:configure PWM function - :ref:`AT+PWMSTOP `:turn off PWM function - :ref:`AT+PWMDUTYSET `:update PWM duty cycle - :ref:`AT+PWMDUTYSETS `:update PWM duty cycle .. _cmd-SYSIOMAP: AT+SYSIOMAP query or set IO mapping table ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+SYSIOMAP=,,,..., **Response:** :: OK Parameters ^^^^ - ****:the total number of IO to set. - ****:module IO pin - (Sort counterclockwise from the upper left corner of the module, pin number starts from 1) The corresponding chip pin number (1~254, this can be based on the pin number on the chip manual) If the module does not have a corresponding chip pin, it is set to NC Description ^^^^ - Set IO pin mapping relationship. Example ^^^^ :: AT+SYSIOMAP=4,3,5,NC,1 OK //The meaning of this command sets a total of 4 IO mapping relationships //Pin 1 of the module corresponds to pin 3 of the chip; //Pin 2 of the module corresponds to pin 5 of the chip; //Pin 3 of the module is not connected to the chip or AT command control is prohibited for this pin. //Pin 4 of the module corresponds to pin 1 of the chip query command ^^^^^^^^ **Command:** :: AT+SYSIOMAP? **Response:** :: +SYSIOMAP:PinNumber:,PinMap:,,..., Parameters ^^^^ - ****: indicates the number of groups in the current mapping table. - ****:module IO pin - (Sort counterclockwise from the upper left corner of the module, pin number starts from 1) The corresponding chip pin number (1~254, this can be based on the pin number on the chip manual) If the module does not have a corresponding chip pin, it is set to NC Description ^^^^ - Query IO pin mapping relationship table Example ^^^^ :: AT+SYSIOMAP? +SYSIOMAP:PinNumber:6,PinMap:NC,5,20,NC,15,NC OK .. _cmd-SYSGPIOWRITE: AT+SYSGPIOWRITE sets GPIO output level ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+SYSGPIOWRITE=, **Response:** :: OK Parameters ^^^^ - ****:module IO pin number. - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****: pin level. - 0:Low Level - 1:High Level Description ^^^^ - Set GPIO Output Level Example ^^^^ :: AT+SYSGPIOWRITE=4,1 .. _cmd-SYSGPIOREAD: AT + SYSGPIOREAD reads GPIO level ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+SYSGPIOREAD= **Response:** :: +SYSGPIOREAD:, Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****: pin level. - 0:Low Level - 1:High Level Description ^^^^ - read GPIO level Example ^^^^ :: AT+SYSGPIOREAD=4 +SYSGPIOREAD:4,1 .. _cmd-PWMCFG: AT+PWMCFG Configuration PWM Function ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+PWMCFG=,, **Response:** :: OK Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****:PWM cycle - 单位 us - ****:duty cycle - Integer 0~100 Description ^^^^ - Ai-WB2 series modules have a total of 5 PWM channels. When opening at the same time, it must be noted that the IO serial number of the chip pin cannot be repeated to 5, otherwise only one will take effect. For example, if IO1/2/6 is set, only IO2/6 will take effect, and IO1 is covered by IO6. - Note: The unit of this command setting is the cycle register of the chip. The effect of the same parameter on different modules may be different. If the accuracy can meet the requirements, it is recommended to use the AT+PWMCFGS setting. The effect of the same parameter of this command on different modules will be basically the same (different chips may have a difference of a few us) Example ^^^^ :: AT+SYSIOMAP=38,NC,NC,NC,NC,11,NC,NC,14,17,3,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,4,NC,NC,NC,5,NC,NC,NC,NC,12,NC,NC AT+PWMCFG=27,3000,80 .. _cmd-PWMCFGS: AT+PWMCFG Configuration PWM Function ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+PWMCFGS=,, **Response:** :: OK Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****:PWM cycle - Unit us - ****:duty cycle - Integer 0~100 Description ^^^^ - Ai-WB2 series modules have a total of 5 PWM channels. When opening at the same time, it must be noted that the IO serial number of the chip pin cannot be repeated to 5, otherwise only one will take effect. For example, if IO1/2/6 is set, only IO2/6 will take effect, and IO1 is covered by IO6. - Note: The unit of this command setting is the cycle register of the chip. The effect of the same parameter on different modules may be different. If the accuracy can meet the requirements, it is recommended to use the AT+PWMCFGS setting. The effect of the same parameter of this command on different modules will be basically the same (different chips may have a difference of a few us) Example ^^^^ :: AT+SYSIOMAP=38,NC,NC,NC,NC,11,NC,NC,14,17,3,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,NC,4,NC,NC,NC,5,NC,NC,NC,NC,12,NC,NC AT+PWMCFGS=27,3000,80 .. _cmd-PWMSTOP: AT+PWMSTOP turns off PWM function ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+PWMSTOP= **Response:** :: OK Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 Description ^^^^ - Turn off PWM function Example ^^^^ :: AT+PWMSTOP=27 .. _cmd-PWMDUTYSET: AT + PWMDUTYSET Update PWM Duty Cycle ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+PWMDUTYSET=, **Response:** :: OK Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****:duty cycle - Integer 0~100 Description ^^^^ - Update PWM duty cycle Example ^^^^ :: AT+PWMDUTYSET=27,60 OK .. _cmd-PWMDUTYSETS: AT+PWMDUTYSETS Update PWM duty cycle ------------------------------------------ Execute command ^^^^^^^^ **Command:** :: AT+PWMDUTYSETS=, **Response:** :: OK Parameters ^^^^ - ****:module IO pin number - Sort counterclockwise from the upper left corner of the module, and the pin number starts from 1 - ****:duty cycle - Integer 0~100 Description ^^^^ - Update PWM duty cycle Example ^^^^ :: AT+PWMDUTYSETS=27,60 OK