IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2010-08-21 06:42:58 (13 years 7 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 7a534d2269bad77693644a2789f6f784b3ccbfd3 |
Message: | Enter TRX_OFF to enable DVDD regulator. Plus minor cleanup. - tools/atspi-txrx/Makefile, tools/atspi-txrx/atspi-txrx.c: new utility that, for now, just turns on the DVDD regulator - tools/atspi-id/Makefile: corrected path in title - fw/include/at86rf230.h: changed TRX_STATE_* to TRX_CMD_* |
Files: |
fw/include/at86rf230.h (1 diff) tools/atspi-id/Makefile (1 diff) tools/atspi-txrx/Makefile (1 diff) tools/atspi-txrx/atspi-txrx.c (1 diff) |
Change Details
fw/include/at86rf230.h | ||
---|---|---|
113 | 113 | TRAC_STATUS_INVALID = 7 |
114 | 114 | }; |
115 | 115 | |
116 | /* --- TRX_STATE [4:0] ----------------------------------------------------- */ | |
116 | /* --- TRX_CMD [4:0] ----------------------------------------------------- */ | |
117 | 117 | |
118 | #define TRX_STATE_SHIFT 0 | |
119 | #define TRX_STATE_MASK 7 | |
118 | #define TRX_CMD_SHIFT 0 | |
119 | #define TRX_CMD_MASK 7 | |
120 | 120 | |
121 | 121 | enum { |
122 | TRX_STATE_NOP = 0x00, /* reset default */ | |
123 | TRX_STATE_TX_START = 0x02, | |
124 | TRX_STATE_FORCE_TRX_OFF = 0x03, | |
125 | TRX_STATE_RX_ON = 0x06, | |
126 | TRX_STATE_TRX_OFF = 0x08, | |
127 | TRX_STATE_PLL_ON = 0x09, | |
128 | TRX_STATE_RX_AACK_ON = 0x16, | |
129 | TRX_STATE_TX_ARET_ON = 0x19, | |
122 | TRX_CMD_NOP = 0x00, /* reset default */ | |
123 | TRX_CMD_TX_START = 0x02, | |
124 | TRX_CMD_FORCE_TRX_OFF = 0x03, | |
125 | TRX_CMD_RX_ON = 0x06, | |
126 | TRX_CMD_TRX_OFF = 0x08, | |
127 | TRX_CMD_PLL_ON = 0x09, | |
128 | TRX_CMD_RX_AACK_ON = 0x16, | |
129 | TRX_CMD_TX_ARET_ON = 0x19, | |
130 | 130 | }; |
131 | 131 | |
132 | 132 | /* --- TRX_CTRL_0 [7:6] ---------------------------------------------------- */ |
tools/atspi-id/Makefile | ||
---|---|---|
1 | 1 | # |
2 | # atspi/Makefile - Build the ATSPI identification utility | |
2 | # atspi-id/Makefile - Build the ATSPI identification utility | |
3 | 3 | # |
4 | 4 | # Written 2010 by Werner Almesberger |
5 | 5 | # Copyright 2010 Werner Almesberger |
tools/atspi-txrx/Makefile | ||
---|---|---|
1 | # | |
2 | # atspi-txrx/Makefile - Build the TX/RX test utility | |
3 | # | |
4 | # Written 2010 by Werner Almesberger | |
5 | # Copyright 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 | F32XBASE = ../../../f32xbase | |
15 | ||
16 | MAIN = atspi-txrx | |
17 | ||
18 | include $(F32XBASE)/lib/Makefile.common | |
19 | ||
20 | CFLAGS += -I../../fw/include -I../include | |
21 | LDLIBS += -L../lib -latspi |
tools/atspi-txrx/atspi-txrx.c | ||
---|---|---|
1 | /* | |
2 | * atspi-txrx/atspi-txrx.c - ben-wpan AF86RF230 TX/RX | |
3 | * | |
4 | * Written 2010 by Werner Almesberger | |
5 | * Copyright 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 <stdlib.h> | |
15 | #include <stdio.h> | |
16 | #include <usb.h> | |
17 | ||
18 | #include "at86rf230.h" | |
19 | #include "atspi/ep0.h" | |
20 | #include "atspi.h" | |
21 | ||
22 | ||
23 | #define FROM_DEV ATSPI_FROM_DEV(0) | |
24 | #define TO_DEV ATSPI_TO_DEV(0) | |
25 | ||
26 | #define BUF_SIZE 256 | |
27 | ||
28 | ||
29 | static void usage(const char *name) | |
30 | { | |
31 | fprintf(stderr, "%s\n", name); | |
32 | exit(1); | |
33 | } | |
34 | ||
35 | ||
36 | int main(int argc, const char **argv) | |
37 | { | |
38 | usb_dev_handle *dev; | |
39 | ||
40 | if (argc != 1) | |
41 | usage(*argv); | |
42 | dev = atspi_open(); | |
43 | if (!dev) | |
44 | return 1; | |
45 | ||
46 | atspi_reg_write(dev, REG_TRX_STATE, TRX_CMD_TRX_OFF); | |
47 | sleep(1000); | |
48 | ||
49 | return 0; | |
50 | } |