TPS23861 Power over Ethernet  0.0.2
Software Application Programming Interface for Command and Control of the TI TPS23861 PSE Controller
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
C:/Users/a0207881/workspace_v5_2/PowerOverEthernet/TPS23861.h File Reference

Go to the source code of this file.

Data Structures

struct  TPS238x_Ports_t
 This structure is used with many functions where multiple ports can be indicated at the same time. More...
 
struct  TPS238x_System_Port_Map_t
 
struct  TPS238X_Interrupt_Register_t
 
struct  TPS238X_Interrupt_Mask_Register_t
 
struct  TPS238X_Power_Enable_Register_t
 
struct  TPS238X_Detection_Event_Register_t
 
struct  TPS238X_Fault_Event_Register_t
 
struct  TPS238X_Inrush_ILIM_Event_Register_t
 
struct  TPS238X_Supply_Event_Register_t
 
struct  TPS238X_Port_Status_Register_t
 
struct  TPS238x_Power_Stauts_Register_t
 
struct  TPS238x_I2C_Slave_Address_Register_t
 
struct  TPS238x_Operating_Mode_Register_t
 
struct  TPS238x_Disconnect_Enable_Register_t
 
struct  TPS238x_Detect_Classification_Enable_Register_t
 
struct  TPS238x_Fast_Shutdown_t
 
struct  TPS238x_Timing_Configuration_Register_t
 
struct  TPS238x_General_Mask_1_Register_t
 
struct  TPS238x_Detect_Class_Restart_Register_t
 
struct  TPS238x_Power_Enable_Register_t
 
struct  TPS238x_Reset_Register_t
 
struct  TPS238x_ID_Register_t
 
struct  TPS238x_Legacy_Detect_Register_t
 
struct  TPS238x_Two_Event_Classification_Register_t
 
struct  TPS238x_Four_Port_Mode_Register_t
 
struct  TPS238x_Class_5_Enable_Timer_Register_t
 
struct  TPS238x_Disconnect_Threshold_Register_t
 
struct  TPS238x_ICUT21_Config_Regsiter_t
 
struct  TPS238x_ICUT43_Config_Regsiter_t
 
struct  TPS238x_Temperature_Register_t
 
union  TPS238x_Input_Voltage_Register_u
 
struct  TPS238x_Input_Voltage_Register_u::Input_Voltage_Short_t
 
struct  TPS238x_Input_Voltage_Register_u::Input_Voltage_Char_t
 
union  TPS238x_Port_Current_Register_u
 
struct  TPS238x_Port_Current_Register_u::Port_Current_Short_t
 
struct  TPS238x_Port_Current_Register_u::Port_Current_Char_t
 
union  TPS238x_Port_Voltage_Register_u
 
struct  TPS238x_Port_Voltage_Register_u::Port_Voltage_Short_t
 
struct  TPS238x_Port_Voltage_Register_u::Port_Voltage_Char_t
 
struct  TPS238x_PoE_Plus_Register_t
 
struct  TPS238x_I2C_Watchdog_Register_t
 
struct  TPS238x_Cool_Down_Gate_Drive_Register_t
 
union  TPS238x_Port_Detect_Resistance_Register_u
 
struct  TPS238x_Port_Detect_Resistance_Register_u::Port_Detect_Resistance_Short_t
 
struct  TPS238x_Port_Detect_Resistance_Register_u::Detect_Resistance_Char_t
 
union  TPS238x_Port_Voltage_Difference_Register_u
 Hardware - Command 6Ah; 2 data byte (LSB followed by MSB); read only
More...
 
struct  TPS238x_Port_Voltage_Difference_Register_u::Port_Voltage_Difference_Short_t
 
struct  TPS238x_Port_Voltage_Difference_Register_u::Port_Voltage_Difference_Char_t
 

Macros

#define TPS_SUCCESSFUL   0x00
 
#define TPS_ERR_PORT_IN_USE   0x80
 
#define TPS_ERR_PORT_NOT_IN_USE   0x81
 
#define TPS_ERR_NO_PORT_AVAILABLE   0x82
 
#define TPS_ERR_I2C_ERROR   0x83
 
#define TPS_GIVE_ME_NEXT_PORT_AVAILABLE   0xff
 
#define TPS_PORT_NOT_REGISTERED_VALUE   0xff
 
#define SWIZZLE_BYTES(x)   {unsigned short y; y = x; x = (((y & 0xff) << 8) | (y >> 8)); }
 Used to switch MSB and LSB bytes in an unsigned short variable. More...
 
#define TPS_MAX_SYSTEM_PORTS   64
 
#define PORT_1_VALUE   0x1
 Bit value of the TPS238x_Ports_t Port 1. More...
 
#define PORT_2_VALUE   0x2
 Bit value of the TPS238x_Ports_t Port 2. More...
 
#define PORT_3_VALUE   0x4
 Bit value of the TPS238x_Ports_t Port 3. More...
 
#define PORT_4_VALUE   0x8
 Bit value of the TPS238x_Ports_t Port 4. More...
 
#define PEC   0x01
 Indicates a power enable status change occurred on at least one port. More...
 
#define PGC   0x02
 Indicates a power good change occurred on at least one port. More...
 
#define DISF   0x04
 Indicates a disconnect event occurred on at least one port. More...
 
#define DETC   0x08
 Indicates at least one detection cycle occurred on at least one port. More...
 
#define CLASC   0x10
 Indicates at least one classification cycle occurred on at least one port. More...
 
#define IFAULT   0x20
 Indicates that an ICUT or ILIM fault occurred on at least one port. More...
 
#define INRF   0x40
 Indicates that an Inrush fault occurred on at least one port. More...
 
#define SUPF   0x80
 Indicates that a supply event fault occurred. More...
 
#define PEMSK   0x01
 Enable power enable interrupts. More...
 
#define PGMSK   0x02
 Enable power good interrupts. More...
 
#define DIMSK   0x04
 Enable disconnect event interrupts. More...
 
#define DEMSK   0x08
 Enable detection cycle event interrupts. More...
 
#define CLMSK   0x10
 Enable classification cycle event interrupts. More...
 
#define IFMSK   0x20
 Enable ICUT or OLIM fault interrupts. More...
 
#define INMSK   0x40
 Enable Inrush fault interrupts. More...
 
#define SUMSK   0x80
 Enable supply event fault interrupts. More...
 
#define PEC1   0x01
 Change to power enable status for port 1. More...
 
#define PEC2   0x02
 Change to power enable status for port 2. More...
 
#define PEC3   0x04
 Change to power enable status for port 3. More...
 
#define PEC4   0x08
 Change to power enable status for port 4. More...
 
#define PGC1   0x10
 Change to power good status for port 1. More...
 
#define PGC2   0x20
 Change to power good status for port 2. More...
 
#define PGC3   0x40
 Change to power good status for port 3. More...
 
#define PGC4   0x80
 Change to power good status for port 4. More...
 
#define POWER_GOOD_EVENT_SHIFT   0
 
#define POWER_ENABLE_EVENT_SHIFT   4
 
#define DETC1   0x01
 Detection cycle occurred on port 1. More...
 
#define DETC2   0x02
 Detection cycle occurred on port 2. More...
 
#define DETC3   0x04
 Detection cycle occurred on port 3. More...
 
#define DETC4   0x08
 Detection cycle occurred on port 4. More...
 
#define CLSC1   0x10
 Classification cycle occurred on port 1. More...
 
#define CLSC2   0x20
 Classification cycle occurred on port 2. More...
 
#define CLSC3   0x40
 Classification cycle occurred on port 3. More...
 
#define CLSC4   0x80
 Classification cycle occurred on port 4. More...
 
#define DETECTION_EVENT_SHIFT   0
 
#define CLASSIFICATION_EVENT_SHIFT   4
 
#define ICUT1   0x01
 ICUT fault occurred at port 1. More...
 
#define ICUT2   0x02
 ICUT fault occurred at port 2. More...
 
#define ICUT3   0x04
 ICUT fault occurred at port 3. More...
 
#define ICUT4   0x08
 ICUT fault occurred at port 4. More...
 
#define DISF1   0x10
 Disconnect event occurred at port 1. More...
 
#define DISF2   0x20
 Disconnect event occurred at port 2. More...
 
#define DISF3   0x40
 Disconnect event occurred at port 3. More...
 
#define DISF4   0x80
 Disconnect event occurred at port 4. More...
 
#define ICUT_EVENT_SHIFT   0
 
#define DISCONNECT_EVENT_SHIFT   4
 
#define INR1   0x01
 Inrush fault occurred at port 1. More...
 
#define INR2   0x02
 Inrush fault occurred at port 2. More...
 
#define INR3   0x04
 Inrush fault occurred at port 3. More...
 
#define INR4   0x08
 Inrush fault occurred at port 4. More...
 
#define ILIM1   0x10
 ILIM fault occurred at port 1. More...
 
#define ILIM2   0x20
 ILIM fault occurred at port 2. More...
 
#define ILIM3   0x40
 ILIM fault occurred at port 3. More...
 
#define ILIM4   0x80
 ILIM fault occurred at port 4. More...
 
#define INRUSH_EVENT_SHIFT   0
 
#define ILIM_EVENT_SHIFT   4
 
#define VPUV   0x10
 
#define VDUV   0x20
 
#define TSD   0x80
 
#define DETECT   0x0F
 
#define CLASS   0xF0
 
#define CLASS_SHIFT   4
 
#define DETECT_SHIFT   0
 
#define GET_DETECT(x)   (x & 0xF)
 
#define GET_CLASS(x)   (x>>8)
 
#define PE1_STATUS   0x01
 Port 1 has power enabled. More...
 
#define PE2_STATUS   0x02
 Port 2 has power enabled. More...
 
#define PE3_STATUS   0x04
 Port 3 has power enabled. More...
 
#define PE4_STATUS   0x08
 Port 4 has power enabled. More...
 
#define PG1_STATUS   0x10
 Port 1 is powered on with good voltage levels. More...
 
#define PG2_STATUS   0x20
 Port 2 is powered on with good voltage levels. More...
 
#define PG3_STATUS   0x40
 Port 3 is powered on with good voltage levels. More...
 
#define PG4_STATUS   0x80
 Port 4 is powered on with good voltage levels. More...
 
#define POWER_ENABLE_STATUS   (PE1_STATUS + PE2_STATUS + PE3_STATUS + PE4_STATUS)
 
#define POWER_GOOD_STATUS   (PG1_STATUS + PG2_STATUS + PG3_STATUS + PG4_STATUS)
 
#define GET_POWER_ENABLE_STATUS(x)   (x & POWER_ENABLE_STATUS)
 
#define GET_POWER_GOOD_STATUS(x)   (x >> 8)
 
#define AUTO_BIT   0x80
 The part will default into auto mode after power on if this bit is set. More...
 
#define I2C_ADDRESS_MASK   0x7F
 7 bit I2C address More...
 
#define TPS238X_ALERT_RESPONSE_ADDRESS   0x0C
 
#define TPS238X_BROADCAST_ADDRESS   0x30
 
#define TPS238X_UNLOCK_CODE   0xAA
 Unlock code for the I2C address registers to prevent disastrous overwrites. More...
 
#define OPERATING_MODE_MASK   0x3
 
#define OPERATING_PORT_1_MODE   0x03
 
#define OPERATING_PORT_2_MODE   0x0C
 
#define OPERATING_PORT_3_MODE   0x30
 
#define OPERATING_PORT_4_MODE   0xC0
 
#define DCDE1   0x01
 DC disconnect enable for 2 pair operation in port 1. More...
 
#define DCDE2   0x02
 DC disconnect enable for 2 pair operation in port 2. More...
 
#define DCDE3   0x04
 DC disconnect enable for 2 pair operation in port 3. More...
 
#define DCDE4   0x08
 DC disconnect enable for 2 pair operation in port 4. More...
 
#define DETE1   0x01
 Enable detections for port 1. More...
 
#define DETE2   0x02
 Enable detections for port 2. More...
 
#define DETE3   0x04
 Enable detections for port 3. More...
 
#define DETE4   0x08
 Enable detections for port 4. More...
 
#define CLE1   0x10
 Enable classifications for port 1. More...
 
#define CLE2   0x20
 Enable classifications for port 2. More...
 
#define CLE3   0x40
 Enable classifications for port 3. More...
 
#define CLE4   0x80
 Enable classifications for port 4. More...
 
#define FSE1   0x10
 
#define FSE2   0x20
 
#define FSE3   0x40
 
#define FSE4   0x80
 
#define FSE_SHIFT   4
 
#define TDIS_MASK   0x3
 
#define TDIS_SHIFT   0x0
 
#define TICUT_MASK   0xC
 
#define TICUT_SHIFT   0x2
 
#define TSTART_MASK   0x30
 
#define TSTART_SHIFT   0x4
 
#define TLIM_MASK   0xC0
 
#define TLIM_SHIFT   0x6
 
#define _960_A_D_CONV_PER_SECOND   0x10
 
#define _800_A_D_CONV_PER_SECOND   0x00
 
#define _250M   0x01
 250 mOhm resistor used as current sensor More...
 
#define MAINS   0x10
 Convert port voltage rate of 960 or 800 A/D conversions per sec. More...
 
#define INTEN   0x80
 External INT/ enabled by any unmasked bit of interrupt register. More...
 
#define RDET1   0x01
 Restart Detection Port 1. More...
 
