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

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

+ Collaboration diagram for Public Functions:

Functions

volatile struct P33C_DAC_MODULE_sp33c_DacModule_GetHandle (void)
 Gets pointer to DAC Module SFR set. More...
 
volatile uint16_t p33c_DacModule_Dispose (void)
 Resets all DAC Module registers to their RESET default values. More...
 
volatile struct P33C_DAC_MODULE_s p33c_DacModule_ConfigRead (void)
 Read the current configuration from the DAC module base registers. More...
 
volatile uint16_t p33c_DacModule_ConfigWrite (volatile struct P33C_DAC_MODULE_s dacModuleConfig)
 Writes a user-defined configuration to the DAC module base registers. More...
 
volatile struct P33C_DAC_INSTANCE_sp33c_DacInstance_GetHandle (volatile uint16_t dacInstance)
 Gets pointer to DAC Instance SFR set. More...
 
volatile uint16_t p33c_DacInstance_Dispose (volatile uint16_t dacInstance)
 Resets all DAC Instance registers to their RESET default values. More...
 
volatile struct P33C_DAC_INSTANCE_s p33c_DacInstance_ConfigRead (volatile uint16_t dacInstance)
 Read the current configuration from the DAC instance registers. More...
 
volatile uint16_t p33c_DacInstance_ConfigWrite (volatile uint16_t dacInstance, volatile struct P33C_DAC_INSTANCE_s dacConfig)
 Writes a user-defined configuration to the DAC instance registers. More...
 

Detailed Description

Public functions of the DAC PRAL driver.

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

Function Documentation

◆ p33c_DacInstance_ConfigRead()

volatile struct P33C_DAC_INSTANCE_s p33c_DacInstance_ConfigRead ( volatile uint16_t  dacInstance)

Read the current configuration from the DAC instance registers.

Parameters
dacInstanceIndex of the selected DAC Instance (1=DAC1, 2=DAC2, etc.)
Returns
DAC instance object of type struct P33C_DAC_INSTANCE_s of the selected DAC instance

This function reads all registers with their current configuration into a data structure of type P33C_DAC_INSTANCE_s. Users can read and verify or modify the configuration to write it back to the DAC instance
registers or copy configurations to other instances of the same type.

Definition at line 197 of file p33c_dac.c.

◆ p33c_DacInstance_ConfigWrite()

volatile uint16_t p33c_DacInstance_ConfigWrite ( volatile uint16_t  dacInstance,
volatile struct P33C_DAC_INSTANCE_s  dacConfig 
)

Writes a user-defined configuration to the DAC instance registers.

Parameters
dacInstanceIndex of the selected DAC Instance (1=DAC1, 2=DAC2, etc.)
dacConfigDAC instance object of type struct P33C_DAC_INSTANCE_s of the selected DAC instance
Returns
0 = failure, writing DAC instance was not successful
1 = success, writing DAC instance was successful

This function writes a user-defined DAC instance configuration of type P33C_DAC_INSTANCE_s to the DAC instance 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 252 of file p33c_dac.c.

+ Here is the caller graph for this function:

◆ p33c_DacInstance_Dispose()

volatile uint16_t p33c_DacInstance_Dispose ( volatile uint16_t  dacInstance)

Resets all DAC Instance registers to their RESET default values.

Parameters
dacInstanceIndex of the selected DAC Instance (1=DAC1, 2=DAC2, etc.)
Returns
0 = failure, disposing DAC instance was not successful
1 = success, disposing DAC instance was successful

This function clears all DAC instance registers to their default values set when the device comes out of RESET.

Default configuration:

  • all outputs are set to logic functions
  • all analog functions are disabled
  • all pull-up and pull-down resistors are disabled
  • all DACs are operating in push-pull mode (open drain disabled)
  • all DACs are configured as input with their signal level HIGH

Definition at line 197 of file p33c_dac.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ p33c_DacInstance_GetHandle()

volatile struct P33C_DAC_INSTANCE_s * p33c_DacInstance_GetHandle ( volatile uint16_t  dacInstance)

Gets pointer to DAC Instance SFR set.

Parameters
dacInstanceIndex of the selected DAC Instance (1=DAC1, 2=DAC2, etc.)
Returns
DAC instance object of type struct P33C_DAC_INSTANCE_s of the selected DAC instance

This function returns the pointer to a DAC instance register set in Special Function Register memory space. This pointer can be used to directly write to/read from the Special Function Registers of a given peripheral instance.

Definition at line 165 of file p33c_dac.c.

+ Here is the caller graph for this function:

◆ p33c_DacModule_ConfigRead()

volatile struct P33C_DAC_MODULE_s p33c_DacModule_ConfigRead ( void  )

Read the current configuration from the DAC module base registers.

Parameters
void
Returns
0 = failure, reading DAC module was not successful (returns NULL)
n = success, reading DAC module was successful (returns 16-bit wide pointer)

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

Definition at line 75 of file p33c_dac.c.

◆ p33c_DacModule_ConfigWrite()

volatile uint16_t p33c_DacModule_ConfigWrite ( volatile struct P33C_DAC_MODULE_s  dacModuleConfig)

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

Parameters
dacModuleConfigDigital-to-Analog converter module configuration of type struct P33C_DAC_MODULE_s
Returns
0 = failure, writing DAC module was not successful
1 = success, writing DAC module was successful

This function writes a user-defined DAC module configuration of type P33C_DAC_MODULE_s to the DAC 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 129 of file p33c_dac.c.

+ Here is the caller graph for this function:

◆ p33c_DacModule_Dispose()

volatile uint16_t p33c_DacModule_Dispose ( void  )

Resets all DAC Module registers to their RESET default values.

Parameters
void
Returns
0 = failure, disposing DAC module was not successful
1 = success, disposing DAC module was successful

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

Default configuration:

  • all outputs are set to logic functions
  • all analog functions are disabled
  • all pull-up and pull-down resistors are disabled
  • all DACs are operating in push-pull mode (open drain disabled)
  • all DACs are configured as input with their signal level HIGH

Definition at line 75 of file p33c_dac.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ p33c_DacModule_GetHandle()

volatile struct P33C_DAC_MODULE_s * p33c_DacModule_GetHandle ( void  )

Gets pointer to DAC Module SFR set.

Parameters
void
Returns
struct P33C_DAC_MODULE_s Pointer to DAC module special function register set object

This function returns the pointer to a DAC 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 DAC peripheral module configuration.

Definition at line 44 of file p33c_dac.c.

+ Here is the caller graph for this function: