MAX32672 Peripheral Driver API
Peripheral Driver API for the MAX32672
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
mxc_delay.h
1
6/******************************************************************************
7 *
8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9 * Analog Devices, Inc.),
10 * Copyright (C) 2023-2024 Analog Devices, Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 ******************************************************************************/
25
26/* Define to prevent redundant inclusion */
27#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_MXC_DELAY_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_MXC_DELAY_H_
29
30#include <stdint.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
43/***** Definitions *****/
50#define MXC_DELAY_SEC(s) (((uint32_t)s) * 1000000UL)
57#define MXC_DELAY_MSEC(ms) (ms * 1000UL)
64#define MXC_DELAY_USEC(us) (us)
65
72typedef void (*mxc_delay_complete_t)(int result);
73
74/***** Function Prototypes *****/
75
84int MXC_Delay(uint32_t us);
85
98int MXC_DelayAsync(uint32_t us, mxc_delay_complete_t callback);
99
106
111void MXC_DelayAbort(void);
112
119
122#ifdef __cplusplus
123}
124#endif
125
126#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_MXC_DELAY_H_
int MXC_DelayAsync(uint32_t us, mxc_delay_complete_t callback)
Starts a non-blocking delay for the specified number of microseconds.
void(* mxc_delay_complete_t)(int result)
The callback routine used by MXC_DelayAsync() when the delay is complete or aborted early.
Definition: mxc_delay.h:72
int MXC_DelayCheck(void)
Returns the status of a non-blocking delay request.
void MXC_DelayAbort(void)
Stops an asynchronous delay previously started.
void MXC_DelayHandler(void)
Processes the delay interrupt.
int MXC_Delay(uint32_t us)
Blocks and delays for the specified number of microseconds.