1 /** @file notification.c
\r
2 * @brief User Notification Definition File
\r
6 * This file defines empty notification routines.
\r
7 * The user needs to remove the while loop and define
\r
15 #include "sys_selftest.h"
\r
23 /* USER CODE BEGIN (0) */
\r
24 #include "FreeRTOS.h"
\r
25 #include "os_semphr.h"
\r
26 #include "os_task.h"
\r
28 /** @brief Semaphore blocking task when it waits for interrupt signaling message receive
\r
30 * Defined in commands.c */
\r
31 extern xSemaphoreHandle canMsgReceived;
\r
32 extern xSemaphoreHandle canMsgSent;
\r
33 /** @brief Semaphore blocking task when it waits for interrupt signaling end of the conversion
\r
35 * Defined in commands.c */
\r
36 extern xSemaphoreHandle adcDataConverted;
\r
39 extern xSemaphoreHandle linMsgReceived;
\r
40 extern xSemaphoreHandle linIDReceived;
\r
42 /** @brief Data structure containing converted data from ADC
\r
44 * Defined in commands.c */
\r
45 extern ADCData_t adcData;
\r
46 extern canBASE_t *canDst;
\r
47 extern canBASE_t *canSrc;
\r
48 extern uint32_t canMsgBox;
\r
51 void esmGroup1Notification(uint32_t channel)
\r
53 /* enter user code and remove the while loop... */
\r
55 /* USER CODE BEGIN (1) */
\r
60 /* USER CODE BEGIN (2) */
\r
63 void esmGroup2Notification(uint32_t channel)
\r
65 /* enter user code and remove the while loop... */
\r
67 /* USER CODE BEGIN (3) */
\r
72 /* USER CODE BEGIN (4) */
\r
75 void memoryPort0TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
77 /* enter user code and remove the while loop... */
\r
79 /* USER CODE BEGIN (5) */
\r
84 /* USER CODE BEGIN (6) */
\r
87 void memoryPort1TestFailNotification(uint32_t groupSelect, uint32_t dataSelect, uint32_t address, uint32_t data)
\r
89 /* enter user code and remove the while loop... */
\r
91 /* USER CODE BEGIN (7) */
\r
96 /* USER CODE BEGIN (8) */
\r
98 void adcNotification(adcBASE_t *adc, uint32_t group)
\r
100 /* USER CODE BEGIN (11) */
\r
101 // Group selected by group selector has been read
\r
102 if (adc->GxINTFLG[group] & 8) {
\r
104 ch_count = adcGetData(adc, group, &adcData.adc_data[0]);
\r
105 adcData.flags |= (ch_count == adcData.ch_count) ? 0 : BAD_CHANNELS_COUNT;
\r
106 xSemaphoreGiveFromISR(adcDataConverted, NULL);
\r
108 // Memory overrun detected - set flag
\r
109 if (adc->GxINTFLG[group] & 2) {
\r
110 adcData.flags |= MEM_OVERRUN;
\r
111 adc->GxFIFORESETCR[1] = 1;
\r
113 /* USER CODE END */
\r
117 /* USER CODE BEGIN (12) */
\r
118 /* USER CODE END */
\r
119 void canErrorNotification(canBASE_t *node, uint32_t notification)
\r
121 /* USER CODE BEGIN (13) */
\r
122 if (node == canSrc) {
\r
123 xSemaphoreGiveFromISR(canMsgSent, NULL);
\r
125 if (node == canDst) {
\r
126 xSemaphoreGiveFromISR(canMsgReceived, NULL);
\r
128 /* USER CODE END */
\r
132 /* USER CODE BEGIN (14) */
\r
133 /* USER CODE END */
\r
135 void canMessageNotification(canBASE_t *node, uint32_t messageBox)
\r
137 /* USER CODE BEGIN (15) */
\r
139 if (messageBox == canMsgBox)
\r
141 if (node == canDst) {
\r
142 /* node 2 - receive testloopback message complete */
\r
143 while(!canIsRxMessageArrived(node, canMsgBox))
\r
145 xSemaphoreGiveFromISR(canMsgReceived, NULL);
\r
147 if (node == canSrc) {
\r
148 xSemaphoreGiveFromISR(canMsgSent, NULL);
\r
152 /* USER CODE END */
\r
156 /* USER CODE BEGIN (16) */
\r
157 /* USER CODE END */
\r
158 void gioNotification(int bit)
\r
160 /* enter user code and remove the while loop... */
\r
162 /* USER CODE BEGIN (19) */
\r
163 /* USER CODE END */
\r
167 /* USER CODE BEGIN (20) */
\r
168 /* USER CODE END */
\r
169 void linNotification(linBASE_t *lin, uint32_t flags)
\r
171 /* USER CODE BEGIN (23) */
\r
172 if (flags & LIN_ID_INT) {
\r
173 xSemaphoreGiveFromISR(linIDReceived, NULL);
\r
175 if (flags & LIN_RX_INT) {
\r
176 lin->FLR |= (1 << 9);
\r
177 xSemaphoreGiveFromISR(linMsgReceived, NULL);
\r
179 /* USER CODE END */
\r
183 /* USER CODE BEGIN (24) */
\r
184 /* USER CODE END */
\r
185 void mibspiNotification(mibspiBASE_t *mibspi, uint32_t flags)
\r
187 /* enter user code and remove the while loop... */
\r
189 /* USER CODE BEGIN (25) */
\r
190 /* USER CODE END */
\r
194 /* USER CODE BEGIN (26) */
\r
195 /* USER CODE END */
\r
197 void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
\r
199 /* enter user code and remove the while loop... */
\r
201 /* USER CODE BEGIN (27) */
\r
202 /* USER CODE END */
\r
205 /* USER CODE BEGIN (28) */
\r
206 /* USER CODE END */
\r
208 void sciNotification(sciBASE_t *sci, uint32_t flags)
\r
210 /* USER CODE BEGIN (29) */
\r
211 if (sci == sciREG) {
\r
212 if (flags & SCI_RX_INT) {
\r
213 sciReceive(sci, 1, NULL); // Restart receiving
\r
216 /* USER CODE END */
\r
220 /* USER CODE BEGIN (30) */
\r
221 /* USER CODE END */
\r
222 void pwmNotification(hetBASE_t * hetREG,uint32_t pwm, uint32_t notification)
\r
224 /* enter user code and remove the while loop... */
\r
226 /* USER CODE BEGIN (33) */
\r
227 /* USER CODE END */
\r
231 /* USER CODE BEGIN (34) */
\r
232 /* USER CODE END */
\r
234 void edgeNotification(hetBASE_t * hetREG,uint32_t edge)
\r
236 /* enter user code and remove the while loop... */
\r
238 /* USER CODE BEGIN (35) */
\r
239 /* USER CODE END */
\r
243 /* USER CODE BEGIN (36) */
\r
244 /* USER CODE END */
\r
246 void hetNotification(hetBASE_t *het, uint32_t offset)
\r
248 /* enter user code and remove the while loop... */
\r
250 /* USER CODE BEGIN (37) */
\r
251 /* USER CODE END */
\r
255 /* USER CODE BEGIN (38) */
\r
256 /* USER CODE END */
\r