IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
Source at commit 5109e0bd44a870009975cc1f3cdf6edcce8da5cb created 13 years 7 months ago. By Werner Almesberger, Basic framework for CNTR firmware. | |
---|---|
1 | /* |
2 | * cntr/cntr.c - CNTR initialization and main loop |
3 | * |
4 | * Written 2008-2010 by Werner Almesberger |
5 | * Copyright 2008-2010 Werner Almesberger |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | */ |
12 | |
13 | |
14 | #include "regs.h" |
15 | #include "io.h" |
16 | #include "usb.h" |
17 | #include "cntr/ep0.h" |
18 | #include "version.h" |
19 | |
20 | |
21 | static void init_io(void) |
22 | { |
23 | /* |
24 | * Signal Mode Value |
25 | * |
26 | * PROBE_T0 open drain 1 (input) |
27 | * PROBE_ECI open drain 1 (input) |
28 | * PROBE_INT0 open drain 1 (input) |
29 | * |
30 | * PROBE_TERM open drain 0 |
31 | * |
32 | * LED push-pull 0 (set up by boot loader) |
33 | * |
34 | * all unused open drain 0 |
35 | */ |
36 | |
37 | P0 = 1 << PROBE_INT0_BIT; |
38 | P1 = (1 << PROBE_T0_BIT) | (1 << PROBE_ECI_BIT); |
39 | P2 = 0; |
40 | P3 = 0; |
41 | |
42 | /* |
43 | * Disable pull-ups |
44 | */ |
45 | XBR1 |= WEAKPUD; |
46 | } |
47 | |
48 | |
49 | void main(void) |
50 | { |
51 | init_io(); |
52 | |
53 | // usb_init(); |
54 | // ep0_init(); |
55 | |
56 | while (1) { |
57 | // usb_poll(); |
58 | } |
59 | } |
60 |