#include <ngcbI2C.hpp>
Public Member Functions | |
| ngcbI2C () | |
| ngcbI2C (int cnt) | |
| ngcbI2C (int scl, int sda) | |
| ngcbI2C (int scl, int sda, int cnt) | |
| ngcbI2C (int scl, int sda, int sclIn, int sdaIn, int ackIn, int cnt) | |
| virtual | ~ngcbI2C () |
| Destructor. | |
| char * | ErrMsg () |
| Return error-message buffer. | |
| void | AckOn () |
| Enable acknowledge handling. | |
| void | AckOff () |
| Disable acknowledge handling. | |
| void | SCL_IN (int bit) |
| Define clock-line bit fot read (clock-stretching) | |
| void | SDA_IN (int bit) |
| Define data-line bit for read (by default ack-line is the same) | |
| void | ACK_IN (int bit) |
| Define ack-line bit. | |
| void | SDA_DIR_SWITCH (int bit) |
| Define SDA direction switch bit. | |
| void | SCL_DIR_SWITCH (int bit) |
| Define SCL direction switch bit. | |
| void | ClkStretching (int rx, int tx) |
| Set clock-stretching capabilities. | |
| void | ClkStretchCnt (int cnt) |
| Set counter for clock-stretching. | |
| int | ClkStretchCnt () |
| Return clock-stretching counter. | |
| int | Write (int addr, const char *byte, int n) |
| Standard 7-bit write operation. | |
| int | Write10 (int addr, const char *byte, int n) |
| 10-bit write operation | |
| int | Read (int addr, char *byte, int n) |
| Standard 7-bit read operation. | |
| int | Read10 (int addr, char *byte, int n) |
| 10-bit read operation | |
| int | LastState () |
| Return last state of SDA and SCL. | |
Protected Member Functions | |
| virtual int | OutCB (int d, int *resultCode, char *erms) |
| Output call-back (1 word) | |
| virtual int | InCB (int *d, int *resultCode, char *erms) |
| Input call-back (1 word) | |
Serial I2C register class
|
inline |
Constructor method. This sets the clock-line to bit 0 and the data-line to bit 1. Clock-stretching is disabled by default.
|
inlineexplicit |
Constructor method specifying just the polling counter for clock-stretching. The clock-line is on bit 0 and the data-line is on bit 1.
|
inline |
Constructor method specifying clock-line (scl) and data-line (sda). Clock-stretching is disabled by default.
|
inline |
Constructor method specifying clock-line (scl), data-line (sda) and the polling counter for clock-stretching. If the polling counter is set to zero (default), then clock-stretching is disabled in all cases for both read- and write-operations as well as for receiving the acknowledge bit. However the acknowledge bit is still considered unless explicitely ignored via the AckOff() function.
|
inline |
Constructor method specifying all signal lines and the polling counter.
|
inlinevirtual |
Destructor.
|
inline |
Define ack-line bit.
|
inline |
Disable acknowledge handling.
|
inline |
Enable acknowledge handling.
|
inline |
Return clock-stretching counter.
|
inline |
Set counter for clock-stretching.
|
inline |
Set clock-stretching capabilities.
|
inline |
Return error-message buffer.
|
inlineprotectedvirtual |
Input call-back (1 word)
Reimplemented in ngcbI2C_IO.
|
inline |
Return last state of SDA and SCL.
|
inlineprotectedvirtual |
Output call-back (1 word)
Reimplemented in ngcbI2C_IO.
|
inline |
Standard 7-bit read operation.
|
inline |
10-bit read operation
|
inline |
Define SCL direction switch bit.
|
inline |
Define clock-line bit fot read (clock-stretching)
|
inline |
Define SDA direction switch bit.
|
inline |
Define data-line bit for read (by default ack-line is the same)
|
inline |
Standard 7-bit write operation.
|
inline |
10-bit write operation