2023-06-24 09:05:38 +03:00
|
|
|
% var moduleName = "pga"
|
|
|
|
|
% var module = system.modules['/driverlib/' + moduleName + '.js'];
|
|
|
|
|
%if (module != null)
|
|
|
|
|
%{
|
|
|
|
|
//*****************************************************************************
|
|
|
|
|
//
|
|
|
|
|
// PGA Configurations
|
|
|
|
|
//
|
|
|
|
|
//*****************************************************************************
|
|
|
|
|
% for(var i = 0; i < module.$instances.length; i++) {
|
|
|
|
|
% var instance = module.$instances[i];
|
|
|
|
|
% let modInst = instance[moduleName];
|
|
|
|
|
#define `instance.$name`_BASE `instance.pgaBase`
|
|
|
|
|
#define `instance.$name`_GAIN `instance.gainMode`
|
|
|
|
|
% if (instance.enableFilter) {
|
|
|
|
|
#define `instance.$name`_FILTER `instance.filterMode`
|
|
|
|
|
% } else {
|
|
|
|
|
#define `instance.$name`_FILTER PGA_LOW_PASS_FILTER_DISABLED
|
2023-12-13 14:16:16 +03:00
|
|
|
% }
|
|
|
|
|
% if (instance.enableFilterMode)
|
|
|
|
|
% {
|
|
|
|
|
#define `instance.$name`_PMUXInput PGA_PMUX_VSSA
|
|
|
|
|
#define `instance.$name`_NMUXInput PGA_NMUX_RTAP
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_NON_INVERTING_GAIN_VSSA
|
|
|
|
|
% }
|
|
|
|
|
% if (instance.modeSelection == "BufferMode")
|
|
|
|
|
% {
|
|
|
|
|
#define `instance.$name`_PMUXInput PGA_PMUX_POS
|
|
|
|
|
#define `instance.$name`_NMUXInput PGA_NMUX_RTOP
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_NAKED_OPAMP
|
|
|
|
|
% }
|
|
|
|
|
% else if (instance.modeSelection == "StandaloneMode")
|
|
|
|
|
% {
|
|
|
|
|
#define `instance.$name`_PMUXInput PGA_PMUX_POS
|
|
|
|
|
#define `instance.$name`_NMUXInput PGA_NMUX_NEG
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_NAKED_OPAMP
|
|
|
|
|
% }
|
|
|
|
|
% else if (instance.modeSelection == "Non-invertingMode")
|
|
|
|
|
% {
|
|
|
|
|
#define `instance.$name`_PMUXInput PGA_PMUX_POS
|
|
|
|
|
#define `instance.$name`_NMUXInput PGA_NMUX_RTAP
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_NON_INVERTING_GAIN_VSSA
|
|
|
|
|
% }
|
|
|
|
|
% else if (instance.modeSelection == "SubtractorMode")
|
|
|
|
|
% {
|
|
|
|
|
#define `instance.$name`_PMUXInput PGA_PMUX_POS
|
|
|
|
|
#define `instance.$name`_NMUXInput PGA_NMUX_RTAP
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_INVERTING_GAIN_NEG
|
|
|
|
|
% }
|
|
|
|
|
% if (instance.enableNEGShared) {
|
|
|
|
|
#define `instance.$name`_MMUXInput PGA_MMUX_INVERTING_GAIN_NEG_SHARED
|
2023-06-24 09:05:38 +03:00
|
|
|
% }
|
|
|
|
|
% if (instance.useSignalConditionCalculator) {
|
|
|
|
|
#define `instance.$name`_CONDITIONEDPGAINMIN `instance.calculatedInputSignalConditionMin`f //Conditioned PGA_IN signal minimum
|
|
|
|
|
#define `instance.$name`_CONDITIONEDPGAINMAX `instance.calculatedInputSignalConditionMax`f //Conditioned PGA_IN signal maximum
|
|
|
|
|
#define `instance.$name`_CONDITIONEDPGAOUTMIN `instance.calculatedOutputSignalConditionMin`f //Conditioned PGA_OUT signal minimum
|
|
|
|
|
#define `instance.$name`_CONDITIONEDPGAOUTMAX `instance.calculatedOutputSignalConditionMax`f //Conditioned PGA_OUT signal maximum
|
|
|
|
|
% }
|
|
|
|
|
% if (instance.useCutoffFreqCalculator) {
|
|
|
|
|
#define `instance.$name`_CUTOFFFREQ `instance.calculatedCutoffFreq`f //Calculated cutoff frequency of low-pass filter
|
|
|
|
|
% }
|
2023-12-13 14:16:16 +03:00
|
|
|
% if (instance.cutoffFreqCalculator) {
|
|
|
|
|
#define `instance.$name`_CUTOFFFREQ `instance.calculatedFreq`f //Calculated cutoff frequency of low-pass filter using internal gain resistor
|
|
|
|
|
% }
|
2023-06-24 09:05:38 +03:00
|
|
|
void `instance.$name`_init();
|
|
|
|
|
% }
|
|
|
|
|
%}
|