Data Structures | |
class | Tle94112Mtb |
class Tle94112Mtb |
Public Types | |
enum | HalfBridge { TLE_NOHB = 0 , TLE_HB1 , TLE_HB2 , TLE_HB3 , TLE_HB4 , TLE_HB5 , TLE_HB6 , TLE_HB7 , TLE_HB8 , TLE_HB9 , TLE_HB10 , TLE_HB11 , TLE_HB12 } |
enum for the halfbridges on a TLE94112 More... | |
enum | PWMChannel { TLE_NOPWM = 0 , TLE_PWM1 , TLE_PWM2 , TLE_PWM3 } |
enum for the PWM channels of a halfbridge on TLE94112 More... | |
enum | HBState { TLE_FLOATING = 0b00 , TLE_LOW = 0b01 , TLE_HIGH = 0b10 } |
enum for the output states of a halfbridge More... | |
enum | HBOCState { TLE_NONE = 0b00 , TLE_LOWSIDE = 0b01 , TLE_HIGHSIDE = 0b10 } |
enum for the overcurrent states of a halfbridge More... | |
enum | PWMFreq { TLE_FREQOFF = 0b00 , TLE_FREQ80HZ , TLE_FREQ100HZ , TLE_FREQ200HZ } |
enum for the frequencies of a PWM channel More... | |
enum | DiagFlag { TLE_SPI_ERROR = 0x80 , TLE_LOAD_ERROR = 0x40 , TLE_UNDER_VOLTAGE = 0x20 , TLE_OVER_VOLTAGE = 0x10 , TLE_POWER_ON_RESET = 0x08 , TLE_TEMP_SHUTDOWN = 0x04 , TLE_TEMP_WARNING = 0x02 } |
enum for the flags in the register SYS_DIAG1 More... | |
Public Member Functions | |
Tle94112Mtb (void) | |
Construct a new Tle94112Mtb object This constructor calls with default pinsetting for the MCU board. Keep in mind that we do not set the chipselect pin with the SPI class, as we need a constant signal during multiple transfers. More... | |
Tle94112Mtb (cyhal_gpio_t csPin) | |
Construct a new Tle94112Mtb object This constructor calls with default pinsetting for the SPI except for the chip select pin. Keep in mind that we do not set the chipselect pin with the SPI class, as we need a constant signal during multiple transfers. More... | |
Tle94112Mtb (cyhal_gpio_t csPin, cyhal_gpio_t misoPin, cyhal_gpio_t mosiPin, cyhal_gpio_t sckPin) | |
Construct a new Tle94112Mtb object For ModusToolbox HAL setups with different than the usual pinsettings. More... | |
void | begin (void) |
enables and initializes the TLE94112 More... | |
void | end (void) |
deactivates all outputs and disables the TLE94112 More... | |
void | configHB (HalfBridge hb, HBState state, PWMChannel pwm) |
sets the output state and the PWM channel for a halfbridge (only for passive freewheeling) More... | |
void | configHB (HalfBridge hb, HBState state, PWMChannel pwm, uint8_t activeFW) |
sets the output state and the PWM channel for a halfbridge (allows active freewheeling) More... | |
void | configPWM (PWMChannel pwm, PWMFreq freq, uint8_t dutyCycle) |
sets the frequency and duty cycle for a PWM channel More... | |
uint8_t | setLedMode (HalfBridge hb, uint8_t active) |
sets LED mode on compatible half bridges (half bridge 1 or 2 of TLE94112) More... | |
uint8_t | getSysDiagnosis () |
returns a diagnosis value for error detection More... | |
uint8_t | getSysDiagnosis (DiagFlag mask) |
shows if errors of a specific type have occurred More... | |
uint8_t | getSysDiagnosis (uint8_t mask) |
shows if errors of a specific type have occurred More... | |
uint8_t | getHBOverCurrent (HalfBridge hb) |
gets the overcurrent error flag bit for a specific halfbridge More... | |
uint8_t | getHBOpenLoad (HalfBridge hb) |
gets the openload error flag bit for a specific halfbridge More... | |
void | clearErrors () |
clears all clearable error flags More... | |
Data Fields | |
SPIC * | sBus |
GPIOC * | cs |
GPIOC * | en |
Timer * | timer |
Static Public Attributes | |
static const uint8_t | TLE_STATUS_OK = 0U |
Reference value of Status Register. More... | |
Protected Types | |
enum | CtrlRegisters { HB_ACT_1_CTRL = 0 , HB_ACT_2_CTRL , HB_ACT_3_CTRL , HB_MODE_1_CTRL , HB_MODE_2_CTRL , HB_MODE_3_CTRL , PWM_CH_FREQ_CTRL , PWM1_DC_CTRL , PWM2_DC_CTRL , PWM3_DC_CTRL , FW_OL_CTRL , FW_CTRL } |
enum for the control registers in a TLE94112 More... | |
enum | StatusRegisters { SYS_DIAG1 = 0 , OP_ERROR_1_STAT , OP_ERROR_2_STAT , OP_ERROR_3_STAT , OP_ERROR_4_STAT , OP_ERROR_5_STAT , OP_ERROR_6_STAT } |
enum for the status registers in a TLE94112 More... | |
Protected Member Functions | |
void | init (void) |
initializes this object, automatically called by begin() More... | |
void | _configHB (uint8_t hb, uint8_t state, uint8_t pwm, uint8_t activeFW) |
sets the output state and the PWM channel for a halfbridge automatically called by the public version of configHB More... | |
void | _configPWM (uint8_t pwm, uint8_t freq, uint8_t dutyCycle) |
sets the frequency and duty cycle for a PWM channel automatically called by the public version of configPWM More... | |
uint8_t | _getHBOverCurrent (uint8_t hb) |
gets the overcurrent error flag bit for a specific halfbridge automatically called by the public version of getHBOverCurrent More... | |
uint8_t | _getHBOpenLoad (uint8_t hb) |
gets the openload error flag bit for a specific halfbridge automatically called by the public version of getHBOpenLoad More... | |
void | writeReg (uint8_t reg, uint8_t mask, uint8_t shift, uint8_t data) |
writes data bits to a control register of the TLE94112 More... | |
uint8_t | readStatusReg (uint8_t reg) |
reads one byte from a status register of the TLE94112 More... | |
uint8_t | readStatusReg (uint8_t reg, uint8_t mask, uint8_t shift) |
reads some bits from a status register of the TLE94112 More... | |
void | clearStatusReg (uint8_t reg) |
clears a status register by writing 0x00 to it More... | |
Protected Attributes | |
HalfBridge_t | mHalfBridges [TLE94112_NUM_HB] |
array of register locations for halfbridges More... | |
PWMchannel_t | mPwmChannels [TLE94112_NUM_PWM] |
array of register locations for PWM channels More... | |
uint8_t | mCtrlRegAddresses [TLE94112_NUM_CTRL_REGS] |
mapping array for control register addresses More... | |
uint8_t | mCtrlRegData [TLE94112_NUM_CTRL_REGS] |
mirror array for control register data More... | |
uint8_t | mStatusRegAddresses [TLE94112_NUM_STATUS_REGS] |
mapping array for status register addresses More... | |
uint8_t | mEnabled |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
Tle94112Mtb::Tle94112Mtb | ( | void | ) |
Construct a new Tle94112Mtb object This constructor calls with default pinsetting for the MCU board. Keep in mind that we do not set the chipselect pin with the SPI class, as we need a constant signal during multiple transfers.
Tle94112Mtb::Tle94112Mtb | ( | cyhal_gpio_t | csPin | ) |
Construct a new Tle94112Mtb object This constructor calls with default pinsetting for the SPI except for the chip select pin. Keep in mind that we do not set the chipselect pin with the SPI class, as we need a constant signal during multiple transfers.
csPin | chipselect pin for the wrapping GPIO |
Tle94112Mtb::Tle94112Mtb | ( | cyhal_gpio_t | csPin, |
cyhal_gpio_t | misoPin, | ||
cyhal_gpio_t | mosiPin, | ||
cyhal_gpio_t | sckPin | ||
) |
Construct a new Tle94112Mtb object For ModusToolbox HAL setups with different than the usual pinsettings.
csPin | chipselect pin for the wrapping GPIO |
misoPin | miso pin for the SPIC |
mosiPin | mosi pin for the SPIC |
sckPin | system clock pin for the SPIC |
|
inherited |
enables and initializes the TLE94112
|
inherited |
deactivates all outputs and disables the TLE94112
|
inherited |
sets the output state and the PWM channel for a halfbridge (only for passive freewheeling)
hb | halfbridge which will be configured |
state | sets the output voltage to high, low or floating |
pwm | selects a PWM channel for PWM output |
|
inherited |
sets the output state and the PWM channel for a halfbridge (allows active freewheeling)
hb | halfbridge which will be configured |
state | sets the output voltage to high, low or floating |
pwm | selects a PWM channel for PWM output |
activeFW | 1 for active freewheeling 0 for passive freewheeling (default) |
|
inherited |
sets the frequency and duty cycle for a PWM channel
pwm | PWM channel which will be configured |
freq | selects the PWM output frequency |
dutyCycle | a value from 0 to 255 which sets the dutyCycle |
|
inherited |
sets LED mode on compatible half bridges (half bridge 1 or 2 of TLE94112)
hb | compatible half bridge to set LED mode |
active | LED mode active (1) or inactive (0) |
|
inherited |
returns a diagnosis value for error detection
|
inherited |
shows if errors of a specific type have occurred
mask | mask to filter for a specific flag |
|
inherited |
shows if errors of a specific type have occurred
mask | mask to filter for one or more specific flags this can be a disjunction of DiagFlag values |
|
inherited |
gets the overcurrent error flag bit for a specific halfbridge
hb | halfbridge thats overcurrent flag will be returned |
|
inherited |
gets the openload error flag bit for a specific halfbridge
hb | halfbridge thats openload flag will be returned |
|
inherited |
clears all clearable error flags
|
protectedinherited |
initializes this object, automatically called by begin()
< initial control register configuration
< status register configuration
< bit masking for all halfbridges
< bit masking for all pwm channels
|
protectedinherited |
sets the output state and the PWM channel for a halfbridge automatically called by the public version of configHB
hb | halfbridge which will be configured |
state | sets the output voltage to high, low or floating |
pwm | selects a PWM channel for PWM output |
activeFW | 1 for active freewheeling 0 for passive freewheeling (default) |
|
protectedinherited |
sets the frequency and duty cycle for a PWM channel automatically called by the public version of configPWM
pwm | PWM channel which will be configured |
freq | selects the PWM output frequency |
dutyCycle | a value from 0 to 255 which sets the dutyCycle |
|
protectedinherited |
gets the overcurrent error flag bit for a specific halfbridge automatically called by the public version of getHBOverCurrent
hb | halfbridge thats overcurrent flag will be returned |
|
protectedinherited |
gets the openload error flag bit for a specific halfbridge automatically called by the public version of getHBOpenLoad
hb | halfbridge thats openload flag will be returned |
|
protectedinherited |
writes data bits to a control register of the TLE94112
reg | control register number(mapping array index / CtrlRegisters constant) of the register |
mask | mask for the bits that have to be written |
shift | data will be shifted left by this amount before masking. This is for the bit alignment of data |
data | the data byte that has to be written. It will be shifted and masked before |
|
protectedinherited |
reads one byte from a status register of the TLE94112
reg | status register number(mapping array index / StatusRegisters constant) of the register |
|
protectedinherited |
reads some bits from a status register of the TLE94112
reg | status register number(mapping array index / StatusRegisters constant) of the register |
mask | mask for the bits that have to be read |
shift | data will be shifted right by this amount after masking. This is for the bit alignment of data |
|
protectedinherited |
clears a status register by writing 0x00 to it
reg | status register number(mapping array index / StatusRegisters constant) of the register |
|
staticinherited |
Reference value of Status Register.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
array of register locations for halfbridges
|
protectedinherited |
array of register locations for PWM channels
|
protectedinherited |
mapping array for control register addresses
|
protectedinherited |
mirror array for control register data
|
protectedinherited |
mapping array for status register addresses
|
protectedinherited |