Infineon MOTIX™ MCU TLE985x Device Family SDK
Macros | Enumerations | Functions
hs.h File Reference

Go to the source code of this file.

Detailed Description

High-Side Switch low level access library.

Version
V0.2.5
Date
28. Aug 2023
Note
This file violates [MISRA 2012 Rule 11.1, required], [MISRA 2012 Rule 11.4, advisory], [MISRA 2012 Rule 11.6, required]

Include Graph

Include dependency graph for hs.h:

Macros

#define HS_IRQ_BITS   0x000000E0
 HS Interrupt Mask. More...
 
#define HS_CONF_MASK   0x0000000F
 HS Interrupt Mask. More...
 

Enumerations

enum  THs_HS1_Cfg {
  Ch_HS_Off = 0u , Ch_HS_En = 1u , Ch_HS_PWM = 3u , Ch_HS_On = 5u ,
  Ch_HS_Ol = 9u
}
 This enum lists the High Side channel configuration. More...
 
enum  THs_Sts {
  HS_OT_ISC = 0x00000020u , HS_OL_ISC = 0x00000040u , HS_OC_ISC = 0x00000080u , HS_OT_SC = 0x00002000u ,
  HS_OL_SC = 0x00004000u
}
 This enum lists the High Side channel configuration Mask Status. More...
 
enum  THs_Int { HS_Int_Off = 0U , HS_Int_OT = 1U , HS_Int_OL = 2U , HS_Int_OC = 4U }
 This enum lists the High Side channel Interrupt configuration. More...
 

Functions

void HS_Init (void)
 Initializes the HS module. More...
 
INLINE void HS_Clr_Sts (THs_Sts Sts_Bit)
 Clears High-Side Switch individual status flags. More...
 
INLINE void HS_Set_Int_Channel (THs_Int HS1_Int)
 Sets High-Side Switch Interrupt Enable. More...
 
INLINE void HS_Set_Conf (THs_HS1_Cfg HS1_Cfg)
 Sets the High-Side Switch in the desired state. More...
 
INLINE void HS_HS1_OT_Int_Clr (void)
 Clears HS1 Overtemperature interrupt flag. More...
 
INLINE void HS_HS1_OL_Int_Clr (void)
 Clears HS1 Open Load interrupt flag. More...
 
INLINE void HS_HS1_OC_Int_Clr (void)
 Clears HS1 Overcurrent interrupt flag. More...
 
INLINE void HS_HS1_OT_SC_Clr (void)
 Clears HS1 Overtemperature Status. More...
 
INLINE void HS_HS1_OL_SC_Clr (void)
 Clears HS1 Open Load Status. More...
 
INLINE void HS_HS1_OT_Int_En (void)
 Enables HS1 Overtemperature interrupt. More...
 
INLINE void HS_HS1_OT_Int_Dis (void)
 Disables HS1 Overtemperature interrupt. More...
 
INLINE void HS_HS1_OL_Int_En (void)
 Enables HS1 Open Load interrupt. More...
 
INLINE void HS_HS1_OL_Int_Dis (void)
 Disables HS1 Open Load interrupt. More...
 
INLINE void HS_HS1_OC_Int_En (void)
 Enables HS1 Overcurrent interrupt. More...
 
INLINE void HS_HS1_OC_Int_Dis (void)
 Disables HS1 Overcurrent interrupt. More...
 

Macro Definition Documentation

◆ HS_CONF_MASK

#define HS_CONF_MASK   0x0000000F

HS Interrupt Mask.

◆ HS_IRQ_BITS

#define HS_IRQ_BITS   0x000000E0

HS Interrupt Mask.

Enumeration Type Documentation

◆ THs_HS1_Cfg

This enum lists the High Side channel configuration.

Enumerator
Ch_HS_Off 

channel disabled

Ch_HS_En 

channel enabled

Ch_HS_PWM 

channel enabled with PWM (CCU6 connection)

Ch_HS_On 

channel enabled and static on

Ch_HS_Ol 

channel enabled and Open Load on

◆ THs_Int

enum THs_Int

This enum lists the High Side channel Interrupt configuration.

Enumerator
HS_Int_Off 

all interrupts disable

HS_Int_OT 

Over-Temperature interrupt enable

HS_Int_OL 

Over-Load interrupt enable

HS_Int_OC 

Over-Current interrupt enable

◆ THs_Sts

enum THs_Sts

This enum lists the High Side channel configuration Mask Status.

Enumerator
HS_OT_ISC 

Over-Temperature interrupt Mask

HS_OL_ISC 

Over-Load interrupt Mask

HS_OC_ISC 

Over-Current interrupt Mask

HS_OT_SC 

Over-Temperature Mask

HS_OL_SC 

Over-Load Mask

Function Documentation

◆ HS_Clr_Sts()

INLINE void HS_Clr_Sts ( THs_Sts  Sts_Bit)

Clears High-Side Switch individual status flags.

Parameters
Sts_Bitstatus bit to be cleared, see THs_Sts

Example

This example treats the HS1 Open Load Status.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OL_IS == 1u)
{
HS_HS1_OL_CALLBACK();
}
}
#define HS
Definition: tle985x.h:6271
INLINE void HS_HS1_OL_Int_En(void)
Enables HS1 Open Load interrupt.
Definition: hs.h:460
@ HS_OL_ISC
Over-Load interrupt Mask
Definition: hs.h:102
INLINE void HS_Clr_Sts(THs_Sts Sts_Bit)
Clears High-Side Switch individual status flags.
Definition: hs.h:412

◆ HS_HS1_OC_Int_Clr()

INLINE void HS_HS1_OC_Int_Clr ( void  )

Clears HS1 Overcurrent interrupt flag.

Example

