Statistics
| Branch: | Tag: | Revision:

root / host / apps / omap_debug / usrp-e-led.c @ f2454f90

History | View | Annotate | Download (543 Bytes)

1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <sys/types.h>
4
#include <fcntl.h>
5
#include <string.h>
6
#include <sys/ioctl.h>
7
#include <unistd.h>
8

    
9
#include "usrp_e.h"
10
#include "usrp_e_regs.hpp"
11

    
12
// Usage: usrp_e_uart <string>
13

    
14

    
15
int main(int argc, char *argv[])
16
{
17
        int fp, i, ret;
18
        struct usrp_e_ctl16 d;
19

    
20
        fp = open("/dev/usrp_e0", O_RDWR);
21
        printf("fp = %d\n", fp);
22

    
23
        d.offset = UE_REG_MISC_BASE;
24
        d.count = 1;
25

    
26
        while (1) {
27
                for (i=0; i<8; i++) {
28
                        d.buf[0] = i;
29
                        ret = ioctl(fp, USRP_E_WRITE_CTL16, &d);
30
                        sleep(1);
31
                }
32
        }
33

    
34
        return 0;
35
}