SLVUCR9C August   2023  – April 2025 TPS2HCS10-Q1

 

  1.   1
  2.   Description
  3.   Get Started
  4.   Features
  5.   Applications
  6.   6
  7. 1Evaluation Module Overview
    1. 1.1 Introduction
    2. 1.2 Kit Contents
    3. 1.3 Specification
    4. 1.4 Device Information
  8. 2Hardware
    1. 2.1 Assembly Instructions
    2. 2.2 Revision Differences
    3. 2.3 Jumper Information
    4. 2.4 Interfaces
    5. 2.5 Test Points
    6. 2.6 Transient Testing
  9. 3Software
    1. 3.1 Software Usage
      1. 3.1.1  Command Center View
      2. 3.1.2  I2T Tuner
      3. 3.1.3  Device Settings
      4. 3.1.4  Channel Settings
      5. 3.1.5  Console View
      6. 3.1.6  Log View
      7. 3.1.7  Importing/Exporting
      8. 3.1.8  Firmware Updates
      9. 3.1.9  Persist Settings
      10. 3.1.10 Language Settings
    2. 3.2 Software Development
  10. 4Hardware Design Files
    1. 4.1 Schematics
    2. 4.2 PCB Layouts
    3. 4.3 Bill of Materials (BOM)
  11. 5Additional Information
    1. 5.1 Trademarks
  12. 6Revision History

Software Development

The Smart Fuse Configurator comes with a C header file that was generated from the register map of each supported high-side switch. Initially, this includes the TPS2HCS10-Q1 device. The header files are available on the product page and includes functionality such as:

  • C structure for each bitfield/enumeration of each register
  • Mask definitions of each bitfield
  • Offset definitions of each bitfield
  • Enumerations of each bitfield

This header file is meant to be used to enable software development on an embedded C platform. An excerpt of the SW_STATE register can be seen below.

/* --------- TPS2HCSXX_SW_STATE (0x07) ----------*/

#define TPS2HCSXX_SW_STATE_REG 0x07

typedef union 
{
uint16_t word;
struct
{
/* This bit determines the output state of channel 1 for TPS2HCS08A/N-Q1 
* versions.  */
uint16_t CH1_ON : 1;
/* This bit determines the output state of channel 2 for TPS2HCS08A/N-Q1 
* versions.  */
uint16_t CH2_ON : 1;
/* Reserved */
uint16_t RESERVED_23 : 14;
} bits;
} TPS2HCSXX_SW_STATE;

typedef struct TPS2HCSXX_SW_STATE_OBJ 
{
uint8_t reg;
TPS2HCSXX_SW_STATE value;
} TPS2HCSXX_SW_STATE_OBJ;

#define TPS2HCSXX_SW_STATE_CH1_ON_MASK 0x01
#define TPS2HCSXX_SW_STATE_CH1_ON_OFS 0

typedef enum {
ch1_on_en_0x0_field = 0x0,
ch1_on_en_0x1_field = 0x1,
} tps2hcsxx_ch1_on_field_t;

typedef enum {
ch1_on_en_0x0_mask = 0x0,
ch1_on_en_0x1_mask = 0x1,
} tps2hcsxx_ch1_on_mask_t;

An example of using the bit-wise operation to set CH1 to enabled can be seen below.

int main()
{
    TPS2HCSXX_SW_STATE enableReg;
    
    enableReg.bits.CH1_ON = 1;

    printf("\nChannel Enable: 0x%x\n", enableReg.byte);

    return 0;
}

A byte-wise example can be seen below.

#include "tps2hcs10.h"
#include <stdio.h>

int main()
{
    TPS2HC10S_SW_STATE enableReg;
    
    enableReg.byte = 0x01;

    printf("\nChannel Enable: 0x%x\n", enableReg.byte);

    return 0;
}