|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
crc.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 CRC_H
39#define CRC_H
40
41// Section: Included Files
42
43#include <xc.h>
44#include <stdint.h>
45#include <stdbool.h>
46#include "crc_types.h"
47#include "crc_interface.h"
48// Section: Data Type Definitions
58extern const struct CRC_INTERFACE CRC;
59
60// Section: CRC Module APIs
61
71void CRC_Initialize(void);
72
79void CRC_Deinitialize(void);
80
90void CRC_SeedSet(uint32_t seed, enum CRC_SEED_METHOD seedMethod, enum CRC_SEED_DIRECTION seedDirection);
91
100void CRC_CalculateBufferStart(void *buffer, uint32_t sizeBytes);
101
111void CRC_CalculateProgramStart(uint32_t startAddr, uint32_t sizeBytes);
112
120void CRC_EventCallbackRegister(void (*handler)(void));
121
131 void CRC_EventCallback(void);
132
143void CRC_Tasks(void);
144
155bool CRC_CalculationIsDone(void);
156
166uint32_t CRC_CalculationResultGet(bool reverse, uint32_t xorValue);
167
176uint32_t CRC_CalculationResultRawGet(void);
177
186uint32_t CRC_CalculationResultReverseGet(void);
187
196uint32_t CRC_CalculationResultXORGet(uint32_t xorValue);
197
198#endif //CRC_H
crc_types.h
This is the generated driver types header file for the CRC driver.
CRC_SEED_DIRECTION
CRC_SEED_DIRECTION
Definition crc_types.h:77
CRC_SEED_METHOD
CRC_SEED_METHOD
Definition crc_types.h:66
CRC
const struct CRC_INTERFACE CRC
Structure object of type CRC_INTERFACE with the custom name given by the user in the Melody Driver Us...
Definition crc.c:48
CRC_Initialize
void CRC_Initialize(void)
Initializes the CRC module. This function sets the polynomial and data width; data and seed shift; up...
Definition crc.c:85
CRC_CalculationResultRawGet
uint32_t CRC_CalculationResultRawGet(void)
Gets the CRC raw result if the calculation is done.
Definition crc.c:425
CRC_EventCallbackRegister
void CRC_EventCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CRC Event ev...
Definition crc.c:406
CRC_CalculationResultGet
uint32_t CRC_CalculationResultGet(bool reverse, uint32_t xorValue)
Gets the CRC result if the calculation is done.
Definition crc.c:467
CRC_SeedSet
void CRC_SeedSet(uint32_t seed, enum CRC_SEED_METHOD seedMethod, enum CRC_SEED_DIRECTION seedDirection)
Sets the CRC seed with method and direction.
Definition crc.c:322
CRC_CalculateBufferStart
void CRC_CalculateBufferStart(void *buffer, uint32_t sizeBytes)
CRC module calculation on a buffer in data space.
Definition crc.c:373
CRC_Tasks
void CRC_Tasks(void)
This function cycles through the CRC calculations. This function will load the CRC module FIFO with...
Definition crc.c:487
CRC_EventCallback
void CRC_EventCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
CRC_Deinitialize
void CRC_Deinitialize(void)
Deinitializes CRC to POR values.
Definition crc.c:121
CRC_CalculationResultXORGet
uint32_t CRC_CalculationResultXORGet(uint32_t xorValue)
Gets the CRC XOR'd value of the result if the calculation is done.
Definition crc.c:456
CRC_CalculationResultReverseGet
uint32_t CRC_CalculationResultReverseGet(void)
Gets the CRC reversed value of result if the calculation is done.
Definition crc.c:447
CRC_CalculateProgramStart
void CRC_CalculateProgramStart(uint32_t startAddr, uint32_t sizeBytes)
Starts the CRC calculation on a buffer in program space.
Definition crc.c:385
CRC_CalculationIsDone
bool CRC_CalculationIsDone(void)
Returns the CRC calculation complete status
Definition crc.c:420
CRC_INTERFACE
Structure containing the function pointers of CRC driver.
Definition crc_interface.h:55