#define RDET2   0x02
 Restart Detection Port 2. More...
 
#define RDET3   0x04
 Restart Detection Port 3. More...
 
#define RDET4   0x08
 Restart Detection Port 4. More...
 
#define RCL1   0x10
 Restart Classification Port 1. More...
 
#define RCL2   0x20
 Restart Classification Port 2. More...
 
#define RCL3   0x40
 Restart Classification Port 3. More...
 
#define RCL4   0x80
 Restart Classification Port 4. More...
 
#define RESTART_DETECTION_SHIFT   0
 
#define RESTART_DETECTION_MASK   0x0F
 
#define RESTART_CLASSIFCATION_SHIFT   4
 
#define RESTART_CLASSIFCATION_MASK   0xF0
 
#define PWON1   0x01
 Power on Port 1. More...
 
#define PWON2   0x02
 Power on Port 2. More...
 
#define PWON3   0x04
 Power on Port 3. More...
 
#define PWON4   0x08
 Power on Port 4. More...
 
#define PWOFF1   0x10
 Power off Port 1. More...
 
#define PWOFF2   0x20
 Power off Port 2. More...
 
#define PWOFF3   0x40
 Power off Port 3. More...
 
#define PWOFF4   0x80
 Power off Port 4. More...
 
#define POWER_OFF_SHIFT   4
 
#define POWER_OFF_MASK   0xF0
 
#define POWER_ON_SHIFT   0
 
#define POWER_ON_MASK   0x0F
 
#define RESP1   0x01
 
#define RESP2   0x02
 
#define RESP3   0x04
 
#define RESP4   0x08
 
#define RESAL   0x10
 
#define CLINP   0x40
 
#define CLRAIN   0x80
 
#define ICV   0x07
 
#define MFR_ID   0xF8
 
#define MFR_ID_SHIFT   3
 
#define MFR_ID_DEFAULT   0x0A
 
#define ICV_DEFAULT   0x00
 
#define ID_REGISTER_DEFAULT   ((MFR_ID_DEFAULT<<MFR_ID_SHIFT) | ICV_DEFAULT)
 
#define LEGMOD1   0x03
 
#define LEGMOD2   0x0C
 
#define LEGMOD3   0x30
 
#define LEGMOD4   0xC0
 
#define LEGACY_MODE_MASK   3
 
#define LEGMOD1_SHIFT   0
 
#define LEGMOD2_SHIFT   2
 
#define LEGMOD3_SHIFT   4
 
#define LEGMOD4_SHIFT   6
 
#define TECLEN1   0x03
 
#define TECLEN2   0x0C
 
#define TECLEN3   0x30
 
#define TECLEN4   0xC0
 
#define TWO_EVENT_MASK   3
 
#define TECLEN1_SHIFT   0
 
#define TECLEN2_SHIFT   2
 
#define TECLEN3_SHIFT   4
 
#define TECLEN4_SHIFT   6
 
#define _4P12DIS   0x07
 
#define _4P12EN   0x08
 
#define _4P34DIS   0x70
 
#define _4P34EN   0x80
 
#define FOUR_PAIR_DISCONNECT_MASK   7
 
#define _4P12DIS_SHIFT   0
 
#define _4P12EN_SHIFT   3
 
#define _4P34DIS_SHIFT   4
 
#define _4P34EN_SHIFT   7
 
#define TMR_MASK   0x0F
 Location of interrupt delay time bits. Value in 10ms increments. More...
 
#define CL5EN1   0x10
 Enable class 5 classifications for port 1. More...
 
#define CL5EN2   0x20
 Enable class 5 classifications for port 2. More...
 
#define CL5EN3   0x40
 Enable class 5 classifications for port 3. More...
 
#define CL5EN4   0x80
 Enable class 5 classifications for port 4. More...
 
#define CLASS_5_ENABLE_SHIFT   4
 
#define DCTH1   0x03
 
#define DCTH2   0x0C
 
#define DCTH3   0x30
 
#define DCTH4   0xC0
 
#define DISCONNECT_THRESHOLD_MASK   3
 
#define DCTH1_SHIFT   0
 
#define DCTH2_SHIFT   2
 
#define DCTH3_SHIFT   4
 
#define DCTH4_SHIFT   6
 
#define ICUT_THRESHOLD_MASK   7
 
#define ICUT_PORT_1   0x07
 
#define ICUT_PORT_2   0x70
 
#define ICUT_PORT_1_SHIFT   0
 
#define ICUT_PORT_2_SHIFT   4
 
#define ICUT_PORT_3   0x07
 
#define ICUT_PORT_4   0x70
 
#define ICUT_PORT_3_SHIFT   0
 
#define ICUT_PORT_4_SHIFT   4
 
#define CONVERT_TEMP(x)   (-20.0 + (x*0.652))
 Macro to convert result from tps_GetTemperature() into degrees C (float) More...
 
#define POEP1   0x10
 
#define POEP2   0x20
 
#define POEP3   0x40
 
#define POEP4   0x80
 
#define POE_PLUS_SHIFT   4
 
#define WDS   0x01
 
#define IWD   0x1E
 
#define IWD_SHIFT   1
 
#define IWD_MASK_VALUE   0xB
 Value to place in the IWD bits to disable the I2C watchdog (default setting) More...
 
#define IGATE   0x20
 
#define CLDN_MASK   0xC0
 
#define CLDN_SHIFT   6
 
#define GATE_PULLUP_CURRENT_50_MICROAMP   0
 
#define GATE_PULLUP_CURRENT_25_MICROAMP   1
 
#define PORT_RESISTANCE_MASK_SHORT   0x3FFF
 
#define RS_MASK_SHORT   0xC000
 
#define RS_SHIFT_SHORT   13
 
#define PORT_VOLTAGE_DIFFERENCE_MASK_SHORT   0x0FFF
 
#define VDS_MASK_SHORT   0xF000
 
#define VDS_SHIFT_SHORT   12
 
#define CONVERT_PORT_NUM(x)   (1 << ((uint8_t)x-1))
 A macro that converts a port number into a port value. More...
 
#define TPS238X_INTERRUPT_COMMAND   0x00
 
#define TPS238X_INTERRUPT_MASK_COMMAND   0x01
 
#define TPS238X_POWER_EVENT_COMMAND   0x02
 
#define TPS238X_POWER_EVENT_CLEAR_COMMAND   0x03
 
#define TPS238X_DETECTION_EVENT_COMMAND   0x04
 
#define TPS238X_DETECTION_EVENT_CLEAR_COMMAND   0x05
 
#define TPS238X_FAULT_EVENT_COMMAND   0x06
 
#define TPS238X_FAULT_EVENT_CLEAR_COMMAND   0x07
 
#define TPS238X_INRUSH_LIMIT_EVENT_COMMAND   0x08
 
#define TPS238X_INRUSH_LIMIT_EVENT_CLEAR_COMMAND   0x09
 
#define TPS238X_SUPPLY_EVENT_COMMAND   0x0A
 
#define TPS238X_SUPPLY_EVENT_CLEAR_COMMAND   0x0B
 
#define TPS238X_PORT_1_STATUS_COMMAND   0x0C
 
#define TPS238X_PORT_2_STATUS_COMMAND   0x0D
 
#define TPS238X_PORT_3_STATUS_COMMAND   0x0E
 
#define TPS238X_PORT_4_STATUS_COMMAND   0x0F
 
#define TPS238X_POWER_STATUS_COMMAND   0x10
 
#define TPS238X_I2C_SLAVE_ADDRESS_COMMAND   0x11
 
#define TPS238X_OPERATING_MODE_COMMAND   0x12
 
#define TPS238X_DISCONNECT_ENABLE_COMMAND   0x13
 
#define TPS238X_DETECT_CLASS_ENABLE_COMMAND   0x14
 
#define TPS238X_PORT_POWER_PRIORITY_COMMAND   0x15
 
#define TPS238X_TIMING_CONFIGURATION_COMMAND   0x16
 
#define TPS238X_GENERAL_MASK_1_COMMAND   0x17
 
#define TPS238X_DETECT_CLASS_RESTART_COMMAND   0x18
 
#define TPS238X_POWER_ENABLE_COMMAND   0x19
 
#define TPS238X_RESET_COMMAND   0x1A
 
#define TPS238X_ID_COMMAND   0x1B
 
#define TPS238X_TEST_ENABLE_COMMAND   0x1D
 
#define TPS238X_LEGACY_DETECT_MODE_COMMAND   0x20
 
#define TPS238X_TWO_EVENT_CLASSIFICATION_COMMAND   0x21
 
#define TPS238X_FOUR_PAIR_MODE_COMMAND   0x22
 
#define TPS238X_CLASS_FIVE_TIMER_ENABLE_COMMAND   0x27
 
#define TPS238X_DISCONNECT_THRESHOLD_COMMAND   0x29
 
#define TPS238X_ICUT21_CONFIGURATION_COMMAND   0x2A
 
#define TPS238X_ICUT43_CONFIGURATION_COMMAND   0x2B
 
#define TPS238X_TEMPERATURE_COMMAND   0x2C
 
#define TPS238X_INPUT_VOLTAGE_COMMAND   0x2E
 
#define TPS238X_INPUT_VOLTAGE_LSB_COMMAND   0x2E
 
#define TPS238X_INPUT_VOLTAGE_MSB_COMMAND   0x2F
 
#define TPS238X_PORT_1_CURRENT_COMMAND   0x30
 
#define TPS238X_PORT_1_CURRENT_LSB_COMMAND   0x30
 
#define TPS238X_PORT_1_CURRENT_MSB_COMMAND   0x31
 
#define TPS238X_PORT_1_VOLTAGE_COMMAND   0x32
 
#define TPS238X_PORT_1_VOLTAGE_LSB_COMMAND   0x32
 
#define TPS238X_PORT_1_VOLTAGE_MSB_COMMAND   0x33
 
#define TPS238X_PORT_2_CURRENT_COMMAND   0x34
 
#define TPS238X_PORT_2_CURRENT_LSB_COMMAND   0x34
 
#define TPS238X_PORT_2_CURRENT_MSB_COMMAND   0x35
 
#define TPS238X_PORT_2_VOLTAGE_COMMAND   0x36
 
#define TPS238X_PORT_2_VOLTAGE_LSB_COMMAND   0x36
 
#define TPS238X_PORT_2_VOLTAGE_MSB_COMMAND   0x37
 
#define TPS238X_PORT_3_CURRENT_COMMAND   0x38
 
#define TPS238X_PORT_3_CURRENT_LSB_COMMAND   0x38
 
#define TPS238X_PORT_3_CURRENT_MSB_COMMAND   0x39
 
#define TPS238X_PORT_3_VOLTAGE_COMMAND   0x3A
 
#define TPS238X_PORT_3_VOLTAGE_LSB_COMMAND   0x3A
 
#define TPS238X_PORT_3_VOLTAGE_MSB_COMMAND   0x3B
 
#define TPS238X_PORT_4_CURRENT_COMMAND   0x3C
 
#define TPS238X_PORT_4_CURRENT_LSB_COMMAND   0x3C
 
#define TPS238X_PORT_4_CURRENT_MSB_COMMAND   0x3D
 
#define TPS238X_PORT_4_VOLTAGE_COMMAND   0x3E
 
#define TPS238X_PORT_4_VOLTAGE_LSB_COMMAND   0x3E
 
#define TPS238X_PORT_4_VOLTAGE_MSB_COMMAND   0x3F
 
#define TPS238X_POE_PLUS_COMMAND   0x40
 
#define TPS238X_FIRMWARE_REVISION_COMMAND   0x41
 
#define TPS238X_I2C_WATCHDOG_COMMAND   0x42
 
#define TPS238X_DEVICE_ID_COMMAND   0x43
 
#define TPS238X_COOL_DOWN_GATE_DRIVE_COMMAND   0x45
 
#define TPS238X_PORT_1_DETECT_RESISTANCE_COMMAND   0x60
 
#define TPS238X_PORT_1_DETECT_RESISTANCE_LSB_COMMAND   0x60
 
#define TPS238X_PORT_1_DETECT_RESISTANCE_MSB_COMMAND   0x61
 
#define TPS238X_PORT_2_DETECT_RESISTANCE_COMMAND   0x62
 
#define TPS238X_PORT_2_DETECT_RESISTANCE_LSB_COMMAND   0x62
 
#define TPS238X_PORT_2_DETECT_RESISTANCE_MSB_COMMAND   0x63
 
#define TPS238X_PORT_3_DETECT_RESISTANCE_COMMAND   0x64
 
#define TPS238X_PORT_3_DETECT_RESISTANCE_LSB_COMMAND   0x64
 
#define TPS238X_PORT_3_DETECT_RESISTANCE_MSB_COMMAND   0x65
 
#define TPS238X_PORT_4_DETECT_RESISTANCE_COMMAND   0x66
 
#define TPS238X_PORT_4_DETECT_RESISTANCE_LSB_COMMAND   0x66
 
#define TPS238X_PORT_4_DETECT_RESISTANCE_MSB_COMMAND   0x67
 
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_COMMAND   0x68
 
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x68
 
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x69
 
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_COMMAND   0x6A
 
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6A
 
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6B
 
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_COMMAND   0x6C
 
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6C
 
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6D
 
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_COMMAND   0x6E
 
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6E
 
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6F
 

Typedefs

typedef unsigned short TPS238x_Input_Voltage_t
 
typedef unsigned short TPS238x_Port_Current_t
 
