2.16 OPA Driver
2.16.1 Introduction
Overview
The Operational Amplifier (Op Amp) module provides the ability to condition analog input signals. It can be configured to run in High or Low-Power mode, depending on the user specifications.
Features
- Op-amp is enabled by default.
- Enabling an op-amp instance configures the corresponding input and output pins.
- Positive and Negative channel for each op-amp is user configurable.
2.16.2 Module Documentation
2.16.2.1 OPA Driver
Operational Amplifier Driver used for a wide variety of purposes, including signal conditioning and filtering using dsPIC MCUs.
2.16.2.1.1 Module description
Operational Amplifier Driver used for a wide variety of purposes, including signal conditioning and filtering using dsPIC MCUs.
2.16.2.1.1.1 Data structures
struct OPA_INTERFACE
Structure containing the function pointers of OPA driver.
2.16.2.1.1.2 Enumerations
enum OPA_GAIN { OPA_GAIN_DISABLED }
This defines the gain enumeration for OPA.
enum OPA_INPUT_VOLTAGE_RANGE { OPA_WIDE_INPUT = 0, OPA_LOWERED_INPUT = 1 }
This defines input voltage range enumeration for OPA channels.
2.16.2.1.1.3 Functions
void OPA1_Initialize (void)
Initializes the OPA1 module.
void OPA1_Deinitialize (void)
Deinitializes the OPA1 to POR values.
static void OPA1_Enable (void)
This inline function enables the OPA1 module.
static void OPA1_Disable (void)
This inline function disables the OPA1 module.
static void OPA1_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA1 Wide Input or Lowered input voltage range.
void OPA2_Initialize (void)
Initializes the OPA2 module.
void OPA2_Deinitialize (void)
Deinitializes the OPA2 to POR values.
static void OPA2_Enable (void)
This inline function enables the OPA2 module.
static void OPA2_Disable (void)
This inline function disables the OPA2 module.
static void OPA2_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
void OPA3_Initialize (void)
Initializes OPA3 module.
void OPA3_Deinitialize (void)
Deinitializes the OPA3 to POR values.
static void OPA3_Enable (void)
This inline function enables the OPA3 module.
static void OPA3_Disable (void)
This inline function disables the OPA3 module.
static void OPA3_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
2.16.2.1.1.4 Variables
const struct OPA_INTERFACE OPA1
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
const struct OPA_INTERFACE OPA2
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
const struct OPA_INTERFACE OPA3
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.16.2.1.2 Function Documentation
2.16.2.1.2.1 OPA1_Deinitialize()
void OPA1_Deinitialize (void )
Deinitializes the OPA1 to POR values.
none |
none |
2.16.2.1.2.2 OPA1_Disable()
inline static void OPA1_Disable (void )
This inline function disables the OPA1 module.
none |
none |
2.16.2.1.2.3 OPA1_Enable()
inline static void OPA1_Enable (void )
This inline function enables the OPA1 module.
The OPA1_Initialize function should be called for the specified OPA1 driver instance. |
none |
none |
2.16.2.1.2.4 OPA1_Initialize()
void OPA1_Initialize (void )
Initializes the OPA1 module.
none |
none |
2.16.2.1.2.5 OPA1_InputVoltageRangeSelect()
inline static void OPA1_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA1 Wide Input or Lowered input voltage range.
in | input |
- Wide Input or Lowered Input |
none |
2.16.2.1.2.6 OPA2_Deinitialize()
void OPA2_Deinitialize (void )
Deinitializes the OPA2 to POR values.
none |
none |
2.16.2.1.2.7 OPA2_Disable()
inline static void OPA2_Disable (void )
This inline function disables the OPA2 module.
none |
none |
2.16.2.1.2.8 OPA2_Enable()
inline static void OPA2_Enable (void )
This inline function enables the OPA2 module.
The OPA2_Initialize function should be called for the specified OPA2 driver instance |
none |
none |
2.16.2.1.2.9 OPA2_Initialize()
void OPA2_Initialize (void )
Initializes the OPA2 module.
none |
none |
2.16.2.1.2.10 OPA2_InputVoltageRangeSelect()
inline static void OPA2_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
in | input |
- Wide Input or Lowered Input |
none |
2.16.2.1.2.11 OPA3_Deinitialize()
void OPA3_Deinitialize (void )
Deinitializes the OPA3 to POR values.
none |
none |
2.16.2.1.2.12 OPA3_Disable()
inline static void OPA3_Disable (void )
This inline function disables the OPA3 module.
none |
none |
2.16.2.1.2.13 OPA3_Enable()
inline static void OPA3_Enable (void )
This inline function enables the OPA3 module.
The OPA3_Initialize function should be called for the specified OPA3 driver instance. |
none |
none |
2.16.2.1.2.14 OPA3_Initialize()
void OPA3_Initialize (void )
Initializes OPA3 module.
none |
none |
2.16.2.1.2.15 OPA3_InputVoltageRangeSelect()
inline static void OPA3_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
in | input |
- Wide Input or Lowered Input |
none |
2.16.2.1.3 Enumeration Type Documentation
2.16.2.1.3.1 OPA_GAIN
enum OPA_GAIN
This defines the gain enumeration for OPA.
OPA_GAIN_DISABLED |
OPA Gain is disabled |
2.16.2.1.3.2 OPA_INPUT_VOLTAGE_RANGE
enum OPA_INPUT_VOLTAGE_RANGE
This defines input voltage range enumeration for OPA channels.
OPA_WIDE_INPUT |
Wide Input voltage range selected |
OPA_LOWERED_INPUT |
Lowered Input voltage range selected |
2.16.2.1.4 Variable Documentation
2.16.2.1.4.1 OPA1
const struct OPA_INTERFACE OPA1
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
The default name e.g. OPA1 can be changed by the user in the OPA user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
2.16.2.1.4.2 OPA2
const struct OPA_INTERFACE OPA2
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
The default name e.g. OPA2 can be changed by the user in the OPA user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
2.16.2.1.4.3 OPA3
const struct OPA_INTERFACE OPA3
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
The default name e.g. OPA3 can be changed by the user in the OPA user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
2.16.3 Class Documentation
2.16.3.1 OPA_INTERFACE Struct Reference
Structure containing the function pointers of OPA driver.
2.16.3.1.1 Detailed Description
Structure containing the function pointers of OPA driver.
#include <opa_interface.h>
2.16.3.1.1.1 Public Attributes
void(* Intitialize )(void)
Pointer to OPAx_Initialize e.g. OPA1_Initialize.
void(* Deintitialize )(void)
Pointer to OPAx_Deinitialize e.g. OPA1_Deinitialize.
void(* Enable )(void)
Pointer to OPAx_Enable e.g. OPA1_Enable.
void(* Disable )(void)
Pointer to OPAx_Disable e.g. OPA1_Disable.
void(* InputVoltageRangeSelect )(enum OPA_INPUT_VOLTAGE_RANGE input)
Pointer to OPAx_InputVoltageRangeSelect e.g. OPA1_InputVoltageRangeSelect.
void(* GainSet )(enum OPA_GAIN gainValue)
Pointer to OPAx_GainSet e.g. OPA1_GainSet (This API is hardware dependent)
2.16.3.1.2 Member Data Documentation
2.16.3.1.2.1 Deintitialize
void(* Deintitialize) (void)
Pointer to OPAx_Deinitialize e.g. OPA1_Deinitialize.
2.16.3.1.2.2 Disable
void(* Disable) (void)
Pointer to OPAx_Disable e.g. OPA1_Disable.
2.16.3.1.2.3 Enable
void(* Enable) (void)
Pointer to OPAx_Enable e.g. OPA1_Enable.
2.16.3.1.2.4 GainSet
void(* GainSet) (enum OPA_GAIN gainValue)
Pointer to OPAx_GainSet e.g. OPA1_GainSet (This API is hardware dependent)
2.16.3.1.2.5 InputVoltageRangeSelect
void(* InputVoltageRangeSelect) (enum OPA_INPUT_VOLTAGE_RANGE input)
Pointer to OPAx_InputVoltageRangeSelect e.g. OPA1_InputVoltageRangeSelect.
2.16.3.1.2.6 Intitialize
void(* Intitialize) (void)
Pointer to OPAx_Initialize e.g. OPA1_Initialize.
2.16.4 File Documentation
2.16.4.1 source/opa1.h File Reference
This is the generated driver header file for the OPA1 driver.
#include <xc.h> #include <stdint.h> #include "opa_types.h" #include "opa_interface.h"
2.16.4.1.1 Functions
void OPA1_Initialize (void)
Initializes the OPA1 module.
void OPA1_Deinitialize (void)
Deinitializes the OPA1 to POR values.
static void OPA1_Enable (void)
This inline function enables the OPA1 module.
static void OPA1_Disable (void)
This inline function disables the OPA1 module.
static void OPA1_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA1 Wide Input or Lowered input voltage range.
2.16.4.1.2 Variables
const struct OPA_INTERFACE OPA1
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.16.4.1.3 Detailed Description
This is the generated driver header file for the OPA1 driver.
OPA1 Generated Driver Header File
2.16.4.2 source/opa2.h File Reference
This is the generated driver header file for the OPA2 driver.
#include <xc.h> #include <stdint.h> #include "opa_types.h" #include "opa_interface.h"
2.16.4.2.1 Functions
void OPA2_Initialize (void)
Initializes the OPA2 module.
void OPA2_Deinitialize (void)
Deinitializes the OPA2 to POR values.
static void OPA2_Enable (void)
This inline function enables the OPA2 module.
static void OPA2_Disable (void)
This inline function disables the OPA2 module.
static void OPA2_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
2.16.4.2.2 Variables
const struct OPA_INTERFACE OPA2
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.16.4.2.3 Detailed Description
This is the generated driver header file for the OPA2 driver.
OPA2 Generated Driver Header File
2.16.4.3 source/opa3.h File Reference
This is the generated driver header file for the OPA3 driver.
#include <xc.h> #include <stdint.h> #include "opa_types.h" #include "opa_interface.h"
2.16.4.3.1 Functions
void OPA3_Initialize (void)
Initializes OPA3 module.
void OPA3_Deinitialize (void)
Deinitializes the OPA3 to POR values.
static void OPA3_Enable (void)
This inline function enables the OPA3 module.
static void OPA3_Disable (void)
This inline function disables the OPA3 module.
static void OPA3_InputVoltageRangeSelect (enum OPA_INPUT_VOLTAGE_RANGE input)
This inline function selects OPA2 Wide Input or Lowered input voltage range.
2.16.4.3.2 Variables
const struct OPA_INTERFACE OPA3
Structure object of type OPA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.16.4.3.3 Detailed Description
This is the generated driver header file for the OPA3 driver.
OPA3 Generated Driver Header File
2.16.4.4 source/opa_interface.h File Reference
This is the generated driver interface header file for the OPA driver.
#include "opa_types.h"
2.16.4.4.1 Data structures
struct OPA_INTERFACE
Structure containing the function pointers of OPA driver.
2.16.4.4.2 Detailed Description
This is the generated driver interface header file for the OPA driver.
OPA Generated Driver Interface Header File
OPA Generated Driver Interface Header File
2.16.4.5 source/opa_types.h File Reference
2.16.4.5.1 Enumerations
enum OPA_GAIN { OPA_GAIN_DISABLED }
This defines the gain enumeration for OPA.
enum OPA_INPUT_VOLTAGE_RANGE { OPA_WIDE_INPUT = 0, OPA_LOWERED_INPUT = 1 }
This defines input voltage range enumeration for OPA channels.