mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 23:43:43 +02:00
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
This commit is contained in:
parent
0120f62242
commit
e6f0a1d410
@ -56,5 +56,6 @@ void atrf_sram_write(struct atrf_dsc *dsc, uint8_t addr, uint8_t value);
|
|||||||
uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr);
|
uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr);
|
||||||
|
|
||||||
int atrf_interrupt(struct atrf_dsc *dsc);
|
int atrf_interrupt(struct atrf_dsc *dsc);
|
||||||
|
int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms);
|
||||||
|
|
||||||
#endif /* !ATRF_H */
|
#endif /* !ATRF_H */
|
||||||
|
@ -323,3 +323,10 @@ int atrf_interrupt(struct atrf_dsc *dsc)
|
|||||||
return
|
return
|
||||||
dsc->driver->interrupt ? dsc->driver->interrupt(dsc->handle) : 1;
|
dsc->driver->interrupt ? dsc->driver->interrupt(dsc->handle) : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms)
|
||||||
|
{
|
||||||
|
return dsc->driver->interrupt_wait ?
|
||||||
|
dsc->driver->interrupt_wait(dsc->handle, timeout_ms) : -1;
|
||||||
|
}
|
||||||
|
@ -36,6 +36,7 @@ struct atrf_driver {
|
|||||||
void (*sram_write)(void *dsc, uint8_t addr, uint8_t value);
|
void (*sram_write)(void *dsc, uint8_t addr, uint8_t value);
|
||||||
uint8_t (*sram_read)(void *dsc, uint8_t addr);
|
uint8_t (*sram_read)(void *dsc, uint8_t addr);
|
||||||
int (*interrupt)(void *dsc);
|
int (*interrupt)(void *dsc);
|
||||||
|
int (*interrupt_wait)(void *dsc, int timeout_ms);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user