Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
main_core.h
Go to the documentation of this file.
1
17/*disclaimer*/
18
19#ifndef MAIN_CORE_H
20#define MAIN_CORE_H
21
22// Section: Included Files
23
24#include <xc.h>
25#include <stdint.h>
26#include <stdbool.h>
27#include "main_core_types.h"
28#include "main_core_interface.h"
29
30// Section: Data Type Definitions
31
32
41extern const struct MAIN_CORE_INTERFACE MSIInterface;
42
47#define MSIInterface_Initialize MAIN_CORE_Initialize
48
53#define MSIInterface_Deinitialize MAIN_CORE_Deinitialize
54
59#define MSIInterface_InterruptRequestGenerate MAIN_CORE_InterruptRequestGenerate
60
65#define MSIInterface_IsInterruptRequestAcknowledged MAIN_CORE_IsInterruptRequestAcknowledged
66
71#define MSIInterface_InterruptRequestComplete MAIN_CORE_InterruptRequestComplete
72
77#define MSIInterface_IsInterruptRequested MAIN_CORE_IsInterruptRequested
78
83#define MSIInterface_InterruptRequestAcknowledge MAIN_CORE_InterruptRequestAcknowledge
84
89#define MSIInterface_InterruptRequestAcknowledgeComplete MAIN_CORE_InterruptRequestAcknowledgeComplete
90
95#define MSIInterface_SystemStatusGet MAIN_CORE_SystemStatusGet
96
101#define MSIInterface_FIFORead MAIN_CORE_FIFORead
102
107#define MSIInterface_FIFOWrite MAIN_CORE_FIFOWrite
108
113#define MSIInterface_FIFOReadIsFull MAIN_CORE_FIFOReadIsFull
114
119#define MSIInterface_FIFOReadIsEmpty MAIN_CORE_FIFOReadIsEmpty
120
125#define MSIInterface_FIFOWriteIsFull MAIN_CORE_FIFOWriteIsFull
126
131#define MSIInterface_FIFOWriteIsEmpty MAIN_CORE_FIFOWriteIsEmpty
132
137#define MSIInterface_ProtocolWrite MAIN_CORE_ProtocolWrite
138
143#define MSIInterface_ProtocolRead MAIN_CORE_ProtocolRead
144
149#define MSIInterface_ProtocolIsFull MAIN_CORE_ProtocolIsFull
150
155#define MSIInterface_ProtocolIsEmpty MAIN_CORE_ProtocolIsEmpty
156
157
158// Section: MAIN_CORE Module APIs
159
168void MAIN_CORE_Initialize(void);
169
176void MAIN_CORE_Deinitialize(void);
177
185
194
202
211
219
227
235
243uint16_t MAIN_CORE_FIFORead(uint16_t *pData, uint16_t wordCount);
244
253uint16_t MAIN_CORE_FIFOWrite(uint16_t *pData, uint16_t wordCount);
254
262inline static bool MAIN_CORE_FIFOReadIsFull(void)
263{
264 return(SI1FIFOCSbits.SRFFULL);
265}
266
275inline static bool MAIN_CORE_FIFOReadIsEmpty(void)
276{
277 return(SI1FIFOCSbits.SRFEMPTY);
278}
279
288inline static bool MAIN_CORE_FIFOWriteIsFull(void)
289{
290 return(SI1FIFOCSbits.SWFFULL);
291}
292
301inline static bool MAIN_CORE_FIFOWriteIsEmpty(void)
302{
303 return(SI1FIFOCSbits.SWFEMPTY);
304}
305
314bool MAIN_CORE_ProtocolWrite(enum MAIN_CORE_PROTOCOLS protocolName, uint16_t *pData);
315
324bool MAIN_CORE_ProtocolRead(enum MAIN_CORE_PROTOCOLS protocolName, uint16_t *pData);
325
335inline static bool MAIN_CORE_ProtocolIsFull(enum MAIN_CORE_PROTOCOLS protocolName)
336{
337 bool status = false;
338 switch(protocolName)
339 {
340 case MSI1_ProtocolA:
341 status = SI1MBXSbits.DTRDYA;
342 break;
343 case MSI1_ProtocolB:
344 status = SI1MBXSbits.DTRDYB;
345 break;
346 default:
347 break;
348 }
349 return status;
350}
351
362inline static bool MAIN_CORE_ProtocolIsEmpty(enum MAIN_CORE_PROTOCOLS protocolName)
363{
364 bool status = false;
365 switch(protocolName)
366 {
367 case MSI1_ProtocolA:
368 status = !SI1MBXSbits.DTRDYA;
369 break;
370 case MSI1_ProtocolB:
371 status = !SI1MBXSbits.DTRDYB;
372 break;
373 default:
374 break;
375 }
376 return status;
377}
378
379
380
381#endif //MAIN_CORE_H
382
383
384
@ MSI1_ProtocolA
@ MSI1_ProtocolB
This is the generated driver types header file for the MAIN_CORE driver.
size_t status
Definition uart1.c:99
const struct MAIN_CORE_INTERFACE MSIInterface
Structure object of type MAIN_CORE_INTERFACE with the custom name given by the user in the Melody Dri...
Definition sec_core1.c:155
MAIN_CORE_SYSTEM_STATUS
Defines the status enumeration for main_core.
static bool MAIN_CORE_FIFOReadIsEmpty(void)
This inline function checks whether the status of Read FIFO is Empty. Returns true if last read by Ma...
Definition main_core.h:275
static bool MAIN_CORE_FIFOWriteIsFull(void)
This inline function checks whether the status of Write FIFO is Full. Returns true if last write by M...
Definition main_core.h:288
uint16_t MAIN_CORE_FIFORead(uint16_t *pData, uint16_t wordCount)
This routine reads FIFO data sent from the Main Core.
Definition main_core.c:133
bool MAIN_CORE_IsInterruptRequestAcknowledged(void)
This routine returns the status of interrupt request acknowledge from the MAIN_CORE.
Definition main_core.c:83
uint16_t MAIN_CORE_FIFOWrite(uint16_t *pData, uint16_t wordCount)
This routine transfers FIFO data to Main Core.
Definition main_core.c:153
bool MAIN_CORE_IsInterruptRequested(void)
This routine returns the status of interrupt request from the MAIN_CORE.
Definition main_core.c:94
bool MAIN_CORE_ProtocolWrite(enum MAIN_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine writes data to mailbox.
Definition main_core.c:173
bool MAIN_CORE_ProtocolRead(enum MAIN_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine reads data from mailbox.
Definition main_core.c:184
enum MAIN_CORE_SYSTEM_STATUS MAIN_CORE_SystemStatusGet(void)
This routine returns Main system status.
Definition main_core.c:108
void MAIN_CORE_Initialize(void)
This routine initializes the MSI driver. This routine must be called before any other MSI routine is ...
Definition main_core.c:63
void MAIN_CORE_InterruptRequestAcknowledgeComplete(void)
This routine clears acknowledge for interrupt received from Main MSI.
Definition main_core.c:103
static bool MAIN_CORE_ProtocolIsFull(enum MAIN_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is full. Returns true if New data are ready to read....
Definition main_core.h:335
void MAIN_CORE_InterruptRequestComplete(void)
This routine clears interrupt to MAIN_CORE.
Definition main_core.c:89
MAIN_CORE_PROTOCOLS
Defines the list of Protocols configured for MAIN_CORE_driver.
void MAIN_CORE_Deinitialize(void)
Deinitializes MAIN_CORE to POR values.
Definition main_core.c:71
static bool MAIN_CORE_FIFOWriteIsEmpty(void)
This inline function checks whether the status of Write FIFO is Empty. Returns true if last write by ...
Definition main_core.h:301
static bool MAIN_CORE_ProtocolIsEmpty(enum MAIN_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is empty. Returns true if Protocol is empty indicating ma...
Definition main_core.h:362
void MAIN_CORE_InterruptRequestAcknowledge(void)
This routine acknowledges interrupt received from Main MSI.
Definition main_core.c:98
static bool MAIN_CORE_FIFOReadIsFull(void)
This inline function checks whether the status of Read FIFO is full. last write by Secondary core to ...
Definition main_core.h:262
void MAIN_CORE_InterruptRequestGenerate(void)
This routine generates interrupt to MAIN_CORE.
Definition main_core.c:78
Structure containing the function pointers of MAIN_CORE driver.