This example treats the HS1 Overcurrent interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OC_IS == 1u)
{
HS_HS1_OC_CALLBACK();
}
}
INLINE void HS_HS1_OC_Int_Clr(void)
Clears HS1 Overcurrent interrupt flag.
Definition: hs.h:435
INLINE void HS_HS1_OC_Int_En(void)
Enables HS1 Overcurrent interrupt.
Definition: hs.h:470

◆ HS_HS1_OC_Int_Dis()

INLINE void HS_HS1_OC_Int_Dis ( void  )

Disables HS1 Overcurrent interrupt.

Example

This example treats the HS1 Overcurrent interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OC_IS == 1u)
{
HS_HS1_OC_CALLBACK();
}
}
INLINE void HS_HS1_OC_Int_Dis(void)
Disables HS1 Overcurrent interrupt.
Definition: hs.h:475

◆ HS_HS1_OC_Int_En()

INLINE void HS_HS1_OC_Int_En ( void  )

Enables HS1 Overcurrent interrupt.

Example

This example treats the HS1 Overcurrent interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OC_IS == 1u)
{
HS_HS1_OC_CALLBACK();
}
}

◆ HS_HS1_OL_Int_Clr()

INLINE void HS_HS1_OL_Int_Clr ( void  )

Clears HS1 Open Load interrupt flag.

Example

This example treats the HS1 Open Load interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OL_IS == 1u)
{
HS_HS1_OL_CALLBACK();
}
}
INLINE void HS_HS1_OL_Int_Clr(void)
Clears HS1 Open Load interrupt flag.
Definition: hs.h:430

◆ HS_HS1_OL_Int_Dis()

INLINE void HS_HS1_OL_Int_Dis ( void  )

Disables HS1 Open Load interrupt.

Example

This example treats the HS1 Open Load interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OL_IS == 1u)
{
HS_HS1_OL_CALLBACK();
}
}
INLINE void HS_HS1_OL_Int_Dis(void)
Disables HS1 Open Load interrupt.
Definition: hs.h:465

◆ HS_HS1_OL_Int_En()

INLINE void HS_HS1_OL_Int_En ( void  )

Enables HS1 Open Load interrupt.

Example

This example treats the HS1 Open Load interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OL_IS == 1u)
{
HS_HS1_OL_CALLBACK();
}
}

◆ HS_HS1_OL_SC_Clr()

INLINE void HS_HS1_OL_SC_Clr ( void  )

Clears HS1 Open Load Status.

Example

This example clears HS1 Open Load Status.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OL_STS == 1u)
{
}
}
INLINE void HS_HS1_OL_SC_Clr(void)
Clears HS1 Open Load Status.
Definition: hs.h:445

◆ HS_HS1_OT_Int_Clr()

INLINE void HS_HS1_OT_Int_Clr ( void  )

Clears HS1 Overtemperature interrupt flag.

Example

This example clears HS1 Overtemperature interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OT_IS == 1u)
{
HS_HS1_OT_CALLBACK();
}
}
INLINE void HS_HS1_OT_Int_Clr(void)
Clears HS1 Overtemperature interrupt flag.
Definition: hs.h:425
INLINE void HS_HS1_OT_Int_En(void)
Enables HS1 Overtemperature interrupt.
Definition: hs.h:450

◆ HS_HS1_OT_Int_Dis()

INLINE void HS_HS1_OT_Int_Dis ( void  )

Disables HS1 Overtemperature interrupt.

Example

This example treats the HS1 Overtemperature interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OT_IS == 1u)
{
HS_HS1_OT_CALLBACK();
}
}
INLINE void HS_HS1_OT_Int_Dis(void)
Disables HS1 Overtemperature interrupt.
Definition: hs.h:455

◆ HS_HS1_OT_Int_En()

INLINE void HS_HS1_OT_Int_En ( void  )

Enables HS1 Overtemperature interrupt.

Example

This example treats the HS1 Overtemperature interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OT_IS == 1u)
{
HS_HS1_OT_CALLBACK();
}
}

◆ HS_HS1_OT_SC_Clr()

INLINE void HS_HS1_OT_SC_Clr ( void  )

Clears HS1 Overtemperature Status.

Example

This example clears HS1 Overtemperature Status.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OT_STS == 1u)
{
}
}
INLINE void HS_HS1_OT_SC_Clr(void)
Clears HS1 Overtemperature Status.
Definition: hs.h:440

◆ HS_Init()

void HS_Init ( void  )

Initializes the HS module.

◆ HS_Set_Conf()

INLINE void HS_Set_Conf ( THs_HS1_Cfg  HS1_Cfg)

Sets the High-Side Switch in the desired state.

Parameters
HS1_CfgHS1 Configuration, see THs_HS1_Cfg

Example

This example enables and configures the HS1 with PWM.

void Example_Function(void)
{
}
INLINE void HS_Set_Conf(THs_HS1_Cfg HS1_Cfg)
Sets the High-Side Switch in the desired state.
Definition: hs.h:420
@ Ch_HS_PWM
channel enabled with PWM (CCU6 connection)
Definition: hs.h:91

◆ HS_Set_Int_Channel()

INLINE void HS_Set_Int_Channel ( THs_Int  HS1_Int)

Sets High-Side Switch Interrupt Enable.

Parameters
HS1_IntInterrupt selection, see THs_Int

Example

This example treats the HS1 Overcurrent interrupt.

void Example_Function(void)
{
if (HS->IRQS.bit.HS1_OC_IS == 1u)
{
HS_HS1_OC_CALLBACK();
}
}
@ Int_OC
Over-Current interrupt enable
Definition: bdrv.h:189
INLINE void HS_Set_Int_Channel(THs_Int HS1_Int)
Sets High-Side Switch Interrupt Enable.
Definition: hs.h:400