14#ifndef VEX_GENERIC_CLASS_H
15#define VEX_GENERIC_CLASS_H
32 generic( int32_t index );
81 int32_t
readWord( uint8_t reg,
bool bLittleEndian =
false );
89 int32_t
writeWord( uint8_t reg, uint16_t value,
bool bLittleEndian =
false );
98 bool readReg( uint8_t reg, uint8_t *pBytes, uint8_t nLength );
106 bool writeReg( uint8_t reg, uint8_t *pBytes, uint8_t nLength );
108 typedef enum _i2cRegType {
110 kRegAsciiVersion = 0x00,
111 kRegAsciiVendor = 0x08,
112 kRegAsciiDeviceId = 0x10,
114 kRegUserVendorId = 0x18,
115 kRegUserProductId = 0x19,
117 kRegFirmwareVersion = 0x20,
118 kRegDeviceType = 0x21,
120 kRegDeviceStatus = 0x23
145 bool readRaw( uint8_t addr, uint8_t *pBytes, uint8_t nLength );
153 bool writeRaw( uint8_t addr, uint8_t *pBytes, uint8_t nLength );
int32_t writeWord(uint8_t reg, uint16_t value, bool bLittleEndian=false)
Write 1 word (2 bytes) to the generic sensor.
int32_t productId()
Gets the product id of the generic sensor.
int32_t readWord(uint8_t reg, bool bLittleEndian=false)
Read 1 word (2 bytes) from the generic sensor.
void writeRawWait()
Wait for raw write to complete usually this is not needed, writeRaw will block when called waiting fo...
int32_t version()
Gets the firmware version of the generic sensor.
int32_t readByte(uint8_t reg)
Read 1 byte from the generic sensor.
bool readReg(uint8_t reg, uint8_t *pBytes, uint8_t nLength)
Read bytes from the generic sensor.
bool writeRaw(uint8_t addr, uint8_t *pBytes, uint8_t nLength)
Write bytes to the device.
int32_t vendorId()
Gets the vendor id of the generic sensor.
int32_t writeByte(uint8_t reg, uint8_t value)
Write 1 byte to the generic sensor.
bool writeReg(uint8_t reg, uint8_t *pBytes, uint8_t nLength)
Write bytes to the generic sensor.
bool readRaw(uint8_t addr, uint8_t *pBytes, uint8_t nLength)
Read bytes from the device.
Bumper switch device class