SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
The ENC module is used to convert the raw counts produced by the QEP driver into electrical angle that will be used by the FOC system. An ENC module object and handle need to be declared in the main source file of the project. In the Lab 12b example this is done in proj_lab12b.c.
ENC_Handle encHandle;
ENC_Obj enc;
Once the ENC module object and handle have been declared they need to be initialized. This will assign the handle to point to the specific memory used by the ENC module. This should be done prior to the main loop in the main source file.
// initialize the ENC module
encHandle = ENC_init(&enc, sizeof(enc));