LFSRRand Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
LFSRRand Function
C
WORD LFSRRand();
Description

Returns a pseudo-random 16-bit unsigned integer in the range from 0 to 65535 (0x0000 to 0xFFFF). The random number is generated using a Linear Feedback Shift Register (LFSR) type pseudo-random number generator algorithm. The LFSR can be seeded by calling the LFSRSeedRand() function to generate the same sequence of random numbers as a prior string of calls. 

The internal LFSR will repeat after 2^32-1 iterations.

Preconditions

None

Returns

Random 16-bit unsigned integer.

Side Effects

The internal LFSR seed is updated so that the next call to LFSRRand() will return a different random number.

Remarks

None

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.