![FTDI FT51A Application Note Download Page 138](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158138.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
137
Copyright © 2015 Future Technology Devices International Limited
3
Application Guide
FTDI provide sample code and source code libraries as part of the FT51A Software Development
Kit
to
enable
fast
project
development.
The
FT51A
SDK
Installer
(see
AN_352_FT51A_Installation_Guide
) will install the source code for the libraries described in this
section. It will also install sample code which will demonstrate the use of these source code
libraries.
The source code libraries provide functions that can be used to facilitate various features reducing
the amount of additional code being required. They are intended to implement hardware features
only. The algorithms and methods used are recommended and tested by FTDI.
Several of the source code libraries implement a framework that can be used or adapted in an
application.
3.1
Libraries
The source code libraries are provided to show how to implement and manage features of the
FT51A. They can be modified as required.
Source code is normally provided with one or two functions in each file. The filename is the name
of the function prepended with the name of the library. The reason for this is that the SDCC linker
will optimize-out entire files which are not called but will not normally optimize-out unused
functions within files. This reduces code size in an application without requiring manual
examination of calling graphs.
The intention is that only functions (and hence files) that are required for an application are
included in the project.
The USB device library, Interrupts library and DMA library provide frameworks for an application to
use to exploit the features in hardware.
The function descriptions in this section are only brief overviews of the functions. Please also refer
to the library header files which contain Dioxygen compatible comments for each exposed function.
The Doxygen comments contain descriptions, parameters and return values of functions. Hence,
there are no comments describing functions in the source files.
The filename containing the function is noted along with any other files that the function requires.
3.1.1
Configuration Library
This library contains functions or macros to properly initialise the FT51A, query or set the system
clock frequency (6, 12, 24 or 48 MHz) and determine the IC package.
Source Folder: general_configuration
3.1.1.1
device_initialise()
File: ft51_general_config_device_initialise.c
This is used to initialise the registers in the FT51’s 8051 core registers and enable FT51A
peripheral register access.
This should be called once at the very start of an application.
3.1.1.2
get_ic_package()
File: ft51_general_config_get_ic_package.c
This will return an enumerated value indicating the package type and hence pin count of the
device.