IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2010-09-06 02:18:56 (13 years 6 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | b25cbd812068fb79c56b655a0ea526ab2c0b7382 |
Message: | Fix board initialization in uSD driver. atspi-id now works. - tools/lib/atusd.c (atusd_cycle): we never turned power back on ? - tools/atspi-id/atspi-id.c (main): call atspi_close on exit - tools/lib/atusd.c (atusd_cycle, wait_for_power): moved power on delay to separate function - tools/lib/atusd.c (atusd_open): wait for power to stabilize - tools/lib/atusd.c (atusd_open): need to reset the board to bring it up properly |
Files: |
tools/atspi-id/atspi-id.c (1 diff) tools/lib/atusd.c (5 diffs) |
Change Details
tools/atspi-id/atspi-id.c | ||
---|---|---|
144 | 144 | |
145 | 145 | show_info(dsc); |
146 | 146 | |
147 | atspi_close(dsc); | |
148 | ||
147 | 149 | return 0; |
148 | 150 | } |
tools/lib/atusd.c | ||
---|---|---|
68 | 68 | /* ----- Reset functions --------------------------------------------------- */ |
69 | 69 | |
70 | 70 | |
71 | static void wait_for_power(void) | |
72 | { | |
73 | /* | |
74 | * Give power time to stabilize and the chip time to reset. | |
75 | * Experiments show that even usleep(0) is long enough. | |
76 | */ | |
77 | usleep(10*1000); | |
78 | } | |
79 | ||
80 | ||
71 | 81 | static void atusd_cycle(struct atusd_dsc *dsc) |
72 | 82 | { |
73 | 83 | /* stop the MMC bus clock */ |
... | ... | |
97 | 107 | /* start MMC clock output */ |
98 | 108 | MSC_STRPCL = 2; |
99 | 109 | |
100 | /* | |
101 | * Give power time to stabilize and the chip time to reset. | |
102 | * Experiments show that even usleep(0) is long enough. | |
103 | */ | |
104 | usleep(10*1000); | |
110 | wait_for_power(); | |
105 | 111 | } |
106 | 112 | |
107 | 113 | |
... | ... | |
205 | 211 | /* ----- Driver operations ------------------------------------------------- */ |
206 | 212 | |
207 | 213 | |
214 | static void atusd_reset_rf(void *handle) | |
215 | { | |
216 | struct atusd_dsc *dsc = handle; | |
217 | ||
218 | atusd_cycle(dsc); | |
219 | } | |
220 | ||
221 | ||
208 | 222 | static void *atusd_open(void) |
209 | 223 | { |
210 | 224 | struct atusd_dsc *dsc; |
... | ... | |
254 | 268 | /* start MMC clock output */ |
255 | 269 | MSC_STRPCL = 2; |
256 | 270 | |
257 | atusd_cycle(dsc); | |
271 | wait_for_power(); | |
272 | atusd_reset_rf(dsc); | |
258 | 273 | |
259 | 274 | return dsc; |
260 | 275 | } |
... | ... | |
275 | 290 | } |
276 | 291 | |
277 | 292 | |
278 | static void atusd_reset_rf(void *handle) | |
279 | { | |
280 | struct atusd_dsc *dsc = handle; | |
281 | ||
282 | atusd_cycle(dsc); | |
283 | } | |
284 | ||
285 | ||
286 | 293 | static void atusd_reg_write(void *handle, uint8_t reg, uint8_t v) |
287 | 294 | { |
288 | 295 | struct atusd_dsc *dsc = handle; |