| BlueNRG-1 Peripherals drivers Examples

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

RNG_terminal_main.c
Go to the documentation of this file.
1
2 /******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
3 * File Name : RNG_terminal_main.c
4 * Author : VMA DIVISION
5 * Version : 1.0.0
6 * Date : 21-September-2015
7 * Description : Code demostrating the basic RNG functionality
8 ********************************************************************************
9 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
10 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
11 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
12 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
13 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
14 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
15 *******************************************************************************/
16
148 /* Includes ------------------------------------------------------------------*/
149 #include "BlueNRG1.h"
150 #include "BlueNRG1_conf.h"
151 #include "SDK_EVAL_Config.h"
152 #include <stdio.h>
153
167 /* Private typedef -----------------------------------------------------------*/
168 /* Private define ------------------------------------------------------------*/
169 /* Private macro -------------------------------------------------------------*/
170 /* Private variables ---------------------------------------------------------*/
171 /* Private function prototypes -----------------------------------------------*/
172 /* Private functions ---------------------------------------------------------*/
173
179 int main(void)
180 {
181 /* System initialization function */
182 SystemInit();
183
184 /* Identify BlueNRG1 platform */
185 SdkEvalIdentification();
186
187 /* UART initialization */
188 SdkEvalComUartInit(UART_BAUDRATE);
189
190 /* RNG enable clock */
191 // SysCtrl_PeripheralClockCmd(CLOCK_PERIPH_RNG, ENABLE);
192
193 /* RNG enable */
194 // RNG_Cmd(ENABLE);
195
196 /* Infinite loop */
197 while(1) {
198 /* Loop until the RNG Data Ready is SET */
199 while (RNG_GetFlagStatus() != SET);
200
201 /* Store the received byte in RxBuffer */
202 printf("Random value: 0x%04X\r\n",RNG_GetValue());
203 }
204
205 }
206
207
208 #ifdef USE_FULL_ASSERT
209
216 void assert_failed(uint8_t* file, uint32_t line)
217 {
218 /* User can add his own implementation to report the file name and line number,
219 ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
220
221 /* Infinite loop */
222 while (1)
223 {
224 }
225 }
226
227 #endif
228
241 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
main
int main(void)
Main program code.
Definition: RNG_terminal_main.c:179
UART_BAUDRATE
#define UART_BAUDRATE
Definition: ADC_PDM_main.c:225