SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
hardware_api.h File Reference
Include dependency graph for drivers/hardware_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GenericDriverParams
 

Macros

#define SIMPLEFOC_PWM_ACTIVE_HIGH   true
 
#define SIMPLEFOC_PWM_HIGHSIDE_ACTIVE_HIGH   true
 
#define SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH   true
 
#define SIMPLEFOC_DRIVER_INIT_FAILED   ((void*)-1)
 

Typedefs

typedef struct GenericDriverParams GenericDriverParams
 

Functions

void * _configure1PWM (long pwm_frequency, const int pinA)
 
void * _configure2PWM (long pwm_frequency, const int pinA, const int pinB)
 
void * _configure3PWM (long pwm_frequency, const int pinA, const int pinB, const int pinC)
 
void * _configure4PWM (long pwm_frequency, const int pin1A, const int pin1B, const int pin2A, const int pin2B)
 
void * _configure6PWM (long pwm_frequency, float dead_zone, const int pinA_h, const int pinA_l, const int pinB_h, const int pinB_l, const int pinC_h, const int pinC_l)
 
void _writeDutyCycle1PWM (float dc_a, void *params)
 
void _writeDutyCycle2PWM (float dc_a, float dc_b, void *params)
 
void _writeDutyCycle3PWM (float dc_a, float dc_b, float dc_c, void *params)
 
void _writeDutyCycle4PWM (float dc_1a, float dc_1b, float dc_2a, float dc_2b, void *params)
 
void _writeDutyCycle6PWM (float dc_a, float dc_b, float dc_c, PhaseState *phase_state, void *params)
 

Macro Definition Documentation

◆ SIMPLEFOC_DRIVER_INIT_FAILED

#define SIMPLEFOC_DRIVER_INIT_FAILED   ((void*)-1)

Definition at line 29 of file drivers/hardware_api.h.

◆ SIMPLEFOC_PWM_ACTIVE_HIGH

#define SIMPLEFOC_PWM_ACTIVE_HIGH   true

Definition at line 17 of file drivers/hardware_api.h.

◆ SIMPLEFOC_PWM_HIGHSIDE_ACTIVE_HIGH

#define SIMPLEFOC_PWM_HIGHSIDE_ACTIVE_HIGH   true

Definition at line 21 of file drivers/hardware_api.h.

◆ SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH

#define SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH   true

Definition at line 25 of file drivers/hardware_api.h.

Typedef Documentation

◆ GenericDriverParams

Function Documentation

◆ _configure1PWM()

void * _configure1PWM ( long  pwm_frequency,
const int  pinA 
)

Configuring PWM frequency, resolution and alignment

  • Stepper driver - 2PWM setting
  • hardware specific
Parameters
pwm_frequency- frequency in hertz - if applicable
pinApinA pwm pin
Returns
-1 if failed, or pointer to internal driver parameters struct if successful

◆ _configure2PWM()

void * _configure2PWM ( long  pwm_frequency,
const int  pinA,
const int  pinB 
)

Configuring PWM frequency, resolution and alignment

  • Stepper driver - 2PWM setting
  • hardware specific
Parameters
pwm_frequency- frequency in hertz - if applicable
pinApinA bldc driver
pinBpinB bldc driver
Returns
-1 if failed, or pointer to internal driver parameters struct if successful
Here is the caller graph for this function:

◆ _configure3PWM()

void * _configure3PWM ( long  pwm_frequency,
const int  pinA,
const int  pinB,
const int  pinC 
)

Configuring PWM frequency, resolution and alignment

  • BLDC driver - 3PWM setting
  • hardware specific
Parameters
pwm_frequency- frequency in hertz - if applicable
pinApinA bldc driver
pinBpinB bldc driver
pinCpinC bldc driver
Returns
-1 if failed, or pointer to internal driver parameters struct if successful
Here is the caller graph for this function:

◆ _configure4PWM()

void * _configure4PWM ( long  pwm_frequency,
const int  pin1A,
const int  pin1B,
const int  pin2A,
const int  pin2B 
)

