Added definitions for asynchronous read and write IO commands.

This commit is contained in:
Thomas Doerfler
2008-09-30 10:00:50 +00:00
parent 57a4040666
commit 1196226358
2 changed files with 41 additions and 0 deletions
+5
View File
@@ -1,3 +1,8 @@
2008-09-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libi2c/libi2c.h: Added definitions for asynchronous read and write IO
commands.
2008-09-26 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1316/cpukit
+36
View File
@@ -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
}