Example program for EVAL-AD9106.

Dependencies:   AD910x

Committer:
scabatan
Date:
Thu Mar 04 02:13:05 2021 +0000
Revision:
2:f20dbb194f12
Parent:
1:b9d129e45c30
Child:
3:7a4971eab899
Updated config.h and main.cpp

Who changed what in which revision?

UserRevisionLine numberNew contents of line
scabatan 1:b9d129e45c30 1 /* Copyright (c) 2021 Analog Devices, Inc. All rights reserved.
Kjansen45 0:3c9cc352dbfc 2
Kjansen45 0:3c9cc352dbfc 3 Redistribution and use in source and binary forms, with or without modification,
Kjansen45 0:3c9cc352dbfc 4 are permitted provided that the following conditions are met:
Kjansen45 0:3c9cc352dbfc 5 - Redistributions of source code must retain the above copyright notice,
Kjansen45 0:3c9cc352dbfc 6 this list of conditions and the following disclaimer.
Kjansen45 0:3c9cc352dbfc 7 - Redistributions in binary form must reproduce the above copyright notice,
Kjansen45 0:3c9cc352dbfc 8 this list of conditions and the following disclaimer in the documentation
Kjansen45 0:3c9cc352dbfc 9 and/or other materials provided with the distribution.
Kjansen45 0:3c9cc352dbfc 10 - Modified versions of the software must be conspicuously marked as such.
Kjansen45 0:3c9cc352dbfc 11 - This software is licensed solely and exclusively for use with processors/products
Kjansen45 0:3c9cc352dbfc 12 manufactured by or for Analog Devices, Inc.
Kjansen45 0:3c9cc352dbfc 13 - This software may not be combined or merged with other code in any manner
Kjansen45 0:3c9cc352dbfc 14 that would cause the software to become subject to terms and conditions which
Kjansen45 0:3c9cc352dbfc 15 differ from those listed here.
Kjansen45 0:3c9cc352dbfc 16 - Neither the name of Analog Devices, Inc. nor the names of its contributors
Kjansen45 0:3c9cc352dbfc 17 may be used to endorse or promote products derived from this software without
Kjansen45 0:3c9cc352dbfc 18 specific prior written permission.
scabatan 1:b9d129e45c30 19 - The use of this software may or may not infringe the patent rights of one or
Kjansen45 0:3c9cc352dbfc 20 more patent holders. This license does not release you from the requirement
Kjansen45 0:3c9cc352dbfc 21 that you obtain separate licenses from these patent holders to use this software.
scabatan 1:b9d129e45c30 22
Kjansen45 0:3c9cc352dbfc 23 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND
Kjansen45 0:3c9cc352dbfc 24 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
Kjansen45 0:3c9cc352dbfc 25 TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
Kjansen45 0:3c9cc352dbfc 26 NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Kjansen45 0:3c9cc352dbfc 27 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES
Kjansen45 0:3c9cc352dbfc 28 (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL
Kjansen45 0:3c9cc352dbfc 29 PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
Kjansen45 0:3c9cc352dbfc 30 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Kjansen45 0:3c9cc352dbfc 31 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Kjansen45 0:3c9cc352dbfc 32 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
Kjansen45 0:3c9cc352dbfc 33 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kjansen45 0:3c9cc352dbfc 34
scabatan 1:b9d129e45c30 35 <Insert license number here.>
Kjansen45 0:3c9cc352dbfc 36
Kjansen45 0:3c9cc352dbfc 37 */
Kjansen45 0:3c9cc352dbfc 38
scabatan 1:b9d129e45c30 39 /*** Libraries ***/
scabatan 1:b9d129e45c30 40 #include "mbed.h"
scabatan 1:b9d129e45c30 41 #include "platform/mbed_thread.h"
scabatan 1:b9d129e45c30 42 #include "config.h"
scabatan 1:b9d129e45c30 43 #include "ad910x.h"
Kjansen45 0:3c9cc352dbfc 44
scabatan 1:b9d129e45c30 45 /*** Defines for UART Protocol ***/
scabatan 1:b9d129e45c30 46 #define BAUD_RATE 9600
scabatan 1:b9d129e45c30 47
scabatan 1:b9d129e45c30 48 AD910x device( PA_15 );
scabatan 1:b9d129e45c30 49 DigitalOut en_cvddx( PG_7, 0 ); ///< DigitalOut instance for enable pin of on-board oscillator supply
scabatan 1:b9d129e45c30 50 DigitalOut shdn_n_lt3472( PG_9, 0 ); ///< DigitalOut instance for shutdown/enable pin of on-board amplifier supply
scabatan 1:b9d129e45c30 51
scabatan 1:b9d129e45c30 52 /* Configure and instantiate UART protocol and baud rate */
scabatan 1:b9d129e45c30 53 UnbufferedSerial pc( USBTX, USBRX, BAUD_RATE );
Kjansen45 0:3c9cc352dbfc 54
scabatan 1:b9d129e45c30 55 /*** Function Declarations ***/
scabatan 1:b9d129e45c30 56 void setup_device( void );
scabatan 1:b9d129e45c30 57 void print_title( void );
scabatan 1:b9d129e45c30 58 void print_prompt1( void );
scabatan 1:b9d129e45c30 59 void print_prompt2( void );
scabatan 1:b9d129e45c30 60 void print_menu( void );
scabatan 1:b9d129e45c30 61 void play_example1( void );
scabatan 1:b9d129e45c30 62 void play_example2( void );
scabatan 1:b9d129e45c30 63 void play_example3( void );
scabatan 1:b9d129e45c30 64 void play_example4( void );
scabatan 1:b9d129e45c30 65 void play_example5( void );
scabatan 1:b9d129e45c30 66 void play_example6( void );
scabatan 1:b9d129e45c30 67 void print_prompt3( void );
scabatan 1:b9d129e45c30 68 void stop_example( void );
scabatan 1:b9d129e45c30 69 void print_prompt4( void );
Kjansen45 0:3c9cc352dbfc 70
scabatan 1:b9d129e45c30 71 /*** Main Function ***/
Kjansen45 0:3c9cc352dbfc 72
Kjansen45 0:3c9cc352dbfc 73 int main()
Kjansen45 0:3c9cc352dbfc 74 {
scabatan 1:b9d129e45c30 75 char ext_clk = 'y';
scabatan 1:b9d129e45c30 76 char amp_out = 'n';
scabatan 1:b9d129e45c30 77 char stop = 'n';
scabatan 1:b9d129e45c30 78 char exit = 'n';
scabatan 1:b9d129e45c30 79 char example = 1;
scabatan 1:b9d129e45c30 80 uint8_t connected = 1;
scabatan 1:b9d129e45c30 81
scabatan 1:b9d129e45c30 82 device.resetb = 1;
scabatan 1:b9d129e45c30 83 device.triggerb = 1;
scabatan 1:b9d129e45c30 84 setup_device();
scabatan 1:b9d129e45c30 85
Kjansen45 0:3c9cc352dbfc 86 print_title();
scabatan 1:b9d129e45c30 87
scabatan 1:b9d129e45c30 88 while( connected == 1 ){
scabatan 1:b9d129e45c30 89 print_prompt1();
scabatan 1:b9d129e45c30 90 ext_clk = getchar();
scabatan 1:b9d129e45c30 91 if ( ext_clk == 'y' ){
scabatan 1:b9d129e45c30 92 en_cvddx = 0;
scabatan 1:b9d129e45c30 93 printf("Please connect external clock source to J10.\n");
scabatan 1:b9d129e45c30 94 } else {
scabatan 1:b9d129e45c30 95 en_cvddx = 1;
scabatan 1:b9d129e45c30 96 printf("On-board oscillator supply is enabled.\n");
scabatan 1:b9d129e45c30 97 }
scabatan 2:f20dbb194f12 98 thread_sleep_for(500);
scabatan 1:b9d129e45c30 99 print_prompt2();
scabatan 1:b9d129e45c30 100 amp_out = getchar();
scabatan 1:b9d129e45c30 101 if ( amp_out == 'y' ){
scabatan 1:b9d129e45c30 102 shdn_n_lt3472 = 1;
scabatan 1:b9d129e45c30 103 printf("On-board amplifier supply is enabled.\n");
scabatan 1:b9d129e45c30 104 } else {
scabatan 1:b9d129e45c30 105 shdn_n_lt3472 = 0;
scabatan 1:b9d129e45c30 106 }
scabatan 1:b9d129e45c30 107 print_menu();
scabatan 1:b9d129e45c30 108 example = getchar();
scabatan 1:b9d129e45c30 109 printf("%c\n", example);
scabatan 1:b9d129e45c30 110 switch (example) {
scabatan 1:b9d129e45c30 111 case '1':
scabatan 1:b9d129e45c30 112 play_example1();
scabatan 1:b9d129e45c30 113 break;
Kjansen45 0:3c9cc352dbfc 114
scabatan 1:b9d129e45c30 115 case '2':
scabatan 1:b9d129e45c30 116 play_example2();
scabatan 1:b9d129e45c30 117 break;
scabatan 1:b9d129e45c30 118
scabatan 1:b9d129e45c30 119 case '3':
scabatan 1:b9d129e45c30 120 play_example3();
Kjansen45 0:3c9cc352dbfc 121 break;
Kjansen45 0:3c9cc352dbfc 122
scabatan 1:b9d129e45c30 123 case '4':
scabatan 1:b9d129e45c30 124 play_example4();
Kjansen45 0:3c9cc352dbfc 125 break;
scabatan 1:b9d129e45c30 126
scabatan 1:b9d129e45c30 127 case '5':
scabatan 1:b9d129e45c30 128 play_example5();
scabatan 1:b9d129e45c30 129 break;
scabatan 1:b9d129e45c30 130
scabatan 1:b9d129e45c30 131 case '6':
scabatan 1:b9d129e45c30 132 play_example6();
scabatan 1:b9d129e45c30 133 break;
scabatan 1:b9d129e45c30 134
Kjansen45 0:3c9cc352dbfc 135 default:
scabatan 1:b9d129e45c30 136 printf("\n****Invalid Entry****\n\n");
Kjansen45 0:3c9cc352dbfc 137 break;
scabatan 1:b9d129e45c30 138 }
scabatan 1:b9d129e45c30 139 print_prompt3();
scabatan 1:b9d129e45c30 140 while ( !(stop == 'y') ){
scabatan 1:b9d129e45c30 141 stop = getchar();
scabatan 1:b9d129e45c30 142 }
scabatan 1:b9d129e45c30 143 stop_example();
scabatan 1:b9d129e45c30 144 print_prompt4();
scabatan 1:b9d129e45c30 145 exit = getchar();
scabatan 1:b9d129e45c30 146 if ( exit == 'y' ){
scabatan 1:b9d129e45c30 147 connected = 0;
scabatan 1:b9d129e45c30 148 printf("\nExiting program...\n");
scabatan 1:b9d129e45c30 149 }
scabatan 1:b9d129e45c30 150
scabatan 1:b9d129e45c30 151 }
scabatan 1:b9d129e45c30 152
scabatan 1:b9d129e45c30 153 return 0;
scabatan 1:b9d129e45c30 154
scabatan 1:b9d129e45c30 155 }
scabatan 1:b9d129e45c30 156
scabatan 1:b9d129e45c30 157 /*** Function Definitions ***/
Kjansen45 0:3c9cc352dbfc 158
scabatan 1:b9d129e45c30 159 /*Function to setup SPI communication*/
scabatan 1:b9d129e45c30 160 void setup_device()
scabatan 1:b9d129e45c30 161 {
scabatan 1:b9d129e45c30 162 device.spi_init( WORD_LEN, POL, FREQ );
scabatan 1:b9d129e45c30 163 device.AD910x_reg_reset();
scabatan 1:b9d129e45c30 164 }
scabatan 1:b9d129e45c30 165
scabatan 1:b9d129e45c30 166 /*Function to print the title block when program first starts*/
scabatan 1:b9d129e45c30 167 void print_title()
scabatan 1:b9d129e45c30 168 {
scabatan 1:b9d129e45c30 169 printf("\n***********************************************************************\n");
scabatan 2:f20dbb194f12 170 printf("* EVAL-%s Demonstration Program *\n", ACTIVE_DEVICE);
scabatan 1:b9d129e45c30 171 printf("* *\n");
scabatan 1:b9d129e45c30 172 printf("* This program demonstrates how to generate waveforms with the %s *\n", ACTIVE_DEVICE);
scabatan 1:b9d129e45c30 173 printf("* using example register configurations in the datasheet. *\n");
scabatan 1:b9d129e45c30 174 printf("* This program is developed using Mbed OS version 6. *\n");
scabatan 1:b9d129e45c30 175 printf("***********************************************************************\n");
scabatan 1:b9d129e45c30 176 }
scabatan 1:b9d129e45c30 177
scabatan 1:b9d129e45c30 178 /*Function to print the first prompt/question to user to setup on-board oscillator supply*/
scabatan 1:b9d129e45c30 179 void print_prompt1()
scabatan 1:b9d129e45c30 180 {
scabatan 1:b9d129e45c30 181 printf( "\nUsing external clock source?\n" );
scabatan 1:b9d129e45c30 182 printf( "If yes, press y. If no, press any other key.\n" );
scabatan 1:b9d129e45c30 183 }
scabatan 1:b9d129e45c30 184
scabatan 1:b9d129e45c30 185 /*Function to print the next prompt/question to user to setup on-board amplifier supply*/
scabatan 1:b9d129e45c30 186 void print_prompt2()
scabatan 1:b9d129e45c30 187 {
scabatan 1:b9d129e45c30 188 printf( "\nConnected DAC outputs to on-board amplifiers?\n" );
scabatan 1:b9d129e45c30 189 printf( "If yes, press y. If no, press any other key.\n" );
Kjansen45 0:3c9cc352dbfc 190 }
Kjansen45 0:3c9cc352dbfc 191
scabatan 1:b9d129e45c30 192 /*Function to print summary of example AD910x configurations to play*/
scabatan 1:b9d129e45c30 193 void print_menu()
scabatan 1:b9d129e45c30 194 {
scabatan 1:b9d129e45c30 195 printf("\nExample Summary\n");
scabatan 1:b9d129e45c30 196 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 197 printf(" 1 - 4 Gaussian Pulses with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 198 printf(" 2 - 4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 199 printf(" 3 - 4 Pulsed DDS-Generated Sine Waves with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 200 printf(" 4 - Pulsed DDS-Generated Sine Wave and 3 Sawtooth Generator Waveforms\n");
scabatan 1:b9d129e45c30 201 printf(" 5 - Pulsed DDS-Generated Sine Waves Amplitude-Modulated by an SRAM Vector\n");
scabatan 1:b9d129e45c30 202 printf(" 6 - DDS-Generated Sine Wave and 3 Sawtooth Waveforms\n");
scabatan 1:b9d129e45c30 203 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 204 printf(" 1 - Gaussian Pulse\n");
scabatan 1:b9d129e45c30 205 printf(" 2 - Pulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 206 printf(" 3 - Pulsed DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 207 printf(" 4 - Sawtooth Waveform\n");
scabatan 1:b9d129e45c30 208 printf(" 5 - Pulsed DDS-Generated Sine Wave Amplitude-Modulated by an SRAM Vector\n");
scabatan 1:b9d129e45c30 209 printf(" 6 - DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 210 }
scabatan 1:b9d129e45c30 211 printf("Select an option: ");
scabatan 1:b9d129e45c30 212 }
Kjansen45 0:3c9cc352dbfc 213
scabatan 1:b9d129e45c30 214 /*Function to play example 1*/
scabatan 1:b9d129e45c30 215 void play_example1()
Kjansen45 0:3c9cc352dbfc 216 {
scabatan 1:b9d129e45c30 217 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 218 printf("\n4 Gaussian Pulses with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 219 thread_sleep_for(500);
scabatan 1:b9d129e45c30 220 device.AD910x_update_sram( example1_RAM_gaussian );
scabatan 1:b9d129e45c30 221 device.AD910x_update_regs( AD9106_example1_regval );
scabatan 1:b9d129e45c30 222 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 223 printf("\nGaussian Pulse\n");
scabatan 1:b9d129e45c30 224 thread_sleep_for(500);
scabatan 1:b9d129e45c30 225 device.AD910x_update_sram( example1_RAM_gaussian );
scabatan 1:b9d129e45c30 226 device.AD910x_update_regs( AD9102_example1_regval );
scabatan 1:b9d129e45c30 227 }
scabatan 1:b9d129e45c30 228 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 229 }
scabatan 1:b9d129e45c30 230
scabatan 1:b9d129e45c30 231 /*Function to play example 2*/
scabatan 1:b9d129e45c30 232 void play_example2()
scabatan 1:b9d129e45c30 233 {
scabatan 1:b9d129e45c30 234 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 235 printf("\n4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 236 thread_sleep_for(500);
scabatan 1:b9d129e45c30 237 device.AD910x_update_sram( example2_4096_ramp );
scabatan 1:b9d129e45c30 238 device.AD910x_update_regs( AD9106_example2_regval );
scabatan 1:b9d129e45c30 239 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 240 printf("\nPulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 241 thread_sleep_for(500);
scabatan 1:b9d129e45c30 242 device.AD910x_update_sram( example2_4096_ramp );
scabatan 1:b9d129e45c30 243 device.AD910x_update_regs( AD9102_example2_regval );
scabatan 1:b9d129e45c30 244 }
scabatan 1:b9d129e45c30 245 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 246 }
Kjansen45 0:3c9cc352dbfc 247
scabatan 1:b9d129e45c30 248 /*Function to play example 3*/
scabatan 1:b9d129e45c30 249 void play_example3()
scabatan 1:b9d129e45c30 250 {
scabatan 1:b9d129e45c30 251 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 252 printf("\n4 Pulsed DDS-Generated Sine Waves with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 253 thread_sleep_for(500);
scabatan 1:b9d129e45c30 254 device.AD910x_update_regs( AD9106_example3_regval );
scabatan 1:b9d129e45c30 255 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 256 printf("\nPulsed DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 257 thread_sleep_for(500);
scabatan 1:b9d129e45c30 258 device.AD910x_update_regs( AD9102_example3_regval );
scabatan 1:b9d129e45c30 259 }
scabatan 1:b9d129e45c30 260 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 261 }
scabatan 1:b9d129e45c30 262
scabatan 1:b9d129e45c30 263 /*Function to play example 4*/
scabatan 1:b9d129e45c30 264 void play_example4()
scabatan 1:b9d129e45c30 265 {
scabatan 1:b9d129e45c30 266 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 267 printf("\nPulsed DDS-Generated Sine Wave and 3 Sawtooth Generator Waveforms\n");
scabatan 1:b9d129e45c30 268 thread_sleep_for(500);
scabatan 1:b9d129e45c30 269 device.AD910x_update_regs( AD9106_example4_regval );
scabatan 1:b9d129e45c30 270 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 271 printf("\nSawtooth Waveform\n");
scabatan 1:b9d129e45c30 272 thread_sleep_for(500);
scabatan 1:b9d129e45c30 273 device.AD910x_update_regs( AD9102_example4_regval );
scabatan 1:b9d129e45c30 274 }
scabatan 1:b9d129e45c30 275 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 276 }
Kjansen45 0:3c9cc352dbfc 277
scabatan 1:b9d129e45c30 278 /*Function to play example 5*/
scabatan 1:b9d129e45c30 279 void play_example5()
Kjansen45 0:3c9cc352dbfc 280 {
scabatan 1:b9d129e45c30 281 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 282 printf("\n4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 283 thread_sleep_for(500);
scabatan 1:b9d129e45c30 284 device.AD910x_update_sram( example5_RAM_gaussian );
scabatan 1:b9d129e45c30 285 device.AD910x_update_regs( AD9106_example5_regval );
scabatan 1:b9d129e45c30 286 }else if ( ACTIVE_DEVICE == "AD9102"){
scabatan 1:b9d129e45c30 287 printf("\nPulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 288 thread_sleep_for(500);
scabatan 1:b9d129e45c30 289 device.AD910x_update_sram( example5_RAM_gaussian );
scabatan 1:b9d129e45c30 290 device.AD910x_update_regs( AD9102_example5_regval );
scabatan 1:b9d129e45c30 291 }
scabatan 1:b9d129e45c30 292 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 293 }
Kjansen45 0:3c9cc352dbfc 294
scabatan 1:b9d129e45c30 295 /*Function to play example 1*/
scabatan 1:b9d129e45c30 296 void play_example6()
scabatan 1:b9d129e45c30 297 {
scabatan 1:b9d129e45c30 298 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 299 printf("\nDDS-Generated Sine Wave and 3 Sawtooth Waveforms\n");
scabatan 1:b9d129e45c30 300 thread_sleep_for(500);
scabatan 1:b9d129e45c30 301 device.AD910x_update_regs( AD9106_example6_regval );
scabatan 1:b9d129e45c30 302 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 303 printf("\nDDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 304 thread_sleep_for(500);
scabatan 1:b9d129e45c30 305 device.AD910x_update_regs( AD9102_example6_regval );
scabatan 1:b9d129e45c30 306 }
scabatan 1:b9d129e45c30 307 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 308 }
scabatan 1:b9d129e45c30 309
scabatan 1:b9d129e45c30 310 /*Function to print prompt/question to user to stop pattern*/
scabatan 1:b9d129e45c30 311 void print_prompt3()
Kjansen45 0:3c9cc352dbfc 312 {
scabatan 1:b9d129e45c30 313 printf( "\nStop pattern?\n" );
scabatan 1:b9d129e45c30 314 printf( "If yes, press y.\n" );
Kjansen45 0:3c9cc352dbfc 315 }
scabatan 1:b9d129e45c30 316
scabatan 1:b9d129e45c30 317 /*Function to stop pattern generation*/
scabatan 1:b9d129e45c30 318 void stop_example()
scabatan 1:b9d129e45c30 319 {
scabatan 1:b9d129e45c30 320 device.AD910x_stop_pattern();
scabatan 1:b9d129e45c30 321 printf( "Pattern stopped.\n" );
scabatan 1:b9d129e45c30 322 }
scabatan 1:b9d129e45c30 323
scabatan 1:b9d129e45c30 324 /*Function to print prompt/question to user to exit program*/
scabatan 1:b9d129e45c30 325 void print_prompt4()
scabatan 1:b9d129e45c30 326 {
scabatan 1:b9d129e45c30 327 printf( "\nExit program?\n" );
scabatan 1:b9d129e45c30 328 printf( "If yes, press y.\n" );
scabatan 1:b9d129e45c30 329 }