![FTDI FT51A Скачать руководство пользователя страница 148](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158148.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
147
Copyright © 2015 Future Technology Devices International Limited
3.1.10.2
watchdog_feed
File: ft51_watchdog_feed.c
Feed the watchdog and therefore restore the start value to the watchdog timer.
3.1.10.3
reset_cause
File: ft51_watchdog_reset_cause.c
Get the reason for the last reset of the device. This can be a normal reset or a watchdog reset.
3.1.11
DFU Library
The DFU library provides functions for handling the Device Firmware Update class. The class is
described in the following document:
http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf
It will manage a detach timer for transitioning to the DFU mode from Run Time mode and control
the state machine when updating the firmware via download requests.
The firmware may still be required to reset the device after the firmware is downloaded when a
USB reset is seen on the bus. The device cannot do a bus detach-attach sequence so the
bitWillDetach
in the bmAttributes will need to be set to 0 (for no).
It supports downloading of firmware only (
bitCanDnload
) but does not support manifest checking
(
bitManifestationTolerant)
.
This library is in a single file
Source Folder: dfu
File: ft51_usb_dfu.c
Requires: ft51_usb_transfer.c, ft51_usb_endpoint_features.c
3.1.11.1
dfu_is_runtime
Returns non-zero if the current state of the DFU machine is runtime, i.e. DFU are not active.
3.1.11.2
dfu_class_req_detach
Handler for the DFU_DETACH class request. This will change the state from appIDLE to dfuDETACH
and allow entering DFU mode on a USB reset. Starts a detach timer which will return to normal
runtime mode (appIDLE) if it expires before a USB reset.
3.1.11.3
dfu_timer
Decrements the detach timer. If it expires then return to the appIDLE state.
3.1.11.4
dfu_class_req_download
Handles DFU_DNLOAD requests and programs the MTP memory with data received.
3.1.11.5
dfu_class_req_getstatus
Returns the current DFU state machine enumeration, and increments the state from dfuMANIFEST-
SYNC to dfuMANIFEST-WAIT-RESET or dfuDNLOAD-SYNC to dfuDNLOAD-IDLE.
Returns current error status if set.
3.1.11.6
dfu_class_req_clrstatus
Clears a dfuERROR state back to dfuIDLE.
3.1.11.7
dfu_class_req_abort
Cancels the current DFU operation and returns back to dfuIDLE.