39#pragma config MBXM0 = M2S
40#pragma config MBXM1 = M2S
41#pragma config MBXM2 = M2S
42#pragma config MBXM3 = M2S
43#pragma config MBXM4 = M2S
44#pragma config MBXM5 = M2S
45#pragma config MBXM6 = M2S
46#pragma config MBXM7 = M2S
47#pragma config MBXM8 = M2S
48#pragma config MBXM9 = M2S
49#pragma config MBXM10 = M2S
50#pragma config MBXM11 = M2S
51#pragma config MBXM12 = M2S
52#pragma config MBXM13 = M2S
53#pragma config MBXM14 = M2S
54#pragma config MBXM15 = S2M
57#pragma config MBXHSA = MBX4
58#pragma config MBXHSB = MBX14
59#pragma config MBXHSC = MBX15
60#pragma config MBXHSD = MBX15
63#pragma config MBXHSE = MBX15
64#pragma config MBXHSF = MBX15
65#pragma config MBXHSG = MBX15
66#pragma config MBXHSH = MBX15
69#pragma config HSAEN = ON
70#pragma config HSBEN = ON
71#pragma config HSCEN = OFF
72#pragma config HSDEN = OFF
73#pragma config HSEEN = OFF
74#pragma config HSFEN = OFF
75#pragma config HSGEN = OFF
76#pragma config HSHEN = OFF
79#pragma config S1DMTIVTL = 0x0
82#pragma config S1DMTIVTH = 0x0
85#pragma config S1DMTCNTL = 0x0
88#pragma config S1DMTCNTH = 0x0
91#pragma config S1DMTDIS = OFF
94#pragma config S1FNOSC = FRCPLL
95#pragma config S1IESO = OFF
98#pragma config S1OSCIOFNC = OFF
99#pragma config S1FCKSM = CSECMD
100#pragma config S1PLLKEN = S1PLLKEN_ON
103#pragma config S1RWDTPS = PS1048576
104#pragma config S1RCLKSEL = LPRC
105#pragma config S1WINDIS = ON
106#pragma config S1WDTWIN = WIN25
107#pragma config S1SWDTPS = PS1048576
108#pragma config S1FWDTEN = ON_SW
111#pragma config S1ICS = PGD2
112#pragma config S1ISOLAT = ON
113#pragma config S1NOBTSWP = OFF
116#pragma config S1ALTI2C1 = OFF
117#pragma config S1SPI1PIN = PPS
118#pragma config S1SSRE = ON
119#pragma config S1MSRE = OFF
122#pragma config S1CTXT1 = OFF
123#pragma config S1CTXT2 = OFF
124#pragma config S1CTXT3 = OFF
125#pragma config S1CTXT4 = OFF
128#pragma config S1BISTDIS = DISABLED
135#include "../sec_core_interface.h"
140#define SECONDARY_IMAGE dspic33ch_totem_pole_single_phase_secondary_IL
141#define SECONDARY_NUMBER 1
148#define _MTSIRQ _MSTIRQ
183 .ProtocolCallbackRegister = NULL,
184 .ReadFIFODataReadyCallbackRegister = NULL,
185 .WriteFIFOEmptyCallbackRegister = NULL,
186 .FIFOOverFLowUnderFlowCallbackRegister = NULL,
187 .SecondaryInitiatedCallbackRegister = NULL,
188 .SecondaryBreakCallbackRegister = NULL,
189 .SecondaryResetCallbackRegister = NULL,
213 #if __XC16_VERSION__ < 1700
229 #if __XC16_VERSION__ < 1700
245 MSI1CONbits.MTSIRQ = 1U;
250 return(MSI1STATbits.MTSIACK);
256 MSI1CONbits.MTSIRQ = 0U;
261 return(MSI1STATbits.STMIRQ);
265 MSI1CONbits.STMIACK = 1U;
270 MSI1CONbits.STMIACK = 0U;
277 if(MSI1STATbits.SLVWDRST)
304 if(MSI1STATbits.SLVRST)
310 switch(MSI1STATbits.SLVPWR)
327 uint16_t readCountStatus = 0U;
333 *pData++ = MRSWFDATA;
342 return readCountStatus;
347 uint16_t writeCountStatus = 0U;
353 MWSRFDATA = *pData++;
362 return writeCountStatus;
373 MSI1MBX0D = pData[0];
374 MSI1MBX1D = pData[1];
375 MSI1MBX2D = pData[2];
376 MSI1MBX3D = pData[3];
377 MSI1MBX4D = pData[4];
388 MSI1MBX5D = pData[0];
389 MSI1MBX6D = pData[1];
390 MSI1MBX7D = pData[2];
391 MSI1MBX8D = pData[3];
392 MSI1MBX9D = pData[4];
393 MSI1MBX10D = pData[5];
394 MSI1MBX11D = pData[6];
395 MSI1MBX12D = pData[7];
396 MSI1MBX13D = pData[8];
397 MSI1MBX14D = pData[9];
This is the generated driver header file for the SEC_CORE1 driver.
This is the generated driver types header file for the SEC_CORE driver.
@ SEC_CORE_RESET_CAUSE_WATCHDOG
@ SEC_CORE_RESET_CAUSE_UNSPECIFIED
@ SEC_CORE_SYSTEM_STATUS_IN_RESET_STATE
@ SEC_CORE_SYSTEM_STATUS_IDLE_MODE
@ SEC_CORE_SYSTEM_STATUS_RUNNING_STATE
@ SEC_CORE_SYSTEM_STATUS_SLEEP_MODE
@ SEC_CORE_SYSTEM_STATUS_NOT_IN_LOW_POWER_MODE
unsigned char dspic33ch_totem_pole_single_phase_secondary_IL[]
void SEC_CORE1_InterruptRequestGenerate(void)
This routine generates interrupt to SEC_CORE1.
void SEC_CORE1_InterruptRequestAcknowledge(void)
This routine acknowledges interrupt received from SEC_CORE1.
uint16_t SEC_CORE1_FIFOWrite(uint16_t *pData, uint16_t wordCount)
This routine transfers FIFO data to SEC_CORE1.
enum SEC_CORE_RESET_CAUSE SEC_CORE1_GetResetCause(void)
This routine returns the cause for SEC_CORE1 reset.
SEC_CORE_RESET_CAUSE
Defines the sec_core reset cause enumeration.
static void SEC_CORE1_WriteFIFODisable(void)
This inline function Disables the Write FIFO.
uint16_t SEC_CORE1_FIFORead(uint16_t *pData, uint16_t wordCount)
This routine reads FIFO data sent from the SEC_CORE1.
void SEC_CORE1_Program(void)
This routine programs secondary.
void SEC_CORE1_InterruptRequestComplete(void)
This routine clears interrupt to SEC_CORE1.
static bool SEC_CORE1_ProtocolIsEmpty(enum SEC_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is empty. Returns true if Protocol is empty indicating ma...
void SEC_CORE1_Start(void)
This routine enables secondary core.
const struct SEC_CORE_INTERFACE MSIInterface
Structure object of type SEC_CORE_INTERFACE with the custom name given by the user in the Melody Driv...
void SEC_CORE1_Initialize(void)
This routine initializes the MSI driver. This routine must be called before any other MSI routine is ...
bool SEC_CORE1_IsInterruptRequested(void)
This routine returns the status of interrupt request from the SEC_CORE1.
static bool SEC_CORE1_FIFOWriteIsEmpty(void)
This inline function checks whether the status of Write FIFO is Empty. Returns true if last write by ...
enum SEC_CORE_SYSTEM_STATUS SEC_CORE1_SystemStatusGet(void)
This routine returns Secondary system status.
bool SEC_CORE1_ProtocolWrite(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine writes data to mailbox.
bool SEC_CORE1_IsInterruptRequestAcknowledged(void)
This routine returns the status of interrupt request acknowledge from the SEC_CORE1.
static bool SEC_CORE1_FIFOReadIsEmpty(void)
This inline function checks whether the status of Read FIFO is Empty. Returns true if last read by Ma...
bool SEC_CORE1_ProtocolRead(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine reads data from mailbox.
void SEC_CORE1_InterruptRequestAcknowledgeComplete(void)
This routine clears acknowledge for interrupt received from SEC_CORE1.
SEC_CORE_SYSTEM_STATUS
Defines the status enumeration for sec_core.
static void SEC_CORE1_WriteFIFOEnable(void)
This inline function Enables the Write FIFO.
SEC_CORE_PROTOCOLS
Defines the list of Protocols configured for SEC_CORE_driver.
static bool SEC_CORE1_ProtocolIsFull(enum SEC_CORE_PROTOCOLS protocolName)
This inline function checks whether mailbox is full. Returns true if new data are ready to read....
void SEC_CORE1_ResetCauseClear(enum SEC_CORE_RESET_CAUSE resetCause)
This routine clears the cause for SEC_CORE1 reset.
static bool SEC_CORE1_FIFOWriteIsFull(void)
This inline function checks whether the status of Write FIFO is Full. Returns true if last write by M...
void SEC_CORE1_Deinitialize(void)
Deinitializes SEC_CORE1 to POR values.
static bool SEC_CORE1_FIFOReadIsFull(void)
This inline function checks whether the status of Read FIFO is full. last write by Secondary core to ...
static void SEC_CORE1_ReadFIFODisable(void)
This inline function Disables the Read FIFO.
static void SEC_CORE1_ReadFIFOEnable(void)
This inline function Enables the Read FIFO.
Structure containing the function pointers of SEC_CORE driver.
void(* Initialize)(void)
Pointer to SEC_COREx_Initialize e.g. SEC_CORE1_Initialize.