typedef unsigned short TPS238x_Port_Voltage_t
 
typedef unsigned short TPS238x_Port_Detect_Resistance_t
 
typedef unsigned short TPS238x_Port_Voltage_Difference_t
 

Enumerations

enum  TPS238x_On_Off_t { TPS_OFF = 0x0, TPS_ON = 0x1 }
 
enum  TPS238x_PortNum_t { TPS238X_PORT_1 = 1, TPS238X_PORT_2 = 2, TPS238X_PORT_3 = 3, TPS238X_PORT_4 = 4 }
 
enum  TPS238x_Classification_Status_t {
  CLASS_UNKNOWN = 0x0, CLASS_1 = 0x1, CLASS_2 = 0x2, CLASS_3 = 0x3,
  CLASS_4 = 0x4, CLASS_0 = 0x6, CLASS_OVERCURRENT = 0x7, CLASS_MISMATCH = 0x8,
  CLASS_5 = 0x9
}
 The classification status. More...
 
enum  TPS238x_Detection_Status_t {
  DETECT_UNKNOWN = 0x0, DETECT_SHORT_CIRCUIT = 0x1, DETECT_RESIST_LOW = 0x3, DETECT_RESIST_VALID = 0x4,
  DETECT_RESIST_HIGH = 0x5, DETECT_OPEN_CIRCUIT = 0x6, DETECT_MOSFET_FAULT = 0x8, DETECT_LEGACY = 0x9,
  DETECT_CAP_INVALID_CLAMP_VOLTAGE = 0xA, DETECT_CAP_INVALID_DELTA_V = 0xB, DETECT_CAP_INVALID_LEGACY_RANGE = 0xC
}
 Detection status. More...
 
enum  TPS238x_Operating_Modes_t { OPERATING_MODE_OFF = 0x0, OPERATING_MODE_MANUAL = 0x1, OPERATING_MODE_SEMI_AUTO = 0x2, OPERATING_MODE_AUTO = 0x3 }
 Operating mode for each of the ports (off, manual, semi-auto, auto) More...
 
enum  TPS238x_ILIM_Timing_t { TLIM_60_MS = 0x0, TLIM_30_MS = 0x1, TLIM_15_MS = 0x2, TLIM_10_MS = 0x3 }
 Set the ILIM fault timing, which is the foldback current time limit duration before port turn off. Used in tps_SetTiming() More...
 
enum  TPS238x_TStart_Timing_t { TSTART_60_MS = 0x0, TSTART_30_MS = 0x1, TSTART_120_MS = 0x2 }
 Set the length of the TSTART period, which is the maximum allowed overcurrent time during inrush. Used in tps_SetTiming() More...
 
enum  TPS238x_TICUT_Timing_t { TICUT_60_MS = 0x0, TICUT_30_MS = 0x1, TICUT_120_MS = 0x2, TICUT_240_MS = 0x3 }
 Set the length of the ICUT Fault Timing period, which is the overcurrent time duration before port turn off. Used in tps_SetTiming() More...
 
enum  TPS238x_TDIS_Timing_t { TDIS_360_MS = 0x0, TDIS_90_MS = 0x1, TDIS_180_MS = 0x2, TDIS_720_MS = 0x3 }
 Set the length of the Disconnect delay, which is the time to turn off a port once there is a disconnect condition. Used in tps_SetTiming() More...
 
enum  TPS238x_Legacy_Detect_t { LEGACY_DETECT_DISABLED = 0x0, LEGACY_DETECT_ONLY = 0x1, LEGACY_DETECT_STANDARD_THEN_LEGACY = 0x2 }
 Define the legacy-detect mode for each port . Used in tps_ConfigPort() More...
 
enum  TPS238x_Two_Event_t { TWO_EVENT_DISABLE = 0x0, TWO_EVENT_AFTER_CLASS_4 = 0x1, TWO_EVENT_AFTER_CLASS_5 = 0x2, TWO_EVENT_AFTER_CLASS_4_OR_5 = 0x3 }
 Set the conditions for PSE-initiated two-event physical classifications. Used in tps_ConfigPort() More...
 
enum  TPS238x_Four_Pair_t {
  FOUR_PAIR_DISCONNECT_DISABLED = 0x0, FOUR_PAIR_DISCONNECT_BASED_ON_LOWER_PORT = 0x1, FOUR_PAIR_DISCONNECT_BASED_ON_HIGHER_PORT = 0x2, FOUR_PAIR_DISCONNECT_BASED_ON_EITHER_PORT = 0x3,
  FOUR_PAIR_DISCONNECT_BASED_ON_BOTH_PORTS = 0x4
}
 Define Four Pair Disconnect modes in tps_Config4Pair() More...
 
enum  TPS238x_Disconnect_Threshold_t { DCTH_7_5_MILLIAMP = 0x0, DCTH_15_MILLIAMP = 0x1, DCTH_30_MILLIAMP = 0x2, DCTH_50_MILLIAMP = 0x3 }
 Current levels for disconnect threshold. Used in tps_ConfigPort() More...
 
enum  TPS238x_ICUT_Config_t {
  ICUT_374_MILLIAMP = 0x0, ICUT_110_MILLIAMP = 0x1, ICUT_204_MILLIAMP = 0x2, ICUT_754_MILLIAMP = 0x4,
  ICUT_592_MILLIAMP = 0x5, ICUT_686_MILLIAMP = 0x6, ICUT_920_MILLIAMP = 0x7
}
 ICUT Current thresholds. Used in tps_ConfigPort() More...
 
enum  TPS238x_POE_Plus_Foldback_t { _1X_ILIM_FOLDBACK_CURVE = 0x0, _2X_ILIM_FOLDBACK_CURVE = 0x1 }
 Foldback curve applied to a port when powered on. Used in tps_ConfigPort() More...
 
enum  TPS238x_Cool_Down_Timing_t { COOL_DOWN_1_SEC = 0x0, COOL_DOWN_2_SEC = 0x2, COOL_DOWN_4_SEC = 0x3 }
 Used in tps_SetTiming() to set the time between a port shut down due to a fault and a subsequent power up. More...
 
enum  TPS238x_Detect_Resistance_Status_t { RS_STATUS_GOOD = 0x0, RS_STATUS_SHORT_CIRCUIT = 0x1, RS_STATUS_OPEN_CIRCUIT = 0x2, RS_STATUS_MOSFET_SHORT_FAULT = 0x3 }
 
enum  TPS238x_Detect_Voltage_Difference_Status_t {
  VDS_STATUS_POWER_ON_RESET = 0x0, VDS_STATUS_VALID_MEASUREMENT = 0x1, VDS_STATUS_TIMEOUT = 0x2, VDS_STATUS_FIRST_MEASUREMENT_EXCESS = 0x3,
  VDS_STATUS_SECOND_MEASUREMENT_EXCESS = 0x4, VDS_STATUS_INSUFFICIENT_SIGNAL = 0x5
}
 

Functions

uint8_t tps_RegisterPort (uint16_t device_i2c_address, TPS238x_PortNum_t devicePortNum)
 Allocates a system level port number for a given TPS23861 device and it's specific port number. More...
 
uint16_t tps_GetDeviceI2CAddress (uint8_t systemPortNum)
 Get the TPS23861 I2C Address associated with a registered System Port Number. More...
 
TPS238x_PortNum_t tps_GetDevicePortNum (uint8_t systemPortNum)
 Get the TPS23861 I2C Address associated with a registered System Port Number. More...
 
uint8_t tps_GetSystemPortNumber (uint16_t deviceI2CAddress, TPS238x_PortNum_t devicePortNum)
 Returns the handle already allocated for the given TPS23861 and device port number. More...
 
uint8_t tps_SetI2CAddresses (uint8_t temp_i2cAddress, uint8_t numDevices, uint8_t *list_ofAddresses, TPS238x_On_Off_t *list_ofAutoMode)
 Allows a set of TPS23861 to be configured with unique I2C addresses. More...
 
uint8_t tps_SetDeviceInterruptMask (uint8_t device_i2c_address, TPS238X_Interrupt_Mask_Register_t intMask, uint8_t intDelayTime)
 Set the interrupt mask register. More...
 
uint8_t tps_GetDeviceInterruptMask (uint8_t device_i2c_address, TPS238X_Interrupt_Mask_Register_t *intMask, uint8_t *intDelayTime)
 Get the current setting of the interrupt mask register. More...
 
uint8_t tps_GetDeviceInterruptStatus (uint8_t device_i2c_address, TPS238X_Interrupt_Register_t *status)
 Get the current interrupt status for the indicated TPS23861 part. More...
 
uint8_t tps_GetDeviceAllInterruptEvents (uint8_t device_i2c_address, TPS238x_Ports_t *powerEnablePortEvents, TPS238x_Ports_t *powerGoodPortEvents, TPS238x_Ports_t *detectionPortEvents, TPS238x_Ports_t *classificationPortEvents, TPS238x_Ports_t *icutPortEvents, TPS238x_Ports_t *disconnectPortEvents, TPS238x_Ports_t *inrushPortEvents, TPS238x_Ports_t *ilimPortEvents, TPS238X_Supply_Event_Register_t *supplyEvents)
 Returns all of the individual event/fault registers that generated a TPS23861 interrupt. More...
 
uint8_t tps_GetPortDetectClassStatus (uint8_t systemPortNum, uint8_t *detectionStatus, uint8_t *classificationStatus)
 Returns the detection and classification status of the specified port. More...
 
uint8_t tps_GetPortDetectionStatus (uint8_t systemPortNum, TPS238x_Detection_Status_t *detectionStatus)
 Returns the detection status of the specified port. More...
 
uint8_t tps_GetPortClassificationStatus (uint8_t systemPortNum, TPS238x_Classification_Status_t *classificationStatus)
 Returns the classification status of the specified port. More...
 
uint8_t tps_GetDevicePowerStatus (uint8_t device_i2c_address, TPS238x_Ports_t *powerEnablePorts, TPS238x_Ports_t *powerGoodPorts)
 Returns the power enable and power good status of the 4 ports in the TPS23861. More...
 
uint8_t tps_GetDevicePowerEnableStatus (uint8_t device_i2c_address, TPS238x_Ports_t *powerEnablePorts)
 Returns the power enable status of the 4 ports in the TPS23861. More...
 
uint8_t tps_GetDevicePowerGoodStatus (uint8_t device_i2c_address, TPS238x_Ports_t *powerGoodPorts)
 Returns the power good status of the 4 ports in the TPS23861. More...
 
uint8_t tps_GetPortPowerGoodStatus (uint8_t systemPortNum)
 Returns the power good status of the 4 ports in the TPS23861. More...
 
uint8_t tps_SetDevicePowerOn (uint8_t device_i2c_address, TPS238x_Ports_t portsPoweredOn)
 Configures the power on state for each of the device ports on a specific TPS23861. More...
 
uint8_t tps_SetDevicePowerOff (uint8_t device_i2c_address, TPS238x_Ports_t portsPoweredOff)
 Configures the power down (off) state for each of the device ports on a specific TPS23861. More...
 
uint8_t tps_SetPortPower (uint8_t systemPortNum, TPS238x_On_Off_t on_off)
 Power on or off a single specified system port. More...
 
uint8_t tps_GetDeviceDetectionEnable (uint8_t device_i2c_address, TPS238x_Ports_t *detectPorts)
 Returns the device ports that are enabled for detection operation on the specific TPS23861. More...
 
uint8_t tps_GetPortDetectionEnable (uint8_t systemPortNum)
 Returns whether the indicated system port is enabled for detection operation. More...
 
uint8_t tps_GetDeviceClassificationEnable (uint8_t device_i2c_address, TPS238x_Ports_t *classPorts)
 Returns the device ports that are enabled for classification operation for a specific TPS23861 device. More...
 
uint8_t tps_GetPortClassificationEnable (uint8_t systemPortNum)
 Returns whether the indicated system port is enabled for classification operation. More...
 
uint8_t tps_GetDeviceDetectClassEnable (uint8_t device_i2c_address, TPS238x_Ports_t *detectPorts, TPS238x_Ports_t *classPorts)
 Returns the device ports that are enabled for detection and classification operation on the specified TPS23861. More...
 
uint8_t tps_SetDeviceDetectClassEnable (uint8_t device_i2c_address, TPS238x_Ports_t detectPorts, TPS238x_Ports_t classPorts)
 Configures the device ports that are enabled for detection and classification operation for a specified TPS23861. More...
 
uint8_t tps_SetPortDetectClassEnable (uint8_t systemPortNum, TPS238x_On_Off_t on_off_detect, TPS238x_On_Off_t on_off_class)
 Configures a single port to enable or disable the detection and classification operation. More...
 
uint8_t tps_GetDeviceDisconnectEnable (uint8_t device_i2c_address, TPS238x_Ports_t *disconnectPorts)
 Returns the ports that are enabled for 2 pair disconnection operation. More...
 
uint8_t tps_SetDeviceDisconnectEnable (uint8_t device_i2c_address, TPS238x_Ports_t disconnectPorts)
 Configures the ports to configure those that are enabled for 2 pair disconnection operation. More...
 
uint8_t tps_SetPortDisconnectEnable (uint8_t systemPortNum, TPS238x_On_Off_t on_off)
 Configures a single port to enable or disable the 2 pair disconnection operation. More...
 
