MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
system_max32675.h
1/******************************************************************************
2 *
3 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
4 * Analog Devices, Inc.),
5 * Copyright (C) 2023-2024 Analog Devices, Inc.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ******************************************************************************/
20
21#ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32675_INCLUDE_SYSTEM_MAX32675_H_
22#define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32675_INCLUDE_SYSTEM_MAX32675_H_
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <stdint.h>
29
30/*----------------------------------------------------------------------------
31 Define clocks
32 *----------------------------------------------------------------------------*/
33
34/* NOTE: HIRC was previously named CRYPTO */
35#ifdef CRYPTO_FREQ
36#warning WARNING: CRYPTO_FREQ does not exist in MAX32675, replace with HIRC_FREQ!
37#define HIRC_FREQ CRYPTO_FREQ
38#endif
39
40/* NOTE: EXTCLK needs to be defined by user based on the clock they supply */
41#ifndef EXTCLK_FREQ
42#define EXTCLK_FREQ 75000000
43#endif
44
45/* NOTE: This is the nominal value for INRO. The actual value may vary from chip to chip.
46 Update if use of this oscillator requires precise timing.*/
47/* NOTE: INRO was previously named NANORING */
48#ifndef INRO_FREQ
49#define INRO_FREQ 80000
50#endif
51
52//NOTE: IPO clock bit is documented as 96MHz, but SR says this will be 100.
53#ifndef IPO_FREQ
54#define IPO_FREQ 100000000
55#endif
56
57#ifndef IBRO_FREQ
58#define IBRO_FREQ 7372800
59#endif
60
61/* NOTE: ERFO_FREQ (16MHz-32MHz) needs to be defined by user based on the clock they supply */
62#ifndef ERFO_FREQ
63#define ERFO_FREQ 16000000
64#endif
65
66#ifndef ERTCO_FREQ
67#define ERTCO_FREQ 32768
68#endif
69
70#ifndef HIRC_FREQ
71#define HIRC_FREQ IPO_FREQ
72#endif
73
74extern uint32_t SystemCoreClock;
75#ifdef PeripheralClock
76#warning PeripheralClock define is being overidden.
77#else
78#define PeripheralClock (SystemCoreClock / 2)
79#endif
80
81/*
82 * Initialize the system
83 *
84 * @brief Setup the microcontroller system.
85 * Initialize the System and update the SystemCoreClock variable.
86 */
87void SystemInit(void);
88
89/*
90 * Update SystemCoreClock variable
91 *
92 * @brief Updates the SystemCoreClock with current core Clock
93 * retrieved from cpu registers.
94 */
95void SystemCoreClockUpdate(void);
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32675_INCLUDE_SYSTEM_MAX32675_H_