Example program for EVAL-AD9106.

Dependencies:   AD910x

Committer:
scabatan
Date:
Wed Mar 03 02:18:23 2021 +0000
Revision:
1:b9d129e45c30
Parent:
0:3c9cc352dbfc
Child:
2:f20dbb194f12
Initial commit

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 1:b9d129e45c30 98 print_prompt2();
scabatan 1:b9d129e45c30 99 amp_out = getchar();
scabatan 1:b9d129e45c30 100 if ( amp_out == 'y' ){
scabatan 1:b9d129e45c30 101 shdn_n_lt3472 = 1;
scabatan 1:b9d129e45c30 102 printf("On-board amplifier supply is enabled.\n");
scabatan 1:b9d129e45c30 103 } else {
scabatan 1:b9d129e45c30 104 shdn_n_lt3472 = 0;
scabatan 1:b9d129e45c30 105 }
scabatan 1:b9d129e45c30 106 print_menu();
scabatan 1:b9d129e45c30 107 example = getchar();
scabatan 1:b9d129e45c30 108 printf("%c\n", example);
scabatan 1:b9d129e45c30 109 switch (example) {
scabatan 1:b9d129e45c30 110 case '1':
scabatan 1:b9d129e45c30 111 play_example1();
scabatan 1:b9d129e45c30 112 break;
Kjansen45 0:3c9cc352dbfc 113
scabatan 1:b9d129e45c30 114 case '2':
scabatan 1:b9d129e45c30 115 play_example2();
scabatan 1:b9d129e45c30 116 break;
scabatan 1:b9d129e45c30 117
scabatan 1:b9d129e45c30 118 case '3':
scabatan 1:b9d129e45c30 119 play_example3();
Kjansen45 0:3c9cc352dbfc 120 break;
Kjansen45 0:3c9cc352dbfc 121
scabatan 1:b9d129e45c30 122 case '4':
scabatan 1:b9d129e45c30 123 play_example4();
Kjansen45 0:3c9cc352dbfc 124 break;
scabatan 1:b9d129e45c30 125
scabatan 1:b9d129e45c30 126 case '5':
scabatan 1:b9d129e45c30 127 play_example5();
scabatan 1:b9d129e45c30 128 break;
scabatan 1:b9d129e45c30 129
scabatan 1:b9d129e45c30 130 case '6':
scabatan 1:b9d129e45c30 131 play_example6();
scabatan 1:b9d129e45c30 132 break;
scabatan 1:b9d129e45c30 133
Kjansen45 0:3c9cc352dbfc 134 default:
scabatan 1:b9d129e45c30 135 printf("\n****Invalid Entry****\n\n");
Kjansen45 0:3c9cc352dbfc 136 break;
scabatan 1:b9d129e45c30 137 }
scabatan 1:b9d129e45c30 138 print_prompt3();
scabatan 1:b9d129e45c30 139 while ( !(stop == 'y') ){
scabatan 1:b9d129e45c30 140 stop = getchar();
scabatan 1:b9d129e45c30 141 }
scabatan 1:b9d129e45c30 142 stop_example();
scabatan 1:b9d129e45c30 143 print_prompt4();
scabatan 1:b9d129e45c30 144 exit = getchar();
scabatan 1:b9d129e45c30 145 if ( exit == 'y' ){
scabatan 1:b9d129e45c30 146 connected = 0;
scabatan 1:b9d129e45c30 147 printf("\nExiting program...\n");
scabatan 1:b9d129e45c30 148 }
scabatan 1:b9d129e45c30 149
scabatan 1:b9d129e45c30 150 }
scabatan 1:b9d129e45c30 151
scabatan 1:b9d129e45c30 152 return 0;
scabatan 1:b9d129e45c30 153
scabatan 1:b9d129e45c30 154 }
scabatan 1:b9d129e45c30 155
scabatan 1:b9d129e45c30 156 /*** Function Definitions ***/
Kjansen45 0:3c9cc352dbfc 157
scabatan 1:b9d129e45c30 158 /*Function to setup SPI communication*/
scabatan 1:b9d129e45c30 159 void setup_device()
scabatan 1:b9d129e45c30 160 {
scabatan 1:b9d129e45c30 161 device.spi_init( WORD_LEN, POL, FREQ );
scabatan 1:b9d129e45c30 162 device.AD910x_reg_reset();
scabatan 1:b9d129e45c30 163 }
scabatan 1:b9d129e45c30 164
scabatan 1:b9d129e45c30 165 /*Function to print the title block when program first starts*/
scabatan 1:b9d129e45c30 166 void print_title()
scabatan 1:b9d129e45c30 167 {
scabatan 1:b9d129e45c30 168 printf("\n***********************************************************************\n");
scabatan 1:b9d129e45c30 169 printf("* EVAL-%S Demonstration Program *\n", ACTIVE_DEVICE);
scabatan 1:b9d129e45c30 170 printf("* *\n");
scabatan 1:b9d129e45c30 171 printf("* This program demonstrates how to generate waveforms with the %s *\n", ACTIVE_DEVICE);
scabatan 1:b9d129e45c30 172 printf("* using example register configurations in the datasheet. *\n");
scabatan 1:b9d129e45c30 173 printf("* This program is developed using Mbed OS version 6. *\n");
scabatan 1:b9d129e45c30 174 printf("***********************************************************************\n");
scabatan 1:b9d129e45c30 175 }
scabatan 1:b9d129e45c30 176
scabatan 1:b9d129e45c30 177 /*Function to print the first prompt/question to user to setup on-board oscillator supply*/
scabatan 1:b9d129e45c30 178 void print_prompt1()
scabatan 1:b9d129e45c30 179 {
scabatan 1:b9d129e45c30 180 printf( "\nUsing external clock source?\n" );
scabatan 1:b9d129e45c30 181 printf( "If yes, press y. If no, press any other key.\n" );
scabatan 1:b9d129e45c30 182 }
scabatan 1:b9d129e45c30 183
scabatan 1:b9d129e45c30 184 /*Function to print the next prompt/question to user to setup on-board amplifier supply*/
scabatan 1:b9d129e45c30 185 void print_prompt2()
scabatan 1:b9d129e45c30 186 {
scabatan 1:b9d129e45c30 187 printf( "\nConnected DAC outputs to on-board amplifiers?\n" );
scabatan 1:b9d129e45c30 188 printf( "If yes, press y. If no, press any other key.\n" );
Kjansen45 0:3c9cc352dbfc 189 }
Kjansen45 0:3c9cc352dbfc 190
scabatan 1:b9d129e45c30 191 /*Function to print summary of example AD910x configurations to play*/
scabatan 1:b9d129e45c30 192 void print_menu()
scabatan 1:b9d129e45c30 193 {
scabatan 1:b9d129e45c30 194 printf("\nExample Summary\n");
scabatan 1:b9d129e45c30 195 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 196 printf(" 1 - 4 Gaussian Pulses with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 197 printf(" 2 - 4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 198 printf(" 3 - 4 Pulsed DDS-Generated Sine Waves with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 199 printf(" 4 - Pulsed DDS-Generated Sine Wave and 3 Sawtooth Generator Waveforms\n");
scabatan 1:b9d129e45c30 200 printf(" 5 - Pulsed DDS-Generated Sine Waves Amplitude-Modulated by an SRAM Vector\n");
scabatan 1:b9d129e45c30 201 printf(" 6 - DDS-Generated Sine Wave and 3 Sawtooth Waveforms\n");
scabatan 1:b9d129e45c30 202 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 203 printf(" 1 - Gaussian Pulse\n");
scabatan 1:b9d129e45c30 204 printf(" 2 - Pulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 205 printf(" 3 - Pulsed DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 206 printf(" 4 - Sawtooth Waveform\n");
scabatan 1:b9d129e45c30 207 printf(" 5 - Pulsed DDS-Generated Sine Wave Amplitude-Modulated by an SRAM Vector\n");
scabatan 1:b9d129e45c30 208 printf(" 6 - DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 209 }
scabatan 1:b9d129e45c30 210 printf("Select an option: ");
scabatan 1:b9d129e45c30 211 }
Kjansen45 0:3c9cc352dbfc 212
scabatan 1:b9d129e45c30 213 /*Function to play example 1*/
scabatan 1:b9d129e45c30 214 void play_example1()
Kjansen45 0:3c9cc352dbfc 215 {
scabatan 1:b9d129e45c30 216 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 217 printf("\n4 Gaussian Pulses with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 218 thread_sleep_for(500);
scabatan 1:b9d129e45c30 219 device.AD910x_update_sram( example1_RAM_gaussian );
scabatan 1:b9d129e45c30 220 device.AD910x_update_regs( AD9106_example1_regval );
scabatan 1:b9d129e45c30 221 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 222 printf("\nGaussian Pulse\n");
scabatan 1:b9d129e45c30 223 thread_sleep_for(500);
scabatan 1:b9d129e45c30 224 device.AD910x_update_sram( example1_RAM_gaussian );
scabatan 1:b9d129e45c30 225 device.AD910x_update_regs( AD9102_example1_regval );
scabatan 1:b9d129e45c30 226 }
scabatan 1:b9d129e45c30 227 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 228 }
scabatan 1:b9d129e45c30 229
scabatan 1:b9d129e45c30 230 /*Function to play example 2*/
scabatan 1:b9d129e45c30 231 void play_example2()
scabatan 1:b9d129e45c30 232 {
scabatan 1:b9d129e45c30 233 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 234 printf("\n4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 235 thread_sleep_for(500);
scabatan 1:b9d129e45c30 236 device.AD910x_update_sram( example2_4096_ramp );
scabatan 1:b9d129e45c30 237 device.AD910x_update_regs( AD9106_example2_regval );
scabatan 1:b9d129e45c30 238 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 239 printf("\nPulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 240 thread_sleep_for(500);
scabatan 1:b9d129e45c30 241 device.AD910x_update_sram( example2_4096_ramp );
scabatan 1:b9d129e45c30 242 device.AD910x_update_regs( AD9102_example2_regval );
scabatan 1:b9d129e45c30 243 }
scabatan 1:b9d129e45c30 244 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 245 }
Kjansen45 0:3c9cc352dbfc 246
scabatan 1:b9d129e45c30 247 /*Function to play example 3*/
scabatan 1:b9d129e45c30 248 void play_example3()
scabatan 1:b9d129e45c30 249 {
scabatan 1:b9d129e45c30 250 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 251 printf("\n4 Pulsed DDS-Generated Sine Waves with Different Start Delays and Digital Gain Settings\n");
scabatan 1:b9d129e45c30 252 thread_sleep_for(500);
scabatan 1:b9d129e45c30 253 device.AD910x_update_regs( AD9106_example3_regval );
scabatan 1:b9d129e45c30 254 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 255 printf("\nPulsed DDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 256 thread_sleep_for(500);
scabatan 1:b9d129e45c30 257 device.AD910x_update_regs( AD9102_example3_regval );
scabatan 1:b9d129e45c30 258 }
scabatan 1:b9d129e45c30 259 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 260 }
scabatan 1:b9d129e45c30 261
scabatan 1:b9d129e45c30 262 /*Function to play example 4*/
scabatan 1:b9d129e45c30 263 void play_example4()
scabatan 1:b9d129e45c30 264 {
scabatan 1:b9d129e45c30 265 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 266 printf("\nPulsed DDS-Generated Sine Wave and 3 Sawtooth Generator Waveforms\n");
scabatan 1:b9d129e45c30 267 thread_sleep_for(500);
scabatan 1:b9d129e45c30 268 device.AD910x_update_regs( AD9106_example4_regval );
scabatan 1:b9d129e45c30 269 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 270 printf("\nSawtooth Waveform\n");
scabatan 1:b9d129e45c30 271 thread_sleep_for(500);
scabatan 1:b9d129e45c30 272 device.AD910x_update_regs( AD9102_example4_regval );
scabatan 1:b9d129e45c30 273 }
scabatan 1:b9d129e45c30 274 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 275 }
Kjansen45 0:3c9cc352dbfc 276
scabatan 1:b9d129e45c30 277 /*Function to play example 5*/
scabatan 1:b9d129e45c30 278 void play_example5()
Kjansen45 0:3c9cc352dbfc 279 {
scabatan 1:b9d129e45c30 280 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 281 printf("\n4 Pulses Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 282 thread_sleep_for(500);
scabatan 1:b9d129e45c30 283 device.AD910x_update_sram( example5_RAM_gaussian );
scabatan 1:b9d129e45c30 284 device.AD910x_update_regs( AD9106_example5_regval );
scabatan 1:b9d129e45c30 285 }else if ( ACTIVE_DEVICE == "AD9102"){
scabatan 1:b9d129e45c30 286 printf("\nPulse Generated from an SRAM Vector\n");
scabatan 1:b9d129e45c30 287 thread_sleep_for(500);
scabatan 1:b9d129e45c30 288 device.AD910x_update_sram( example5_RAM_gaussian );
scabatan 1:b9d129e45c30 289 device.AD910x_update_regs( AD9102_example5_regval );
scabatan 1:b9d129e45c30 290 }
scabatan 1:b9d129e45c30 291 device.AD910x_start_pattern();
Kjansen45 0:3c9cc352dbfc 292 }
Kjansen45 0:3c9cc352dbfc 293
scabatan 1:b9d129e45c30 294 /*Function to play example 1*/
scabatan 1:b9d129e45c30 295 void play_example6()
scabatan 1:b9d129e45c30 296 {
scabatan 1:b9d129e45c30 297 if ( ACTIVE_DEVICE == "AD9106" ){
scabatan 1:b9d129e45c30 298 printf("\nDDS-Generated Sine Wave and 3 Sawtooth Waveforms\n");
scabatan 1:b9d129e45c30 299 thread_sleep_for(500);
scabatan 1:b9d129e45c30 300 device.AD910x_update_regs( AD9106_example6_regval );
scabatan 1:b9d129e45c30 301 }else if( ACTIVE_DEVICE == "AD9102" ){
scabatan 1:b9d129e45c30 302 printf("\nDDS-Generated Sine Wave\n");
scabatan 1:b9d129e45c30 303 thread_sleep_for(500);
scabatan 1:b9d129e45c30 304 device.AD910x_update_regs( AD9102_example6_regval );
scabatan 1:b9d129e45c30 305 }
scabatan 1:b9d129e45c30 306 device.AD910x_start_pattern();
scabatan 1:b9d129e45c30 307 }
scabatan 1:b9d129e45c30 308
scabatan 1:b9d129e45c30 309 /*Function to print prompt/question to user to stop pattern*/
scabatan 1:b9d129e45c30 310 void print_prompt3()
Kjansen45 0:3c9cc352dbfc 311 {
scabatan 1:b9d129e45c30 312 printf( "\nStop pattern?\n" );
scabatan 1:b9d129e45c30 313 printf( "If yes, press y.\n" );
Kjansen45 0:3c9cc352dbfc 314 }
scabatan 1:b9d129e45c30 315
scabatan 1:b9d129e45c30 316 /*Function to stop pattern generation*/
scabatan 1:b9d129e45c30 317 void stop_example()
scabatan 1:b9d129e45c30 318 {
scabatan 1:b9d129e45c30 319 device.AD910x_stop_pattern();
scabatan 1:b9d129e45c30 320 printf( "Pattern stopped.\n" );
scabatan 1:b9d129e45c30 321 }
scabatan 1:b9d129e45c30 322
scabatan 1:b9d129e45c30 323 /*Function to print prompt/question to user to exit program*/
scabatan 1:b9d129e45c30 324 void print_prompt4()
scabatan 1:b9d129e45c30 325 {
scabatan 1:b9d129e45c30 326 printf( "\nExit program?\n" );
scabatan 1:b9d129e45c30 327 printf( "If yes, press y.\n" );
scabatan 1:b9d129e45c30 328 }