MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
afe.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#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_AFE_H_
27#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_AFE_H_
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/***** Includes *******/
34#include "afe.h"
35#include "afe_adc_zero_regs.h"
36#include "afe_adc_one_regs.h"
37#include "afe_dac_regs.h"
38#include "afe_hart_regs.h"
39#include "tmr.h"
40#include "mxc_sys.h"
41#include "mxc_assert.h"
42#include "infoblock.h"
43
44/***** Definitions *****/
45#define AFE_REG_ADDR_BANK_POS 23
46#define AFE_REG_ADDR_BANK ((uint32_t)(0x03 << AFE_REG_ADDR_BANK_POS))
47#define AFE_REG_ADDR_POS 16
48#define AFE_REG_ADDR ((uint32_t)(0x7F << AFE_REG_ADDR_POS))
49#define AFE_REG_ADDR_LEN_POS 0
50#define AFE_REG_ADDR_LEN ((uint32_t)(0x07 << AFE_REG_ADDR_LEN_POS))
51#define AFE_REG_ADDR_READ_BIT 0x80
52#define AFE_CRC_LEN 1
53
54#define AFE_ADC0_BANK 0
55#define AFE_ADC1_BANK 1
56#define AFE_DAC_BANK 2
57#define AFE_HART_BANK 3
58
59/***** Function Prototypes *****/
64int afe_setup(mxc_tmr_regs_t *tmr);
65
70void afe_reset(void);
71
80int afe_write_register(uint32_t target_reg, uint32_t value);
81
91int afe_bank_write_register(uint32_t target_reg, uint8_t reg_bank, uint32_t value);
92
101int afe_read_register(uint32_t target_reg, uint32_t *value);
102
112int afe_bank_read_register(uint32_t target_reg, uint8_t reg_bank, uint32_t *value);
113
121int afe_load_trims(mxc_tmr_regs_t *tmr);
122
128void afe_dump_registers(uint32_t reg_bank);
129
132#ifdef __cplusplus
133}
134#endif
135
136#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_AFE_H_
Registers, Bit Masks and Bit Positions for the AFE_ADC_ONE Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_ADC_ZERO Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_DAC Peripheral Module.
Registers, Bit Masks and Bit Positions for the AFE_HART Peripheral Module.
Definition: tmr_regs.h:76