PA6, PA7 usb_id usb_on all pull high
USB_ID: High voltage trigger external USB for charging
USB_ON: Used to test the sub has been powered, plug the USB
A: Enter Charger_host_mode instructions have been plugged into USB.
Circuit Start-up circuit analysis:
Shutting down functions in the Poweroff function
Hal_gpio_writepin (Dc3v2_en_gpio_port,dc3v2_en_pin,gpio_pin_reset);
The meaning of this function is to turn off the DCDC circuit of its own power supply, and the control pin is PA9 3v2_dcdc_en.
Make 3v2_dcdc_en level Pull high, is 3v2 level pull high.
Hal_gpio_writepin (Rfpwr_en_gpio_port,rfpwr_en_pin,gpio_pin_reset); PA8 Rf_pwr_e
This function is to turn off the RF power enable circuit
As can be seen from the above figure, the high level of the 3v2_en is triggered jointly by 3v2_dcdc_en and HOME_BTN. HOME_BTN plays a leading role in the boot time. The HOME_BTN is in a suspended state when the machine is turned off.
As long as the 3v2_dcdc_en pull down the circuit will turn off the 3v2 power.
The following is the trigger circuit:
The above is the home key circuit, the home button has the role of the machine also related to the role.
The role of the boot has been analyzed, the following discussion of the home key shutdown principle.
Home key is PC3
if (Presshomebuttontick > 200)
{
Presshomebuttonflag = 0;
Power_off ();
}
if (1 = = Presshomebuttonflag)
{
presshomebuttontick++;
}
Else
{
Presshomebuttontick = 0;
}
External Home button Long press the home button for 2 seconds will automatically shut down.