2.16 OPA Driver

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.1 Module Documentation

2.16.1.1 OPA Driver

Operational Amplifier Driver used for a wide variety of purposes, including signal conditioning and filtering using dsPIC MCUs.

2.16.1.1.1 Module description

Operational Amplifier Driver used for a wide variety of purposes, including signal conditioning and filtering using dsPIC MCUs.

Data structures
  • struct OPA_INTERFACE

    Structure containing the function pointers of OPA driver.

Functions
Variables

2.16.1.1.2 Function Documentation

OPA1_Deinitialize()

void OPA1_Deinitialize (void )

Deinitializes the OPA1 to POR values.

Parameters:
none
Returns:

none  

OPA1_Disable()

inline static void OPA1_Disable (void )

This inline function disables the OPA1 module.

Parameters:
none
Returns:

none  

OPA1_Enable()

inline static void OPA1_Enable (void )

This inline function enables the OPA1 module.

Precondition:

The OPA1_Initialize function should be called for the specified OPA1 driver instance.

Parameters:
none
Returns:

none  

OPA1_Initialize()

void OPA1_Initialize (void )

Initializes the OPA1 module.

Parameters:
none
Returns:

none  

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.

Parameters:
in input

- Wide Input or Lowered Input

Returns:

none  

OPA2_Deinitialize()

void OPA2_Deinitialize (void )

Deinitializes the OPA2 to POR values.

Parameters:
none
Returns:

none  

OPA2_Disable()

inline static void OPA2_Disable (void )

This inline function disables the OPA2 module.

Parameters:
none
Returns:

none  

OPA2_Enable()

inline static void OPA2_Enable (void )

This inline function enables the OPA2 module.

Precondition:

The OPA2_Initialize function should be called for the specified OPA2 driver instance

Parameters:
none
Returns:

none  

OPA2_Initialize()

void OPA2_Initialize (void )

Initializes the OPA2 module.

Parameters:
none
Returns:

none  

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.

Parameters:
in input

- Wide Input or Lowered Input

Returns:

none  

OPA3_Deinitialize()

void OPA3_Deinitialize (void )

Deinitializes the OPA3 to POR values.

Parameters:
none
Returns:

none  

OPA3_Disable()

inline static void OPA3_Disable (void )

This inline function disables the OPA3 module.

Parameters:
none
Returns:

none  

OPA3_Enable()

inline static void OPA3_Enable (void )

This inline function enables the OPA3 module.

Precondition:

The OPA3_Initialize function should be called for the specified OPA3 driver instance.

Parameters:
none
Returns:

none  

OPA3_Initialize()

void OPA3_Initialize (void )

Initializes OPA3 module.

Parameters:
none
Returns:

none  

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.

Parameters:
in input

- Wide Input or Lowered Input

Returns:

none  

2.16.1.1.3 Enumeration Type Documentation

OPA_GAIN

enum OPA_GAIN

This defines the gain enumeration for OPA.

OPA_GAIN_DISABLED

OPA Gain is disabled

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.1.1.4 Variable Documentation

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.

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.

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.2 Data Structure Documentation

2.16.2.1 OPA_INTERFACE Struct Reference

Structure containing the function pointers of OPA driver.

2.16.2.1.1 Detailed Description

Structure containing the function pointers of OPA driver.

#include <opa_interface.h>

Data Fields

2.16.2.1.2 Field Documentation

The documentation for this struct was generated from the following file:

source/

opa_interface.h

Deintitialize

void(* Deintitialize) (void)

Pointer to OPAx_Deinitialize e.g. OPA1_Deinitialize.

Disable

void(* Disable) (void)

Pointer to OPAx_Disable e.g. OPA1_Disable.

Enable

void(* Enable) (void)

Pointer to OPAx_Enable e.g. OPA1_Enable.

GainSet

void(* GainSet) (enum OPA_GAIN gainValue)

Pointer to OPAx_GainSet e.g. OPA1_GainSet (This API is hardware dependent)

InputVoltageRangeSelect

void(* InputVoltageRangeSelect) (enum OPA_INPUT_VOLTAGE_RANGE input)

Pointer to OPAx_InputVoltageRangeSelect e.g. OPA1_InputVoltageRangeSelect.

Intitialize

void(* Intitialize) (void)

Pointer to OPAx_Initialize e.g. OPA1_Initialize.

2.16.3 File Documentation

2.16.3.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.3.1.2 Variables

2.16.3.1.3 Detailed Description

This is the generated driver header file for the OPA1 driver.

OPA1 Generated Driver Header File

2.16.3.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.3.2.2 Variables

2.16.3.2.3 Detailed Description

This is the generated driver header file for the OPA2 driver.

OPA2 Generated Driver Header File

2.16.3.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.3.3.2 Variables

2.16.3.3.3 Detailed Description

This is the generated driver header file for the OPA3 driver.

OPA3 Generated Driver Header File

2.16.3.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.3.4.1 Data structures

  • struct OPA_INTERFACE

    Structure containing the function pointers of OPA driver.

2.16.3.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