Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example

Public functions of the AMP PRAL driver. More...

+ Collaboration diagram for Public Functions:

Functions

volatile struct P33C_OPA_MODULE_sp33c_OpaModule_GetHandle (void)
 Gets pointer to op-amp Module SFR set. More...
 
volatile uint16_t p33c_OpaModule_Dispose (void)
 Resets all Op-Amp Module registers to their RESET default values. More...
 
volatile struct P33C_OPA_MODULE_s p33c_OpaModule_ConfigRead (void)
 Read the current configuration from the op-amp module base registers. More...
 
volatile uint16_t p33c_OpaModule_ConfigWrite (volatile struct P33C_OPA_MODULE_s opaModuleConfig)
 Writes a user-defined configuration to the op-amp module base registers. More...
 

Variables

volatile struct P33C_OPA_MODULE_s opaModuleConfigClear
 Default RESET configuration of the op-amp module base SFRs. More...
 
volatile struct P33C_OPA_MODULE_s opaModuleDefault
 Default configuration of op-amp module running from 500 MHz input clock. More...
 

Detailed Description

Public functions of the AMP PRAL driver.

This is the detailed description of public functions of the AMP PRAL driver

Function Documentation

◆ p33c_OpaModule_ConfigRead()

struct P33C_OPA_MODULE_s p33c_OpaModule_ConfigRead ( void  )

Read the current configuration from the op-amp module base registers.

Returns
struct P33C_OPA_MODULE_s

This function reads all registers with their current configuration into a data structure of type P33C_OPA_MODULE_s. Users can read and verify or modify the configuration to write it back to the op-amp module registers.

Definition at line 72 of file p33c_opa.c.

◆ p33c_OpaModule_ConfigWrite()

uint16_t p33c_OpaModule_ConfigWrite ( volatile struct P33C_OPA_MODULE_s  opaModuleConfig)

Writes a user-defined configuration to the op-amp module base registers.

Parameters
opaModuleConfigOperation Amplifier Peripheral SFR data object of type struct P33C_OPA_MODULE_s
Returns
unsigned integer
0 = failure, writing op-amp module was not successful
1 = success, writing op-amp module was successful

This function writes a user-defined op-amp module configuration of type P33C_OPA_MODULE_s to the op-amp module base registers. The individual register configurations have to be set in user-code before calling this function. To simplify the configuration process of standard functions, this driver provides templates, which can be loaded and written directly.

Definition at line 125 of file p33c_opa.c.

+ Here is the caller graph for this function:

◆ p33c_OpaModule_Dispose()

uint16_t p33c_OpaModule_Dispose ( void  )

Resets all Op-Amp Module registers to their RESET default values.

Returns
unsigned integer
0 = failure, disposing OP-Amp module was not successful
1 = success, disposing OP-Amp module was successful

This function clears all op-amp module registers to their default values set when the device comes out of RESET.

Default configuration:

  • all operational amplifiers are turned off
  • the operational amplifier module is turned off
  • all operational amplifier negative inputs are enabled

Definition at line 72 of file p33c_opa.c.

+ Here is the call graph for this function:

◆ p33c_OpaModule_GetHandle()

struct P33C_OPA_MODULE_s * p33c_OpaModule_GetHandle ( void  )

Gets pointer to op-amp Module SFR set.

Returns
struct P33C_OPA_MODULE_s*: Pointer to op-amp module special function register set object

This function returns the pointer to a op-amp module register set Special Function Register memory space. This pointer can be used to directly write to/read from the Special Function Registers of the op-amp peripheral module configuration.

Definition at line 43 of file p33c_opa.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ opaModuleConfigClear

opaModuleConfigClear
Initial value:
= {
.AmpCon1L.value = 0x0000,
.AmpCon1H.value = 0x0000
}

Default RESET configuration of the op-amp module base SFRs.

Default configuration of the op-amp module SFRs with all its registers being reset to their default state when the device comes out of RESET. Programmers can use this template to reset (dispose) a previously used op-amp module when it's not used anymore or to ensure a known startup condition before writing individual configurations to its SFRs.

Definition at line 125 of file p33c_opa.c.

◆ opaModuleDefault

opaModuleDefault
Initial value:
= {
.AmpCon1L.value = 0x0000,
.AmpCon1H.value = 0x0007,
}

Default configuration of op-amp module running from 500 MHz input clock.

Default configuration of the op-amp module SFRs with all its registers being reset to their default state when the device comes out of RESET.

Programmers can use this template to reset a previously used op-amp module when it's not used anymore or to ensure a known startup condition before writing individual configurations to its SFRs.

Definition at line 125 of file p33c_opa.c.