Digital Power Starter Kit 3 Firmware
dsPIC33C Boost Converter Voltage Mode Control Example
dev_boost_pconfig.h
1 /* Microchip Technology Inc. and its subsidiaries. You may use this software
2  * and any derivatives exclusively with Microchip products.
3  *
4  * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
5  * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
6  * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
7  * PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
8  * WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
9  *
10  * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
11  * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
12  * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
13  * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
14  * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS
15  * IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF
16  * ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
17  *
18  * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
19  * TERMS.
20  */
21 
22 /*
23  * File: dev_boost_pconfig.h
24  * Author: M91406
25  * Comments: Peripheral configuration template header file for generic boost converter driver
26  * Revision history:
27  * 1.0 initial release
28  */
29 
30 // This is a guard condition so that contents of this file are not included
31 // more than once.
32 #ifndef BOOST_CONVERTER_PERIPHERAL_CONFIGURATION_H
33 #define BOOST_CONVERTER_PERIPHERAL_CONFIGURATION_H
34 
35 #include <xc.h> // include processor files - each processor file is guarded.
36 #include <stdint.h> // include standard integer data types
37 #include <stdbool.h> // include standard boolean data types
38 #include <stddef.h> // include standard definition data types
39 
40 #include "dev_boost_typedef.h"
41 
42 /* ********************************************************************************
43  * DEVICE GPIO INSTANCE CONFIGURATION
44  * *******************************************************************************/
45 
46 extern volatile uint16_t boostGPIO_Initialize(volatile struct BOOST_CONVERTER_s* boostInstance);
47 extern volatile uint16_t boostGPIO_Set(volatile struct BOOST_GPIO_INSTANCE_s* boostGPIOInstance);
48 extern volatile uint16_t boostGPIO_Clear(volatile struct BOOST_GPIO_INSTANCE_s* boostGPIOInstance);
49 extern volatile bool boostGPIO_GetPinState(volatile struct BOOST_GPIO_INSTANCE_s* boostGPIOInstance);
50 
51 /* ********************************************************************************
52  * HIGH SPEED PWM MODULE CONFIGURATION
53  * *******************************************************************************/
54 
55 extern volatile uint16_t boostPWM_ModuleInitialize(volatile struct BOOST_CONVERTER_s* boostInstance);
56 extern volatile uint16_t boostPWM_ChannelInitialize(volatile struct BOOST_CONVERTER_s* boostInstance);
57 extern volatile uint16_t boostPWM_Start(volatile struct BOOST_CONVERTER_s* boostInstance);
58 extern volatile uint16_t boostPWM_Stop(volatile struct BOOST_CONVERTER_s* boostInstance);
59 extern volatile uint16_t boostPWM_Suspend(volatile struct BOOST_CONVERTER_s* boostInstance);
60 extern volatile uint16_t boostPWM_Resume(volatile struct BOOST_CONVERTER_s* boostInstance);
61 
62 extern volatile struct P33C_PWM_MODULE_s boostPwmModuleConfig;
63 extern volatile struct P33C_PWM_GENERATOR_s boostPwmGeneratorConfig;
64 
65 /* ********************************************************************************
66  * HIGH SPEED ADC MODULE CONFIGURATION
67  * *******************************************************************************/
68 
69 extern volatile uint16_t boostADC_ModuleInitialize(void);
70 extern volatile uint16_t boostADC_ChannelInitialize(volatile BOOST_ADC_INPUT_SETTINGS_t* adcInstance);
71 extern volatile uint16_t boostADC_Start(void);
72 
73 /* ********************************************************************************
74  * HIGH ANALOG COMPARATOR INSTANCE CONFIGURATION
75  * *******************************************************************************/
76 
77 // (not supported yet)
78 
79 #endif /* BOOST_CONVERTER_PERIPHERAL_CONFIGURATION_H */
80 
ADC input channel configuration.
GPIO instance of the converter control GPIO.
BOOST control & monitoring data structure.