uint8_t tps_SetDeviceTiming (uint8_t device_i2c_address, TPS238x_ILIM_Timing_t ilimTiming, TPS238x_TStart_Timing_t startTiming, TPS238x_TICUT_Timing_t icutTiming, TPS238x_TDIS_Timing_t disconnectTiming, TPS238x_Cool_Down_Timing_t coolDownFaultTiming)
 Configures the timing of the various current limits and disconnection determinations for a given device in the system. More...
 
uint8_t tps_FastShutdownDeviceEnable (uint8_t device_i2c_address, TPS238x_Ports_t ports)
 Configures the fast shutdown enable for each of the ports on the TPS23861. More...
 
uint8_t tps_FastShutdownPortEnable (uint8_t systemPortNum, TPS238x_On_Off_t on_off)
 Configures the fast shutdown enable for a specific port on the TPS23861. More...
 
uint8_t tps_ConfigPort (uint8_t systemPortNum, TPS238x_Operating_Modes_t operatingMode, TPS238x_Legacy_Detect_t legacyDetect, TPS238x_Two_Event_t twoEvent, TPS238x_On_Off_t class5Enable, TPS238x_Disconnect_Threshold_t disconnectThreshold, TPS238x_ICUT_Config_t icutCurrentThreshold, TPS238x_POE_Plus_Foldback_t poepFoldbackCurve)
 Configures the current thresholds and operating modes for the specified port. More...
 
uint8_t tps_ConfigDevice4Pair (uint8_t device_i2c_address, TPS238x_On_Off_t on_off_Port12, TPS238x_Four_Pair_t disconnectModePort12, TPS238x_On_Off_t on_off_Port34, TPS238x_Four_Pair_t disconnectModePort34)
 Configures two ports to be used together as 4 pair operation. More...
 
uint8_t tps_RestartDeviceDetection (uint8_t device_i2c_address, TPS238x_Ports_t detectPorts)
 Forces a restart of the detection process on the indicated ports on a given TPS23861 in the system. More...
 
uint8_t tps_RestartPortDetection (uint8_t systemPortNum)
 Forces a restart of the detection process on the indicated device ports for a given TPS23861. More...
 
uint8_t tps_RestartDeviceClassification (uint8_t device_i2c_address, TPS238x_Ports_t classPorts)
 Forces a restart of the classification process on the indicated ports. More...
 
uint8_t tps_RestartPortClassification (uint8_t systemPortNum)
 Forces a restart of the classification process on the single indicated port. More...
 
uint8_t tps_RestartDeviceDetectClass (uint8_t device_i2c_address, TPS238x_Ports_t detectPorts, TPS238x_Ports_t classPorts)
 Forces a restart both the classification and detection processes on the indicated ports. More...
 
uint8_t tps_ResetDevicePort (uint8_t systemPortNum)
 Forces a reset of the indicated device ports on the indicated TPS23861 device. More...
 
uint8_t tps_ResetPort (uint8_t systemPortNum)
 Forces a reset of the single specified system port number identifying a single port on a specific registered TPS23861. More...
 
uint8_t tps_GetPortMeasurements (uint8_t systemPortNum, uint16_t *voltage, uint16_t *current)
 Returns the voltage and current of the registered system port. More...
 
uint8_t tps_GetDeviceInputVoltage (uint8_t device_i2c_address, uint16_t *voltage)
 Returns the input voltage of the specified TPS23861. More...
 
uint8_t tps_GetDeviceTemperature (uint8_t device_i2c_address, uint8_t *temperature)
 Returns the temperature of the specified TPS23861. More...
 
uint8_t tps_GetPortDetectResistance (uint8_t systemPortNum, uint16_t *detectResistance, TPS238x_Detect_Resistance_Status_t *detectResistanceStatus)
 Returns the detection resistance value for the registered system port number on a specific TPS23861. More...
 
uint8_t tps_GetPortDetectVoltageDifference (uint8_t systemPortNum, uint16_t *detectVoltageDiff, TPS238x_Detect_Voltage_Difference_Status_t *detectVoltageDiffStatus)
 Returns the voltage difference for the indicated system port number on one of the TPS23861 in the system. More...
 
uint8_t tps_ReleasePort (uint8_t systemPortNum)
 Releases a register system port number from the port mapping table. More...
 

Macro Definition Documentation

#define _250M   0x01

250 mOhm resistor used as current sensor

#define _4P12DIS   0x07
#define _4P12DIS_SHIFT   0
#define _4P12EN   0x08
#define _4P12EN_SHIFT   3
#define _4P34DIS   0x70
#define _4P34DIS_SHIFT   4
#define _4P34EN   0x80
#define _4P34EN_SHIFT   7
#define _800_A_D_CONV_PER_SECOND   0x00
#define _960_A_D_CONV_PER_SECOND   0x10
#define AUTO_BIT   0x80

The part will default into auto mode after power on if this bit is set.

#define CL5EN1   0x10

Enable class 5 classifications for port 1.

#define CL5EN2   0x20

Enable class 5 classifications for port 2.

#define CL5EN3   0x40

Enable class 5 classifications for port 3.

#define CL5EN4   0x80

Enable class 5 classifications for port 4.

#define CLASC   0x10

Indicates at least one classification cycle occurred on at least one port.

#define CLASS   0xF0
#define CLASS_5_ENABLE_SHIFT   4
#define CLASS_SHIFT   4
#define CLASSIFICATION_EVENT_SHIFT   4
#define CLDN_MASK   0xC0
#define CLDN_SHIFT   6
#define CLE1   0x10

Enable classifications for port 1.

#define CLE2   0x20

Enable classifications for port 2.

#define CLE3   0x40

Enable classifications for port 3.

#define CLE4   0x80

Enable classifications for port 4.

#define CLINP   0x40
#define CLMSK   0x10

Enable classification cycle event interrupts.

#define CLRAIN   0x80
#define CLSC1   0x10

Classification cycle occurred on port 1.

#define CLSC2   0x20

Classification cycle occurred on port 2.

#define CLSC3   0x40

Classification cycle occurred on port 3.

#define CLSC4   0x80

Classification cycle occurred on port 4.

#define CONVERT_PORT_NUM (   x)    (1 << ((uint8_t)x-1))

A macro that converts a port number into a port value.

#define CONVERT_TEMP (   x)    (-20.0 + (x*0.652))

Macro to convert result from tps_GetTemperature() into degrees C (float)

#define DCDE1   0x01

DC disconnect enable for 2 pair operation in port 1.

#define DCDE2   0x02

DC disconnect enable for 2 pair operation in port 2.

#define DCDE3   0x04

DC disconnect enable for 2 pair operation in port 3.

#define DCDE4   0x08

DC disconnect enable for 2 pair operation in port 4.

#define DCTH1   0x03
#define DCTH1_SHIFT   0
#define DCTH2   0x0C
#define DCTH2_SHIFT   2
#define DCTH3   0x30
#define DCTH3_SHIFT   4
#define DCTH4   0xC0
#define DCTH4_SHIFT   6
#define DEMSK   0x08

Enable detection cycle event interrupts.

#define DETC   0x08

Indicates at least one detection cycle occurred on at least one port.

#define DETC1   0x01

Detection cycle occurred on port 1.

#define DETC2   0x02

Detection cycle occurred on port 2.

#define DETC3   0x04

Detection cycle occurred on port 3.

#define DETC4   0x08

Detection cycle occurred on port 4.

#define DETE1   0x01

Enable detections for port 1.

#define DETE2   0x02

Enable detections for port 2.

#define DETE3   0x04

Enable detections for port 3.

#define DETE4   0x08

Enable detections for port 4.

#define DETECT   0x0F
#define DETECT_SHIFT   0
#define DETECTION_EVENT_SHIFT   0
#define DIMSK   0x04

Enable disconnect event interrupts.

#define DISCONNECT_EVENT_SHIFT   4
#define DISCONNECT_THRESHOLD_MASK   3
#define DISF   0x04

Indicates a disconnect event occurred on at least one port.

#define DISF1   0x10

Disconnect event occurred at port 1.

#define DISF2   0x20

Disconnect event occurred at port 2.

#define DISF3   0x40

Disconnect event occurred at port 3.

#define DISF4   0x80

Disconnect event occurred at port 4.

#define FOUR_PAIR_DISCONNECT_MASK   7
#define FSE1   0x10
#define FSE2   0x20
#define FSE3   0x40
#define FSE4   0x80
#define FSE_SHIFT   4
#define GATE_PULLUP_CURRENT_25_MICROAMP   1
#define GATE_PULLUP_CURRENT_50_MICROAMP   0
#define GET_CLASS (   x)    (x>>8)
#define GET_DETECT (   x)    (x & 0xF)
#define GET_POWER_ENABLE_STATUS (   x)    (x & POWER_ENABLE_STATUS)
#define GET_POWER_GOOD_STATUS (   x)    (x >> 8)
#define I2C_ADDRESS_MASK   0x7F

7 bit I2C address

#define ICUT1   0x01

ICUT fault occurred at port 1.

#define ICUT2   0x02

ICUT fault occurred at port 2.

#define ICUT3   0x04

ICUT fault occurred at port 3.

#define ICUT4   0x08

ICUT fault occurred at port 4.

#define ICUT_EVENT_SHIFT   0
#define ICUT_PORT_1   0x07
#define ICUT_PORT_1_SHIFT   0
#define ICUT_PORT_2   0x70
#define ICUT_PORT_2_SHIFT   4
#define ICUT_PORT_3   0x07
#define ICUT_PORT_3_SHIFT   0
#define ICUT_PORT_4   0x70
#define ICUT_PORT_4_SHIFT   4
#define ICUT_THRESHOLD_MASK   7
#define ICV   0x07
#define ICV_DEFAULT   0x00
#define ID_REGISTER_DEFAULT   ((MFR_ID_DEFAULT<<MFR_ID_SHIFT) | ICV_DEFAULT)
#define IFAULT   0x20

Indicates that an ICUT or ILIM fault occurred on at least one port.

#define IFMSK   0x20

Enable ICUT or OLIM fault interrupts.

#define IGATE   0x20
#define ILIM1   0x10

ILIM fault occurred at port 1.

#define ILIM2   0x20

ILIM fault occurred at port 2.

#define ILIM3   0x40

ILIM fault occurred at port 3.

#define ILIM4   0x80

ILIM fault occurred at port 4.

#define ILIM_EVENT_SHIFT   4
#define INMSK   0x40

Enable Inrush fault interrupts.

#define INR1   0x01

Inrush fault occurred at port 1.

#define INR2   0x02

Inrush fault occurred at port 2.

#define INR3   0x04

Inrush fault occurred at port 3.

#define INR4   0x08

Inrush fault occurred at port 4.

#define INRF   0x40

Indicates that an Inrush fault occurred on at least one port.

#define INRUSH_EVENT_SHIFT   0
#define INTEN   0x80

External INT/ enabled by any unmasked bit of interrupt register.

#define IWD   0x1E
#define IWD_MASK_VALUE   0xB

Value to place in the IWD bits to disable the I2C watchdog (default setting)

#define IWD_SHIFT   1
#define LEGACY_MODE_MASK   3
#define LEGMOD1   0x03
#define LEGMOD1_SHIFT   0
#define LEGMOD2   0x0C
#define LEGMOD2_SHIFT   2
#define LEGMOD3   0x30
#define LEGMOD3_SHIFT   4
#define LEGMOD4   0xC0
#define LEGMOD4_SHIFT   6
#define MAINS   0x10

Convert port voltage rate of 960 or 800 A/D conversions per sec.

#define MFR_ID   0xF8
#define MFR_ID_DEFAULT   0x0A
#define MFR_ID_SHIFT   3
#define OPERATING_MODE_MASK   0x3
#define OPERATING_PORT_1_MODE   0x03
#define OPERATING_PORT_2_MODE   0x0C
#define OPERATING_PORT_3_MODE   0x30
#define OPERATING_PORT_4_MODE   0xC0
#define PE1_STATUS   0x01

Port 1 has power enabled.

#define PE2_STATUS   0x02

Port 2 has power enabled.

#define PE3_STATUS   0x04

Port 3 has power enabled.

#define PE4_STATUS   0x08

Port 4 has power enabled.

#define PEC   0x01

Indicates a power enable status change occurred on at least one port.

#define PEC1   0x01

Change to power enable status for port 1.

#define PEC2   0x02

Change to power enable status for port 2.

#define PEC3   0x04

Change to power enable status for port 3.

#define PEC4   0x08

Change to power enable status for port 4.

#define PEMSK   0x01

Enable power enable interrupts.

#define PG1_STATUS   0x10

Port 1 is powered on with good voltage levels.

#define PG2_STATUS   0x20

Port 2 is powered on with good voltage levels.

#define PG3_STATUS   0x40

Port 3 is powered on with good voltage levels.

#define PG4_STATUS   0x80

Port 4 is powered on with good voltage levels.

#define PGC   0x02

Indicates a power good change occurred on at least one port.

#define PGC1   0x10

Change to power good status for port 1.

#define PGC2   0x20

Change to power good status for port 2.

#define PGC3   0x40

Change to power good status for port 3.

#define PGC4   0x80

Change to power good status for port 4.

#define PGMSK   0x02

Enable power good interrupts.

#define POE_PLUS_SHIFT   4
#define POEP1   0x10
#define POEP2   0x20
#define POEP3   0x40
#define POEP4   0x80
#define PORT_1_VALUE   0x1

Bit value of the TPS238x_Ports_t Port 1.

#define PORT_2_VALUE   0x2