Configuring PWM frequency, resolution and alignment

  • Stepper driver - 4PWM setting
  • hardware specific
Parameters
pwm_frequency- frequency in hertz - if applicable
pin1Apin1A stepper driver
pin1Bpin1B stepper driver
pin2Apin2A stepper driver
pin2Bpin2B stepper driver
Returns
-1 if failed, or pointer to internal driver parameters struct if successful
Here is the caller graph for this function:

◆ _configure6PWM()

void * _configure6PWM ( long  pwm_frequency,
float  dead_zone,
const int  pinA_h,
const int  pinA_l,
const int  pinB_h,
const int  pinB_l,
const int  pinC_h,
const int  pinC_l 
)

Configuring PWM frequency, resolution and alignment

  • BLDC driver - 6PWM setting
  • hardware specific
Parameters
pwm_frequency- frequency in hertz - if applicable
dead_zoneduty cycle protection zone [0, 1] - both low and high side low - if applicable
pinA_hpinA high-side bldc driver
pinA_lpinA low-side bldc driver
pinB_hpinA high-side bldc driver
pinB_lpinA low-side bldc driver
pinC_hpinA high-side bldc driver
pinC_lpinA low-side bldc driver
Returns
-1 if failed, or pointer to internal driver parameters struct if successful
Here is the caller graph for this function:

◆ _writeDutyCycle1PWM()

void _writeDutyCycle1PWM ( float  dc_a,
void *  params 
)

Function setting the duty cycle to the pwm pin (ex. analogWrite())

  • Stepper driver - 2PWM setting
  • hardware specific
Parameters
dc_aduty cycle phase A [0, 1]
dc_bduty cycle phase B [0, 1]
paramsthe driver parameters

◆ _writeDutyCycle2PWM()

void _writeDutyCycle2PWM ( float  dc_a,
float  dc_b,
void *  params 
)

Function setting the duty cycle to the pwm pin (ex. analogWrite())

  • Stepper driver - 2PWM setting
  • hardware specific
Parameters
dc_aduty cycle phase A [0, 1]
dc_bduty cycle phase B [0, 1]
paramsthe driver parameters
Here is the caller graph for this function:

◆ _writeDutyCycle3PWM()

void _writeDutyCycle3PWM ( float  dc_a,
float  dc_b,
float  dc_c,
void *  params 
)

Function setting the duty cycle to the pwm pin (ex. analogWrite())

  • BLDC driver - 3PWM setting
  • hardware specific
Parameters
dc_aduty cycle phase A [0, 1]
dc_bduty cycle phase B [0, 1]
dc_cduty cycle phase C [0, 1]
paramsthe driver parameters
Here is the caller graph for this function:

◆ _writeDutyCycle4PWM()

void _writeDutyCycle4PWM ( float  dc_1a,
float  dc_1b,
float  dc_2a,
float  dc_2b,
void *  params 
)

Function setting the duty cycle to the pwm pin (ex. analogWrite())

  • Stepper driver - 4PWM setting
  • hardware specific
Parameters
dc_1aduty cycle phase 1A [0, 1]
dc_1bduty cycle phase 1B [0, 1]
dc_2aduty cycle phase 2A [0, 1]
dc_2bduty cycle phase 2B [0, 1]
paramsthe driver parameters
Here is the caller graph for this function:

◆ _writeDutyCycle6PWM()

void _writeDutyCycle6PWM ( float  dc_a,
float  dc_b,
float  dc_c,
PhaseState phase_state,
void *  params 
)

Function setting the duty cycle to the pwm pin (ex. analogWrite())

  • BLDC driver - 6PWM setting
  • hardware specific
Parameters
dc_aduty cycle phase A [0, 1]
dc_bduty cycle phase B [0, 1]
dc_cduty cycle phase C [0, 1]
phase_statepointer to PhaseState[3] array
paramsthe driver parameters
Here is the caller graph for this function: