Aleksandrs Gumenuks / MaximInterface_Extended

Dependents:   mbed_DS28EC20_GPIO

Embed: (wiki syntax)

« Back to documentation index

DS28E17 Class Reference

DS28E17 Class Reference

DS28E17 1-Wire®-to-I2C Master Bridge. More...

#include <DS28E17.hpp>

Public Member Functions

MaximInterface_EXPORT error_code writeDataWithStop (uint_least8_t I2C_addr, span< const uint_least8_t > data, uint_least8_t *wr_status=NULL)
 Write Data With Stop command.
MaximInterface_EXPORT error_code writeDataNoStop (uint_least8_t I2C_addr, span< const uint_least8_t > data, uint_least8_t *wr_status=NULL)
 Write Data No Stop command.
MaximInterface_EXPORT error_code writeDataOnly (span< const uint_least8_t > data, uint_least8_t *wr_status=NULL)
 Write Data Only command.
MaximInterface_EXPORT error_code writeDataOnlyWithStop (span< const uint_least8_t > data, uint_least8_t *wr_status=NULL)
 Write Data Only With Stop command.
MaximInterface_EXPORT error_code writeReadDataWithStop (uint_least8_t I2C_addr, span< const uint_least8_t > write_data, span< uint_least8_t > read_data, uint_least8_t *wr_status=NULL)
 Write, Read Data With Stop command.
MaximInterface_EXPORT error_code readDataWithStop (uint_least8_t I2C_addr, span< uint_least8_t > data)
 Read Data With Stop command.
MaximInterface_EXPORT error_code writeConfigReg (I2CSpeed speed)
 Write to Configuration Register of DS28E17.
MaximInterface_EXPORT error_code readConfigReg (I2CSpeed &speed)
 Read the Configuration Register of DS28E17.
MaximInterface_EXPORT error_code enableSleepMode ()
 Put the device into a low current mode.
MaximInterface_EXPORT error_code readDeviceRevision (uint_least8_t &rev)
 Read the Device Revision of DS28E17.

Detailed Description

DS28E17 1-Wire®-to-I2C Master Bridge.

The DS28E17 is a 1-Wire slave to I2C master bridge device that interfaces directly to I2C slaves at standard (100kHz max) or fast (400kHz max). Data transfers serially by means of the 1-Wire® protocol, which requires only a single data lead and a ground return. Every DS28E17 is guaranteed to have a unique 64-bit ROM registration number that serves as a node address in the 1-Wire network. Multiple DS28E17 devices can coexist with other devices in the 1-Wire network and be accessed individually without affecting other devices. The DS28E17 allows using complex I2C devices such as display controllers, ADCs, DACs, I2C sensors, etc. in a 1-Wire environment. Each self-timed DS28E17 provides 1-Wire access for a single I2C interface.

Definition at line 56 of file DS28E17.hpp.


Member Function Documentation

error_code enableSleepMode (  )

Put the device into a low current mode.

All 1-Wire communication is ignored until woken up. Immediately after the command, the device monitors the WAKEUP input pin and exits sleep mode on a rising edge.

Definition at line 118 of file DS28E17.cpp.

error_code readConfigReg ( I2CSpeed &  speed )

Read the Configuration Register of DS28E17.

Parameters:
[out]speedSpeed read from configuration register.

Definition at line 92 of file DS28E17.cpp.

error_code readDataWithStop ( uint_least8_t  I2C_addr,
span< uint_least8_t >  data 
)

Read Data With Stop command.

Output on I2C: S, Slave Address + Read, Read Data [1-255], P (NACK last read byte)

Parameters:
[in]I2C_addrI2C slave address. The least significant bit of the I2C address is automatically set by the command.
[out]dataI2C data that was read with length 1-255.

Definition at line 75 of file DS28E17.cpp.

error_code readDeviceRevision ( uint_least8_t &  rev )

Read the Device Revision of DS28E17.

The upper nibble is the major revision, and the lower nibble is the minor revision.

Parameters:
[out]revDevice Revision.

Definition at line 127 of file DS28E17.cpp.

error_code writeConfigReg ( I2CSpeed  speed )

Write to Configuration Register of DS28E17.

Definition at line 81 of file DS28E17.cpp.

error_code writeDataNoStop ( uint_least8_t  I2C_addr,
span< const uint_least8_t >  data,
uint_least8_t *  wr_status = NULL 
)

Write Data No Stop command.

Output on I2C: S, Address + Write, Write Data [1-255]

Parameters:
[in]I2C_addrI2C slave address. The least significant bit of the I2C address is automatically cleared by the command.
[in]dataI2C data to write with length 1-255.
[out]wr_statusIndicates which write byte NACK’d. A value of 00h indicates all bytes were acknowledged by the slave. A non-zero value indicates the byte number that NACK’d. May be set to NULL.

Definition at line 48 of file DS28E17.cpp.

error_code writeDataOnly ( span< const uint_least8_t >  data,
uint_least8_t *  wr_status = NULL 
)

Write Data Only command.

Output on I2C: Write Data [1-255]

Parameters:
[in]dataI2C data to write with length 1-255.
[out]wr_statusIndicates which write byte NACK’d. A value of 00h indicates all bytes were acknowledged by the slave. A non-zero value indicates the byte number that NACK’d. May be set to NULL.

Definition at line 55 of file DS28E17.cpp.

error_code writeDataOnlyWithStop ( span< const uint_least8_t >  data,
uint_least8_t *  wr_status = NULL 
)

Write Data Only With Stop command.

Output on I2C: Write Data [1-255], P

Parameters:
[in]dataI2C data to write with length 1-255.
[out]wr_statusIndicates which write byte NACK’d. A value of 00h indicates all bytes were acknowledged by the slave. A non-zero value indicates the byte number that NACK’d. May be set to NULL.

Definition at line 61 of file DS28E17.cpp.

error_code writeDataWithStop ( uint_least8_t  I2C_addr,
span< const uint_least8_t >  data,
uint_least8_t *  wr_status = NULL 
)

Write Data With Stop command.

Output on I2C: S, Address + Write, Write Data [1-255], P

Parameters:
[in]I2C_addrI2C slave address. The least significant bit of the I2C address is automatically cleared by the command.
[in]dataI2C data to write with length 1-255.
[out]wr_statusIndicates which write byte NACK’d. A value of 00h indicates all bytes were acknowledged by the slave. A non-zero value indicates the byte number that NACK’d. May be set to NULL.

Definition at line 41 of file DS28E17.cpp.

error_code writeReadDataWithStop ( uint_least8_t  I2C_addr,
span< const uint_least8_t >  write_data,
span< uint_least8_t >  read_data,
uint_least8_t *  wr_status = NULL 
)

Write, Read Data With Stop command.

Output on I2C: S, Slave Address + Write, Write Data [1-255], Sr, Address + Read, Read Data [1-255], P (NACK last read byte)

Parameters:
[in]I2C_addrI2C slave address. The least significant bit of the I2C address is automatically cleared and set by the command.
[in]write_dataI2C data to write with length 1-255.
[out]read_dataI2C data that was read with length 1-255.
[out]wr_statusIndicates which write byte NACK’d. A value of 00h indicates all bytes were acknowledged by the slave. A non-zero value indicates the byte number that NACK’d. May be set to NULL.

Definition at line 67 of file DS28E17.cpp.