TPS23861 Power over Ethernet
0.0.2
Software Application Programming Interface for Command and Control of the TI TPS23861 PSE Controller
|
Go to the source code of this file.
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 |
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... | |
#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 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 |
Used in tps_SetTiming() to set the time between a port shut down due to a fault and a subsequent power up.
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()
Detection status.
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 |
enum TPS238x_Four_Pair_t |
Define Four Pair Disconnect modes in tps_Config4Pair()
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 |
Define the legacy-detect mode for each port . Used in tps_ConfigPort()
enum TPS238x_On_Off_t |
Operating mode for each of the ports (off, manual, semi-auto, auto)
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 |
enum TPS238x_PortNum_t |
enum TPS238x_Two_Event_t |
Set the conditions for PSE-initiated two-event physical classifications. Used in tps_ConfigPort()
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | on_off_Port12 | Enables ports 1 & 2 to operate in 4-pair mode (TPS_ON) |
[in] | disconnectModePort12 | Disconnection 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_Port34 | Enables ports 3 & 4 to operate in 4-pair mode (TPS_ON) |
[in] | disconnectModePort34 | Disconnection 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] |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[in] | operatingMode | Define the operating mode for the port [OPERATING_MODE_OFF, OPERATING_MODE_MANUAL, OPERATING_MODE_SEMI_AUTO, or OPERATING_MODE_AUTO] |
[in] | legacyDetect | The system can perform combinations of standard and legacy detections [LEGACY_DETECT_DISABLED, LEGACY_DETECT_ONLY, or LEGACY_DETECT_STANDARD_THEN_LEGACY] |
[in] | twoEvent | The 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] | class5Enable | Allows the system to attempt Class 5 current levels [TPS_ON or TPS_OFF] |
[in] | disconnectThreshold | Current threshold for disconnection [DCTH_7_5_MILLIAMP, DCTH_15_MILLIAMP, DCTH_30_MILLIAMP, or DCTH_50_MILLIAMP] |
[in] | icutCurrentThreshold | ICUT 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] | poepFoldbackCurve | Defines the foldback curve applied to a port when it is turned on [_1X_ILIM_FOLDBACK_CURVE or _2X_ILIM_FOLDBACK_CURVE] |
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
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | ports | A TPS238x_Ports_t variable that identifies the ports that will be enabled for fast shutdown |
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
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[in] | on_off | Enable (TPS_ON) or disable (TPS_OFF) the fast shutdown for the indicated port |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *powerEnablePortEvents | Address of a TPS238x_Ports_t variable that will receive the ports containing a power enable status change |
[out] | *powerGoodPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports containing a power good status change |
[out] | *detectionPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a detection cycle |
[out] | *classificationPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a classification cycle |
[out] | *icutPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a ICUT fault |
[out] | *disconnectPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a disconnect event |
[out] | *inrushPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a inrush fault at port turn on |
[out] | *ilimPortEvents | Address of a TPS238x_Ports_t variable that will receive the ports that had a ILIM fault occurred |
[out] | *supplyEvents | Address 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 |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *classPorts | Address 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. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *detectPorts | Address 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] | *classPorts | Address 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. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *detectPorts | Address 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. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *disconnectPorts | Address 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. |
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
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *voltage | The 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 |
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).
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *intMask | Address 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] | *intDelayTime | Address of a uint8_t variable that will indicat the amount of defer time, with a 10ms lsb, of non-critical interrupts. |
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)
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *status | Address 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 |
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
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *powerEnablePorts | Address of a TPS238x_Ports_t variable that will receive the power enable status with one bit for each port in power enabled state. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *powerGoodPorts | Address of a TPS238x_Ports_t variable that will receive the power good status with one bit for each port in power good state. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *powerEnablePorts | Address of a TPS238x_Ports_t variable that will receive the power enable status with one bit for each port in power enabled state. |
[out] | *powerGoodPorts | Address of a TPS238x_Ports_t variable that will receive the power good status with one bit for each port in power good state. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[out] | *temperature | The 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 |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *classificationStatus | Address 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) |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *detectionStatus | Address 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] | *classificationStatus | Address 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) |
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
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *detectionStatus | Address 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) |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *detectResistance | The 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] | *detectResistanceStatus | The 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] |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *detectVoltageDiff | The 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] | *detectVoltageDiffStatus | The 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] |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[out] | *voltage | The 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] | *current | The 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. |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | devicePortNum | TPS238X_PORT_1 - TPS238X_PORT_4, The port number ON THE SPECIFIC TPS23861 device |
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).
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | devicePortNum | TPS238X_PORT_1 - TPS238X_PORT_4, The port number ON THE SPECIFIC TPS23861 device |
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().
[in] | systemPortNum | Port Number Value returned from the port registration function, 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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | classPorts | A TPS238x_Ports_t variable that identifies the ports that will be restarted for classification with one bit for each port restarted. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | detectPorts | A TPS238x_Ports_t variable that identifies the ports that will be restarted for detection with one bit for each port restarted. |
[in] | classPorts | A TPS238x_Ports_t variable that identifies the ports that will be restarted for classification with one bit for each port restarted. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | detectPorts | A TPS238x_Ports_t variable that identifies the ports that will be restarted for detection with one bit for each port restarted. |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | detectPorts | A 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] | classPorts | A TPS238x_Ports_t variable that identifies the ports that will be enabled for classification with one bit for each port in classification enabled state. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | disconnectPorts | A TPS238x_Ports_t variable that contains the ports that will be enabled for 2 pair disconnection with one bit for each port. |
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).
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | intMask | TPS238X_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] | intDelayTime | Amount of time, with a 10ms lsb, to defer non-critical interrupts. Allows for "grouping" of events |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | portsPoweredOff | A TPS238x_Ports_t variable that identifies the ports that will be powered off. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | portsPoweredOn | A TPS238x_Ports_t variable that identifies the ports that will be powered on. |
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.
[in] | device_i2c_address | 7 bit I2C address of the TPS238x part being controlled (do not included R/W bit) |
[in] | ilimTiming | The 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] | startTiming | The 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] | icutTiming | ICUT 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] | disconnectTiming | Disconnect 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] | coolDownFaultTiming | Amount of time before a port can turn back on after fault [COOL_DOWN_1_SEC, COOL_DOWN_2_SEC, or COOL_DOWN_4_SEC] |
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.
[in] | temp_i2cAddress | A temporary 7 bit I2C address that will be used during the address programming of the TPS238x parts (do not included R/W bit) |
[in] | numDevices | Number of TPS23861 devices on the I2C bus |
[in] | list_ofAddresses | A 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_ofAutoMode | A 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 |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[in] | on_off_detect | TPS_ON to enable detection operations for the indicated port, TPS_OFF otherwise |
[in] | on_off_class | TPS_ON to enable classification operations for the indicated port, TPS_OFF otherwise |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[in] | on_off | TPS_ON to enable disconnection operations for the indicated port, TPS_OFF otherwise |
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.
[in] | systemPortNum | Port Number Value returned from the port registration function, tps_RegisterPort() |
[in] | on_off | Indicates whether to power on (TPS_ON) or power off (TPS_OFF) the specified port |