Multi Half-Bridge 4.0.0
Library of Infineon's Multi Half-Bridge IC controllers family
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
Collaboration diagram for PAL <br>:

Data Structures

class  GPIOMtb
 ModusToolbox GPIO wrapper class. More...
 
class  SPICMtb
 
class  TimerMtb
 MoudusToolbox timer wrapper. More...
 

Macros

#define SPI_FREQ_HZ   (1000000UL)
 ModusToolbox SPIC class.
 

Detailed Description


Data Structure Documentation

◆ GPIOMtb

class GPIOMtb

ModusToolbox GPIO wrapper class.

Inheritance diagram for GPIOMtb:
Collaboration diagram for GPIOMtb:

Public Types

Interrupt event
enum  IntEvent_t { INT_FALLING_EDGE = 0 , INT_RISING_EDGE = 1 }
 
Voltage level
enum  VLevel_t { GPIO_LOW = 0 , GPIO_HIGH = 1 }
 
Voltage logic
enum  VLogic_t { NEGATIVE = 1 , POSITIVE = 2 }
 

Public Member Functions

 GPIOMtb (cyhal_gpio_t pin, cyhal_gpio_direction_t dir, cyhal_gpio_drive_mode_t driveMode, VLogic_t logic)
 GPIO ModusToolbox HAL constructor.
 
 ~GPIOMtb ()
 GPIO ModusToolbox destructor.
 
Error_t init ()
 Initializes the ModusToolbox GPIO.
 
Error_t deinit ()
 Initializes the ModusToolbox GPIO.
 
VLevel_t read ()
 Reads the ModusToolbox GPIO voltage level.
 
Error_t write (VLevel_t level)
 Writes the ModusToolbox GPIO output voltage level.
 
Error_t enable ()
 Enables the ModusToolbox output according to the GPIO logic.
 
Error_t disable ()
 Disables the ModusToolbox output according to the GPIO logic.
 
Error_t checkErrorStatus ()
 

Static Public Attributes

static const cyhal_gpio_t unusedPin = CYHAL_NC_PIN_VALUE
 

Member Enumeration Documentation

◆ IntEvent_t

Enumerator
INT_FALLING_EDGE 

Interrupt on falling edge

INT_RISING_EDGE 

Interrupt on rising edge

◆ VLevel_t

Enumerator
GPIO_LOW 

Level low

GPIO_HIGH 

Level high

◆ VLogic_t

Enumerator
NEGATIVE 

Negative logic. 0 on voltage level high, 1 on voltage low

POSITIVE 

Positive logic. 1 on voltage level high, 0 on voltage low

Constructor & Destructor Documentation

◆ GPIOMtb()

GPIOMtb::GPIOMtb ( cyhal_gpio_t  pin,
cyhal_gpio_direction_t  dir,
cyhal_gpio_drive_mode_t  driveMode,
VLogic_t  logic 
)

GPIO ModusToolbox HAL constructor.

Parameters
[in]pinGPIO pin number
[in]dirGPIO direction
[in]driveModeGPIO driver mode
[in]logicVoltage logic

◆ ~GPIOMtb()

GPIOMtb::~GPIOMtb ( )

GPIO ModusToolbox destructor.

Here is the call graph for this function:

Member Function Documentation

◆ init()

Error_t GPIOMtb::init ( )
inlinevirtual

Initializes the ModusToolbox GPIO.

Returns
GPIO error code
Return values
OKif success
ERRORif initialization error

Implements tle94112::GPIOC.

◆ deinit()

Error_t GPIOMtb::deinit ( )
inlinevirtual

Initializes the ModusToolbox GPIO.

Returns
GPIO error code
Return values
OKif success
ERRORif deinitialization error

Implements tle94112::GPIOC.

◆ read()

GPIOMtb::VLevel_t GPIOMtb::read ( )
inlinevirtual

Reads the ModusToolbox GPIO voltage level.

