NHS31xx SW API
event_dft.h
1 /*
2  * Copyright 2017-2019 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
12 #ifndef __EVENT_DFT_H_
13 #define __EVENT_DFT_H_
14 
49 #include "chip.h"
50 
51 #ifndef EVENT_EEPROM_FIRST_ROW
52 
58  #define EVENT_EEPROM_FIRST_ROW (1024 / EEPROM_ROW_SIZE)
59 #endif
60 #if !(EVENT_EEPROM_FIRST_ROW >= 0) || !(EVENT_EEPROM_FIRST_ROW < EEPROM_NR_OF_RW_ROWS)
61  #error Invalid value for EVENT_EEPROM_FIRST_ROW
62 #endif
63 
64 #ifndef EVENT_EEPROM_LAST_ROW
65 
71  #define EVENT_EEPROM_LAST_ROW (EVENT_EEPROM_FIRST_ROW + (1024 / EEPROM_ROW_SIZE) - 1)
72 #endif
73 #if !(EVENT_EEPROM_LAST_ROW >= EVENT_EEPROM_FIRST_ROW) || !(EVENT_EEPROM_LAST_ROW < EEPROM_NR_OF_RW_ROWS)
74  #error Invalid value for EVENT_EEPROM_LAST_ROW
75 #endif
76 
78 #define EVENT_EEPROM_ROW_COUNT (EVENT_EEPROM_LAST_ROW - EVENT_EEPROM_FIRST_ROW + 1)
79 
81 #define EVENT_EEPROM_SIZE (EVENT_EEPROM_ROW_COUNT * EEPROM_ROW_SIZE)
82 
83 /* ------------------------------------------------------------------------- */
84 
85 #ifdef EVENT_CB
86  #undef EVENT_CB_SELF_DEFINED
87 #else
88 
92  #define EVENT_CB_SELF_DEFINED 1
93 
99  #define EVENT_CB DummyEventCb
100 #endif
101 
107 #define EVENT_CB_OPENING_INDEX 0xFFFFFFFE
108 
109 #ifndef EVENT_CB_OPENING_CALL
110 
121  #define EVENT_CB_OPENING_CALL 0
122 #endif
123 
129 #define EVENT_CB_CLOSING_INDEX 0xFFFFFFFF
130 
131 #ifndef EVENT_CB_CLOSING_CALL
132 
143  #define EVENT_CB_CLOSING_CALL 0
144 #endif
145 
153 #define EVENT_OVERHEAD_CHOICE_A 0x41
154 
162 #define EVENT_OVERHEAD_CHOICE_B 0x42
163 
171 #define EVENT_OVERHEAD_CHOICE_C 0x43
172 
180 #define EVENT_OVERHEAD_CHOICE_D 0x44
181 
189 #define EVENT_OVERHEAD_CHOICE_E 0x45
190 
191 #ifndef EVENT_OVERHEAD_CHOICE
192 
208  #define EVENT_OVERHEAD_CHOICE EVENT_OVERHEAD_CHOICE_A
209 #endif
210 
211 #if (EVENT_OVERHEAD_CHOICE == EVENT_OVERHEAD_CHOICE_B) || (EVENT_OVERHEAD_CHOICE == EVENT_OVERHEAD_CHOICE_C)
212  #define EVENT_OVERHEAD 5
213 #elif (EVENT_OVERHEAD_CHOICE == EVENT_OVERHEAD_CHOICE_D) || (EVENT_OVERHEAD_CHOICE == EVENT_OVERHEAD_CHOICE_E)
214  #define EVENT_OVERHEAD 4
215 #else /* EVENT_OVERHEAD_CHOICE_A */
216 
222  #define EVENT_OVERHEAD 6
223 #endif
224 
225 #endif