diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2013-12-23 14:16:07 +0100 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2013-12-23 14:16:07 +0100 |
commit | 72d6c50a2224f9d6d0d7f9bb516f9a8698b5a58d (patch) | |
tree | 1c39a63369a8b0e6390c607c32816ff370d9a9ee /twi_slave_driver.h | |
parent | e9b41c8d6bf9f28a2146652d5ed3b1cd0bc478c7 (diff) | |
download | vgaedidinjector-72d6c50a2224f9d6d0d7f9bb516f9a8698b5a58d.tar.gz vgaedidinjector-72d6c50a2224f9d6d0d7f9bb516f9a8698b5a58d.tar.bz2 |
reading EDID information from display and submission to host works
Diffstat (limited to 'twi_slave_driver.h')
-rw-r--r-- | twi_slave_driver.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/twi_slave_driver.h b/twi_slave_driver.h index c09c43b..ca10b82 100644 --- a/twi_slave_driver.h +++ b/twi_slave_driver.h @@ -77,11 +77,9 @@ typedef enum TWIS_RESULT_enum { TWIS_RESULT_ABORTED = (0x06<<0),
} TWIS_RESULT_t;
-/* Buffer size defines. */
-#define TWIS_RECEIVE_BUFFER_SIZE 8
-#define TWIS_SEND_BUFFER_SIZE 8
-
+struct TWI_Slave;
+typedef void (*TWI_SlaveProc)(struct TWI_Slave*);
/*! \brief TWI slave driver struct.
*
@@ -89,26 +87,28 @@ typedef enum TWIS_RESULT_enum { * buffers and necessary varibles.
*/
typedef struct TWI_Slave {
- TWI_t *interface; /*!< Pointer to what interface to use*/
- void (*Process_Data) (void); /*!< Pointer to process data function*/
- register8_t receivedData[TWIS_RECEIVE_BUFFER_SIZE]; /*!< Read data*/
- register8_t sendData[TWIS_SEND_BUFFER_SIZE]; /*!< Data to write*/
- register8_t bytesReceived; /*!< Number of bytes received*/
- register8_t bytesSent; /*!< Number of bytes sent*/
- register8_t status; /*!< Status of transaction*/
- register8_t result; /*!< Result of transaction*/
- bool abort; /*!< Strobe to abort*/
+ TWI_t *interface; /*!< Pointer to what interface to use*/
+ TWI_SlaveProc Process_Data; /*!< Pointer to process data function*/
+ uint8_t *recvData;
+ uint8_t const *sendData; /*!< Data to write*/
+ uint8_t bytesMaxRecv;
+ uint8_t bytesToSend; /*!< Number of bytes to send */
+ uint8_t bytesReceived; /*!< Number of bytes received*/
+ uint8_t bytesSent; /*!< Number of bytes sent*/
+ uint8_t status; /*!< Status of transaction*/
+ uint8_t result; /*!< Result of transaction*/
+ bool abort; /*!< Strobe to abort*/
} TWI_Slave_t;
-
-
void TWI_SlaveInitializeDriver(TWI_Slave_t *twi,
TWI_t *module,
- void (*processDataFunction) (void));
+ TWI_SlaveProc processDataFunction);
void TWI_SlaveInitializeModule(TWI_Slave_t *twi,
uint8_t address,
- TWI_SLAVE_INTLVL_t intLevel);
+ TWI_SLAVE_INTLVL_t intLevel,
+ uint8_t *recvData,
+ uint8_t bytesMaxRecv );
void TWI_SlaveInterruptHandler(TWI_Slave_t *twi);
void TWI_SlaveAddressMatchHandler(TWI_Slave_t *twi);
|