EasyManua.ls Logo

Gemalto Prox-SU - Page 36

Default Icon
134 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Reference Manual Preliminary
Prox–DU & Prox–SU
www.gemalto.com Release for first samples Do not use for final design
DOC118569A Public Use Page 36/134
Globals :
Ressources
(Use) :
(Modify):
(Call) Internals :
Externals :
*Remarks :
*****************************************************************************/
unsigned char ucMadCrc( unsigned char _uc_len,
unsigned char *_puc_in,
unsigned char *_puc_out )
{
unsigned char u_i;
unsigned char u_j;
unsigned char uc_status;
uc_status = ERR_OK;
*_puc_out = 0xC7; // bit-swapped 0xE3
for (u_j = 0; u_j < _uc_len; u_j++)
{
*_puc_out = *_puc_out ^ _puc_in[u_j];
for (u_i = 0; u_i < 8; u_i++)
{
if (*_puc_out & 0x80)
{
*_puc_out = (*_puc_out << 1) ^ 0x1D;
}
else
{
*_puc_out = *_puc_out << 1;
}
}
}
if (*_puc_out)
{
uc_status = ERR_MAD_CRC;
}
return (uc_status); // 0x00 if last byte is the CRC of the previous bytes
}

Table of Contents

Other manuals for Gemalto Prox-SU

Related product manuals