 |
MAX32665 Peripheral Driver API
Peripheral Driver API for the MAX32665
|
58 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN0 ((uint32_t)(0x00000000UL))
60 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN1 ((uint32_t)(0x00000001UL))
61 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN2 ((uint32_t)(0x00000002UL))
62 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN3 ((uint32_t)(0x00000003UL))
63 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN4 ((uint32_t)(0x00000004UL))
64 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN5 ((uint32_t)(0x00000005UL))
65 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN6 ((uint32_t)(0x00000006UL))
66 #define MXC_V_ADC_CTRL_ADC_CHSEL_AIN7 ((uint32_t)(0x00000007UL))
67 #define MXC_V_ADC_CTRL_ADC_CHSEL_VCOREA ((uint32_t)(0x00000008UL))
68 #define MXC_V_ADC_CTRL_ADC_CHSEL_VCOREB ((uint32_t)(0x00000009UL))
69 #define MXC_V_ADC_CTRL_ADC_CHSEL_VRXOUT ((uint32_t)(0x0000000AUL))
70 #define MXC_V_ADC_CTRL_ADC_CHSEL_VTXOUT ((uint32_t)(0x0000000BUL))
71 #define MXC_V_ADC_CTRL_ADC_CHSEL_VDDA ((uint32_t)(0x0000000CUL))
72 #define MXC_V_ADC_CTRL_ADC_CHSEL_VDDB ((uint32_t)(0x0000000DUL))
73 #define MXC_V_ADC_CTRL_ADC_CHSEL_VDDI0 ((uint32_t)(0x0000000EUL))
74 #define MXC_V_ADC_CTRL_ADC_CHSEL_VDDI0H ((uint32_t)(0x0000000FUL))
75 #define MXC_V_ADC_CTRL_ADC_CHSEL_VREGI ((uint32_t)(0x00000010UL))
95 MXC_ADC_CH_VCOREB = MXC_V_ADC_CTRL_ADC_CHSEL_VCOREB,
98 MXC_ADC_CH_VDDA = MXC_V_ADC_CTRL_ADC_CHSEL_VDDA,
99 MXC_ADC_CH_VDDB = MXC_V_ADC_CTRL_ADC_CHSEL_VDDB,
100 MXC_ADC_CH_VDDIO = MXC_V_ADC_CTRL_ADC_CHSEL_VDDI0,
101 MXC_ADC_CH_VDDIOH = MXC_V_ADC_CTRL_ADC_CHSEL_VDDI0H,
102 MXC_ADC_CH_VREGI = MXC_V_ADC_CTRL_ADC_CHSEL_VREGI,
@ MXC_ADC_CH_7
VDD18 input select.
Definition: adc.h:93
@ MXC_ADC_SCALE_1
ADC Scale by 1x (no scaling)
Definition: adc.h:124
void MXC_ADC_EnableInt(uint32_t flags)
Enable specific ADC interrupts.
int MXC_ADC_GetMonitorChannel(mxc_adc_monitor_t monitor)
Get the channel used by a monitor.
@ MXC_ADC_CH_0
Select Channel 0.
Definition: adc.h:86
@ MXC_ADC_SCALE_2X
ADC Scale by 2x (this scales ADC Reference by 1/2)
Definition: adc.h:123
int MXC_ADC_GetMonitorLowThreshold(mxc_adc_monitor_t monitor)
Set the low limit for a specific monitor.
int MXC_ADC_GetConversionSpeed(void)
Gets the current ADC conversion speed.
void MXC_ADC_EnableMonitor(mxc_adc_monitor_t monitor)
Enable channel high/low monitor.
int highThreshold
High Threshold for monitor (RAW ADC counts)
Definition: adc.h:153
@ MXC_ADC_CH_VRXOUT
VRTC divided by 2.
Definition: adc.h:96
int MXC_ADC_Handler(void)
Call this function from the ADC ISR when using Async API functions.
int MXC_ADC_GetData(uint16_t *outdata)
Gets the result from the previous ADC conversion.
int MXC_ADC_GetMonitorHighThreshold(mxc_adc_monitor_t monitor)
Set the high limit for a specific monitor.
@ MXC_ADC_SCALE_8
ADC Scale by 1/8 (this uses 1/4 and an additional 1/2 scaling)
Definition: adc.h:129
@ MXC_ADC_CH_4
Channel 0 divided by 5.
Definition: adc.h:90
void(* mxc_adc_monitor_cb_t)(void *req, int error)
Callback used when a monitor detects that a channel has reached a limit.
Definition: adc.h:142
int MXC_ADC_ConvertAsync(mxc_adc_conversion_req_t req)
Perform a conversion on a specific channel.
mxc_adc_chsel_t channel
Channel to use.
Definition: adc.h:151
int MXC_ADC_Shutdown(void)
Shuts down the ADC.
void MXC_ADC_DisableInt(uint32_t flags)
Disable specific ADC interrupts.
void MXC_ADC_SetExtScale(mxc_adc_scale_t scale)
Sets the scaling used for conversions on external channels.
mxc_adc_monitor_cb_t callback
Function to call when the channel crosses threshold.
Definition: adc.h:154
@ MXC_ADC_CH_5
Channel 1 divided by 5.
Definition: adc.h:91
int MXC_ADC_Busy(void)
Checks if the ADC is busy (performing a conversion)
void MXC_ADC_MonitorAsync(mxc_adc_monitor_req_t req)
Monitor a specific channel for an out of range event.
int MXC_ADC_Init(void)
Performs the ADC startup procedure.
void MXC_ADC_DisableMonitorAsync(mxc_adc_monitor_t monitor)
Disable a callback for a monitor.
@ MXC_ADC_SCALE_2
ADC Scale by 1/2.
Definition: adc.h:125
@ MXC_ADC_SCALE_3
ADC Scale by 1/3.
Definition: adc.h:126
@ MXC_ADC_CH_1
Select Channel 1.
Definition: adc.h:87
int MXC_ADC_StartConversion(mxc_adc_chsel_t channel)
Perform a conversion on a specific channel.
int MXC_ADC_Convert(mxc_adc_conversion_req_t *req)
Perform a conversion on a specific channel.
mxc_adc_monitor_t
Enumeration type for the ADC Monitors 4 Monitors exist and can be mapped to any ADC channels.
Definition: adc.h:110
Used to set up channel for conversion.
Definition: adc.h:161
@ MXC_ADC_CH_VCOREA
VDD12 input select.
Definition: adc.h:94
#define MXC_V_ADC_CTRL_ADC_CHSEL_AIN0
< Macros to select ADC channels
Definition: adc.h:59
mxc_adc_chsel_t
Enumeration type for the ADC Input Channels.
Definition: adc.h:85
void MXC_ADC_SetMonitorLowThreshold(mxc_adc_monitor_t monitor, uint32_t threshold)
Set the low limit for a specific monitor.
void MXC_ADC_SetDataAlignment(int msbJustify)
Set the data alignment.
@ MXC_ADC_CH_2
Select Channel 2.
Definition: adc.h:88
void MXC_ADC_EnableMonitorAsync(mxc_adc_monitor_t monitor, mxc_adc_monitor_cb_t callback)
Set a callback to be called when a monitor goes out of range.
mxc_adc_scale_t
Enumeration type for ADC Scale values Internal ADC channels automatically use the most appropriate sc...
Definition: adc.h:122
int MXC_ADC_StartConversionAsync(mxc_adc_chsel_t channel, mxc_adc_complete_cb_t callback)
Perform a conversion on a specific channel.
@ MXC_ADC_CH_3
Select Channel 3.
Definition: adc.h:89
void MXC_ADC_Monitor(mxc_adc_monitor_req_t req)
Monitor a specific channel for an out of range event.
@ MXC_ADC_SCALE_4
ADC Scale by 1/4.
Definition: adc.h:127
void MXC_ADC_ClearFlags(uint32_t flags)
Performs the ADC startup procedure.
Used to set up a monitor to watch a channel.
Definition: adc.h:148
@ MXC_ADC_CH_6
VDDB divided by 4.
Definition: adc.h:92
int MXC_ADC_GetFlags(void)
Performs the ADC startup procedure.
mxc_adc_monitor_t monitor
Monitor to use.
Definition: adc.h:149
int lowThreshold
Low Threshold for monitor (RAW ADC counts)
Definition: adc.h:152
void MXC_ADC_DisableMonitor(mxc_adc_monitor_t monitor)
Disable channel high/low monitor.
void MXC_ADC_SetMonitorChannel(mxc_adc_monitor_t monitor, mxc_adc_chsel_t channel)
Set a monitor to use a specific channel.
int MXC_ADC_StartConversionDMA(mxc_adc_chsel_t channel, uint16_t *data, void(*callback)(int, int))
Perform a conversion on a specific channel.
mxc_adc_scale_t scale
Channel scale to use (if external channel)
Definition: adc.h:150
void(* mxc_adc_complete_cb_t)(void *req, int error)
Callback used when a conversion event is complete.
Definition: adc.h:136
@ MXC_ADC_CH_VTXOUT
TMON input select.
Definition: adc.h:97
int rawADCValue
Result of the conversion.
Definition: adc.h:164
void MXC_ADC_SetMonitorHighThreshold(mxc_adc_monitor_t monitor, uint32_t threshold)
Set the high limit for a specific monitor.
@ MXC_ADC_SCALE_6
ADC Scale by 1/6 (this uses 1/3 and an additional 1/2 scaling)
Definition: adc.h:128
mxc_adc_complete_cb_t callback
Function to call when callback is complete.
Definition: adc.h:165
int MXC_ADC_SetConversionSpeed(uint32_t hz)
Sets the ADC conversion speed.