Bit value of the TPS238x_Ports_t Port 2.

#define PORT_3_VALUE   0x4

Bit value of the TPS238x_Ports_t Port 3.

#define PORT_4_VALUE   0x8

Bit value of the TPS238x_Ports_t Port 4.

#define PORT_RESISTANCE_MASK_SHORT   0x3FFF
#define PORT_VOLTAGE_DIFFERENCE_MASK_SHORT   0x0FFF
#define POWER_ENABLE_EVENT_SHIFT   4
#define POWER_ENABLE_STATUS   (PE1_STATUS + PE2_STATUS + PE3_STATUS + PE4_STATUS)
#define POWER_GOOD_EVENT_SHIFT   0
#define POWER_GOOD_STATUS   (PG1_STATUS + PG2_STATUS + PG3_STATUS + PG4_STATUS)
#define POWER_OFF_MASK   0xF0
#define POWER_OFF_SHIFT   4
#define POWER_ON_MASK   0x0F
#define POWER_ON_SHIFT   0
#define PWOFF1   0x10

Power off Port 1.

#define PWOFF2   0x20

Power off Port 2.

#define PWOFF3   0x40

Power off Port 3.

#define PWOFF4   0x80

Power off Port 4.

#define PWON1   0x01

Power on Port 1.

#define PWON2   0x02

Power on Port 2.

#define PWON3   0x04

Power on Port 3.

#define PWON4   0x08

Power on Port 4.

#define RCL1   0x10

Restart Classification Port 1.

#define RCL2   0x20

Restart Classification Port 2.

#define RCL3   0x40

Restart Classification Port 3.

#define RCL4   0x80

Restart Classification Port 4.

#define RDET1   0x01

Restart Detection Port 1.

#define RDET2   0x02

Restart Detection Port 2.

#define RDET3   0x04

Restart Detection Port 3.

#define RDET4   0x08

Restart Detection Port 4.

#define RESAL   0x10
#define RESP1   0x01
#define RESP2   0x02
#define RESP3   0x04
#define RESP4   0x08
#define RESTART_CLASSIFCATION_MASK   0xF0
#define RESTART_CLASSIFCATION_SHIFT   4
#define RESTART_DETECTION_MASK   0x0F
#define RESTART_DETECTION_SHIFT   0
#define RS_MASK_SHORT   0xC000
#define RS_SHIFT_SHORT   13
#define SUMSK   0x80

Enable supply event fault interrupts.

#define SUPF   0x80

Indicates that a supply event fault occurred.

#define SWIZZLE_BYTES (   x)    {unsigned short y; y = x; x = (((y & 0xff) << 8) | (y >> 8)); }

Used to switch MSB and LSB bytes in an unsigned short variable.

#define TDIS_MASK   0x3
#define TDIS_SHIFT   0x0
#define TECLEN1   0x03
#define TECLEN1_SHIFT   0
#define TECLEN2   0x0C
#define TECLEN2_SHIFT   2
#define TECLEN3   0x30
#define TECLEN3_SHIFT   4
#define TECLEN4   0xC0
#define TECLEN4_SHIFT   6
#define TICUT_MASK   0xC
#define TICUT_SHIFT   0x2
#define TLIM_MASK   0xC0
#define TLIM_SHIFT   0x6
#define TMR_MASK   0x0F

Location of interrupt delay time bits. Value in 10ms increments.

#define TPS238X_ALERT_RESPONSE_ADDRESS   0x0C
#define TPS238X_BROADCAST_ADDRESS   0x30
#define TPS238X_CLASS_FIVE_TIMER_ENABLE_COMMAND   0x27
#define TPS238X_COOL_DOWN_GATE_DRIVE_COMMAND   0x45
#define TPS238X_DETECT_CLASS_ENABLE_COMMAND   0x14
#define TPS238X_DETECT_CLASS_RESTART_COMMAND   0x18
#define TPS238X_DETECTION_EVENT_CLEAR_COMMAND   0x05
#define TPS238X_DETECTION_EVENT_COMMAND   0x04
#define TPS238X_DEVICE_ID_COMMAND   0x43
#define TPS238X_DISCONNECT_ENABLE_COMMAND   0x13
#define TPS238X_DISCONNECT_THRESHOLD_COMMAND   0x29
#define TPS238X_FAULT_EVENT_CLEAR_COMMAND   0x07
#define TPS238X_FAULT_EVENT_COMMAND   0x06
#define TPS238X_FIRMWARE_REVISION_COMMAND   0x41
#define TPS238X_FOUR_PAIR_MODE_COMMAND   0x22
#define TPS238X_GENERAL_MASK_1_COMMAND   0x17
#define TPS238X_I2C_SLAVE_ADDRESS_COMMAND   0x11
#define TPS238X_I2C_WATCHDOG_COMMAND   0x42
#define TPS238X_ICUT21_CONFIGURATION_COMMAND   0x2A
#define TPS238X_ICUT43_CONFIGURATION_COMMAND   0x2B
#define TPS238X_ID_COMMAND   0x1B
#define TPS238X_INPUT_VOLTAGE_COMMAND   0x2E
#define TPS238X_INPUT_VOLTAGE_LSB_COMMAND   0x2E
#define TPS238X_INPUT_VOLTAGE_MSB_COMMAND   0x2F
#define TPS238X_INRUSH_LIMIT_EVENT_CLEAR_COMMAND   0x09
#define TPS238X_INRUSH_LIMIT_EVENT_COMMAND   0x08
#define TPS238X_INTERRUPT_COMMAND   0x00
#define TPS238X_INTERRUPT_MASK_COMMAND   0x01
#define TPS238X_LEGACY_DETECT_MODE_COMMAND   0x20
#define TPS238X_OPERATING_MODE_COMMAND   0x12
#define TPS238X_POE_PLUS_COMMAND   0x40
#define TPS238X_PORT_1_CURRENT_COMMAND   0x30
#define TPS238X_PORT_1_CURRENT_LSB_COMMAND   0x30
#define TPS238X_PORT_1_CURRENT_MSB_COMMAND   0x31
#define TPS238X_PORT_1_DETECT_RESISTANCE_COMMAND   0x60
#define TPS238X_PORT_1_DETECT_RESISTANCE_LSB_COMMAND   0x60
#define TPS238X_PORT_1_DETECT_RESISTANCE_MSB_COMMAND   0x61
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_COMMAND   0x68
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x68
#define TPS238X_PORT_1_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x69
#define TPS238X_PORT_1_STATUS_COMMAND   0x0C
#define TPS238X_PORT_1_VOLTAGE_COMMAND   0x32
#define TPS238X_PORT_1_VOLTAGE_LSB_COMMAND   0x32
#define TPS238X_PORT_1_VOLTAGE_MSB_COMMAND   0x33
#define TPS238X_PORT_2_CURRENT_COMMAND   0x34
#define TPS238X_PORT_2_CURRENT_LSB_COMMAND   0x34
#define TPS238X_PORT_2_CURRENT_MSB_COMMAND   0x35
#define TPS238X_PORT_2_DETECT_RESISTANCE_COMMAND   0x62
#define TPS238X_PORT_2_DETECT_RESISTANCE_LSB_COMMAND   0x62
#define TPS238X_PORT_2_DETECT_RESISTANCE_MSB_COMMAND   0x63
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_COMMAND   0x6A
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6A
#define TPS238X_PORT_2_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6B
#define TPS238X_PORT_2_STATUS_COMMAND   0x0D
#define TPS238X_PORT_2_VOLTAGE_COMMAND   0x36
#define TPS238X_PORT_2_VOLTAGE_LSB_COMMAND   0x36
#define TPS238X_PORT_2_VOLTAGE_MSB_COMMAND   0x37
#define TPS238X_PORT_3_CURRENT_COMMAND   0x38
#define TPS238X_PORT_3_CURRENT_LSB_COMMAND   0x38
#define TPS238X_PORT_3_CURRENT_MSB_COMMAND   0x39
#define TPS238X_PORT_3_DETECT_RESISTANCE_COMMAND   0x64
#define TPS238X_PORT_3_DETECT_RESISTANCE_LSB_COMMAND   0x64
#define TPS238X_PORT_3_DETECT_RESISTANCE_MSB_COMMAND   0x65
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_COMMAND   0x6C
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6C
#define TPS238X_PORT_3_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6D
#define TPS238X_PORT_3_STATUS_COMMAND   0x0E
#define TPS238X_PORT_3_VOLTAGE_COMMAND   0x3A
#define TPS238X_PORT_3_VOLTAGE_LSB_COMMAND   0x3A
#define TPS238X_PORT_3_VOLTAGE_MSB_COMMAND   0x3B
#define TPS238X_PORT_4_CURRENT_COMMAND   0x3C
#define TPS238X_PORT_4_CURRENT_LSB_COMMAND   0x3C
#define TPS238X_PORT_4_CURRENT_MSB_COMMAND   0x3D
#define TPS238X_PORT_4_DETECT_RESISTANCE_COMMAND   0x66
#define TPS238X_PORT_4_DETECT_RESISTANCE_LSB_COMMAND   0x66
#define TPS238X_PORT_4_DETECT_RESISTANCE_MSB_COMMAND   0x67
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_COMMAND   0x6E
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_LSB_COMMAND   0x6E
#define TPS238X_PORT_4_DETECT_VOLTAGE_DIFF_MSB_COMMAND   0x6F
#define TPS238X_PORT_4_STATUS_COMMAND   0x0F
#define TPS238X_PORT_4_VOLTAGE_COMMAND   0x3E
#define TPS238X_PORT_4_VOLTAGE_LSB_COMMAND   0x3E
#define TPS238X_PORT_4_VOLTAGE_MSB_COMMAND   0x3F
#define TPS238X_PORT_POWER_PRIORITY_COMMAND   0x15
#define TPS238X_POWER_ENABLE_COMMAND   0x19
#define TPS238X_POWER_EVENT_CLEAR_COMMAND   0x03
#define TPS238X_POWER_EVENT_COMMAND   0x02
#define TPS238X_POWER_STATUS_COMMAND   0x10
#define TPS238X_RESET_COMMAND   0x1A
#define TPS238X_SUPPLY_EVENT_CLEAR_COMMAND   0x0B
#define TPS238X_SUPPLY_EVENT_COMMAND   0x0A
#define TPS238X_TEMPERATURE_COMMAND   0x2C
#define TPS238X_TEST_ENABLE_COMMAND   0x1D
#define TPS238X_TIMING_CONFIGURATION_COMMAND   0x16
#define TPS238X_TWO_EVENT_CLASSIFICATION_COMMAND   0x21
#define TPS238X_UNLOCK_CODE   0xAA

Unlock code for the I2C address registers to prevent disastrous overwrites.

#define TPS_ERR_I2C_ERROR   0x83
#define TPS_ERR_NO_PORT_AVAILABLE   0x82
#define TPS_ERR_PORT_IN_USE   0x80
#define TPS_ERR_PORT_NOT_IN_USE   0x81
#define TPS_GIVE_ME_NEXT_PORT_AVAILABLE   0xff
#define TPS_MAX_SYSTEM_PORTS   64
#define TPS_PORT_NOT_REGISTERED_VALUE   0xff
#define TPS_SUCCESSFUL   0x00
#define TSD   0x80
#define TSTART_MASK   0x30
#define TSTART_SHIFT   0x4
#define TWO_EVENT_MASK   3
#define VDS_MASK_SHORT   0xF000
#define VDS_SHIFT_SHORT   12
#define VDUV   0x20
#define VPUV   0x10
#define WDS   0x01

Typedef Documentation

typedef unsigned short TPS238x_Input_Voltage_t
typedef unsigned short TPS238x_Port_Current_t
typedef unsigned short TPS238x_Port_Detect_Resistance_t
typedef unsigned short TPS238x_Port_Voltage_Difference_t
typedef unsigned short TPS238x_Port_Voltage_t

Enumeration Type Documentation

The classification status.

Enumerator
CLASS_UNKNOWN 

Unknown - invalid.

CLASS_1 

Class 1.

CLASS_2 

Class 2.

CLASS_3 

Class 3.

CLASS_4 

Class 4.

CLASS_0 

Class 0.

CLASS_OVERCURRENT 

Overcurrent - invalid.

CLASS_MISMATCH 

Class mismatch - invalid.

CLASS_5 

Class 5.

Used in tps_SetTiming() to set the time between a port shut down due to a fault and a subsequent power up.

Enumerator
COOL_DOWN_1_SEC 

Cool down time of 1 sec after port shut down due to fault before port power up.

COOL_DOWN_2_SEC 

Cool down time of 2 sec after port shut down due to fault before port power up.

COOL_DOWN_4_SEC 

Cool down time of 4 sec after port shut down due to fault before port power up.

Enumerator
RS_STATUS_GOOD 

If at least one detection operation and this status, the detection resistance measuremnt is good.

RS_STATUS_SHORT_CIRCUIT 

Short circuit < 2 kOhms)

RS_STATUS_OPEN_CIRCUIT 

Open circuit.

RS_STATUS_MOSFET_SHORT_FAULT 

MOSFET short fault.

Indicates the status of the most recent voltage difference result on the port. The measurement is only valid when the status is VDS_STATUS_VALID_MEASUREMENT. Used in tps_GetDetectVoltageDifference()

Enumerator
VDS_STATUS_POWER_ON_RESET 

Power-on reset.

VDS_STATUS_VALID_MEASUREMENT 

