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

dev_boost_substates.h
1
33 /*
34 * File: dev_boost_substates.h
35 * Author: M91406
36 * Comments: Boost converter operation states header file
37 * Revision history:
38 * 10/28/20 1.0 initial version
39 */
40
41 // This is a guard condition so that contents of this file are not included
42 // more than once.
43 #ifndef BOOST_CONVERTER_OPERATION_SUBSTATES_H
44 #define BOOST_CONVERTER_OPERATION_SUBSTATES_H
45
46 #include <xc.h> // include processor files - each processor file is guarded.
47 #include <stdint.h> // include standard integer data types
48 #include <stdbool.h> // include standard boolean data types
49
50 /***********************************************************************************
51 * @ingroup lib-layer-boost-state-machine-properties-variables
52 * @var volatile uint16_t (*BoostConverterRampUpSubStateMachine[])(volatile struct BOOST_CONVERTER_s *boostInstance)
53 * @brief Function pointer array of boost converter startup sub-states
54 * @details
55 * The function pointer list BoostConverterRampUpSubStateMachine[] is providing
56 * access to a list of state functions. Each function mapped into this array
57 * as function pointer represents a self-contained, independent sub-state.
58 * The main state machine will call functions from this list in order of their
59 * index within the array, starting from '0'. While this list is executed, the
60 * calling main state is transparent by passing through the return value of the
61 * most recent sub-state. Once all sub-states have been executed, the calling main
62 * state will return the COMPLETE flag, allowing the main state machine to move on.
63 *
64 * Each function needs to be called by handing over a parameter of type
65 *
66 * - struct BOOST_CONVERTER_s
67 *
68 * Each function returns of type unsigned integer:
69 *
70 * - 0 = BOOST_OPSRET_ERROR
71 * - 1 = BOOST_OPSRET_COMPLETE
72 * - 2 = BOOST_OPSRET_REPEAT
73 *
74 **********************************************************************************/
75
76 extern volatile uint16_t (*BoostConverterRampUpSubStateMachine[])
77 (volatile struct BOOST_CONVERTER_s *boostInstance);
78
79 /***********************************************************************************
80 * @var volatile uint16_t BoostRampUpSubStateList_size
81 * @ingroup lib-layer-boost-state-machine-properties-variables
82 * @brief Boost converter sub-state machine function pointer array size
83 **********************************************************************************/
84
85 extern volatile uint16_t BoostRampUpSubStateList_size;
86
87
88 #endif /* BOOST_CONVERTER_OPERATION_SUBSTATES_H */
89
BOOST_CONVERTER_s
BOOST control & monitoring data structure.
Definition: dev_boost_typedef.h:527