Cronologic Ndigo Crate Guía de usuario Pagina 49

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 57
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 48
5 C Example
1 #i n c l u d e ” N d i g o i n t e r f a c e . h
2 #i n c l u d e <s t d i o . h>
3 #i n c l u d e <s t d l i b . h>
4
5 i n t main ( i n t argc , char ar g v [ ] )
6 {
7 n d i g o i n i t p a r a m e t e r s params ;
8 n d i g o g e t d e f a u l t i n i t p a r a m e t e r s (&params ) ;
9
10 params . c a r d i n d e x = 0 ;
11 params . b u f f e r s i z e [ 0 ] = 1<<23;
12 params . d r i v e e x t e r n a l c l o c k = true ;
13 params . i s s l a v e = f a l s e ;
14 params . u s e e x t e r n a l c l o c k = f a l s e ;
15
16 in t e r r o r c o d e ;
17 const char e r r o r m e s s a g e ;
18 n d i g o d e v i c e ndgo = n d i g o i n i t (&params , &e r r o r c o d e , &e r r o r m e s s a g e ) ;
19 i f ( e r r o r c o d e != NDIGO OK ) {
20 p r i n t f ( \ n E r r o r %d : %s \n , e r r o r c o d e , e r r o r m e s s a g e ) ;
21 e x i t ( 1) ;
22 }
23
24 n d i g o c o n f i g u r a t i o n c o n f i g ;
25 n d i g o g e t d e f a u l t c o n f i g u r a t i o n ( ndgo , &c o n f i g ) ;
26 c o n f i g . adc mode = NDIGO ADC MODE ABCD ;
27
28 // d i s a b l e unused t r i g g e r blocks
29 c o n f i g . t r i g g e r b l o c k [ 1 ] . e n a b l e d = f a l s e ;
30 c o n f i g . t r i g g e r b l o c k [ 2 ] . e n a b l e d = f a l s e ;
31 c o n f i g . t r i g g e r b l o c k [ 3 ] . e n a b l e d = f a l s e ;
32 c o n f i g . t r i g g e r b l o c k [ 4 ] . e n a b l e d = f a l s e ;
33
34 // c o n f i g u r e t r i g g e r b loc k 0
35 c o n f i g . t r i g g e r b l o c k [ 0 ] . e n a b l e d = tr ue ;
36 c o n f i g . t r i g g e r b l o c k [ 0 ] . m i n i m u m f r e e p a c k e t s = 1 . 0 ;
37 c o n f i g . t r i g g e r b l o c k [ 0 ] . p r e c u r s o r = 0 ;
38 c o n f i g . t r i g g e r b l o c k [ 0 ] . r e t r i g g e r = 0 ;
45
Vista de pagina 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 55 56 57

Comentarios a estos manuales

Sin comentarios