SLVAFT2 May 2024 TPS2HCS10-Q1
The suite of drivers that Texas Instruments provides for the HCS family of smart fuse high-side switches were designed to be generic and allow for complete configuration and utilization of the underlying device. Features of these drivers include:
The drivers and relation to the provided code examples are shown in Figure 2-1:
The top level driver APIs have the HCS_ prefix to signify the HCS family of smart fuse devices and are provided in hcs_control_driver.h and hcs_control_driver.c from the software package. The top level code examples use these APIs to provide a generic set of functionality to control and configure the high-side switch. For the physical SPI communication, a set of external functions are declared in hcs_control_driver.h :
/* --------------------------- Porting Functions ---------------------------- */
/*
* These functions need to be implemented by each individual device port. The functions
* handle the low-level hardware specific implementation with the respective
* architecture's specific hardware peripherals (SPI and GPIO)
*/
bool HCS_port_spiSendData(uint8_t *data, uint8_t len, uint8_t* respData);
void HCS_port_assertSPI(void);
void HCS_port_deassertSPI(void);
These functions are defined in each individual architecture implementation and handle the hardware SPI interaction of each platform. More details of porting these functions to additional architectures can be found in the Section 2.3. A full list of APIs including functionality, parameters, and return values can be found in Section 2.4.