0% found this document useful (0 votes)
20 views

XMC1000 RomFunctionTable

Uploaded by

Roberto Dias
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

XMC1000 RomFunctionTable

Uploaded by

Roberto Dias
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1 /*************************************************************************** */

2 /**
3 * @file XMC1000_RomFunctionTable.h
4 * Infineon XMC Device Series
5 * @version V1.0
6 * @date 08 April 2013
7 *
8 Copyright (C) 2013 Infineon Technologies AG. All rights reserved.
9 *
10 *
11 * @par
12 * Infineon Technologies AG (Infineon) is supplying this software for use with
13 * Infineon's microcontrollers. This file can be freely distributed
14 * within development tools that are supporting such microcontrollers.
15 *
16 * @par
17 * THIS SOFTWARE IS PROVIDED AS IS. NO WARRANTIES, WHETHER EXPRESS, IMPLIED
18 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
20 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
21 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
22 *
23 ******************************************************************************/
24
25 /*****************************************************************************
26 ************************* Version history ************************************
27 V1.0, 08 Jan 2013, GD, First version with XMC1000 devices
28 *****************************************************************************/
29
30 #ifndef ROM_FUNCTION_TABLE_H
31 #define ROM_FUNCTION_TABLE_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /* ***************************************************************************
38 ******************************* Constants *******************************
39 *************************************************************************** */
40 /* Start address of the ROM function table */
41 #define ROM_FUNCTION_TABLE_START (0x00000100U)
42
43 /* Pointer to Erase Flash Page routine */
44 #define _NvmErase (ROM_FUNCTION_TABLE_START + 0x00U)
45
46 /* Pointer to Erase, Program & Verify Flash Page routine */
47 #define _NvmProgVerify (ROM_FUNCTION_TABLE_START + 0x04U)
48
49 /* Pointer to Request BMI installation routine */
50 #define _BmiInstallationReq (ROM_FUNCTION_TABLE_START + 0x08U)
51
52
53 /* ***************************************************************************
54 ******************************** Enumerations ********************************
55 *************************************************************************** */
56 typedef enum TagNVMStatus
57 {
58
59 /* The function succeeded */
60 NVM_PASS = (int32_t)0x00010000U,
61
62 /* Generic error code */
63 NVM_E_FAIL = (int32_t)0x80010001U,
64
65 /* Source data not in RAM */
66 NVM_E_SRC_AREA_EXCCEED = (int32_t)0x80010003U,
67
68 /* Source data is not 4 byte aligned */
69 NVM_E_SRC_ALIGNMENT = (int32_t)0x80010004U,
70
71 /* NVM module cannot be physically accessed */
72 NVM_E_NVM_FAIL = (int32_t)0x80010005U,
73
74 /* Verification of written page not successful */
75 NVM_E_VERIFY = (int32_t)0x80010006U,
76
77 /* Destination data is not (completely) located in NVM */
78 NVM_E_DST_AREA_EXCEED = (int32_t)0x80010009U,
79
80 /* Destination data is not properly aligned */
81 NVM_E_DST_ALIGNMENT = (int32_t)0x80010010U,
82
83 } NVM_STATUS;
84
85
86 /* ***************************************************************************
87 *********************************** Macros ***********************************
88 *************************************************************************** */
89
90 /* ***************************************************************************
91 Description: Erase granularity = 1 Page of 16 blocks of 16 Bytes
92 = Equivalent to 256 Bytes using this routine.
93
94 Input
parameters:

95 – Logical address of the Flash Page to be erased which must be page aligned
96 and in NVM address range
97
98 Return status:
99 – OK (NVM_PASS)
100 – Invalid address (NVM_E_DST_ALIGNMENT or NVM_E_DST_AREA_EXCEED)
101 – Operation failed (Error during low level NVM programming driver):
102 NVM_E_FAIL
103 NVM_E_VERIFY
104 NVM_E_NVM_FAIL
105
106 Prototype:
107 NVM_STATUS XMC1000_NvmErasePage(uint32_t *pageAddr)
108 *************************************************************************** */
109 #define XMC1000_NvmErasePage (*((NVM_STATUS (**) (uint32_t * )) \
110 _NvmErase))
111
112 /* ***************************************************************************
113 Description: This procedure performs erase (skipped if not necessary), program
114 and verify of selected Flash page.
115
116 Input
parameter:

117 – Logical address of the target Flash Page, must be page aligned and in NVM
118 address range
119
120 – Address in SRAM where the data starts, must be 4-byte aligned
121
122 Return status:
123 – OK (NVM_PASS)
124 – Invalid addresses
125 NVM_E_DST_ALIGNMENT
126 NVM_E_SRC_ALIGNMENT
127 NVM_E_DST_AREA_EXCEED
128 NVM_E_SRC_AREA_EXCCEED
129 – Operation failed (Error during low level NVM programming driver):
130 NVM_E_FAIL
131 NVM_E_VERIFY
132 NVM_E_NVM_FAIL
133
134 Prototype:
135 NVM_STATUS XMC1000_NvmProgVerify(const uint32_t *srcAddr, uint32_t *dstAddr)
136 *************************************************************************** */
137 #define XMC1000_NvmProgVerify (*((NVM_STATUS (**) (const uint32_t * ,\
138 uint32_t * ))\
139 _NvmProgVerify))
140
141
142 /* ***************************************************************************
143 Description: This procedure initiates installation of a new BMI value. In
144 particular, it can be used as well as to restore the state upon delivery for a
145 device already in User Productive mode.
146
147 Input
parameter:

148 – BMI value to be installed


149
150 Return status:
151 – wrong input BMI value (0x01) - only upon error, if OK the procedure triggers
152 a reset respectively does not return to calling routine !
153
154 Prototype:
155 unsigned long XMC1000_BmiInstallationReq(unsigned short requestedBmiValue)
156 **************************************************************************** */
157 #define XMC1000_BmiInstallationReq (*((uint32_t (**) (uint16_t)) \
158 _BmiInstallationReq))
159
160 #ifdef __cplusplus
161 }
162 #endif
163
164 #endif /* ROM_FUNCTION_TABLE_H */
165

You might also like