ApplicationReportSPRAA85C–February2012ProgrammingTMS320x28xxand28xxxPeripheralsinC/C++LoriHeustess..................................................................................................................AECC2000ABSTRACTThisapplicationreportexploresahardwareabstractionlayerimplementationtomakeC/C++codingeasieronC28x™devices.Thismethodiscomparedtotraditional#definemacrosandtopicsofcodeefficiencyandspecialcaseregistersarealsoaddressed.Contents1Introduction..................................................................................................................12Traditional#defineApproach..............................................................................................33BitFieldandRegister-FileStructureApproach.........................................................................54BitFieldandRegister-FileStructureAdvantages.....................................................................115CodeSizeandPerformanceUsingBitFields.........................................................................126Read-Modify-WriteConsiderationsWhenUsingBitFields..........................................................167ASpecialCase:eCANControlRegisters..............................................................................218References.................................................................................................................23ListofFigures1SCISCICCRRegister......................................................................................................92SCISCICTL1Register.....................................................................................................93CodeComposerStudiov5.1AutocompleteFeature.................................................................124CodeComposerStudiov5.1ExpressionWindow....................................................................125PeripheralClockControl0Register(PCLKCR0).....................................................................13ListofTables1S...