From 11962263589bef8a420cb3b62052429f6678da73 Mon Sep 17 00:00:00 2001 From: Thomas Doerfler Date: Tue, 30 Sep 2008 10:00:50 +0000 Subject: Added definitions for asynchronous read and write IO commands. --- cpukit/libi2c/libi2c.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'cpukit/libi2c') diff --git a/cpukit/libi2c/libi2c.h b/cpukit/libi2c/libi2c.h index 8e52ec3e3e..503706346d 100644 --- a/cpukit/libi2c/libi2c.h +++ b/cpukit/libi2c/libi2c.h @@ -414,6 +414,7 @@ rtems_libi2c_ioctl (rtems_device_minor_number minor, */ #define RTEMS_LIBI2C_IOCTL_GET_DRV_T 4 + /* * retval = rtems_libi2c_ioctl(rtems_device_minor_number minor, * RTEMS_LIBI2C_IOCTL_GET_DRV_T, @@ -424,6 +425,15 @@ rtems_libi2c_ioctl (rtems_device_minor_number minor, * */ +/** + * @brief IO control command for asynchronous read and write. + * + * @see rtems_libi2c_read_write_done_t and rtems_libi2c_read_write_async_t. + * + * @warning This is work in progress! + */ +#define RTEMS_LIBI2C_IOCTL_READ_WRITE_ASYNC 5 + /* * argument data structures for IOCTLs defined above */ @@ -448,6 +458,32 @@ typedef struct { rtems_libi2c_read_write_t rd_wr; } rtems_libi2c_tfm_read_write_t; +/** + * @brief Notification function type for asynchronous read and write. + * + * @see RTEMS_LIBI2C_IOCTL_READ_WRITE_ASYNC and + * rtems_libi2c_read_write_async_t. + * + * @warning This is work in progress! + */ +typedef void (*rtems_libi2c_read_write_done_t) \ + ( int /* return value */, int /* nbytes */, void * /* arg */); + +/** + * @brief IO command data for asynchronous read and write. + * + * @see RTEMS_LIBI2C_IOCTL_READ_WRITE_ASYNC and + * rtems_libi2c_read_write_done_t. + * + * @warning This is work in progress! + */ +typedef struct { + unsigned char *rd_buf; + const unsigned char *wr_buf; + int byte_cnt; + rtems_libi2c_read_write_done_t done; + void *arg; +} rtems_libi2c_read_write_async_t; #ifdef __cplusplus } -- cgit v1.2.3