tools/atrf-txrx/atrf-txrx.c |
112 | 112 | atrf_reg_write(dsc, REG_IRQ_MASK, 0xff); |
113 | 113 | |
114 | 114 | flush_interrupts(dsc); |
115 | | if (atrf_identify(dsc) == artf_at86rf231) |
| 115 | if (atrf_identify(dsc) == atrf_at86rf231) |
116 | 116 | wait_for_interrupt(dsc, IRQ_CCA_ED_DONE, IRQ_CCA_ED_DONE, 1); |
117 | 117 | /* according to table 7-1, 37 us max */ |
118 | 118 | |
... | ... | |
131 | 131 | if (!rate) |
132 | 132 | return; |
133 | 133 | switch (atrf_identify(dsc)) { |
134 | | case artf_at86rf230: |
| 134 | case atrf_at86rf230: |
135 | 135 | fprintf(stderr, "AT86RF230 only supports 250 kbps\n"); |
136 | 136 | break; |
137 | | case artf_at86rf231: |
| 137 | case atrf_at86rf231: |
138 | 138 | atrf_reg_write(dsc, REG_TRX_CTRL_2, rate); |
139 | 139 | break; |
140 | 140 | default: |
tools/atrf-xtal/atben.c |
1 | 1 | /* |
2 | 2 | * atrf-xtal/atben.c - ATBEN-specific driver and evaluation |
3 | 3 | * |
4 | | * Written 2011 by Werner Almesberger |
5 | | * Copyright 2011 Werner Almesberger |
| 4 | * Written 2011, 2013 by Werner Almesberger |
| 5 | * Copyright 2011, 2013 Werner Almesberger |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
59 | 59 | |
60 | 60 | /* minimum TX power, maximize delays, disable CRC */ |
61 | 61 | switch (atrf_identify(dsc)) { |
62 | | case artf_at86rf230: |
| 62 | case atrf_at86rf230: |
63 | 63 | atrf_reg_write(dsc, REG_PHY_TX_PWR, 0xf); |
64 | 64 | break; |
65 | | case artf_at86rf231: |
| 65 | case atrf_at86rf231: |
66 | 66 | atrf_reg_write(dsc, REG_PHY_TX_PWR, 0xff); |
67 | 67 | atrf_reg_write(dsc, REG_TRX_CTRL_1, 0); |
68 | 68 | break; |
tools/lib/cwtest.c |
1 | 1 | /* |
2 | 2 | * lib/cwtest.c - Set up AT86RF230/231 constant wave test mode |
3 | 3 | * |
4 | | * Written 2010-2011 by Werner Almesberger |
5 | | * Copyright 2010-2011 Werner Almesberger |
| 4 | * Written 2010-2011, 2013 by Werner Almesberger |
| 5 | * Copyright 2010-2011, 2013 Werner Almesberger |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
30 | 30 | { |
31 | 31 | if (atrf_usb_handle(dsc)) |
32 | 32 | return 1; |
33 | | if (atrf_identify(dsc) == artf_at86rf230) |
| 33 | if (atrf_identify(dsc) == atrf_at86rf230) |
34 | 34 | return 1; |
35 | 35 | return 0; |
36 | 36 | } |
... | ... | |
111 | 111 | void cw_test_begin(struct atrf_dsc *dsc, uint8_t cont_tx) |
112 | 112 | { |
113 | 113 | switch (atrf_identify(dsc)) { |
114 | | case artf_at86rf230: |
| 114 | case atrf_at86rf230: |
115 | 115 | enter_test_mode_230(dsc, cont_tx); |
116 | 116 | last_cont_tx = cont_tx; |
117 | 117 | break; |
118 | | case artf_at86rf231: |
| 118 | case atrf_at86rf231: |
119 | 119 | prepare_test_mode_231(dsc, cont_tx); |
120 | 120 | start_test_mode_231(dsc); |
121 | 121 | break; |
... | ... | |
128 | 128 | void cw_test_resume(struct atrf_dsc *dsc) |
129 | 129 | { |
130 | 130 | switch (atrf_identify(dsc)) { |
131 | | case artf_at86rf230: |
| 131 | case atrf_at86rf230: |
132 | 132 | enter_test_mode_230(dsc, last_cont_tx); |
133 | 133 | break; |
134 | | case artf_at86rf231: |
| 134 | case atrf_at86rf231: |
135 | 135 | start_test_mode_231(dsc); |
136 | 136 | break; |
137 | 137 | default: |
... | ... | |
142 | 142 | |
143 | 143 | void cw_test_end(struct atrf_dsc *dsc) |
144 | 144 | { |
145 | | if (atrf_identify(dsc) == artf_at86rf231) |
| 145 | if (atrf_identify(dsc) == atrf_at86rf231) |
146 | 146 | atrf_reg_write(dsc, REG_PART_NUM, 0); |
147 | 147 | |
148 | 148 | atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_FORCE_TRX_OFF); |
tools/lib/misctxrx.c |
1 | 1 | /* |
2 | 2 | * lib/misctxrx.c - Miscellaenous transceiver helper functions |
3 | 3 | * |
4 | | * Written 2010-2011 by Werner Almesberger |
5 | | * Copyright 2010-2011 Werner Almesberger |
| 4 | * Written 2010-2011, 2013 by Werner Almesberger |
| 5 | * Copyright 2010-2011, 2013 Werner Almesberger |
6 | 6 | * |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
... | ... | |
146 | 146 | uint8_t tmp; |
147 | 147 | |
148 | 148 | switch (atrf_identify(dsc)) { |
149 | | case artf_at86rf230: |
| 149 | case atrf_at86rf230: |
150 | 150 | atrf_reg_write(dsc, REG_PHY_TX_PWR, |
151 | 151 | (crc ? TX_AUTO_CRC_ON_230 : 0) | power); |
152 | 152 | break; |
153 | | case artf_at86rf231: |
| 153 | case atrf_at86rf231: |
154 | 154 | tmp = atrf_reg_read(dsc, REG_PHY_TX_PWR); |
155 | 155 | tmp = (tmp & ~TX_PWR_MASK) | power; |
156 | 156 | atrf_reg_write(dsc, REG_PHY_TX_PWR, tmp); |
... | ... | |
166 | 166 | static const double *tx_power_table(struct atrf_dsc *dsc) |
167 | 167 | { |
168 | 168 | switch (atrf_identify(dsc)) { |
169 | | case artf_at86rf230: |
| 169 | case atrf_at86rf230: |
170 | 170 | return tx_pwr_230; |
171 | | case artf_at86rf231: |
| 171 | case atrf_at86rf231: |
172 | 172 | return tx_pwr_231; |
173 | 173 | break; |
174 | 174 | default: |