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

Functions of the second library layer. More...

+ Collaboration diagram for Functions:

Functions

volatile uint16_t buckPWM_ModuleInitialize (volatile struct BUCK_CONVERTER_s *buckInstance)
 Initializes the buck PWM module by resetting its registers to default. More...
 
volatile uint16_t buckPWM_ChannelInitialize (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function initializes the output pins for the PWM output and the default buck PWM settings. More...
 
volatile uint16_t buckPWM_Start (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function enables the buck PWM operation. More...
 
volatile uint16_t buckPWM_Stop (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function stops the buck PWM output. More...
 
volatile uint16_t buckPWM_Suspend (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function disables the PWM generator IOs. More...
 
volatile uint16_t buckPWM_Resume (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function resumes the buck PWM operation. More...
 
volatile uint16_t buckADC_ModuleInitialize (void)
 This fucntion initializes the buck by resetting all its registers to default. More...
 
volatile uint16_t buckADC_ChannelInitialize (volatile struct BUCK_ADC_INPUT_SETTINGS_s *adcInstance)
 This function initializes the settings for the ADC channel. More...
 
volatile uint16_t buckADC_Start (void)
 This function enables the ADC module and starts the ADC cores analog inputs for the required input signals. More...
 
volatile uint16_t buckGPIO_Set (volatile struct BUCK_GPIO_INSTANCE_s *buckGPIOInstance)
 This function sets the selected general purpose input/ouput pins. More...
 
volatile uint16_t buckGPIO_Clear (volatile struct BUCK_GPIO_INSTANCE_s *buckGPIOInstance)
 This function clears the selected general purpose input/output pin. More...
 
volatile bool buckGPIO_GetPinState (volatile struct BUCK_GPIO_INSTANCE_s *buckGPIOInstance)
 This function gets the state of the selected pin. More...
 
volatile uint16_t buckGPIO_Initialize (volatile struct BUCK_CONVERTER_s *buckInstance)
 This function initializes the buck input pins. More...
 
volatile uint16_t buckGPIO_PrivateInitialize (volatile struct BUCK_GPIO_INSTANCE_s *buckGPIOInstance)
 This function sets the pin as input or output. More...
 

Detailed Description

Functions of the second library layer.

This is the detailed description of public functions of the peripheral configuration module of the buck converter device driver library.

Function Documentation

◆ buckADC_ChannelInitialize()

uint16_t buckADC_ChannelInitialize ( volatile struct BUCK_ADC_INPUT_SETTINGS_s adcInstance)

This function initializes the settings for the ADC channel.

Parameters
adcInstancePointer to an ADC Input Configuration data object of type struct BUCK_ADC_INPUT_SETTINGS_s
Returns
unsigned integer (0=failure, 1=success)

This function initializes the ADC input registers based on the selected ADC channel. This function sets the input channel trigger source, input mode, and the ADC core connected to the selected channel.

Definition at line 528 of file dev_buck_pconfig.c.

+ Here is the caller graph for this function:

◆ buckADC_ModuleInitialize()

uint16_t buckADC_ModuleInitialize ( void  )

This fucntion initializes the buck by resetting all its registers to default.

Parameters
void
Returns
unsigned integer (0=failure, 1=success)

The ADC initialization covers basic configurations like data format, clock sources and dividers as well as specific configurations for ADC cores. These settings are general, basic settings and not related to specific analog inputs. The standard configuration set here sets up the ADC module and ADC cores for maximum performance.

Definition at line 429 of file dev_buck_pconfig.c.

+ Here is the caller graph for this function:

◆ buckADC_Start()

uint16_t buckADC_Start ( void  )

This function enables the ADC module and starts the ADC cores analog inputs for the required input signals.

Parameters
void
Returns
unsigned integer (0=failure, 1=success)

This function enables the ADC module, powers-up and enables the ADC cores used and waits until ADC cores are ready.

Definition at line 622 of file dev_buck_pconfig.c.

+ Here is the caller graph for this function:

◆ buckGPIO_Clear()

uint16_t buckGPIO_Clear ( volatile struct BUCK_GPIO_INSTANCE_s buckGPIOInstance)

This function clears the selected general purpose input/output pin.

Parameters
buckGPIOInstancePointer to a GPIO instance data object of type struct BUCK_GPIO_INSTANCE_s
Returns
unsigned integer (0=failure, 1=success)

This function captures the pin that the use desired to be put in inactive state.

Definition at line 688 of file dev_buck_pconfig.c.

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

◆ buckGPIO_GetPinState()

bool buckGPIO_GetPinState ( volatile struct BUCK_GPIO_INSTANCE_s buckGPIOInstance)

This function gets the state of the selected pin.

Parameters
buckGPIOInstancePointer to a GPIO instance data object of type struct BUCK_GPIO_INSTANCE_s
Returns
unsigned integer (0=failure, 1=success)

This function captures the selected pin and read its state.

Definition at line 723 of file dev_buck_pconfig.c.

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

◆ buckGPIO_Initialize()

uint16_t buckGPIO_Initialize ( volatile struct BUCK_CONVERTER_s buckInstance)

This function initializes the buck input pins.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function initializes the ENABLE input pin and POWER GOOD output pin using the buck GPIO_PrivateInitialize (URL = buckGPIO_PrivateInitialize).

Definition at line 754 of file dev_buck_pconfig.c.

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

◆ buckGPIO_PrivateInitialize()

volatile uint16_t buckGPIO_PrivateInitialize ( volatile struct BUCK_GPIO_INSTANCE_s buckGPIOInstance)

This function sets the pin as input or output.

Parameters
buckGPIOInstancePointer to a GPIO instance data object of type struct BUCK_GPIO_INSTANCE_s
Returns
unsigned integer (0=failure, 1=success)

This function captures the user selected pin then set the pin to inactive and set it as digital input or output pin.

Definition at line 786 of file dev_buck_pconfig.c.

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

◆ buckGPIO_Set()

uint16_t buckGPIO_Set ( volatile struct BUCK_GPIO_INSTANCE_s buckGPIOInstance)

This function sets the selected general purpose input/ouput pins.

Parameters
buckGPIOInstancePointer to a GPIO instance data object of type struct BUCK_GPIO_INSTANCE_s
Returns
unsigned integer (0=failure, 1=success)

This function captures the user selected pin to be activated through LAT register.

Definition at line 653 of file dev_buck_pconfig.c.

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

◆ buckPWM_ChannelInitialize()

uint16_t buckPWM_ChannelInitialize ( volatile struct BUCK_CONVERTER_s buckInstance)

This function initializes the output pins for the PWM output and the default buck PWM settings.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function initializes the buck PWM channel with default values for maximum performance.

Default configuration:

  • selected PWM outputs are enabled
  • PWM timing settings are loaded (i.e., duty cycle, period, dead-times, blanking)
  • PWM synchronization is established

Definition at line 110 of file dev_buck_pconfig.c.

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

◆ buckPWM_ModuleInitialize()

uint16_t buckPWM_ModuleInitialize ( volatile struct BUCK_CONVERTER_s buckInstance)

Initializes the buck PWM module by resetting its registers to default.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function initializes the buck PWM module base registers with default values for maximum performance.

Default configuration:

  • all PWM peripheral power is enabled
  • all PWM generators are disabled
  • default PWM Module configurations are written in buck PWM module base registers

Definition at line 54 of file dev_buck_pconfig.c.

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

◆ buckPWM_Resume()

uint16_t buckPWM_Resume ( volatile struct BUCK_CONVERTER_s buckInstance)

This function resumes the buck PWM operation.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

THis function updates the PWM timing bit and the PWM output pins are enabled.

Definition at line 369 of file dev_buck_pconfig.c.

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

◆ buckPWM_Start()

uint16_t buckPWM_Start ( volatile struct BUCK_CONVERTER_s buckInstance)

This function enables the buck PWM operation.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function starts the operation of the buck PWM by enabling the PWM generator and its output pins.

Definition at line 212 of file dev_buck_pconfig.c.

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

◆ buckPWM_Stop()

uint16_t buckPWM_Stop ( volatile struct BUCK_CONVERTER_s buckInstance)

This function stops the buck PWM output.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function shuts down the PWM output by disabling all PWM channels of the recent buck converter object, overriding the output pins and resetting the buck PWM duty cycle to its minimum duty ratio.

If the Power Good output is enabled, this output pin will also be reset.

Definition at line 281 of file dev_buck_pconfig.c.

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

◆ buckPWM_Suspend()

uint16_t buckPWM_Suspend ( volatile struct BUCK_CONVERTER_s buckInstance)

This function disables the PWM generator IOs.

Parameters
buckInstancePointer to a Buck Converter data object of type struct BUCK_CONVERTER_s
Returns
unsigned integer (0=failure, 1=success)

This function suspends the buck PWM operation by disabling all PWM outputs of the recent buck converter configuration, overriding the PWM output pins and setting the duty cycle to 0.

Definition at line 327 of file dev_buck_pconfig.c.

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