# PGA Module

The Programmable Gain Amplifier (PGA) API provides a set of functions for configuring and using the PGA module. The functions provided allow the user to setup and configure the PGA by providing access to the PGA wrapper registers.

group `pga_api`

  Defines

  `PGA_REGISTER_PGACTL` PGA_LOCK_PGACTL

    PGA Register PGACTL

  `PGA_REGISTER_GAIN3TRIM` PGA_LOCK_PGAGAIN3TRIM

    PGA Register GAIN3TRIM

  `PGA_REGISTER_GAIN6TRIM` PGA_LOCK_PGAGAIN6TRIM

    PGA Register GAIN6TRIM

  `PGA_REGISTER_GAIN12TRIM` PGA_LOCK_PGAGAIN12TRIM

    PGA Register GAIN12TRIM

  `PGA_REGISTER_GAIN24TRIM` PGA_LOCK_PGAGAIN24TRIM

    PGA Register GAIN24TRIM

  Enums

  enum `PGA_GainValue`

    Values that can be passed to PGA_setGain() as the gainValue parameter.

    Values:

    enumerator `PGA_GAIN_3` = 0x0

      PGA gain value of 3.

    enumerator `PGA_GAIN_6` = 0x20

      PGA gain value of 6.

    enumerator `PGA_GAIN_12` = 0x40

      PGA gain value of 12.

    enumerator `PGA_GAIN_24` = 0x60

      PGA gain value of 24.

  enum `PGA_LowPassResistorValue`

    Values that can be passed to PGA_setFilterResistor() as the resistorValue parameter.

    Values:

    enumerator `PGA_LOW_PASS_FILTER_DISABLED` = 0

      Low pass filter disabled (open circuit)

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_200_OHM` = 2

      Resistor value of 200 Ohm.

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_160_OHM` = 4

      Resistor value of 160 Ohm.

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_130_OHM` = 6

      Resistor value of 130 Ohm.

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_100_OHM` = 8

      Resistor value of 100 Ohm.

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_80_OHM` = 10

      Resistor value of 80 Ohm.

    enumerator `PGA_LOW_PASS_FILTER_RESISTOR_50_OHM` = 12

      Resistor value of 50 Ohm.

  Functions

  void `PGA_enable`(uint32_t base)

    Enables PGA.

    This function enables the PGA module.

    Parameters

      - `base`: is the base address of the PGA module.

    Return

      None.

  void `PGA_disable`(uint32_t base)

    Disables PGA.

    This function disables the PGA module.

    Parameters

      - `base`: is the base address of the PGA module.

    Return

      None.

  void `PGA_setGain`(uint32_t base, PGA_GainValue gainValue)

    Sets PGA gain value

    This function sets the PGA gain value.

    Parameters

      - `base`: is the base address of the PGA module.

      - `gainValue`: is the PGA gain value.

    Return

      None.

  void `PGA_setFilterResistor`(uint32_t base, PGA_LowPassResistorValue resistorValue)

    Sets PGA output filter resistor value

    This function sets the resistor value for the PGA output low pass RC filter. The resistance for the RC low pass filter is provided within the microprocessor and is determined by the value of resistorValue. The capacitor, however, has to be connected outside the microprocessor.

    Parameters

      - `base`: is the base address of the PGA module.

      - `resistorValue`: is the PGA output resistor value.

    Note: Setting a value of PGA_LOW_PASS_FILTER_RESISTOR_0_OHM will disable the internal resistance value.

    Return

      None.

  uint16_t `PGA_getPGARevision`(uint32_t base)

    Returns the PGA revision number.

    This function returns the PGA revision number.

    Parameters

      - `base`: is the base address of the PGA module.

    Return

      Returns PGA revision.

  uint16_t `PGA_getPGAType`(uint32_t base)

    Returns the PGA Type.

    This function returns the PGA Type number.

    Parameters

      - `base`: is the base address of the PGA module.

    Return

      Returns PGA type.

  void `PGA_lockRegisters`(uint32_t base, uint16_t registerType)

    Locks PGA registers.

    This function locks the PGA registers specified by registerType. Valid values for registerType are: PGA_REGISTER_PGACTL, PGA_REGISTER_GAINxTRIM, where x is 3,6,12 or 24.

    Parameters

      - `base`: is the base address of the PGA module.

      - `registerType`: is the PGA register to be locked.

    Return

      None.

The code for this module is contained in driverlib/pga.c, with driverlib/pga.h containing the API declarations for use by applications.