eTPU function library and application interface (API). freescale PX R4040, eTPU, eTPU libraries, TPU, PX R40, 10.x
Quảng cáo
Quảng cáo
eTPU function library and application interface (API)
To program the eTPU effectively, the user must have a clear understanding of how the eTPU hardware works. By using the code in C-language, the programmer can leave the mechanics of the eTPU programming like parameter packing, microinstruction packing, etc., to the compiler and focus more on the application logic.
With the help of the compiler, the same symbol can be referenced by the eTPU and host software. The host software can interface with eTPU functions via application programming interface (API) functions, instead of accessing physical memory locations and registers. The host application can call these API functions to interface with the eTPU. The references to these
API functions and symbols for parameters are resolved at compile time. The implementation details of the eTPU functions are hidden from the host application. This design improves the flexibility of the eTPU functions’ implementation and the portability of the host application code.
2 eTPU function library and application interface (API)
The eTPU function APIs enable the use of eTPU functions in applications. The eTPU function APIs include CPU methods that demonstrate how to initialize, control, and monitor the eTPU function. The CPU application does not need to access eTPU channel registers and/or function parameters directly. Rather, the CPU application can use the eTPU function APIs instead. These functions can be used on any product that has an eTPU module.
Freescale provides an eTPU functions library that is a superset of the standard TPU library functions. These, along with an available C compiler, make it relatively easy to port older applications to the eTPU. By providing source code of the eTPU library, developers are able to create customized functions for specific applications.
2.1 eTPU API functions
The following sections present a list of the API functions available on the Freescale website, http://www.freescale.com
2.1.1 General timing functions
• Full-featured and synchronized PWM
• Input capture/output compare (Protected Output Compare)
• Frequency and period measurement
• Pulse/Period accumulate
• Queued output match for complex outputs
• GPIO
2.1.2 Communication functions
• SPI
• UART
• UART with Flow Control
• Proprietary Protocols
2
2.1.3 Motor control functions
• Stepper motor
• Hall decoder
• Quadrature decoder
• PWM–Master for DC motors
eTPU Libraries Integration to CodeWarrior (CW) 10.x, Rev. 0, 8/2012
Freescale Semiconductor, Inc.
Tải xuống
Quảng cáo