SLVUCR9B August   2023  – January 2024 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.

/* --------- TPS2HC10S_SW_STATE (0x07) ----------*/
/* DESCRIPTION:  */

#define TPS2HC10S_SW_STATE_REG 0x07

typedef union 
{
    uint16_t bytes;
    struct
    {
        /* Set this bit to 1 to turn on the FET and CH1 output ON */
        unsigned CH1_ON : 1;
        /* Set this bit to 1 to turn on the FET and CH2 output ON */
        unsigned CH2_ON : 1;
        /* Reserved */
        unsigned RESERVED_14 : 14;
    } bits;
} TPS2HC10S_SW_STATE;

#define TPS2HC10S_SW_STATE_CH1_ON_MASK 0x01
#define TPS2HC10S_SW_STATE_CH1_ON_OFS 0

typedef enum {
    ch1_on_en_1_0x1 = 0x1,
    ch1_on_en_2_0x3 = 0x3,
} ch1_on_t;

#define TPS2HC10S_SW_STATE_CH2_ON_MASK 0x02
#define TPS2HC10S_SW_STATE_CH2_ON_OFS 1

typedef enum {
    ch2_on_en_1_0x1 = 0x2,
    ch2_on_en_2_0x2 = 0x4,
} ch2_on_t;

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

int main()
{
    TPS2HC10S_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;
}