Valid measurement.

VDS_STATUS_TIMEOUT 

Unable to achieve 2.2 V to take first measurement before timeout.

VDS_STATUS_FIRST_MEASUREMENT_EXCESS 

First measurement exceeds V det-clamp (min)

VDS_STATUS_SECOND_MEASUREMENT_EXCESS 

Second measurement exceeds V det-clamp (min)

VDS_STATUS_INSUFFICIENT_SIGNAL 

Delta V < 0.9 V (insufficient signal)

Detection status.

Enumerator
DETECT_UNKNOWN 

Unknown - invalid.

DETECT_SHORT_CIRCUIT 

Short circuit (<1.8 kOhm) - invalid.

DETECT_RESIST_LOW 

Resistance too low - invalid.

DETECT_RESIST_VALID 

Resistance valid.

DETECT_RESIST_HIGH 

Resistance too hig - invalid.

DETECT_OPEN_CIRCUIT 

Open circuit - invalid.

DETECT_MOSFET_FAULT 

MOSFET Fault - invalid.

DETECT_LEGACY 

Legacy detect - valid legacy detection.

DETECT_CAP_INVALID_CLAMP_VOLTAGE 

Detect measurement beyond clamp voltage - invalid legacy detection.

DETECT_CAP_INVALID_DELTA_V 

Insufficient Delta V - invalid legacy detection.

DETECT_CAP_INVALID_LEGACY_RANGE 

Capacitance measurement outside range of legacy device - invalid legacy detection.

Current levels for disconnect threshold. Used in tps_ConfigPort()

Enumerator
DCTH_7_5_MILLIAMP 

7.5 mA

DCTH_15_MILLIAMP 

15 mA

DCTH_30_MILLIAMP 

30 mA

DCTH_50_MILLIAMP 

50 mA

Define Four Pair Disconnect modes in tps_Config4Pair()

Enumerator
FOUR_PAIR_DISCONNECT_DISABLED 
FOUR_PAIR_DISCONNECT_BASED_ON_LOWER_PORT 

eg. Disconnect 1 and 2 if port 1 disconnect conditions met

FOUR_PAIR_DISCONNECT_BASED_ON_HIGHER_PORT 

eg. Disconnect 1 and 2 if port 2 disconnect conditions met

FOUR_PAIR_DISCONNECT_BASED_ON_EITHER_PORT 

eg. Disconnect 1 and 2 if port 1 or 2 disconnect conditions met

FOUR_PAIR_DISCONNECT_BASED_ON_BOTH_PORTS 

eg. Disconnect 1 and 2 if port 1 and 2 disconnect conditions met

ICUT Current thresholds. Used in tps_ConfigPort()

Enumerator
ICUT_374_MILLIAMP 

374 mA

ICUT_110_MILLIAMP 

110 mA

ICUT_204_MILLIAMP 

204 mA

ICUT_754_MILLIAMP 

754 mA

ICUT_592_MILLIAMP 

592 mA

ICUT_686_MILLIAMP 

686 mA

ICUT_920_MILLIAMP 

920 mA

Set the ILIM fault timing, which is the foldback current time limit duration before port turn off. Used in tps_SetTiming()

Enumerator
TLIM_60_MS 

60 ms

TLIM_30_MS 

30 ms

TLIM_15_MS 

15 ms

TLIM_10_MS 

10 ms

Define the legacy-detect mode for each port . Used in tps_ConfigPort()

Enumerator
LEGACY_DETECT_DISABLED 

Perform standard detection operation only.

LEGACY_DETECT_ONLY 

Perform legacy detection operation only.

LEGACY_DETECT_STANDARD_THEN_LEGACY 

Perform a standard detection operation and follow with a legacy detection operation.

Enumerator
TPS_OFF 
TPS_ON 

Operating mode for each of the ports (off, manual, semi-auto, auto)

Enumerator
OPERATING_MODE_OFF 

Off; no detection or classifications.

OPERATING_MODE_MANUAL 

Manual, detection and classification upon command.

OPERATING_MODE_SEMI_AUTO 

Semi-auto, automatic detection and classification (if enabled), but no automatic power on.

OPERATING_MODE_AUTO 

Auto, automatic detection,. classification, anb power on.

Foldback curve applied to a port when powered on. Used in tps_ConfigPort()

Enumerator
_1X_ILIM_FOLDBACK_CURVE 

1 x Ilim foldback curve applied when port is powered on

_2X_ILIM_FOLDBACK_CURVE 

2 x Ilim foldback curve applied when port is powered on

Used with functions that indicate a single port.

Note
that the hardware registers use a bit value with a separate bit for each port number. Conversion can be done with the CONVERT_PORT_NUM () macro
Enumerator
TPS238X_PORT_1 
TPS238X_PORT_2 
TPS238X_PORT_3 
TPS238X_PORT_4 

Set the length of the Disconnect delay, which is the time to turn off a port once there is a disconnect condition. Used in tps_SetTiming()

Enumerator
TDIS_360_MS 

360 ms

TDIS_90_MS 

90 ms

TDIS_180_MS 

180 ms

TDIS_720_MS 

720 ms

Set the length of the ICUT Fault Timing period, which is the overcurrent time duration before port turn off. Used in tps_SetTiming()

Enumerator
TICUT_60_MS 

60 ms

TICUT_30_MS 

30 ms

TICUT_120_MS 

120 ms

TICUT_240_MS 

240 ms

Set the length of the TSTART period, which is the maximum allowed overcurrent time during inrush. Used in tps_SetTiming()

Enumerator
TSTART_60_MS 

60 ms

TSTART_30_MS 

30 ms

TSTART_120_MS 

120 ms

Set the conditions for PSE-initiated two-event physical classifications. Used in tps_ConfigPort()

Enumerator
TWO_EVENT_DISABLE 

Two-event classification is disabled.

TWO_EVENT_AFTER_CLASS_4 

Start second classification event if class 4 event occurs.

TWO_EVENT_AFTER_CLASS_5 

Start second classification event if class 5 event occurs.

TWO_EVENT_AFTER_CLASS_4_OR_5 

Start second classification event if class 4 or 5 event occurs.

Function Documentation

uint8_t tps_ConfigDevice4Pair ( uint8_t  device_i2c_address,
TPS238x_On_Off_t  on_off_Port12,
TPS238x_Four_Pair_t  disconnectModePort12,
TPS238x_On_Off_t  on_off_Port34,
TPS238x_Four_Pair_t  disconnectModePort34 
)

Configures two ports to be used together as 4 pair operation.

The TPS23861 allows ports 1 & 2 or ports 3 & 4 to operate together to perform 4 pair PSE. There a a number of different disconnect modes that can be applied to a 4-pair port set. This function allows the user to enable the 4-pair port sets and define the disconnection mode to be used.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]on_off_Port12Enables ports 1 & 2 to operate in 4-pair mode (TPS_ON)
[in]disconnectModePort12Disconnection mode for the 4-pair port set using ports 1 and 2 [FOUR_PAIR_DISCONNECT_DISABLED, FOUR_PAIR_DISCONNECT_BASED_ON_LOWER_PORT, FOUR_PAIR_DISCONNECT_BASED_ON_HIGHER_PORT, FOUR_PAIR_DISCONNECT_BASED_ON_EITHER_PORT, or FOUR_PAIR_DISCONNECT_BASED_ON_BOTH_PORTS]
[in]on_off_Port34Enables ports 3 & 4 to operate in 4-pair mode (TPS_ON)
[in]disconnectModePort34Disconnection mode for the 4-pair port set using ports 3 and 4 [FOUR_PAIR_DISCONNECT_DISABLED, FOUR_PAIR_DISCONNECT_BASED_ON_LOWER_PORT, FOUR_PAIR_DISCONNECT_BASED_ON_HIGHER_PORT, FOUR_PAIR_DISCONNECT_BASED_ON_EITHER_PORT, or FOUR_PAIR_DISCONNECT_BASED_ON_BOTH_PORTS]
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_Config4Pair ()
uint8_t tps_ConfigPort ( uint8_t  systemPortNum,
TPS238x_Operating_Modes_t  operatingMode,
TPS238x_Legacy_Detect_t  legacyDetect,
TPS238x_Two_Event_t  twoEvent,
TPS238x_On_Off_t  class5Enable,
TPS238x_Disconnect_Threshold_t  disconnectThreshold,
TPS238x_ICUT_Config_t  icutCurrentThreshold,
TPS238x_POE_Plus_Foldback_t  poepFoldbackCurve 
)

Configures the current thresholds and operating modes for the specified port.

The TPS23861 has a number of the threshold values and operating modes that determine the characteristic capabilities of a given port. This includes whether the port can detect class 5 devices or operate in legacy detection modes. This function allows the user to configure the characteristics for a given port.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[in]operatingModeDefine the operating mode for the port [OPERATING_MODE_OFF, OPERATING_MODE_MANUAL, OPERATING_MODE_SEMI_AUTO, or OPERATING_MODE_AUTO]
[in]legacyDetectThe system can perform combinations of standard and legacy detections [LEGACY_DETECT_DISABLED, LEGACY_DETECT_ONLY, or LEGACY_DETECT_STANDARD_THEN_LEGACY]
[in]twoEventThe system can attempt two event physical layer classifications when a class 4 or class 5 PD is found [TWO_EVENT_DISABLE, TWO_EVENT_AFTER_CLASS_4, TWO_EVENT_AFTER_CLASS_5, or TWO_EVENT_AFTER_CLASS_4_OR_5]
[in]class5EnableAllows the system to attempt Class 5 current levels [TPS_ON or TPS_OFF]
[in]disconnectThresholdCurrent threshold for disconnection [DCTH_7_5_MILLIAMP, DCTH_15_MILLIAMP, DCTH_30_MILLIAMP, or DCTH_50_MILLIAMP]
[in]icutCurrentThresholdICUT Current threshold [ICUT_110_MILLIAMP, ICUT_204_MILLIAMP, ICUT_374_MILLIAMP, ICUT_592_MILLIAMP, ICUT_686_MILLIAMP, ICUT_754_MILLIAMP, or ICUT_920_MILLIAMP]
[in]poepFoldbackCurveDefines the foldback curve applied to a port when it is turned on [_1X_ILIM_FOLDBACK_CURVE or _2X_ILIM_FOLDBACK_CURVE]
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_Config4Pair ()
uint8_t tps_FastShutdownDeviceEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t  ports 
)

Configures the fast shutdown enable for each of the ports on the TPS23861.

This function will enable or disable the fast shutdown on each of the ports of the TPS23861

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]portsA TPS238x_Ports_t variable that identifies the ports that will be enabled for fast shutdown
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_FastShutdownPortEnable ()
uint8_t tps_FastShutdownPortEnable ( uint8_t  systemPortNum,
TPS238x_On_Off_t  on_off 
)

Configures the fast shutdown enable for a specific port on the TPS23861.

This function will enable or disable the fast shutdown on a specific port of the TPS23861

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[in]on_offEnable (TPS_ON) or disable (TPS_OFF) the fast shutdown for the indicated port
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_FastShutdownDeviceEnable ()
uint8_t tps_GetDeviceAllInterruptEvents ( uint8_t  device_i2c_address,
TPS238x_Ports_t powerEnablePortEvents,
TPS238x_Ports_t powerGoodPortEvents,
TPS238x_Ports_t detectionPortEvents,
TPS238x_Ports_t classificationPortEvents,
TPS238x_Ports_t icutPortEvents,
TPS238x_Ports_t disconnectPortEvents,
TPS238x_Ports_t inrushPortEvents,
TPS238x_Ports_t ilimPortEvents,
TPS238X_Supply_Event_Register_t supplyEvents 
)

Returns all of the individual event/fault registers that generated a TPS23861 interrupt.

There are a number of events and faults that can generate an interrupt. This function returns the individual indicators for each of the interruptable event/fault conditions.

Calling this function will clear the interrupts associated with these events/faults, so the user should process all indicators present.

There are individual functions that return the event/fault status for an individual register.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*powerEnablePortEventsAddress of a TPS238x_Ports_t variable that will receive the ports containing a power enable status change
[out]*powerGoodPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports containing a power good status change
[out]*detectionPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a detection cycle
[out]*classificationPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a classification cycle
[out]*icutPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a ICUT fault
[out]*disconnectPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a disconnect event
[out]*inrushPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a inrush fault at port turn on
[out]*ilimPortEventsAddress of a TPS238x_Ports_t variable that will receive the ports that had a ILIM fault occurred
[out]*supplyEventsAddress of a TPS238X_Supply_Event_Register_t variable that will receive the supply event faults VPUV_VPower_Undervoltage_Event VDUV_Vdd_UVLO_Event TSD_Thermal_Shutdown_Event
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
Note
Since the individual hardware registers contain more than one status in them, event status cannot be processed individually.
See Also
tps_GetInterruptMask ()
tps_SetInterruptMask ()
tps_GetInterruptStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceClassificationEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t classPorts 
)

Returns the device ports that are enabled for classification operation for a specific TPS23861 device.

This function will return the ports that are configured for classification operations.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*classPortsAddress of a TPS238x_Ports_t variable that will receive the ports that are enabled for classification with one bit for each port in classification enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortClassificationEnable ()
tps_GetDeviceDetectionEnable ()
tps_GetDeviceDetectClassEnable ()
tps_SetDeviceDetectClassEnable ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceDetectClassEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t detectPorts,
TPS238x_Ports_t classPorts 
)

