
Appendix A
SLAU587 – August 2014
Example Application Code
A.1
Introduction
Project Structure
•
emeter-communication.c – source code for low level UART communication routines including UART
port setup, write and read from UART, interrupt services routine for byte-wise send and receive
•
emeter-dlt645.c – source code for the polling mode protocol implementation
•
emeter-main.c – source code for system initialization, main loop, callback functions implementation and
interrupt vector placement.
•
emeter-metrology-i2041.r43 – embedded metering library object code
•
emeter-setup.c – source code for low level system initialization
•
emeter-template.h – source code for configuration (will be discussed later)
•
metrology-calibration-default.c – source code to put the user defined default calibration parameter into
a proper data structure
•
metrology-calibration-template.h – source code of user defined default calibration parameter
•
emeter-autoreport.c – source code for performing auto reporting. (Note: To enable auto report support,
uncomment the #define AUTOREPORT_SUPPORT definition in emeter-template.h.)
A.2
Prepaing the Application Code to Run
1. Select the emter-app-i2041 project tab at the bottom of the Workspace window
2. Check project options by right clicking project name and select [Options…] from the pop-up menu (see
48
Example Application Code
SLAU587 – August 2014
Copyright © 2014, Texas Instruments Incorporated