Skip to content
Snippets Groups Projects
Commit 8263b120 authored by Ayoub Farah Hassan's avatar Ayoub Farah Hassan Committed by Clément Foucher
Browse files

Adding functions to initialize interrupt on repetition counter event

This commit add three functions to implement interrupt on HRTIM repetition counter event.
parent 5f0d1c5c
No related branches found
No related tags found
1 merge request!47Adding functions to initialize interrupt on repetition counter event
...@@ -92,7 +92,45 @@ void hrtim_init_voltage_leg1_boost_leg2_buck(hrtim_tu_t leg1_tu, hrtim_tu_t leg2 ...@@ -92,7 +92,45 @@ void hrtim_init_voltage_leg1_boost_leg2_buck(hrtim_tu_t leg1_tu, hrtim_tu_t leg2
void hrtim_init_voltage_leg1_boost_leg2_buck_center_aligned(hrtim_tu_t leg1_tu, hrtim_tu_t leg2_tu); void hrtim_init_voltage_leg1_boost_leg2_buck_center_aligned(hrtim_tu_t leg1_tu, hrtim_tu_t leg2_tu);
void hrtim_update_adc_trig_interleaved(uint16_t new_trig, hrtim_tu_t leg1_tu, hrtim_tu_t leg2_tu); void hrtim_update_adc_trig_interleaved(uint16_t new_trig, hrtim_tu_t leg1_tu, hrtim_tu_t leg2_tu);
/**
* @brief Enable interrupt on repetition counter for the chosen timing unit
* @param tu_src timing unit which will be the source for the ISR :
* @arg @ref MSTR
* @arg @ref TIMA
* @arg @ref TIMB
* @arg @ref TIMC
* @arg @ref TIMD
* @arg @ref TIME
* @arg @ref TIMF
*/
void hrtim_PeriodicEvent_en(hrtim_tu_t tu_src);
/**
* @brief Disable interrupt on repetition counter for the chosen timing unit
* @param tu_src timing unit which will be the source for the ISR :
* @arg @ref MSTR
* @arg @ref TIMA
* @arg @ref TIMB
* @arg @ref TIMC
* @arg @ref TIMD
* @arg @ref TIME
* @arg @ref TIMF
*/
void hrtim_PeriodicEvent_dis(hrtim_tu_t tu_src);
/**
* @brief Change the repetition counter value to control the ISR interrupt
* @param repetion value between 0 and 255 for the repetition counter
* @param tu_src timing unit which will be the source for the ISR :
* @arg @ref MSTR
* @arg @ref TIMA
* @arg @ref TIMB
* @arg @ref TIMC
* @arg @ref TIMD
* @arg @ref TIME
* @arg @ref TIMF
*/
void hrtim_PeriodicEvent_SetRep(uint32_t repetition, hrtim_tu_t tu_src);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -77,6 +77,23 @@ void hrtim_update_adc_trig_interleaved(uint16_t new_trig, hrtim_tu_t leg1_tu, hr ...@@ -77,6 +77,23 @@ void hrtim_update_adc_trig_interleaved(uint16_t new_trig, hrtim_tu_t leg1_tu, hr
} }
} }
void hrtim_PeriodicEvent_en(hrtim_tu_t tu_src)
{
LL_HRTIM_TIM_SetRepetition(HRTIM1, tu_src , 9); /* We initialize the ISR interrupt frequency
to 1/10 of the switching frequency first */
LL_HRTIM_EnableIT_REP(HRTIM1, tu_src); /* Enabling the interrupt on repetition counter event*/
}
void hrtim_PeriodicEvent_dis(hrtim_tu_t tu_src)
{
LL_HRTIM_DisableIT_REP(HRTIM1, tu_src); /* Disabling the interrupt on repetition counter event*/
}
void hrtim_PeriodicEvent_SetRep(uint32_t repetition, hrtim_tu_t tu_src)
{
LL_HRTIM_TIM_SetRepetition(HRTIM1, tu_src , repetition);
}
void hrtim_init_current() void hrtim_init_current()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment