This section describes functions and macros of the driver's API.
|
#define | CRC_Read() |
| Reads and returns calculated CRC code. More...
|
|
#define | CRC_Calc8(ptr, len) |
| Calculates CRC of the data array of bytes (8-bits) and returns calculated CRC code. More...
|
|
#define | CRC_Calc16(ptr, len) |
| Calculates CRC of the data array of half-words (16-bits) and returns calculated CRC code. More...
|
|
#define | CRC_Calc32(ptr, len) |
| Calculates CRC of the data array of words (32-bits) and returns calculated CRC code. More...
|
|
#define | CRC_Init(crc) |
| Initializes CRC calculation. More...
|
|
This macro reads and returns calculated CRC code.
- Returns
- uint32 CRC number.
- Note
- Implemented as a function call.
#define CRC_Calc8 |
( |
|
ptr, |
|
|
|
len |
|
) |
| |
This function calculates CRC of the data array of bytes (8-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.
- Parameters
-
ptr | Pointer to data array of bytes (8-bits). |
len | Number of data bytes |
- Returns
- uint32 CRC number.
- Note
- Implemented as a function call.
#define CRC_Calc16 |
( |
|
ptr, |
|
|
|
len |
|
) |
| |
This function calculates CRC of the data array of half-words (16-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.
- Parameters
-
ptr | Pointer to data array of half-words (16-bits). |
len | Number of data half-words. |
- Returns
- uint32 CRC number.
- Note
- Implemented as a function call.
#define CRC_Calc32 |
( |
|
ptr, |
|
|
|
len |
|
) |
| |
This function calculates CRC of the data array of words (32-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.
- Parameters
-
ptr | Pointer to data array of words (32-bits). |
len | Number of data words. |
- Returns
- uint32 CRC number.
- Note
- Implemented as a function call.
This function initializes CRC calculation and allows user to select preferred calculation algorithm.
- Parameters
-
- Returns
- void* pointer to CRC_DATA register.
- Note
- Implemented as a function call. Information about various CRC specs available from http://en.wikipedia.org/wiki/Cyclic_redundancy_check