Returns the device ports that are enabled for detection and classification operation on the specified TPS23861.

This function will return the device ports that are configured for detection and classification operations.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*detectPortsAddress of a TPS238x_Ports_t variable that will receive the ports that are enabled for detection with one bit for each port in detection enabled state.
[out]*classPortsAddress of a TPS238x_Ports_t variable that will receive the ports that are enabled for classification with one bit for each port in classification enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetDeviceClassificationEnable ()
tps_GetDeviceDetectionEnable ()
tps_SetDeviceDetectClassEnable ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceDetectionEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t detectPorts 
)

Returns the device ports that are enabled for detection operation on the specific TPS23861.

This function will return the ports that are configured for detection operations.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*detectPortsAddress of a TPS238x_Ports_t variable that will receive the device ports that are enabled for detection with one bit for each port in detection enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDetectionEnable ()
tps_GetDeviceClassificationEnable ()
tps_GetDeviceDetectClassEnable ()
tps_SetDeviceDetectClassEnable ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceDisconnectEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t disconnectPorts 
)

Returns the ports that are enabled for 2 pair disconnection operation.

This function will return the ports that are configured for 2 pair disconnect operations. Disconnect operation consists of measuring the port current at the SENn pin, starting the TDIS timer when the current drops below the threshold, and turning the port off if the timer times out.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*disconnectPortsAddress of a TPS238x_Ports_t variable that will receive the ports that are enabled for 2 pair disconnection with one bit for each port in disconnect enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDisconnectEnable ()
tps_SetDisconnectEnable ()
tps_GetSystemPortNumber ()
uint16_t tps_GetDeviceI2CAddress ( uint8_t  systemPortNum)

Get the TPS23861 I2C Address associated with a registered System Port Number.

This function returns the I2C address for the TPS23861 device registered for a given System Port Number

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint16_t I2C Address number associated with this specific port.
TPS_PORT_NOT_REGISTERED_VALUE - Indicates no port associated.
See Also
tps_RegisterPort ()
tps_GetDevicePortNum ()
uint8_t tps_GetDeviceInputVoltage ( uint8_t  device_i2c_address,
uint16_t *  voltage 
)

Returns the input voltage of the specified TPS23861.

This function will return the input voltage of the specified TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*voltageThe address of a uint16_t variable where the input voltage of the TPS23861. The voltage will be a scaled integer with an LSB of 3.662 mVolts
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortMeasurements ()
uint8_t tps_GetDeviceInterruptMask ( uint8_t  device_i2c_address,
TPS238X_Interrupt_Mask_Register_t intMask,
uint8_t *  intDelayTime 
)

Get the current setting of the interrupt mask register.

The function returns the TPS23861 events/faults that are able to generate interrupts (unmasked).

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*intMaskAddress of a TPS238X_Interrupt_Mask_Register_t variable that will the current events that can generate interrupts PEMSK_Power_Enable_Unmask PGMSK_Power_Good_Unmask DIMSK_Disconnect_Unmask DEMSK_Detection_Cycle_Unmask CLMSK_Classificiation_Cycle_Unmask IFMSK_IFAULT_Unmask INMSK_Inrush_Fault_Unmask SUMSK_Supply_Event_Fault_Unmask
[out]*intDelayTimeAddress of a uint8_t variable that will indicat the amount of defer time, with a 10ms lsb, of non-critical interrupts.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetInterruptMask ()
tps_GetInterruptEvents ()
tps_GetAllInterruptStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceInterruptStatus ( uint8_t  device_i2c_address,
TPS238X_Interrupt_Register_t status 
)

Get the current interrupt status for the indicated TPS23861 part.

The function returns a variable that has a one bit indicator for each of the interrupts in the TPS23861.

The interrupt mask register identifies which events/faults will generate an interrupt. The status register will still indicate events/faults that are masked and would not generate an interrupt. If the user wants to only process unmasked interrupts, the results from this function must be combined with the interrupt mask (tps_GetInterruptMask)

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*statusAddress of a TPS238X_Interrupt_Register_t variable that will receive the current interrupt status PEC_Power_Enable_Change PGC_Power_Good_Change DISF_Disconnect_Event DETC_Detection_Cycle CLASC_Classification_Cycle IFAULT_ICUT_ILIM_Fault INRF_Inrush_Fault SUPF_Supply_Event_Fault
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetInterruptEvents ()
tps_SetInterruptMask ()
tps_GetAllInterruptMask ()
tps_GetSystemPortNumber ()
TPS238x_PortNum_t tps_GetDevicePortNum ( uint8_t  systemPortNum)

Get the TPS23861 I2C Address associated with a registered System Port Number.

This function returns the I2C address for the TPS23861 device registered for a given System Port Number

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint16_t Device Port Number associated with this specific System Port Number.
TPS_PORT_NOT_REGISTERED_VALUE - Indicates no port associated.
See Also
tps_RegisterPort ()
tps_GetDeviceI2CAddress ()
uint8_t tps_GetDevicePowerEnableStatus ( uint8_t  device_i2c_address,
TPS238x_Ports_t powerEnablePorts 
)

Returns the power enable status of the 4 ports in the TPS23861.

This function will return the power good state of each port.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*powerEnablePortsAddress of a TPS238x_Ports_t variable that will receive the power enable status with one bit for each port in power enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPowerGoodStatus ()
tps_GetPowerStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDevicePowerGoodStatus ( uint8_t  device_i2c_address,
TPS238x_Ports_t powerGoodPorts 
)

Returns the power good status of the 4 ports in the TPS23861.

This function will return the power good state of each port.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*powerGoodPortsAddress of a TPS238x_Ports_t variable that will receive the power good status with one bit for each port in power good state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPowerEnableStatus ()
tps_GetPowerStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDevicePowerStatus ( uint8_t  device_i2c_address,
TPS238x_Ports_t powerEnablePorts,
TPS238x_Ports_t powerGoodPorts 
)

Returns the power enable and power good status of the 4 ports in the TPS23861.

This function will return both the power enable and the power good state of each port.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*powerEnablePortsAddress of a TPS238x_Ports_t variable that will receive the power enable status with one bit for each port in power enabled state.
[out]*powerGoodPortsAddress of a TPS238x_Ports_t variable that will receive the power good status with one bit for each port in power good state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPowerEnableStatus ()
tps_GetPowerGoodStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetDeviceTemperature ( uint8_t  device_i2c_address,
uint8_t *  temperature 
)

Returns the temperature of the specified TPS23861.

This function will return the temperature of the specified TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[out]*temperatureThe address of a uint8_t variable where the temperature of the TPS23861. The temperature will be a scaled integer with an LSB of 0.652 degrees Celsius
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
uint8_t tps_GetPortClassificationEnable ( uint8_t  systemPortNum)

Returns whether the indicated system port is enabled for classification operation.

This function will return whether the indicated system port is configured for classification operations.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t TPS_ON - Port is enabled for classification TPS_OFF - Port is NOT enabled for classification
See Also
tps_GetDeviceClassificationEnable ()
tps_GetPortDetectionEnable ()
tps_SetPortDetectClassEnable ()
uint8_t tps_GetPortClassificationStatus ( uint8_t  systemPortNum,
TPS238x_Classification_Status_t classificationStatus 
)

Returns the classification status of the specified port.

This function will return the most recent classification result for the indicated port on the TPS23861.

The function will return a 0 (CLASS_UNKNOWN) when the port is turned off.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*classificationStatusAddress of a TPS238x_Classification_Status_t variable that will receive the classification status for the indicated port (CLASS_UNKNOWN, CLASS_1, CLASS_2, CLASS_3, CLASS_4, CLASS_0, CLASS_OVERCURRENT, CLASS_MISMATCH, or CLASS_5)
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDetectionStatus ()
tps_GetPortDetectClassStatus ()
uint8_t tps_GetPortDetectClassStatus ( uint8_t  systemPortNum,
uint8_t *  detectionStatus,
uint8_t *  classificationStatus 
)

Returns the detection and classification status of the specified port.

This function will return the most recent detection and classification result for the indicated port on the TPS23861.

The function will return a 0 (CLASS_UNKNOWN) when the port is turned off.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*detectionStatusAddress of a TPS238x_Detection_Status_t variable that will receive the detecttion status for the indicated port (DETECT_UNKNOWN, DETECT_SHORT_CIRCUIT, DETECT_RESIST_LOW, DETECT_RESIST_VALID, DETECT_RESIST_HIGH, DETECT_OPEN_CIRCUIT, DETECT_MOSFET_FAULT, DETECT_LEGACY, DETECT_CAP_INVALID_CLAMP_VOLTAGE, DETECT_CAP_INVALID_DELTA_V, or DETECT_CAP_VALID_LEGACY_RANGE)
[out]*classificationStatusAddress of a TPS238x_Classification_Status_t variable that will receive the classification status for the indicated port (CLASS_UNKNOWN, CLASS_1, CLASS_2, CLASS_3, CLASS_4, CLASS_0, CLASS_OVERCURRENT, CLASS_MISMATCH, or CLASS_5)
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDetectionStatus ()
tps_GetPortClassificationStatus ()
uint8_t tps_GetPortDetectionEnable ( uint8_t  systemPortNum)

Returns whether the indicated system port is enabled for detection operation.

This function will return a TPS_ON or TPS_OFF to indicate that the specific system port is enabled for detection or not

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t TPS_ON - Port is enabled for detection TPS_OFF - Port is NOT enabled for detection
See Also
tps_GetDeviceDetectionEnable ()
tps_GetPortClassificationEnable ()
tps_SetPortDetectClassEnable ()
uint8_t tps_GetPortDetectionStatus ( uint8_t  systemPortNum,
TPS238x_Detection_Status_t detectionStatus 
)

Returns the detection status of the specified port.

This function will return the most recent detection result for the indicated port on the TPS23861.

The function will return a 0 (CLASS_UNKNOWN) when the port is turned off.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*detectionStatusAddress of a TPS238x_Detection_Status_t variable that will receive the detecttion status for the indicated port (DETECT_UNKNOWN, DETECT_SHORT_CIRCUIT, DETECT_RESIST_LOW, DETECT_RESIST_VALID, DETECT_RESIST_HIGH, DETECT_OPEN_CIRCUIT, DETECT_MOSFET_FAULT, DETECT_LEGACY, DETECT_CAP_INVALID_CLAMP_VOLTAGE, DETECT_CAP_INVALID_DELTA_V, or DETECT_CAP_INVALID_LEGACY_RANGE)
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortClassificationStatus ()
tps_GetPortDetectClassStatus ()
uint8_t tps_GetPortDetectResistance ( uint8_t  systemPortNum,
uint16_t *  detectResistance,
TPS238x_Detect_Resistance_Status_t detectResistanceStatus 
)

Returns the detection resistance value for the registered system port number on a specific TPS23861.

This function will return the detection resistance and detection status for the registered system port on a TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*detectResistanceThe address of a uint16_t variable where the detection resistance of the port. The detection resistance will be a scaled integer with an LSB of 11.0966 ohms.
[out]*detectResistanceStatusThe address of a TPS238x_Detect_Resistance_Status_t variable for the most recent detection result status [RS_STATUS_GOOD, RS_STATUS_SHORT_CIRCUIT, RS_STATUS_OPEN_CIRCUIT, or RS_STATUS_MOSFET_SHORT_FAULT]
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDetectVoltageDifference ()
uint8_t tps_GetPortDetectVoltageDifference ( uint8_t  systemPortNum,
uint16_t *  detectVoltageDiff,
TPS238x_Detect_Voltage_Difference_Status_t detectVoltageDiffStatus 
)

Returns the voltage difference for the indicated system port number on one of the TPS23861 in the system.

The system will attempt to determine a legacy PD by measuring the PD input capacitance on the PI. A fixed charge is injected into the PI and the resulting voltage difference is reported. The reported voltage difference is only usable when the status indicates a valid measurement.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*detectVoltageDiffThe address of a uint16_t variable where the detection resistance of the port. The detection resistance will be a scaled integer with an LSB of 11.0966 ohms.
[out]*detectVoltageDiffStatusThe address of a TPS238x_Detect_Voltage_Difference_Status_t variable for the most recent detect voltage difference result status [VDS_STATUS_POWER_ON_RESET, VDS_STATUS_VALID_MEASUREMENT, VDS_STATUS_TIMEOUT, VDS_STATUS_FIRST_MEASUREMENT_EXCESS, VDS_STATUS_SECOND_MEASUREMENT_EXCESS, or VDS_STATUS_INSUFFICIENT_SIGNAL]
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetPortDetectResistance ()
uint8_t tps_GetPortMeasurements ( uint8_t  systemPortNum,
uint16_t *  voltage,
uint16_t *  current 
)

Returns the voltage and current of the registered system port.

This function will return the voltage and current on the registered port on a specific TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[out]*voltageThe address of a uint16_t variable where the voltage of the indicated port will be placed. The voltage will be a scaled integer with an LSB of 3.662 mVolts
[out]*currentThe address of a uint16_t variable where the current of the indicated port will be placed. The current will be a scaled integer with an LSB that is dependent on the current-sense resistor. For a 250 mOhm resistor, the LSB will be 62.260 micro-Amps. For a 255 mOhm resistor, the LSB will be 61.039 micro-Amps.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetDeviceInputVoltage ()
uint8_t tps_GetPortPowerGoodStatus ( uint8_t  systemPortNum)

