MAX32680 Peripheral Driver API
Peripheral Driver API for the MAX32680
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
infoblock.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
29#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_INFOBLOCK_H_
30#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_INFOBLOCK_H_
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#if !defined(TRUE) || !defined(FALSE)
37#define TRUE 1
38#define FALSE 0
39#endif
56#define INFOBLOCK_LINE_SIZE 8
57
61#define INFOBLOCK_LINE_OVERHEAD 2
62
66#define INFOBLOCK_ICE_LOCK_SIZE 8
67
71#define INFOBLOCK_WRITE_LOCK_LINE_SIZE 16
72
76#define ICELOCK_UNMODIFIED_VALUE 0xFFFF
77
81#define ICELOCK_EVEN_LOCK_VALUE 0xA5A5
82
86#define ICELOCK_ODD_LOCK_VALUE 0x5A5A
87
92#define INFOBLOCK_MAXIMUM_READ_LENGTH 64
93
97#define INFOBLOCK_USN_OFFSET 0x00
98
103#define INFOBLOCK_ICE_LOCK_OFFSET 0x30
104
108#define INFOBLOCK_ICE_LOCK_MINIMUM 1
109
113#define INFOBLOCK_KEY_OFFSET 0x1000
118#define INFOBLOCK_KEY_SIZE 64
119
125#define INFOBLOCK_ENABLE_SIZE (8)
126
130#define INFOBLOCK_ENABLE_PATTERN 0x5A5AA5A5
131
141typedef enum {
146
156uint16_t crc15_highbitinput(uint16_t crc15val, uint8_t *input, int bitlength);
157
165int infoblock_readraw(uint32_t offset, uint8_t *data);
166
180int infoblock_read(uint32_t offset, uint8_t *data, int length);
181
184#ifdef __cplusplus
185}
186#endif
187
188#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_INFOBLOCK_H_
int infoblock_read(uint32_t offset, uint8_t *data, int length)
infoblock_read Read formatted data from information block
int infoblock_readraw(uint32_t offset, uint8_t *data)
infoblock_readraw Read raw data from information block
uint16_t crc15_highbitinput(uint16_t crc15val, uint8_t *input, int bitlength)
crc15_highbitinput Calculate CRC15 on data bits
lineformat_e
Three information block line types.
Definition: infoblock.h:141
@ INFOBLOCK_LINE_FORMAT_DESIGN
Definition: infoblock.h:144
@ INFOBLOCK_LINE_FORMAT_USN
Definition: infoblock.h:142
@ INFOBLOCK_LINE_FORMAT_RAW
Definition: infoblock.h:143