ESOS32
ESOSOn32-bitProcessors
src
generic_hw
esos_hwxxx_utils.c
Go to the documentation of this file.
1
/*
2
* "Copyright (c) 2019 J. W. Bruce ("AUTHOR(S)")"
3
* All rights reserved.
4
* (J. W. Bruce, jwbruce_AT_tntech.edu, Tennessee Tech University)
5
*
6
* Permission to use, copy, modify, and distribute this software and its
7
* documentation for any purpose, without fee, and without written agreement is
8
* hereby granted, provided that the above copyright notice, the following
9
* two paragraphs and the authors appear in all copies of this software.
10
*
11
* IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
12
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
13
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
14
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
*
16
* THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
17
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
19
* ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
20
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
21
*
22
* Please maintain this header in its entirety when copying/modifying
23
* these files.
24
*
25
*
26
*/
27
28
// Documentation for this file. If the \file tag isn't present,
29
// this file won't be documented.
37
// Include any HW-specific header files to pick up the HW register
38
// definitions, macros, etc.
39
#include "
esos_hwxxx.h
"
40
#include "
esos_hwxxx_utils.h
"
41
42
/***************************************************
43
*
44
* HARDWARE-specific ESOS utility functions
45
*
46
* *************************************************/
47
48
/* ******************************************************
49
* \brief HW pseudo-random number generation...
50
*
51
* \note All hardware must implement this function.
52
*
53
* If the underlying hardware has PRNG on-board, it can
54
* implement it here and return the uint32 "random" number.
55
*
56
* If the underlying HW does not have PRNG on-board, it
57
* can call the hidden ESOS function for software RNG
58
* uint32 __esos_get_PRNG_RandomUint32(void)
59
* and return that value.
60
*
61
********************************************************/
62
uint32_t __esos_hw_PRNG_u32(
void
) {
63
return
__esos_get_PRNG_RandomUint32
();
64
}
// end __esos_hw_PRNG_u32(void)
65
66
67
/* *******************************************************
68
* \brief user-provided function to config the HW RNG
69
*
70
* \note All hardware must implement this function.
71
*
72
* If the underlying hardware has PRNG on-board, HW-specific code
73
* for intializing the PRNG hardware goes here.
74
*
75
* If the underlying HW does not have PRNG on-board, this
76
* function should just return.
77
*
78
******************************************************* */
79
void
__esos_hw_config_PRNG(
void
) {
80
81
}
// end __esos_hw_config_PRNG(void)
82
83
/* *******************************************************
84
* \brief seed the HW pseudo-random number generator...
85
*
86
* \note All hardware must implement this function.
87
*
88
* If the underlying hardware has PRNG on-board, it can
89
* do what it needs to "seed" the PRNG.
90
*
91
* If the underlying HW does not have PRNG on-board, it
92
* can call the hidden ESOS function for seeding the
93
* ESOS software RNG function
94
* void __esos_setSWRNGU32Seed(uint32)
95
*
96
* \sa __esos_get_PRNG_RandomUint32
97
*
98
********************************************************** */
99
void
__esos_hw_set_PRNG_Seed(uint32_t u32_seed) {
100
__esos_set_PRNG_U32Seed
(u32_seed);
101
}
// end __esos_hw_setPRNG_Seed(uint32)
__esos_set_PRNG_U32Seed
void __esos_set_PRNG_U32Seed(uint32_t u32_seed)
Definition:
esos_utils.c:70
__esos_get_PRNG_RandomUint32
uint32_t __esos_get_PRNG_RandomUint32(void)
Definition:
esos_utils.c:80
esos_hwxxx_utils.h
This file contains routines which configure and use hardware-version of the ESOS utility functions.
esos_hwxxx.h
This is the master include file template for the target hardware (hwxxxx)
Generated by
1.8.17