Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / test / test_usb.c @ 1365

History | View | Annotate | Download (702 Bytes)

1
#include <dragonfly_lib.h>
2

    
3
/*
4
 * This function outputs to TeraTerm the following:
5
 *
6
 * Testing...
7
 * 1, 2, 3
8
 * 2A, F4, C8E1
9
 * done.
10
 * 
11
 */
12

    
13
int testusb(void) {
14
        
15
        usb_init();
16
        usb_puts("usb turned on, test starting:\r\n");
17
  
18
        usb_puts("\r\n\n");
19
        delay_ms(1000);
20
        
21
        // print some values to usb
22
  usb_puts("Testing...\n");
23
  usb_puti(1);
24
  usb_putc(',');
25
  usb_putc(' ');
26
  usb_puti(2);
27
  usb_putc(',');
28
  usb_putc(' ');
29
  usb_puti(3);
30
  usb_putc('\n');
31
  usb_puth8(0x2A);  
32
  usb_putc(',');
33
  usb_putc(' ');
34
  usb_puth16(0xF4);
35
  usb_putc(',');
36
  usb_putc(' ');
37
  usb_puth(0xC8E1);
38
  usb_putc('\n');
39
  usb_puts("done.\n");
40
  
41

    
42
  /* TODO: add test for getting values from usb */
43
  
44
  
45
        return 0;
46
}