Returns the power good status of the 4 ports in the TPS23861.

This function will return the power good state of each port.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t TPS_ON if Power Good TPS_OFF is Power is NOT good, TPS_ERR_I2C_ERROR on I2C error status
See Also
tps_GetPortPowerEnableStatus ()
tps_GetDevicePowerGoodStatus ()
tps_GetSystemPortNumber ()
uint8_t tps_GetSystemPortNumber ( uint16_t  device_i2c_address,
TPS238x_PortNum_t  devicePortNum 
)

Returns the handle already allocated for the given TPS23861 and device port number.

This function can be used if the System Port Number returned in the tps_RegisterPort() function is lost or not maintained.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]devicePortNumTPS238X_PORT_1 - TPS238X_PORT_4, The port number ON THE SPECIFIC TPS23861 device
Returns
uint8_t systemPortNum Unique handle that will be used to refer to this device and port number in future function calls.
TPS_PORT_NOT_REGISTERED_VALUE This combination of device and port number was not registered
See Also
tps_RegisterPort ()
uint8_t tps_RegisterPort ( uint16_t  device_i2c_address,
TPS238x_PortNum_t  devicePortNum 
)

Allocates a system level port number for a given TPS23861 device and it's specific port number.

It is easier for users to maintain a system with 4 TPS23861 with 4 ports each, when each port has a unique number. By registering each of the 16 individual ports (in this example), the user can work with ports 0-15, rather than have to maintain device 1 - port 0, through device 4 - port 3.

This function must be called prior to any function call that has a systemPortNum as an input. The current logic has room for TPS_MAX_SYSTEM_PORTS (64) ports. The TPS_PortMap[] variable can be modified to support more ports (or save some memory by supporting fewer).

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]devicePortNumTPS238X_PORT_1 - TPS238X_PORT_4, The port number ON THE SPECIFIC TPS23861 device
Returns
uint8_t systemPortNum Unique handle that will be used to refer to this device and port number in future function calls.
TPS_ERR_NO_PORT_AVAILABLE No port number available, all are in use
See Also
tps_ReleasePort ()
uint8_t tps_ReleasePort ( uint8_t  systemPortNum)

Releases a register system port number from the port mapping table.

This function would undo the registration performed in tps_RegisterPort().

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t TPS_SUCCESSFUL or TPS_ERR_PORT_NOT_IN_USE
See Also
tps_RegisterPort ()
uint8_t tps_ResetDevicePort ( uint8_t  systemPortNum)

Forces a reset of the indicated device ports on the indicated TPS23861 device.

This function will reset the indicated device ports on the identified TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_ResetPort ()
uint8_t tps_ResetPort ( uint8_t  systemPortNum)

Forces a reset of the single specified system port number identifying a single port on a specific registered TPS23861.

This function will reset the single specified port registered with the system for a given TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_ResetDevicePorts ()
uint8_t tps_RestartDeviceClassification ( uint8_t  device_i2c_address,
TPS238x_Ports_t  classPorts 
)

Forces a restart of the classification process on the indicated ports.

This function will restart the classification process on the indicated ports on the TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]classPortsA TPS238x_Ports_t variable that identifies the ports that will be restarted for classification with one bit for each port restarted.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_RestartPortClassification ()
tps_RestartDeviceDetection ()
tps_RestartDeviceDetectClass ()
uint8_t tps_RestartDeviceDetectClass ( uint8_t  device_i2c_address,
TPS238x_Ports_t  detectPorts,
TPS238x_Ports_t  classPorts 
)

Forces a restart both the classification and detection processes on the indicated ports.

This function will restart both the classification and detection process on the indicated ports on the TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]detectPortsA TPS238x_Ports_t variable that identifies the ports that will be restarted for detection with one bit for each port restarted.
[in]classPortsA TPS238x_Ports_t variable that identifies the ports that will be restarted for classification with one bit for each port restarted.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_RestartDeviceClassification ()
tps_RestartDeviceDetection ()
uint8_t tps_RestartDeviceDetection ( uint8_t  device_i2c_address,
TPS238x_Ports_t  detectPorts 
)

Forces a restart of the detection process on the indicated ports on a given TPS23861 in the system.

This function will restart the detection process on the indicated ports on the specified TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]detectPortsA TPS238x_Ports_t variable that identifies the ports that will be restarted for detection with one bit for each port restarted.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_RestartPortDetection ()
tps_RestartDeviceClassification ()
tps_RestartDeviceDetectClass ()
tps_GetSystemPortNumber ()
uint8_t tps_RestartPortClassification ( uint8_t  systemPortNum)

Forces a restart of the classification process on the single indicated port.

This function will restart the classification process on the specified port on the TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_RestartDeviceClassification ()
tps_RestartPortDetection ()
uint8_t tps_RestartPortDetection ( uint8_t  systemPortNum)

Forces a restart of the detection process on the indicated device ports for a given TPS23861.

This function will restart the detection process on the indicated device ports on the given TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_RestartDeviceDetection ()
tps_RestartPortClassification ()
tps_RestartDetectClass ()
uint8_t tps_SetDeviceDetectClassEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t  detectPorts,
TPS238x_Ports_t  classPorts 
)

Configures the device ports that are enabled for detection and classification operation for a specified TPS23861.

This function will set the detection and classification operations for all of the ports on a specific TPS23861.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]detectPortsA TPS238x_Ports_t variable that identifies the ports that will be enabled for detection with one bit for each port in detection enabled state.
[in]classPortsA TPS238x_Ports_t variable that identifies the ports that will be enabled for classification with one bit for each port in classification enabled state.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetPortDetectClassEnable ()
tps_GetDeviceClassificationEnable ()
tps_GetDeviceDetectionEnable ()
tps_GetDeviceDetectClassEnable ()
uint8_t tps_SetDeviceDisconnectEnable ( uint8_t  device_i2c_address,
TPS238x_Ports_t  disconnectPorts 
)

Configures the ports to configure those that are enabled for 2 pair disconnection operation.

This function will configure all four ports to identify which ones support disconnection operations. If the user wishes to configure a single port, the tps_SetPortDisconnectEnable() is used.

Disconnect operation consists of measuring the port current at the SENn pin, starting the TDIS timer when the current drops below the threshold, and turning the port off if the timer times out.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]disconnectPortsA TPS238x_Ports_t variable that contains the ports that will be enabled for 2 pair disconnection with one bit for each port.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetPortDisconnectEnable ()
tps_GetDeviceDisconnectEnable ()
uint8_t tps_SetDeviceInterruptMask ( uint8_t  device_i2c_address,
TPS238X_Interrupt_Mask_Register_t  intMask,
uint8_t  intDelayTime 
)

Set the interrupt mask register.

The function sets which TPS23861 events/faults are allowed to generate interrupts (unmasked).

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]intMaskTPS238X_Interrupt_Mask_Register_t variable that contains the conditions that are allowed to generate interrupts PEMSK_Power_Enable_Unmask PGMSK_Power_Good_Unmask DIMSK_Disconnect_Unmask DEMSK_Detection_Cycle_Unmask CLMSK_Classificiation_Cycle_Unmask IFMSK_IFAULT_Unmask INMSK_Inrush_Fault_Unmask SUMSK_Supply_Event_Fault_Unmask
[in]intDelayTimeAmount of time, with a 10ms lsb, to defer non-critical interrupts. Allows for "grouping" of events
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_GetInterruptMask ()
tps_GetInterruptEvents ()
tps_GetAllInterruptStatus ()
uint8_t tps_SetDevicePowerOff ( uint8_t  device_i2c_address,
TPS238x_Ports_t  portsPoweredOff 
)

Configures the power down (off) state for each of the device ports on a specific TPS23861.

This function will power down (off) multiple ports at the same time. Each of the ports indicated in the TPS23861 will be powered off.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]portsPoweredOffA TPS238x_Ports_t variable that identifies the ports that will be powered off.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetPowerOn ()
tps_SetPortPower ()
tps_GetSystemPortNumber ()
uint8_t tps_SetDevicePowerOn ( uint8_t  device_i2c_address,
TPS238x_Ports_t  portsPoweredOn 
)

Configures the power on state for each of the device ports on a specific TPS23861.

This function will power on multiple ports at the same time. Each of the ports indicated in the TPS23861 will be powered on.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]portsPoweredOnA TPS238x_Ports_t variable that identifies the ports that will be powered on.
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetPowerOff ()
tps_SetPortPower ()
tps_GetSystemPortNumber ()
uint8_t tps_SetDeviceTiming ( uint8_t  device_i2c_address,
TPS238x_ILIM_Timing_t  ilimTiming,
TPS238x_TStart_Timing_t  startTiming,
TPS238x_TICUT_Timing_t  icutTiming,
TPS238x_TDIS_Timing_t  disconnectTiming,
TPS238x_Cool_Down_Timing_t  coolDownFaultTiming 
)

Configures the timing of the various current limits and disconnection determinations for a given device in the system.

The TPS23861 has three levels of overcurrent protections, disconnection detection, and time out after fault conditions. In order to prevent glitches or transients from causing unnecessary shutdowns or faults, the system uses various timers to define the amount of time required over the threshold level before a fault or shutdown is declared.

This function sets up the various timing parameters used in the system. These timings are applicable on all active ports.

Parameters
[in]device_i2c_address7 bit I2C address of the TPS238x part being controlled (do not included R/W bit)
[in]ilimTimingThe ILIM Fault Timing which is the foldback current time limit before port turn off [TLIM_60_MS, TLIM_30_MS, TLIM_15_MS, or TLIM_10_MS]
[in]startTimingThe length of the TSTART period, which is the maximum amount of allowed overcurrent time during inrush [TSTART_30_MS, TSTART_60_MS, or TSTART_120_MS]
[in]icutTimingICUT Fault timing, which is the overcurrent time duration before port turn off [TICUT_30_MS, TICUT_60_MS, TICUT_120_MS, or TICUT_240_MS]
[in]disconnectTimingDisconnect delay, which is the time to turn off a port once there is a disconnect condition [TDIS_90_MS, TDIS_180_MS, TDIS_360_MS, or TDIS_720_MS]
[in]coolDownFaultTimingAmount of time before a port can turn back on after fault [COOL_DOWN_1_SEC, COOL_DOWN_2_SEC, or COOL_DOWN_4_SEC]
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_ConfigPort ()
tps_Config4Pair ()
uint8_t tps_SetI2CAddresses ( uint8_t  temp_i2cAddress,
uint8_t  numDevices,
uint8_t *  list_ofAddresses,
TPS238x_On_Off_t list_ofAutoMode 
)

Allows a set of TPS23861 to be configured with unique I2C addresses.

The system is designed so a number of TPS23861 can be placed on the same I2C bus. For this to work, each device must have a unique I2C address to allow them to be individually commanded. This function will program a set of TPS23861 devices on the same I2C bus with different addresses. The new I2C address will be stored in non-volatile memory and become the new I2C address for the specific part, even after power off.

Parameters
[in]temp_i2cAddressA temporary 7 bit I2C address that will be used during the address programming of the TPS238x parts (do not included R/W bit)
[in]numDevicesNumber of TPS23861 devices on the I2C bus
[in]list_ofAddressesA pointer to a list of uint8_t 7 bit I2C addresses for each of the TPS23861 parts on the I2C bus (do not included R/W bit)
[in]list_ofAutoModeA pointer to a list of TPS_On_Off_t values that contain TPS_ON for the devices that operate in AUTO mode and TPS_OFF for those that do not operate in AUTO mode
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
uint8_t tps_SetPortDetectClassEnable ( uint8_t  systemPortNum,
TPS238x_On_Off_t  on_off_detect,
TPS238x_On_Off_t  on_off_class 
)

Configures a single port to enable or disable the detection and classification operation.

This function will set the detection and classification operations for the selected port of the TPS23861.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[in]on_off_detectTPS_ON to enable detection operations for the indicated port, TPS_OFF otherwise
[in]on_off_classTPS_ON to enable classification operations for the indicated port, TPS_OFF otherwise
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetDeviceDetectClassEnable ()
tps_SetPortDetectClassEnable ()
tps_GetPortClassificationEnable ()
tps_GetPortDetectionEnable ()
uint8_t tps_SetPortDisconnectEnable ( uint8_t  systemPortNum,
TPS238x_On_Off_t  on_off 
)

Configures a single port to enable or disable the 2 pair disconnection operation.

This function will configure one of the four ports to enable or disable disconnection operations. If the user wishes to configure a all ports at once, the tps_SetDisconnectEnable() is used.

Disconnect operation consists of measuring the port current at the SENn pin, starting the TDIS timer when the current drops below the threshold, and turning the port off if the timer times out.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[in]on_offTPS_ON to enable disconnection operations for the indicated port, TPS_OFF otherwise
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetDeviceDisconnectEnable ()
tps_GetPortDisconnectEnable ()
uint8_t tps_SetPortPower ( uint8_t  systemPortNum,
TPS238x_On_Off_t  on_off 
)

Power on or off a single specified system port.

This function will either power on or power down (off) a single port on one of the registered TPS23861 ports in the system.

Parameters
[in]systemPortNumPort Number Value returned from the port registration function, tps_RegisterPort()
[in]on_offIndicates whether to power on (TPS_ON) or power off (TPS_OFF) the specified port
Returns
uint8_t (I2C_SUCCESSFUL or I2C error status)
See Also
tps_SetPowerOn ()
tps_SetPowerOff ()