The module is named OA_2 because it only supports two OAs. A device
containing three op-amps would require a separate module.
enum OA_2.OAADC0_t |
|
XDCscript usage |
meta-domain |
values of type OA_2.OAADC0_t
const OA_2.OAADC0_OFF;
// OAx output to ADC12 input channel select 0
const OA_2.OAADC0;
// OAx output to ADC12 input channel select 0
enum OA_2.OAADC1_t |
|
XDCscript usage |
meta-domain |
values of type OA_2.OAADC1_t
const OA_2.OAADC1_OFF;
// OAx output to ADC12 input channel select 1
const OA_2.OAADC1;
// OAx output to ADC12 input channel select 1
enum OA_2.OAFBR_t |
|
OAx feedback resistor select
XDCscript usage |
meta-domain |
values of type OA_2.OAFBR_t
const OA_2.OAFBR_0;
// OAx Feedback resistor: Tap 0
const OA_2.OAFBR_1;
// OAx Feedback resistor: Tap 1
const OA_2.OAFBR_2;
// OAx Feedback resistor: Tap 2
const OA_2.OAFBR_3;
// OAx Feedback resistor: Tap 3
const OA_2.OAFBR_4;
// OAx Feedback resistor: Tap 4
const OA_2.OAFBR_5;
// OAx Feedback resistor: Tap 5
const OA_2.OAFBR_6;
// OAx Feedback resistor: Tap 6
const OA_2.OAFBR_7;
// OAx Feedback resistor: Tap 7
enum OA_2.OAFC_t |
|
OAx function control
XDCscript usage |
meta-domain |
values of type OA_2.OAFC_t
const OA_2.OAFC_0;
// General Purpose
const OA_2.OAFC_1;
// Unity gain buffer for three-opamp differential amplifier
const OA_2.OAFC_2;
// Unity gain buffer
const OA_2.OAFC_3;
// Comparator
const OA_2.OAFC_4;
// Non-inverting PGA
const OA_2.OAFC_5;
// Cascaded non-inverting PGA
const OA_2.OAFC_6;
// Inverting PGA
const OA_2.OAFC_7;
// Differential amplifier
enum OA_2.OANEXT_t |
|
XDCscript usage |
meta-domain |
values of type OA_2.OANEXT_t
const OA_2.OANEXT_OFF;
// OAx inverting input not externally available
const OA_2.OANEXT;
// OAx inverting input externally available
enum OA_2.OAN_t |
|
Inverting input selection
XDCscript usage |
meta-domain |
values of type OA_2.OAN_t
const OA_2.OAN_0;
// OAxI0
const OA_2.OAN_1;
// OAxI1
const OA_2.OAN_2;
// OAxI2
const OA_2.OAN_3;
// OAxI3
enum OA_2.OAPM_t |
|
Slew rate select
XDCscript usage |
meta-domain |
values of type OA_2.OAPM_t
const OA_2.OAPM_0;
// Off, output high Z
const OA_2.OAPM_1;
// Slow
const OA_2.OAPM_2;
// Medium
const OA_2.OAPM_3;
// Fast
enum OA_2.OAP_t |
|
Non-inverting input selection
XDCscript usage |
meta-domain |
values of type OA_2.OAP_t
const OA_2.OAP_0;
// OAxI0
const OA_2.OAP_1;
// OAxI1
const OA_2.OAP_2;
// OAxI2
const OA_2.OAP_3;
// OAxI3
enum OA_2.OARRIP_t |
|
XDCscript usage |
meta-domain |
values of type OA_2.OARRIP_t
const OA_2.OARRIP_OFF;
// Rtop = AVss, Rbottom = AVcc
const OA_2.OARRIP;
// Rtop = AVcc, Rbottom = AVss
struct OA_2.ForceSetDefaultRegister_t |
|
Force Set Default Register
XDCscript usage |
meta-domain |
var obj = new OA_2.ForceSetDefaultRegister_t;
obj.register = String ...
obj.regForceSet = Bool ...
DETAILS
Type to store if each register needs to be forced initialized
even if the register is in default state.
SEE
struct OA_2.OAxCTL0_t |
|
Opamp Control Register 0 Definition
XDCscript usage |
meta-domain |
var obj = new OA_2.OAxCTL0_t;
// Inverting input select. These bits select the input signal for the OA inverting
input.
00 OAxI0
01 OAxI1
10 OAxIA (see the device-specific data sheet for connected signal)
11 OAxIB (see the device-specific data sheet for connected signal)
// Non-inverting input select. These bits select the input signal for the OA
non-inverting input.
00 OAxI0
01 OA0I1
10 OAxIA (see the device-specific data sheet for connected signal)
11 OAxIB (see the device-specific data sheet for connected signal)
// Slew rate select. These bits select the slew rate vs. current consumption
for the OA.
00 Off, output high Z
01 Slow
10 Medium
11 Fast
// OA output select. These bits, together with the OAFCx bits, control the
routing of the OAx output when OAPMx > 0.
When OAFCx = 0:
00 OAxOUT connected to external pins and ADC input A1, A3, or A5
01 OAxOUT connected to external pins and ADC input A12, A13, or A14
10 OAxOUT connected to external pins and ADC input A1, A3, or A5
11 OAxOUT connected to external pins and ADC input A12, A13, or A14
When OAFCx > 0:
00 OAxOUT used for internal routing only
01 OAxOUT connected to external pins and ADC input A12, A13, or A14
10 OAxOUT connected to external pins and ADC input A1, A3, or A5
11 OAxOUT connected internally to ADC input A12, A13 , or A14.
External A12, A13, or A14 pin connections are disconnected from the
ADC
// OA output select. These bits, together with the OAFCx bits, control the
routing of the OAx output when OAPMx > 0.
When OAFCx = 0:
00 OAxOUT connected to external pins and ADC input A1, A3, or A5
01 OAxOUT connected to external pins and ADC input A12, A13, or A14
10 OAxOUT connected to external pins and ADC input A1, A3, or A5
11 OAxOUT connected to external pins and ADC input A12, A13, or A14
When OAFCx > 0:
00 OAxOUT used for internal routing only
01 OAxOUT connected to external pins and ADC input A12, A13, or A14
10 OAxOUT connected to external pins and ADC input A1, A3, or A5
11 OAxOUT connected internally to ADC input A12, A13 , or A14.
External A12, A13, or A14 pin connections are disconnected from the
ADC
SEE
struct OA_2.OAxCTL1_t |
|
Opamp Control Register 1 Definition
XDCscript usage |
meta-domain |
var obj = new OA_2.OAxCTL1_t;
// OAx feedback resistor select
000 Tap 0 - 0R/16R
001 Tap 1 - 4R/12R
010 Tap 2 - 8R/8R
011 Tap 3 - 10R/6R
100 Tap 4 - 12R/4R
101 Tap 5 - 13R/3R
110 Tap 6 - 14R/2R
111 Tap 7 - 15R/1R
// OAx function control. This bit selects the function of OAx
000 General purpose opamp
001 Unity gain buffer for three-opamp differential amplifier
010 Unity gain buffer
011 Comparator
100 Non-inverting PGA amplifier
101 Cascaded non-inverting PGA amplifier
110 Inverting PGA amplifier
111 Differential amplifier
// OAx inverting input externally available. This bit, when set, connects the
inverting OAx input to the external pin when the integrated resistor network
is used.
0 OAx inverting input not externally available
1 OAx inverting input externally available
// OAx reverse resistor connection in comparator mode
0 RTOP is connected to AVSS and RBOTTOM is connected to AVCC when
OAFCx = 3
1 RTOP is connected to AVCC and RBOTTOM is connected to AVSS when
OAFCx = 3
SEE
OA_2.getAll() // module-wide |
|
Find all peripherals of a certain type
XDCscript usage |
meta-domain |
DETAILS
The type of the peripherals returned is defined by the type of the
caller.
RETURNS
Returns an array of IPeripheral instances
OA_2.getRegisters() // module-wide |
|
Find all registers defined by the peripheral
XDCscript usage |
meta-domain |
OA_2.getRegisters() returns String[]
RETURNS
Returns an array of register names
Instance Config Parameters |
|
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
// Instance config-params object
// OA0 control register 0
};
// OA0 control register 1
};
// OA1 control register 0
};
// OA1 control register 1
};
// Determine if each Register needs to be forced set or not
{
register: "OA0CTL0",
regForceSet: false
},
{
register: "OA0CTL1",
regForceSet: false
},
{
register: "OA1CTL0",
regForceSet: false
},
{
register: "OA1CTL1",
regForceSet: false
}
];
params.name = String undefined;
// Specific peripheral name given by the device
params.owner = String undefined;
// String specifying the entity that manages the peripheral
config OA_2.OA0CTL0 // instance |
|
OA0 control register 0
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
};
config OA_2.OA0CTL1 // instance |
|
OA0 control register 1
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
};
config OA_2.OA1CTL0 // instance |
|
OA1 control register 0
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
};
config OA_2.OA1CTL1 // instance |
|
OA1 control register 1
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
};
config OA_2.forceSetDefaultRegister // instance |
|
Determine if each Register needs to be forced set or not
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
{
register: "OA0CTL0",
regForceSet: false
},
{
register: "OA0CTL1",
regForceSet: false
},
{
register: "OA1CTL0",
regForceSet: false
},
{
register: "OA1CTL1",
regForceSet: false
}
];
config OA_2.name // instance |
|
Specific peripheral name given by the device
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
params.name = String undefined;
DETAILS
Devices can have more than one peripheral of the same type. In such
cases, device data sheets give different names to the instances of a
same peripheral. For example, the name for a timer module could be
TimerA3, and a device that has two such timers can name them TA0
and TA1.
config OA_2.owner // instance |
|
String specifying the entity that manages the peripheral
XDCscript usage |
meta-domain |
var params = new OA_2.Params;
...
params.owner = String undefined;
Instance Creation |
|
XDCscript usage |
meta-domain |
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = OA_2.create(params);
// Create an instance-object
OA_2.getNumberOfOA() // instance |
|
Returns the number of available OA
XDCscript usage |
meta-domain |
inst.getNumberOfOA() returns UChar