Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

Embed: (wiki syntax)

« Back to documentation index

DS2408 Class Reference

DS2408 Class Reference

This class abstracts communicating with the DS2408 port expander. More...

#include <DS2408.h>

Public Member Functions

 DS2408 (OneWire *owMaster, uint8_t romAddr[8])
 DS2408 constructor.
CmdResult registerRead (uint8_t addr, uint8_t &val)
 registerRead()
CmdResult pioLogicRead (uint8_t &val)
 pioLogicRead()
CmdResult pioLogicReliableRead (uint8_t &val)
 pioLogicReliableRead()
CmdResult pioLogicReliableWrite (uint8_t val)
 pioLogicReliableWrite()
CmdResult pioLogicWrite (uint8_t val)
 pioLogicWrite()

Detailed Description

This class abstracts communicating with the DS2408 port expander.

The OneWire library is used for physical layer communication and this class simply makes it easy to communicate with this one chip.

Definition at line 19 of file DS2408.h.


Constructor & Destructor Documentation

DS2408 ( OneWire *  owMaster,
uint8_t  romAddr[8] 
)

DS2408 constructor.

Just initialized internal variables and disables test mode

On Entry:

Parameters:
[in]owMaster- reference to 1-wire master
[in]romAddr- 64-bit address of ROM

On Exit:

Returns:

Definition at line 9 of file DS2408.cpp.


Member Function Documentation

CmdResult pioLogicRead ( uint8_t &  val )

pioLogicRead()

Uses regisrterRead to get logic values

On Exit:

Parameters:
[out]val- lsb represents the state of the pio
Returns:
Result of operation zero for success

Definition at line 52 of file DS2408.cpp.

CmdResult pioLogicReliableRead ( uint8_t &  val )

pioLogicReliableRead()

Uses regisrterRead to get logic values. Then reads again to check for bit errors.

On Exit:

Parameters:
[out]val- lsb represents the state of the pio
Returns:
Result of operation zero for success

Definition at line 57 of file DS2408.cpp.

CmdResult pioLogicReliableWrite ( uint8_t  val )

pioLogicReliableWrite()

writes to pio. Note 0 means active pull down and 1 high-Z to allow PIO to float high. This will automatically retry for DS2408_NRETRIES times.

On Entry:

Parameters:
[in]val- Value for IO.
Returns:
CmdResult - result of operation

Definition at line 78 of file DS2408.cpp.

CmdResult pioLogicWrite ( uint8_t  val )

pioLogicWrite()

writes to pio. Note 0 means active pull down and 1 high-Z to allow PIO to float high.

On Entry:

Parameters:
[in]val- Value for IO.
Returns:
CmdResult - result of operation

Definition at line 62 of file DS2408.cpp.

CmdResult registerRead ( uint8_t  addr,
uint8_t &  val 
)

registerRead()

reads state of pio

On Exit:

Parameters:
[in]addr- per datasheet valid registers are from 0x88 to 0x8D. Note value will be automatically promoted to 16-bit value.
[out]val- register value
Returns:
Result of operation zero for success

Definition at line 39 of file DS2408.cpp.