/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __LOW_LEVEL_H #define __LOW_LEVEL_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include #include #include /* Exported types ------------------------------------------------------------*/ typedef struct{ int type; int index; } monitoring_slot; /* Exported constants --------------------------------------------------------*/ extern const float elec_rad_per_enc; /* Exported variables --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ //Note: to control without feed forward, set feed forward terms to 0.0f. void pwm_trig_adc_cb(ADC_HandleTypeDef* hadc, bool injected); void vbus_sense_adc_cb(ADC_HandleTypeDef* hadc, bool injected); // Utility void global_fault(int error); // Initalisation void start_adc_pwm(); void start_pwm(TIM_HandleTypeDef* htim); void sync_timers(TIM_HandleTypeDef* htim_a, TIM_HandleTypeDef* htim_b, uint16_t TIM_CLOCKSOURCE_ITRx, uint16_t count_offset); void update_brake_current(); void set_brake_current(float brake_current); #ifdef __cplusplus } #endif #endif //__LOW_LEVEL_H