Basic description of file contents.
More...
Go to the source code of this file.
|
| enum | PWM_DRIVE_STATE_TYPE {
PWM_MOTOR_DRIVER_IDLE
, PWM_MOTOR_DRIVER_STARTED
, PWM_MOTOR_DRIVER_DEVICES_OFF
, PWM_MOTOR_DRIVER_ACTIVE
,
PWM_MOTOR_DRIVER_LOWERS_ON
, PWM_MOTOR_DRIVER_UPPERS_ON
} |
| |
| enum | SRMCPWM_ERROR_TYPE {
SR_MCPWM_ERROR_SHUTDOWN_ALREADY_ON = 0
, SR_MCPWM_ERROR_REGISTER_STUCK_AT_1 = 1
, SR_MCPWM_ERROR_REGISTER_STUCK_AT_0 = 2
, SR_MCPWM_ERROR_WAITING_START_TRIGGER = 3
,
SR_MCPWM_ERROR_PERIPHERAL_NOT_SAFE = 4
, SR_MCPWM_ERROR_PERIPHERAL_SAFE = 5
, SR_MCPWM_ERROR_CHECKING = 6
} |
| |
| enum | SRMCPWM_DIAG_STATE_TYPE {
SR_MCPWM_WAITING_TO_CHECK
, SR_MCPWM_CHECK_SIGNAL_POL
, SR_MCPWM_CHECK_STUCK_AT_1
, SR_MCPWM_CHECK_STUCK_AT_0
,
SR_MCPWM_FEEDBACK_UPDATED
} |
| |
| enum | SRMCPWM_GATE_NAME_TYPE {
SR_MCPWM_GATE_A_HI
, SR_MCPWM_GATE_A_LO
, SR_MCPWM_GATE_B_HI
, SR_MCPWM_GATE_B_LO
,
SR_MCPWM_GATE_C_HI
, SR_MCPWM_GATE_C_LO
, SR_MCPWM_GATE_ALL_HI
, SR_MCPWM_GATE_ALL_LO
,
SR_MCPWM_GATE_ALL_6GATES
} |
| |
Basic description of file contents.
Definition in file SRMCPwm.h.
◆ CB_TYPE
| typedef void(* CB_TYPE) (unsigned char) |
◆ PWM_DISABLE_ENABLE_TYPE
| typedef void(* PWM_DISABLE_ENABLE_TYPE) (SRMCPWM_GATE_NAME_TYPE) |
◆ PWM_GET_MAX_TYPE
| typedef unsigned short int(* PWM_GET_MAX_TYPE) (void) |
◆ PWM_INIT_TYPE
| typedef void(* PWM_INIT_TYPE) (unsigned short int, unsigned short int dead_time_ns, CB_TYPE cb) |
◆ PWM_LOAD_ALL_TYPE
| typedef void(* PWM_LOAD_ALL_TYPE) (unsigned short int, unsigned short int, unsigned short int) |
◆ PWM_VOID_VOID_TYPE
| typedef void(* PWM_VOID_VOID_TYPE) (void) |
◆ PWM_DRIVE_STATE_TYPE
| enum PWM_DRIVE_STATE_TYPE |
◆ SRMCPWM_DIAG_STATE_TYPE
| enum SRMCPWM_DIAG_STATE_TYPE |
◆ SRMCPWM_ERROR_TYPE
◆ SRMCPWM_GATE_NAME_TYPE
| enum SRMCPWM_GATE_NAME_TYPE |
◆ SRMCPwm__DiagnosticHandler()
| void SRMCPwm__DiagnosticHandler |
( |
void |
| ) |
|
◆ SRMCPwm__DisablePwmOutput()
| void SRMCPwm__DisablePwmOutput |
( |
SRMCPWM_GATE_NAME_TYPE |
gate_name | ) |
|
Disables PWM output according the parameter gate_name. It disconnects the PWM output to the internal PWM peripheral.
- Parameters
-
| gate_name | selects the gate to be disconnected. |
Definition at line 229 of file SRMCPwm.c.
◆ SRMCPwm__EnablePwmOutput()
| void SRMCPwm__EnablePwmOutput |
( |
SRMCPWM_GATE_NAME_TYPE |
gate_name | ) |
|
Enable the PWM output according the parameter gate_name. It connects the PWM output to the internal PWM peripheral.
- Parameters
-
| gate_name | selects the gate to be connected. |
Definition at line 215 of file SRMCPwm.c.
◆ SRMCPwm__GetDeadtimeNanosec()
| unsigned short int SRMCPwm__GetDeadtimeNanosec |
( |
void |
| ) |
|
Get the configured dead time in the PWM peripheral.
- Returns
- dead time in nanoseconds, decimal and no fractional number.
Definition at line 251 of file SRMCPwm.c.
◆ SRMCPwm__GetDiagFeedback()
| SRMCPWM_ERROR_TYPE SRMCPwm__GetDiagFeedback |
( |
void |
| ) |
|
◆ SRMCPwm__GetHwFaultStatus()
| unsigned char SRMCPwm__GetHwFaultStatus |
( |
void |
| ) |
|
This function returns over current or over temperature error from driver module
Definition at line 258 of file SRMCPwm.c.
◆ SRMCPwm__GetMaxPwm()
| unsigned short int SRMCPwm__GetMaxPwm |
( |
void |
| ) |
|
Get the max PWM counts configured in the peripheral. Note that this method uses a shadowed variable, which was set during the initialization of this module.
- Returns
- Max PWM in timer counts.
Definition at line 97 of file SRMCPwm.c.
◆ SRMCPwm__GetPwmFrequencyHz()
| unsigned short int SRMCPwm__GetPwmFrequencyHz |
( |
void |
| ) |
|
Get the specified PWM frequency.
- Returns
- frequency in Hertz, decimal and no fractional number.
Definition at line 242 of file SRMCPwm.c.
◆ SRMCPwm__Handler250us()
| void SRMCPwm__Handler250us |
( |
void |
| ) |
|
Checks active level pulse duration in IPM SD pin
Definition at line 268 of file SRMCPwm.c.
◆ SRMCPwm__LoadAllPwmValues()
| void SRMCPwm__LoadAllPwmValues |
( |
unsigned short int |
pwm_a, |
|
|
unsigned short int |
pwm_b, |
|
|
unsigned short int |
pwm_c |
|
) |
| |
Load the user pwm duty to the respective registers. All parameters are given in pwm counts.
- Parameters
-
Definition at line 174 of file SRMCPwm.c.
◆ SRMCPwm__PwmISR()
| void SRMCPwm__PwmISR |
( |
void |
| ) |
|
ISR for the PWM. This is configured to happen at the end of each PWM period.
Definition at line 105 of file SRMCPwm.c.
◆ SRMCPwm__StartCounter()
| void SRMCPwm__StartCounter |
( |
void |
| ) |
|
Start the PWM timer counter.
Definition at line 193 of file SRMCPwm.c.
◆ SRMCPwm__StartDiagIfAvailable()
| void SRMCPwm__StartDiagIfAvailable |
( |
unsigned long |
timeout_to_zero, |
|
|
unsigned long |
timeout_to_one |
|
) |
| |
◆ SRMCPwm__StopCounter()
| void SRMCPwm__StopCounter |
( |
void |
| ) |
|
Stop the timer counter. This method also turns off the Pwm ISR because the timer will be stopped.
Definition at line 204 of file SRMCPwm.c.
◆ SRMCPwm__TurnOffAllGates()
| void SRMCPwm__TurnOffAllGates |
( |
void |
| ) |
|
This method is created and reconfigure on fly the Gpio output, because the LOCK bits can be used and the OCx/OCxN will not be able to be reconfigured on fly.
Definition at line 161 of file SRMCPwm.c.
◆ SRMCPwm__TurnOffHighSideGates()
| void SRMCPwm__TurnOffHighSideGates |
( |
void |
| ) |
|
Turn OFF ALL HIGH GATES. This is related to the driver input and NOT to the PWM output.
Definition at line 148 of file SRMCPwm.c.
◆ SRMCPwm__TurnOffLowSideGates()
| void SRMCPwm__TurnOffLowSideGates |
( |
void |
| ) |
|
Turn OFF ALL LOW GATES. This is related to the driver input and NOT to the PWM output.
Definition at line 132 of file SRMCPwm.c.
◆ SRMCPwm__TurnOnHighSideGates()
| void SRMCPwm__TurnOnHighSideGates |
( |
void |
| ) |
|
Turn ON ALL HIGH GATES. This is related to the driver input and NOT to the PWM output.
Definition at line 140 of file SRMCPwm.c.
◆ SRMCPwm__TurnOnLowSideGates()
| void SRMCPwm__TurnOnLowSideGates |
( |
void |
| ) |
|
Turn ON ALL LOW GATES. This is related to the driver input and NOT to the PWM output.
Definition at line 120 of file SRMCPwm.c.
◆ SRMCPWM_DISABLEPWM
◆ SRMCPWM_ENABLEPWM
◆ SRMCPWM_GETMAXPWM
◆ SRMCPWM_INIT
◆ SRMCPWM_LOADPWM
◆ SRMCPWM_TURNONLOWSIDES