Hilscher netX microcontroller driver  V0.0.5.0
Documentation of the netX driver package
system_netx.h
Go to the documentation of this file.
1 /**************************************************************************/
8 /*
9  * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
10  *
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the License); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */
25 
43 #ifndef __SYSTEM_NETX90_APP_H
44 #define __SYSTEM_NETX90_APP_H
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
51 #include <stdint.h>
52 
53 #define NETX_CPU_BOOTBLOCK_MAGIC 0xf3beaf00U
54 #define NETX_CPU_BOOTBLOCK_SIGNATURE 0x41505041U
55 
56 /* Define a structure for all CM4 vectors. */
57 typedef struct NETX_CPU_BOOTBLOCK_STRUCT
58 {
59  uint32_t ulMagic;
60  uint32_t ulFlashOffsetBytes;
61  uintptr_t pulNextHeader;
62  uintptr_t pulDestination;
63  uint32_t ulImageSizeDword;
64  uint32_t ulFlashSelection;
65  uint32_t ulSignature;
66  uint32_t ulReserved0;
67  uint32_t aulHash[7];
70 
71 extern uint32_t SystemCoreClock;
73 extern void (*__preinit_array_start)();
74 extern void (*__preinit_array_end)();
76 extern void (*__init_array_start)();
77 extern void (*__init_array_end)();
84 void SystemInit(void);
85 
86 typedef struct NETX_TEMP_CALIBRATION_Ttag
87 {
88  unsigned long aulCalDate[2];
89  unsigned short ulADCValue;
90  unsigned char sRefTemperature;
91  unsigned char saucReserved[9];
92  unsigned long ulCrc32;
94 
96 
97 static inline uint32_t SystemADC3V3To2V6(uint32_t ulValue){
98  return (ulValue*(33u<<14))/(26u<<14);
99 }
100 
101 #ifndef SYSTEM_TEMPERATURE_FLOATING_POINT_SUPPORT
102 
105 extern int g_TemperatureGradient;
106 
110 extern int g_TemperatureIntercept;
111 
115 void SystemTemperatureByADCValue(uint32_t ulADCValue, int* ulTempValue);
116 #else /* SYSTEM_TEMPERATURE_FLOATING_POINT_SUPPORT */
117 
120 extern float g_TemperatureGradient;
121 
125 extern float g_TemperatureIntercept;
126 
130 void SystemTemperatureByADCValue(uint32_t ulADCValue, float* TempValue);
131 #endif /* SYSTEM_TEMPERATURE_FLOATING_POINT_SUPPORT */
132 
136 typedef struct DRV_TRAMPOLINE_Ttag
137 {
138  void* target;
139  void const * source;
140  unsigned long length;
141  void (*entry)(void);
143 
145 
146 #define __VectorsSize 128u
147 
148 #ifdef NVIC_SOFT_VECTOR
149 
152 extern void* g_avpfVTOR[__VectorsSize];
153 
154 #endif
155 
159 extern void * const __Vectors[];
160 
166 void SystemCoreClockUpdate(void);
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif /* __SYSTEM_NETX90_APP_H */
void SystemTemperatureByADCValue(uint32_t ulADCValue, int *ulTempValue)
Definition: system_netx.c:90
void(* __init_array_end)()
void(* __preinit_array_end)()
DRV_TRAMPOLINE_T tPageFlasherFunction
void(* __init_array_start)()
uint32_t SystemCoreClock
Definition: system_netx.c:40
void const * source
Definition: system_netx.h:139
uint32_t ulImageSizeDword
Definition: system_netx.h:63
unsigned char sRefTemperature
Definition: system_netx.h:90
unsigned short ulADCValue
Definition: system_netx.h:89
int g_TemperatureIntercept
Definition: system_netx.c:84
#define __VectorsSize
Definition: system_netx.h:146
static uint32_t SystemADC3V3To2V6(uint32_t ulValue)
Definition: system_netx.h:97
unsigned long ulCrc32
Definition: system_netx.h:92
NETX_TEMP_CALIBRATION_T g_atTemperatureCalibrationData[2]
Definition: system_netx.c:73
int g_TemperatureGradient
Definition: system_netx.c:79
uintptr_t pulDestination
Definition: system_netx.h:62
uint32_t ulBootHeaderChecksum
Definition: system_netx.h:68
uint32_t ulFlashOffsetBytes
Definition: system_netx.h:60
void SystemCoreClockUpdate(void)
Update SystemCoreClock variable.
Definition: system_netx.c:49
DRV_TRAMPOLINE_T tPageReaderFunction
uintptr_t pulNextHeader
Definition: system_netx.h:61
uint32_t ulFlashSelection
Definition: system_netx.h:64
void SystemInit(void)
Setup the microcontroller system.
Definition: system_netx.c:247
unsigned long length
Definition: system_netx.h:140
void(* __preinit_array_start)()
void *const __Vectors[]