MAX32675 Peripheral Driver API
Peripheral Driver API for the MAX32675
afe.h
1 
6 /*******************************************************************************
7 * Copyright (C) Maxim Integrated Products, Inc., All rights Reserved.
8 *
9 * This software is protected by copyright laws of the United States and
10 * of foreign countries. This material may also be protected by patent laws
11 * and technology transfer regulations of the United States and of foreign
12 * countries. This software is furnished under a license agreement and/or a
13 * nondisclosure agreement and may only be used or reproduced in accordance
14 * with the terms of those agreements. Dissemination of this information to
15 * any party or parties not specified in the license agreement and/or
16 * nondisclosure agreement is expressly prohibited.
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
25 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
28 *
29 * Except as contained in this notice, the name of Maxim Integrated
30 * Products, Inc. shall not be used except as stated in the Maxim Integrated
31 * Products, Inc. Branding Policy.
32 *
33 * The mere transfer of this software does not imply any licenses
34 * of trade secrets, proprietary technology, copyrights, patents,
35 * trademarks, maskwork rights, or any other form of intellectual
36 * property whatsoever. Maxim Integrated Products, Inc. retains all
37 * ownership rights.
38 *******************************************************************************
39 */
40 
41 #ifndef _AFE_H_
42 #define _AFE_H_
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /***** Includes *******/
49 #include "afe.h"
50 #include "afe_adc_zero_regs.h"
51 #include "afe_adc_one_regs.h"
52 #include "afe_dac_regs.h"
53 #include "afe_hart_regs.h"
54 #include "mxc_sys.h"
55 #include "mxc_assert.h"
56 #include "infoblock.h"
57 
58 /***** Definitions *****/
59 #define AFE_REG_ADDR_BANK_POS 23
60 #define AFE_REG_ADDR_BANK ((uint32_t)(0x03 << AFE_REG_ADDR_BANK_POS))
61 #define AFE_REG_ADDR_POS 16
62 #define AFE_REG_ADDR ((uint32_t)(0x7F << AFE_REG_ADDR_POS))
63 #define AFE_REG_ADDR_LEN_POS 0
64 #define AFE_REG_ADDR_LEN ((uint32_t)(0x07 << AFE_REG_ADDR_LEN_POS))
65 #define AFE_REG_ADDR_READ_BIT 0x80
66 #define AFE_CRC_LEN 1
67 
68 #define AFE_ADC0_BANK 0
69 #define AFE_ADC1_BANK 1
70 #define AFE_DAC_BANK 2
71 #define AFE_HART_BANK 3
72 
73 /***** Function Prototypes *****/
77 int afe_setup(void);
78 
87 int afe_write_register(uint32_t target_reg, uint32_t value);
88 
97 int afe_read_register(uint32_t target_reg, uint32_t* value);
98 
105 int afe_load_trims(void);
106 
112 void afe_dump_registers(uint32_t reg_bank);
113 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* _AFE_H_ */