FormazioneSitael / Mbed 2 deprecated I2C_PASSED

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CRC32BIT_LOOKUP_Ext.h Source File

CRC32BIT_LOOKUP_Ext.h

00001 /* =======================================================================================
00002  * (c)
00003  * (c)                                  MEL SYSTEM S.r.l.
00004  * (c)
00005  * (c)                       Libreria VB32_Lib (Vital Board 32 Bit)
00006  * (c)
00007  * (c) La libreria VB32_Lib implementa le tutte le funzionalità necessarie per  l'utilizzo
00008  * (c) dei due processori AT91SAM9 della scheda VB32. La libreria permette di gestire
00009  * (c) tutte  le  periferiche  interne  (DBGU, USART, SPI, ecc..) e  tutte le  periferiche
00010  * (c) esterne (HILSCHER COM-C DPM, ecc..) del processore AT91SAM9.
00011  * (c)
00012  * (c) ===================================================================================
00013  * (c)
00014  * (c)                           Copyright (C) MEL SYSTEM S.r.l.
00015  * (c)
00016  * (c)                             Tutti i diritti riservati.
00017  * (c)
00018  * (c) Questo programma e' tutelato dalle leggi sul copyright,  dalle  leggi  sui  diritti
00019  * (c) d'autore e  dai  trattati  internazionali.  La  riproduzione  o  distribuzione  non
00020  * (c) autorizzata di questo programma, o di parte di esso, sara' perseguibile  civilmente
00021  * (c) e penalmente.
00022  * (c)
00023  * =======================================================================================
00024  */
00025 
00026 /* =======================================================================================
00027  * Informazioni del modulo
00028  * =======================================================================================
00029  * \brf CRC32BIT_LOOKUP
00030  *
00031  * \mod Il modulo CRC32BIT_LOOKUP permette di calcolare crc a 32 bit di vettori di BYTE
00032  *      o di WORD utilizzando una tabella di lookup
00033  *
00034  * \aut Michele Giannese
00035  * =======================================================================================
00036  */
00037 
00038 /* =======================================================================================
00039  * Elenco delle modifiche (data - autore - descrizione)
00040  * =======================================================================================
00041  *
00042  * Ultima:
00043  *
00044  * 23/04/2013 - M. Giannese - creazione del modulo
00045  * =======================================================================================
00046  */
00047 
00048 #ifndef _CRC32BIT_LOOKUP_EXT_H
00049 #define _CRC32BIT_LOOKUP_EXT_H
00050 
00051 /* =======================================================================================
00052  * File inclusi
00053  * =======================================================================================
00054  */
00055 #include "TYPE_Def.h"
00056 
00057 
00058 /* =======================================================================================
00059  * Macro
00060  * =======================================================================================
00061  */
00062 
00063 /* =======================================================================================
00064  * Definizioni
00065  * =======================================================================================
00066  */
00067 
00068 /* \str Struttura contenente la look-up table per il calcolo ottimizzato del CRC a 32 bit */
00069 typedef struct
00070 {
00071    /* \var polynomial Crc 32 bit
00072     * \val 0x00000000..0xFFFFFFFF (1) [-]
00073     * \ini 0
00074     */
00075     UINT32_T UINT32_Poly;
00076     
00077    /* \var Initial value Crc 32 bit
00078     * \val 0x00000000..0xFFFFFFFF (1) [-]
00079     * \ini 0
00080     */
00081     UINT32_T UINT32_Init;
00082     
00083    /* \var Input reflection Crc 32 bit
00084     * \val 0x00000000..0xFFFFFFFF (1) [-]
00085     * \ini 0
00086     */
00087     BOOL_T  BOOL_RefIn;
00088    /* \var Output reflection Crc 32 bit
00089     * \val 0x00000000..0xFFFFFFFF (1) [-]
00090     * \ini 0
00091     */
00092     BOOL_T  BOOL_RefOut;
00093    /* \var XOR value Crc 32 bit
00094     * \val 0x00000000..0xFFFFFFFF (1) [-]
00095     * \ini 0
00096     */
00097     UINT32_T UINT32_XorOut;
00098 
00099     /* \var Look-up Table Crc 32 bit
00100     * \val 0x00000000..0xFFFFFFFF (1) [-]
00101     * \ini 0
00102     */
00103     DWORD_T _vDWORD_CRC32LookUpTable[256];
00104 } CRC32BIT_LOOKUP_TS;
00105 
00106 /* =======================================================================================
00107  * Prototipi delle funzioni
00108  * =======================================================================================
00109  */
00110 
00111 #if defined(__cplusplus)
00112 extern "C"
00113 {
00114 #endif /* __cplusplus */
00115 
00116 /* Restituisce il CRC PROPER a 32 bit calcolato su un vettore di byte */
00117 UINT32_T CRC32BIT_LOOKUP_Compute(const BYTE_T vBYTE_Data[],
00118                                  const UINT32_T UINT32_DataSize,
00119                                  const CRC32BIT_LOOKUP_TS *pCRCLUTable);
00120 
00121 /* Valorizza la look-up table in funzione del valore crcSettings */
00122 ERROR_T CRC32BIT_LOOKUP_Init(CRC32BIT_LOOKUP_TS *pCRCLUTable);
00123 
00124 /* Aggiorna e restituisce il CRC PROPER a 32 bit calcolato su un vettore di byte */
00125 UINT32_T CRC32BIT_LOOKUP_Update(const UINT32_T UINT32_PartialCrc,
00126                                 const BYTE_T vBYTE_Data[],
00127                                 const UINT32_T UINT32_DataSize,
00128                                 const BOOL_T BOOL_FirstData,
00129                                 const CRC32BIT_LOOKUP_TS *pCRCLUTable);
00130 
00131 #if defined(__cplusplus)
00132 }
00133 #endif /* __cplusplus */
00134 
00135 #endif /* _CRC32BIT_LOOKUP_EXT_H */