|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
adc_interface.h
1
18/*
19© [2024] Microchip Technology Inc. and its subsidiaries.
20
21 Subject to your compliance with these terms, you may use Microchip
22 software and any derivatives exclusively with Microchip products.
23 You are responsible for complying with 3rd party license terms
24 applicable to your use of 3rd party software (including open source
25 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
26 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
27 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
28 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
29 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
30 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
31 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
32 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
33 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
34 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
35 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
36 THIS SOFTWARE.
37*/
38
39#ifndef ADC_INTERFACE_H
40#define ADC_INTERFACE_H
41
42// Section: Included Files
43#include <stdint.h>
44#include <stdbool.h>
45#include "adc_types.h"
46#include "../system/interrupt_types.h"
47
48#ifdef __cplusplus //Provide C++ Compatibility
49
50 extern "C" {
51
52#endif
53
54// Section: Data Type Definitions
55
61 struct ADC_INTERFACE
62{
63 void (*Initialize)(void);
65
66 void (*Deinitialize)(void);
68
69 void (*Enable)(void);
71
72 void (*Disable)(void);
74
75 void (*SoftwareTriggerEnable)(void);
77
78 void (*SoftwareTriggerDisable)(void);
80
81 void (*ChannelSelect)(enum ADC_CHANNEL channel);
83
84 uint16_t (*ConversionResultGet)(enum ADC_CHANNEL channel);
86
87 bool (*IsConversionComplete)(enum ADC_CHANNEL channel);
89
90 void (*ResolutionSet)(enum ADC_RESOLUTION_TYPE resolution);
92
93 void (*InterruptEnable)(void);
95
96 void (*InterruptDisable)(void);
98
99 void (*InterruptFlagClear)(void);
101
102 void (*InterruptPrioritySet)(uint16_t priorityValue);
104
105 void (*CommonCallbackRegister)(void (*callback)(void));
107
108 void (*Tasks)(void);
110
111 const struct ADC_MULTICORE *adcMulticoreInterface;
113
114};
115
121 struct ADC_MULTICORE
122{
123 void (*ChannelCallbackRegister)(void(*callback)(enum ADC_CHANNEL channel, uint16_t adcVal));
125
126 void (*ComparatorCallbackRegister)(void(*callback)(enum ADC_CMP comparator));
128
129 void (*ChannelTasks)(enum ADC_CHANNEL channel);
131
132 void (*ComparatorTasks)(enum ADC_CMP comparator);
134
135 void (*IndividualChannelInterruptEnable)(enum ADC_CHANNEL channel);
137
138 void (*IndividualChannelInterruptDisable)(enum ADC_CHANNEL channel);
140
141 void (*IndividualChannelInterruptFlagClear)(enum ADC_CHANNEL channel);
143
144 void (*IndividualChannelInterruptPrioritySet)(enum ADC_CHANNEL channel,enum INTERRUPT_PRIORITY priorityValue);
146
147 void (*CorePowerEnable)(enum ADC_DEDICATED_CORE core);
149
150 void (*SharedCorePowerEnable) (void);
152
153
154 void (*PWMTriggerSourceSet)(enum ADC_CHANNEL channel, enum ADC_PWM_INSTANCE pwmInstance, enum ADC_PWM_TRIGGERS triggerNumber);
156};
157
158#ifdef __cplusplus // Provide C++ Compatibility
159
160 }
161
162#endif
163
164#endif //ADC_INTERFACE_H
adc_types.h
This is the generated driver types header file for the ADC driver.
ADC_RESOLUTION_TYPE
ADC_RESOLUTION_TYPE
Definition adc_types.h:94
ADC_PWM_TRIGGERS
ADC_PWM_TRIGGERS
Definition adc_types.h:138
ADC_CMP
ADC_CMP
Definition adc_types.h:108
ADC_PWM_INSTANCE
ADC_PWM_INSTANCE
Definition adc_types.h:121
ADC_DEDICATED_CORE
ADC_DEDICATED_CORE
Definition adc_types.h:79
ADC_CHANNEL
ADC_CHANNEL
Definition adc_types.h:56
ADC_INTERFACE
Structure containing the function pointers of ADC driver.
Definition adc_interface.h:62
ADC_INTERFACE::Enable
void(* Enable)(void)
Pointer to ADCx_Enable e.g. ADC1_Enable.
Definition adc_interface.h:69
ADC_INTERFACE::adcMulticoreInterface
const struct ADC_MULTICORE * adcMulticoreInterface
Pointer to ADC_MULTICORE.
Definition adc_interface.h:111
ADC_INTERFACE::Tasks
void(* Tasks)(void)
Pointer to ADCx_Tasks e.g. ADC1_Tasks (Supported only in polling mode)
Definition adc_interface.h:108
ADC_INTERFACE::ChannelSelect
void(* ChannelSelect)(enum ADC_CHANNEL channel)
Pointer to ADCx_ChannelSelect e.g. ADC1_ChannelSelect.
Definition adc_interface.h:81
ADC_INTERFACE::ResolutionSet
void(* ResolutionSet)(enum ADC_RESOLUTION_TYPE resolution)
Pointer to ADCx_ResolutionSet e.g. ADC1_ResolutionSet.
Definition adc_interface.h:90
ADC_INTERFACE::ConversionResultGet
uint16_t(* ConversionResultGet)(enum ADC_CHANNEL channel)
Pointer to ADCx_ConversionResultGet e.g. ADC1_ConversionResultGet.
Definition adc_interface.h:84
ADC_INTERFACE::InterruptEnable
void(* InterruptEnable)(void)
Pointer to ADCx_InterruptEnable e.g. ADC1_InterruptEnable.
Definition adc_interface.h:93
ADC_INTERFACE::CommonCallbackRegister
void(* CommonCallbackRegister)(void(*callback)(void))
Pointer to ADCx_CommonCallbackRegister e.g. ADC1_CommonCallbackRegister.
Definition adc_interface.h:105
ADC_INTERFACE::InterruptPrioritySet
void(* InterruptPrioritySet)(uint16_t priorityValue)
Pointer to ADCx_InterruptPrioritySet e.g. ADC1_InterruptPrioritySet.
Definition adc_interface.h:102
ADC_INTERFACE::Disable
void(* Disable)(void)
Pointer to ADCx_Disable e.g. ADC1_Disable.
Definition adc_interface.h:72
ADC_INTERFACE::IsConversionComplete
bool(* IsConversionComplete)(enum ADC_CHANNEL channel)
Pointer to ADCx_IsConversionComplete e.g. ADC1_IsConversionComplete.
Definition adc_interface.h:87
ADC_INTERFACE::Deinitialize
void(* Deinitialize)(void)
Pointer to ADCx_Deinitialize e.g. ADC1_Deinitialize.
Definition adc_interface.h:66
ADC_INTERFACE::InterruptFlagClear
void(* InterruptFlagClear)(void)
Pointer to ADCx_InterruptFlagClear e.g. ADC1_InterruptFlagClear.
Definition adc_interface.h:99
ADC_INTERFACE::SoftwareTriggerEnable
void(* SoftwareTriggerEnable)(void)
Pointer to ADCx_SoftwareTriggerEnable e.g. ADC1_SoftwareTriggerEnable.
Definition adc_interface.h:75
ADC_INTERFACE::SoftwareTriggerDisable
void(* SoftwareTriggerDisable)(void)
Pointer to ADCx_SoftwareTriggerDisable e.g. ADC1_SoftwareTriggerDisable.
Definition adc_interface.h:78
ADC_INTERFACE::InterruptDisable
void(* InterruptDisable)(void)
Pointer to ADCx_InterruptDisable e.g. ADC1_InterruptDisable.
Definition adc_interface.h:96
ADC_INTERFACE::Initialize
void(* Initialize)(void)
Pointer to ADCx_Initialize e.g. ADC1_Initialize.
Definition adc_interface.h:63
ADC_MULTICORE
Structure containing the function pointers of ADC driver.
Definition adc_interface.h:122
ADC_MULTICORE::ComparatorCallbackRegister
void(* ComparatorCallbackRegister)(void(*callback)(enum ADC_CMP comparator))
Pointer to ADCx_ComparatorCallbackRegister e.g. ADC1_ComparatorCallbackRegister.
Definition adc_interface.h:126
ADC_MULTICORE::IndividualChannelInterruptFlagClear
void(* IndividualChannelInterruptFlagClear)(enum ADC_CHANNEL channel)
Pointer to ADCx_IndividualChannelInterruptFlagClear e.g. ADC1_IndividualChannelInterruptFlagClear.
Definition adc_interface.h:141
ADC_MULTICORE::IndividualChannelInterruptEnable
void(* IndividualChannelInterruptEnable)(enum ADC_CHANNEL channel)
Pointer to ADCx_IndividualChannelInterruptEnable e.g. ADC1_IndividualChannelInterruptEnable.
Definition adc_interface.h:135
ADC_MULTICORE::CorePowerEnable
void(* CorePowerEnable)(enum ADC_DEDICATED_CORE core)
Pointer to ADCx_CorePowerEnable e.g. ADC1_CorePowerEnable.
Definition adc_interface.h:147
ADC_MULTICORE::PWMTriggerSourceSet
void(* PWMTriggerSourceSet)(enum ADC_CHANNEL channel, enum ADC_PWM_INSTANCE pwmInstance, enum ADC_PWM_TRIGGERS triggerNumber)
Pointer to ADCx_PWMTriggerSourceSet e.g. ADC1_PWMTriggerSourceSet.
Definition adc_interface.h:154
ADC_MULTICORE::IndividualChannelInterruptDisable
void(* IndividualChannelInterruptDisable)(enum ADC_CHANNEL channel)
Pointer to ADCx_IndividualChannelInterruptDisable e.g. ADC1_IndividualChannelInterruptDisable.
Definition adc_interface.h:138
ADC_MULTICORE::ComparatorTasks
void(* ComparatorTasks)(enum ADC_CMP comparator)
Pointer to ADCx_ComparatorTasks e.g. ADC1_ComparatorTasks.
Definition adc_interface.h:132
ADC_MULTICORE::SharedCorePowerEnable
void(* SharedCorePowerEnable)(void)
Pointer to ADCx_SharedCorePowerEnable e.g. ADC1_SharedCorePowerEnable.
Definition adc_interface.h:150
ADC_MULTICORE::ChannelCallbackRegister
void(* ChannelCallbackRegister)(void(*callback)(enum ADC_CHANNEL channel, uint16_t adcVal))
Pointer to ADCx_ChannelCallbackRegister e.g. ADC1_ChannelCallbackRegister.
Definition adc_interface.h:123
ADC_MULTICORE::IndividualChannelInterruptPrioritySet
void(* IndividualChannelInterruptPrioritySet)(enum ADC_CHANNEL channel, enum INTERRUPT_PRIORITY priorityValue)
Pointer to ADCx_IndividualChannelInterruptPrioritySet e.g. ADC1_IndividualChannelInterruptPrioritySet...
Definition adc_interface.h:144
ADC_MULTICORE::ChannelTasks
void(* ChannelTasks)(enum ADC_CHANNEL channel)
Pointer to ADCx_ChannelTasks e.g. ADC1_ChannelTasks.
Definition adc_interface.h:129