Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
sec_core1.h
Go to the documentation of this file.
1
17/*
18© [2024] Microchip Technology Inc. and its subsidiaries.
19
20 Subject to your compliance with these terms, you may use Microchip
21 software and any derivatives exclusively with Microchip products.
22 You are responsible for complying with 3rd party license terms
23 applicable to your use of 3rd party software (including open source
24 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35 THIS SOFTWARE.
36*/
37
38#ifndef SEC_CORE1_H
39#define SEC_CORE1_H
40
41// Section: Included Files
42
43#include <xc.h>
44#include <stdint.h>
45#include <stdbool.h>
46#include "sec_core_types.h"
47#include "sec_core_interface.h"
48
49// Section: Data Type Definitions
50
51
60extern const struct SEC_CORE_INTERFACE MSIInterface;
61
66#define MSIInterface_Initialize SEC_CORE1_Initialize
67
72#define MSIInterface_Deinitialize SEC_CORE1_Deinitialize
73
78#define MSIInterface_Program SEC_CORE1_Program
79
84#define MSIInterface_Strat SEC_CORE1_Strat
85
90#define MSIInterface_InterruptRequestGenerate SEC_CORE1_InterruptRequestGenerate
91
96#define MSIInterface_IsInterruptRequestAcknowledged SEC_CORE1_IsInterruptRequestAcknowledged
97
102#define MSIInterface_InterruptRequestComplete SEC_CORE1_InterruptRequestComplete
103
108#define MSIInterface_IsInterruptRequested SEC_CORE1_IsInterruptRequested
109
114#define MSIInterface_InterruptRequestAcknowledge SEC_CORE1_InterruptRequestAcknowledge
115
120#define MSIInterface_InterruptRequestAcknowledgeComplete SEC_CORE1_InterruptRequestAcknowledgeComplete
121
126#define MSIInterface_GetResetCause SEC_CORE1_GetResetCause
127
132#define MSIInterface_ResetCauseClear SEC_CORE1_ResetCauseClear
133
138#define MSIInterface_SystemStatusGet SEC_CORE1_SystemStatusGet
139
144#define MSIInterface_WriteFIFOEnable SEC_CORE1_WriteFIFOEnable
145
150#define MSIInterface_WriteFIFODisable SEC_CORE1_WriteFIFODisable
151
156#define MSIInterface_ReadFIFOEnable SEC_CORE1_ReadFIFOEnable
157
162#define MSIInterface_ReadFIFODisable SEC_CORE1_ReadFIFODisable
163
168#define MSIInterface_FIFORead SEC_CORE1_FIFORead
169
174#define MSIInterface_FIFOWrite SEC_CORE1_FIFOWrite
175
180#define MSIInterface_FIFOReadIsFull SEC_CORE1_FIFOReadIsFull
181
186#define MSIInterface_FIFOReadIsEmpty SEC_CORE1_FIFOReadIsEmpty
187
192#define MSIInterface_FIFOWriteIsFull SEC_CORE1_FIFOWriteIsFull
193
198#define MSIInterface_FIFOWriteIsEmpty SEC_CORE1_FIFOWriteIsEmpty
199
204#define MSIInterface_ProtocolWrite SEC_CORE1_ProtocolWrite
205
210#define MSIInterface_ProtocolRead SEC_CORE1_ProtocolRead
211
216#define MSIInterface_ProtocolIsFull SEC_CORE1_ProtocolIsFull
217
222#define MSIInterface_ProtocolIsEmpty SEC_CORE1_ProtocolIsEmpty
223
224
225// Section: SEC_CORE1 Module APIs
226
235void SEC_CORE1_Initialize(void);
236
243void SEC_CORE1_Deinitialize(void);
244
251void SEC_CORE1_Start(void);
252
259void SEC_CORE1_Program(void);
260
268
277
285
294
302
310
318
327
335
344uint16_t SEC_CORE1_FIFORead(uint16_t *pData, uint16_t wordCount);
345
354uint16_t SEC_CORE1_FIFOWrite(uint16_t *pData, uint16_t wordCount);
355
362inline static void SEC_CORE1_WriteFIFOEnable(void)
363{
364 MSI1FIFOCSbits.WFEN = 1U;
365}
366
373inline static void SEC_CORE1_WriteFIFODisable(void)
374{
375 MSI1FIFOCSbits.WFEN = 0U;
376}
377
384inline static void SEC_CORE1_ReadFIFOEnable(void)
385{
386 MSI1FIFOCSbits.RFEN = 1U;
387}
388
395inline static void SEC_CORE1_ReadFIFODisable(void)
396{
397 MSI1FIFOCSbits.RFEN = 0U;
398}
399
407inline static bool SEC_CORE1_FIFOReadIsFull(void)
408{
409 return(MSI1FIFOCSbits.RFFULL);
410}
411
420inline static bool SEC_CORE1_FIFOReadIsEmpty(void)
421{
422 return(MSI1FIFOCSbits.RFEMPTY);
423}
424
433inline static bool SEC_CORE1_FIFOWriteIsFull(void)
434{
435 return(MSI1FIFOCSbits.WFFULL);
436}
437
446inline static bool SEC_CORE1_FIFOWriteIsEmpty(void)
447{
448 return(MSI1FIFOCSbits.WFEMPTY);
449}
450
459bool SEC_CORE1_ProtocolWrite(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData);
460
469bool SEC_CORE1_ProtocolRead(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData);
470
480inline static bool SEC_CORE1_ProtocolIsFull(enum SEC_CORE_PROTOCOLS protocolName)
481{
482 bool status = false;
483 switch(protocolName)
484 {
485 case MSI1_ProtocolA:
486 status = MSI1MBXSbits.DTRDYA;
487 break;
488 case MSI1_ProtocolB:
489 status = MSI1MBXSbits.DTRDYB;
490 break;
491 default:
492 break;
493 }
494 return status;
495}
496
507inline static bool SEC_CORE1_ProtocolIsEmpty(enum SEC_CORE_PROTOCOLS protocolName)
508{
509 bool status = false;
510 switch(protocolName)
511 {
512 case MSI1_ProtocolA:
513 status = !MSI1MBXSbits.DTRDYA;
514 break;
515 case MSI1_ProtocolB:
516 status = !MSI1MBXSbits.DTRDYB;
517 break;
518 default:
519 break;
520 }
521 return status;
522}
523
524
525
526#endif //SEC_CORE1_H
This is the generated driver types header file for the SEC_CORE driver.
@ MSI1_ProtocolA
@ MSI1_ProtocolB
size_t status
Definition uart1.c:99
void SEC_CORE1_InterruptRequestGenerate(void)
This routine generates interrupt to SEC_CORE1.
Definition sec_core1.c:243
void SEC_CORE1_InterruptRequestAcknowledge(void)
This routine acknowledges interrupt received from SEC_CORE1.
Definition sec_core1.c:263
uint16_t SEC_CORE1_FIFOWrite(uint16_t *pData, uint16_t wordCount)
This routine transfers FIFO data to SEC_CORE1.
Definition sec_core1.c:345
enum SEC_CORE_RESET_CAUSE SEC_CORE1_GetResetCause(void)
This routine returns the cause for SEC_CORE1 reset.
Definition sec_core1.c:273
SEC_CORE_RESET_CAUSE
Defines the sec_core reset cause enumeration.
static void SEC_CORE1_WriteFIFODisable(void)
This inline function Disables the Write FIFO.
Definition sec_core1.h:373
uint16_t SEC_CORE1_FIFORead(uint16_t *pData, uint16_t wordCount)
This routine reads FIFO data sent from the SEC_CORE1.
Definition sec_core1.c:325
void SEC_CORE1_Program(void)
This routine programs secondary.
Definition sec_core1.c:227
void SEC_CORE1_InterruptRequestComplete(void)
This routine clears interrupt to SEC_CORE1.
Definition sec_core1.c:254
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...
Definition sec_core1.h:507
void SEC_CORE1_Start(void)
This routine enables secondary core.
Definition sec_core1.c:211
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...
Definition sec_core1.c:155
void SEC_CORE1_Initialize(void)
This routine initializes the MSI driver. This routine must be called before any other MSI routine is ...
Definition sec_core1.c:194
bool SEC_CORE1_IsInterruptRequested(void)
This routine returns the status of interrupt request from the SEC_CORE1.
Definition sec_core1.c:259
static bool SEC_CORE1_FIFOWriteIsEmpty(void)
This inline function checks whether the status of Write FIFO is Empty. Returns true if last write by ...
Definition sec_core1.h:446
enum SEC_CORE_SYSTEM_STATUS SEC_CORE1_SystemStatusGet(void)
This routine returns Secondary system status.
Definition sec_core1.c:300
bool SEC_CORE1_ProtocolWrite(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine writes data to mailbox.
Definition sec_core1.c:365
bool SEC_CORE1_IsInterruptRequestAcknowledged(void)
This routine returns the status of interrupt request acknowledge from the SEC_CORE1.
Definition sec_core1.c:248
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...
Definition sec_core1.h:420
bool SEC_CORE1_ProtocolRead(enum SEC_CORE_PROTOCOLS protocolName, uint16_t *pData)
This routine reads data from mailbox.
Definition sec_core1.c:411
void SEC_CORE1_InterruptRequestAcknowledgeComplete(void)
This routine clears acknowledge for interrupt received from SEC_CORE1.
Definition sec_core1.c:268
SEC_CORE_SYSTEM_STATUS
Defines the status enumeration for sec_core.
static void SEC_CORE1_WriteFIFOEnable(void)
This inline function Enables the Write FIFO.
Definition sec_core1.h:362
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....
Definition sec_core1.h:480
void SEC_CORE1_ResetCauseClear(enum SEC_CORE_RESET_CAUSE resetCause)
This routine clears the cause for SEC_CORE1 reset.
Definition sec_core1.c:289
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...
Definition sec_core1.h:433
void SEC_CORE1_Deinitialize(void)
Deinitializes SEC_CORE1 to POR values.
Definition sec_core1.c:204
static bool SEC_CORE1_FIFOReadIsFull(void)
This inline function checks whether the status of Read FIFO is full. last write by Secondary core to ...
Definition sec_core1.h:407
static void SEC_CORE1_ReadFIFODisable(void)
This inline function Disables the Read FIFO.
Definition sec_core1.h:395
static void SEC_CORE1_ReadFIFOEnable(void)
This inline function Enables the Read FIFO.
Definition sec_core1.h:384
Structure containing the function pointers of SEC_CORE driver.