Returns
GPIO voltage level
Return values
GPIO_LOWif voltage low
GPIO_HIGHif voltage high

Implements tle94112::GPIOC.

◆ write()

Error_t GPIOMtb::write ( VLevel_t  level)
inlinevirtual

Writes the ModusToolbox GPIO output voltage level.

Parameters
[in]levelVoltage level
Returns
GPIO error code
Return values
OKif success
ERRORif error

Implements tle94112::GPIOC.

◆ enable()

Error_t GPIOMtb::enable ( )
inlinevirtual

Enables the ModusToolbox output according to the GPIO logic.

  • Low if negative
  • High if positive
    Returns
    GPIO interrupt event
    Return values
    OKif success
    ERRORif error

Implements tle94112::GPIOC.

◆ disable()

Error_t GPIOMtb::disable ( )
inlinevirtual

Disables the ModusToolbox output according to the GPIO logic.

  • Low if positive
  • High if negative
    Returns
    GPIO error code
    Return values
    OKif success
    ERRORif error

Implements tle94112::GPIOC.

◆ checkErrorStatus()

Error_t GPIOC::checkErrorStatus ( )
inherited

Field Documentation

◆ unusedPin

const cyhal_gpio_t GPIOMtb::unusedPin = CYHAL_NC_PIN_VALUE
static

Unused pin

◆ SPICMtb

class SPICMtb
Inheritance diagram for SPICMtb:
Collaboration diagram for SPICMtb:

Public Member Functions

 SPICMtb (cyhal_gpio_t csPin, cyhal_gpio_t misoPin, cyhal_gpio_t mosiPin, cyhal_gpio_t sckPin)
 Construct a new SPICMtb object.
 
 ~SPICMtb ()
 Destructor of the SPICMtb class.
 
Error_t init ()
 Initialize the SPIC.
 
Error_t deinit ()
 Deinitialize the SPIC.
 
Error_t transfer (uint8_t send, uint8_t &received)
 Transfers a data package via the spi bus.
 
Error_t transfer16 (uint16_t send, uint16_t &received)
 Transfers a data package via the spi bus.
 
Error_t checkErrorStatus ()
 

Static Public Attributes

static const cyhal_gpio_t unusedPin = CYHAL_NC_PIN_VALUE
 

Constructor & Destructor Documentation

◆ SPICMtb()

SPICMtb::SPICMtb ( cyhal_gpio_t  csPin,
cyhal_gpio_t  misoPin,
cyhal_gpio_t  mosiPin,
cyhal_gpio_t  sckPin 
)

Construct a new SPICMtb object.

This function allows to set all parameters of the SPI master.

Parameters
[in]csPinNumber of the desired ChipSelect pin
[in]misoPinNumber of the desired MISO pin
[in]mosiPinNumber of the desired MOSI pin
[in]sckPinNumber of the desired SystemClock pin
Attention
This does not set the platform_spi_peripherals structure yet

◆ ~SPICMtb()

SPICMtb::~SPICMtb ( )

Destructor of the SPICMtb class.

Here is the call graph for this function:

Member Function Documentation

◆ init()

Error_t SPICMtb::init ( )
virtual

Initialize the SPIC.

This function is initializing the chosen spi channel with the given values for lsb,clock and mode

Returns
Error_t

Implements tle94112::SPIC.

◆ deinit()

Error_t SPICMtb::deinit ( )
virtual

Deinitialize the SPIC.

This function is deinitializing the chosen spi channel.

Returns
Error_t

Implements tle94112::SPIC.

◆ transfer()

Error_t SPICMtb::transfer ( uint8_t  send,
uint8_t received 
)
virtual

Transfers a data package via the spi bus.

Attention
__enable_irq() must be used in the main.c file otherwise the transfer function will be pending for ever, as the SPI subsystem is not started
Parameters
[in]sendaddress and/or command to send
[out]receivedreceived data from spi bus
Returns
Error_t

