IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-06-20 21:01:59 (12 years 9 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | e6f0a1d410d4249bbc59c368be37988d4778159f |
Message: | libatrf: new function atrf_interrupt_wait for interrupt-driven wait
for interrupt - tools/lib/driver.h (struct atrf_driver): new driver operation interrupt_wait - include/atrf.h (atrf_interrupt_wait), atrf.c: new function to wait for a transceiver interrupt without polling |
Files: |
tools/include/atrf.h (1 diff) tools/lib/atrf.c (1 diff) tools/lib/driver.h (1 diff) |
Change Details
tools/include/atrf.h | ||
---|---|---|
56 | 56 | uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr); |
57 | 57 | |
58 | 58 | int atrf_interrupt(struct atrf_dsc *dsc); |
59 | int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms); | |
59 | 60 | |
60 | 61 | #endif /* !ATRF_H */ |
tools/lib/atrf.c | ||
---|---|---|
323 | 323 | return |
324 | 324 | dsc->driver->interrupt ? dsc->driver->interrupt(dsc->handle) : 1; |
325 | 325 | } |
326 | ||
327 | ||
328 | int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms) | |
329 | { | |
330 | return dsc->driver->interrupt_wait ? | |
331 | dsc->driver->interrupt_wait(dsc->handle, timeout_ms) : -1; | |
332 | } |
tools/lib/driver.h | ||
---|---|---|
36 | 36 | void (*sram_write)(void *dsc, uint8_t addr, uint8_t value); |
37 | 37 | uint8_t (*sram_read)(void *dsc, uint8_t addr); |
38 | 38 | int (*interrupt)(void *dsc); |
39 | int (*interrupt_wait)(void *dsc, int timeout_ms); | |
39 | 40 | }; |
40 | 41 | |
41 | 42 |