/* ANY-LICENSE V1.0 ---------------- You can use these files under any license approved by the Open Source Initiative, preferrably one of the popular licenses, as long as the license you choose is compatible to the dependencies of these files. See http://www.opensource.org/licenses/ for a list of approved licenses. Author: Martin Furter Project: Tins AVR Lib Repository: http://repos.borg.ch/projects/tins_avr_lib/trunk Copyright: 2015 */ #ifndef TAL_PRNG_H #define TAL_PRNG_H /** \defgroup PRNG PRNG functions @{ */ #include /// Initial value for the XORSHIFT16 PRNG. #define XORSHIFT16_INIT_DEFAULT 257 /** * Initialize the XORSHIFT16 PRNG to the given value. * * @param state The new state. */ void xorshift16_init( uint16_t state ); /** * Add the given value to the internal state of the XORSHIFT16 PRNG. * * @param value Value to add. */ void xorshift16_add( uint16_t value ); /** * Returns the next byte from the XORSHIFT16 PRNG. * * @return The next byte. */ uint8_t xorshift16_next(); /** * Returns the internal state of the XORSHIFT16 PRNG. * * @return The internal state. */ uint16_t xorshift16_get_state(); /// @} #endif // TAL_PRNG_H