Implements tle94112::SPIC.

◆ transfer16()

Error_t SPICMtb::transfer16 ( uint16_t  send,
uint16_t received 
)
virtual

Transfers a data package via the spi bus.

Attention
__enable_irq() must be used in the main.c file otherwise the transfer function will be pending for ever, as the SPI subsystem is not started
Parameters
[in]sendaddress and/or command to send as 16bit
[out]receivedreceived data from spi bus as 16bit
Returns
Error_t

Implements tle94112::SPIC.

◆ checkErrorStatus()

Error_t SPIC::checkErrorStatus ( )
inherited

Field Documentation

◆ unusedPin

const cyhal_gpio_t SPICMtb::unusedPin = CYHAL_NC_PIN_VALUE
static

Unused pin

◆ TimerMtb

class TimerMtb

MoudusToolbox timer wrapper.

Inheritance diagram for TimerMtb:
Collaboration diagram for TimerMtb:

Public Member Functions

 TimerMtb ()
 ModusToolbox Timer configuration.
 
 ~TimerMtb ()
 Destructor of the ModusToolbox Timer class.
 
Error_t init ()
 Initialization of the Timer.
 
Error_t deinit ()
 Deinitialize the Timer.
 
Error_t start ()
 Start the timer.
 
Error_t elapsed (uint32_t &elapsed)
 Calculate the elapsed time.
 
Error_t stop ()
 Stop the timer.
 
Error_t delayMilli (uint32_t timeout)
 Time delay.
 
Error_t delayMicro (uint32_t timeout)
 Time delay.
 

Constructor & Destructor Documentation

◆ TimerMtb()

TimerMtb::TimerMtb ( )

ModusToolbox Timer configuration.

Constructor of the ModusToolbox Timer class

◆ ~TimerMtb()

TimerMtb::~TimerMtb ( )

Destructor of the ModusToolbox Timer class.

Member Function Documentation

◆ init()

Error_t TimerMtb::init ( )
virtual

Initialization of the Timer.

This function is initializing the Timer and sets the elapsed time to zero.

Returns
Error_t

Implements tle94112::Timer.

◆ deinit()

Error_t TimerMtb::deinit ( )
virtual

Deinitialize the Timer.

This function deinitialize the Timer and also resets the elapsed time variable.

Returns
Error_t

Implements tle94112::Timer.

◆ start()

Error_t TimerMtb::start ( )
virtual

Start the timer.

This function is starting the timer.

Returns
Error_t

Implements tle94112::Timer.

◆ elapsed()

Error_t TimerMtb::elapsed ( uint32_t elapsed)
virtual

Calculate the elapsed time.

This function is calculating the elapsed time since the start of the timer. The value stored in the given variable is in milliseconds.

Parameters
[in]&elapsedAddress of a value where the elapsed time should be stored
Returns
Error_t

Implements tle94112::Timer.

Here is the call graph for this function:

◆ stop()

Error_t TimerMtb::stop ( )
virtual

Stop the timer.

This function stops the timer and resets the start time variable.

Returns
Error_t

Implements tle94112::Timer.

◆ delayMilli()

Error_t TimerMtb::delayMilli ( uint32_t  timeout)
virtual

Time delay.

This function is causing a desired delay of the application. The input value is given in milliseconds.

Parameters
[in]timeoutDesired timeout in ms
Returns
Error_t

Implements tle94112::Timer.

◆ delayMicro()

Error_t TimerMtb::delayMicro ( uint32_t  timeout)
virtual

Time delay.

This function is causing a desired delay of the application. The input value is given in microseconds.

Parameters
[in]timeoutDesired timeout in us
Returns
Error_t

Implements tle94112::Timer.

Macro Definition Documentation

◆ SPI_FREQ_HZ

#define SPI_FREQ_HZ   (1000000UL)

ModusToolbox SPIC class.