Device interface library for multiple platforms including Mbed.

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

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

MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeDataWithStop (uint_least8_t I2C_addr, Core::span< const uint_least8_t > data)
 Write Data With Stop command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeDataNoStop (uint_least8_t I2C_addr, Core::span< const uint_least8_t > data)
 Write Data No Stop command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeDataOnly (Core::span< const uint_least8_t > data)
 Write Data Only command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeDataOnlyWithStop (Core::span< const uint_least8_t > data)
 Write Data Only With Stop command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeReadDataWithStop (uint_least8_t I2C_addr, Core::span< const uint_least8_t > write_data, Core::span< uint_least8_t > read_data)
 Write, Read Data With Stop command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
readDataWithStop (uint_least8_t I2C_addr, Core::span< uint_least8_t > data)
 Read Data With Stop command.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeConfigReg (I2CSpeed speed)
 Write to Configuration Register of DS28E17.
MaximInterfaceDevices_EXPORT
Core::Result< I2CSpeed > 
readConfigReg () const
 Read the Configuration Register of DS28E17.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
enableSleepMode ()
 Put the device into a low current mode.
MaximInterfaceDevices_EXPORT
Core::Result< uint_least8_t > 
readDeviceRevision () const
 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

Result< void > 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 105 of file DS28E17.cpp.

Result< DS28E17::I2CSpeed > readConfigReg (  ) const

Read the Configuration Register of DS28E17.

Returns:
speed Speed read from configuration register.

Definition at line 90 of file DS28E17.cpp.

Result< void > readDataWithStop ( uint_least8_t  I2C_addr,
Core::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 73 of file DS28E17.cpp.

Result< uint_least8_t > readDeviceRevision (  ) const

Read the Device Revision of DS28E17.

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

Returns:
Device Revision.

Definition at line 114 of file DS28E17.cpp.

Result< void > writeConfigReg ( I2CSpeed  speed )

Write to Configuration Register of DS28E17.

Definition at line 79 of file DS28E17.cpp.

Result< void > writeDataNoStop ( uint_least8_t  I2C_addr,
Core::span< const uint_least8_t >  data 
)

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.
Returns:
Values from 1-255 in the DS28E17 category represent the Write Status indicating which write byte did not acknowledge.

Definition at line 52 of file DS28E17.cpp.

Result< void > writeDataOnly ( Core::span< const uint_least8_t >  data )

Write Data Only command.

Output on I2C: Write Data [1-255]

Parameters:
[in]dataI2C data to write with length 1-255.
Returns:
Values from 1-255 in the DS28E17 category represent the Write Status indicating which write byte did not acknowledge.

Definition at line 57 of file DS28E17.cpp.

Result< void > writeDataOnlyWithStop ( Core::span< const uint_least8_t >  data )

Write Data Only With Stop command.

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

Parameters:
[in]dataI2C data to write with length 1-255.
Returns:
Values from 1-255 in the DS28E17 category represent the Write Status indicating which write byte did not acknowledge.

Definition at line 61 of file DS28E17.cpp.

Result< void > writeDataWithStop ( uint_least8_t  I2C_addr,
Core::span< const uint_least8_t >  data 
)

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.
Returns:
Values from 1-255 in the DS28E17 category represent the Write Status indicating which write byte did not acknowledge.

Definition at line 46 of file DS28E17.cpp.

Result< void > writeReadDataWithStop ( uint_least8_t  I2C_addr,
Core::span< const uint_least8_t >  write_data,
Core::span< uint_least8_t >  read_data 
)

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.
Returns:
Values from 1-255 in the DS28E17 category represent the Write Status indicating which write byte did not acknowledge.

Definition at line 67 of file DS28E17.cpp.