2015-09-03 01:49 AM
Hello,
On SPC5Studio V3.6 and SPC564B74. I would like to use ICU eMIOS_0 ch. 9 (PA[9], E0UC[9]) but eMIOS ICU config in HAL layers is only listing ch. 0 to 7 and ch.24. It should lists ch.1 to 7 and 9 to 15 on eMIOS_0 and ch.9 to 15 on eMIOS_1 according to reference manual, right? If you confirm the issue, can you please advise on which files should be modified? Please see screenshots below. Thanks, Aurélien2015-09-03 08:25 AM
#if SPC5_ICU_USE_EMIOS0_CH8
/* Driver initialization.*/
icuObjectInit(&ICUD9);
ICUD9.emiosp = &EMIOS_0;
ICUD9.ch_number = 9U;
ICUD8.clock = SPC5_EMIOS0_CLK;
#endif /* SPC5_ICU_USE_EMIOS0_CH7 */
#if SPC5_ICU_USE_EMIOS0_CH0
if
(&ICUD1 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH0 */
#if SPC5_ICU_USE_EMIOS0_CH1
if
(&ICUD2 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH1 */
#if SPC5_ICU_USE_EMIOS0_CH2
if
(&ICUD3 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH2 */
#if SPC5_ICU_USE_EMIOS0_CH3
if
(&ICUD4 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH3 */
#if SPC5_ICU_USE_EMIOS0_CH4
if
(&ICUD5 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH4 */
#if SPC5_ICU_USE_EMIOS0_CH5
if
(&ICUD6 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH5 */
#if SPC5_ICU_USE_EMIOS0_CH6
if
(&ICUD7 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH6 */
#if SPC5_ICU_USE_EMIOS0_CH7
if
(&ICUD8 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH7 */
#if SPC5_ICU_USE_EMIOS0_CH24
if
(&ICUD9 == icup)
increase_emios0_active_channels();
#endif /* SPC5_ICU_USE_EMIOS0_CH24 */
#if SPC5_ICU_USE_EMIOS1_CH24
if
(&ICUD10 == icup)
increase_emios1_active_channels();
#endif /* SPC5_ICU_USE_EMIOS1_CH24 */
and add the matching handler for channel 8 and channel 9
/**
* @brief eMIOS0 Channels 6 and 7 interrupt handler.
* @note It is assumed that the various sources are only activated if the
* associated callback pointer is not equal to @p NULL in order to not
* perform an extra check in a potentially critical interrupt handler.
*
* @isr
*/
OSAL_IRQ_HANDLER(SPC5_EMIOS0_GFR_F6F7_HANDLER) {
OSAL_IRQ_PROLOGUE();
#if SPC5_ICU_USE_EMIOS0_CH6
icu_lld_serve_interrupt(&ICUD7);
#endif
#if SPC5_ICU_USE_EMIOS0_CH7
icu_lld_serve_interrupt(&ICUD8);
#endif
OSAL_IRQ_EPILOGUE();
}
#endif /* SPC5_ICU_USE_EMIOS0_CH6 || SPC5_ICU_USE_EMIOS0_CH7 */
Best regards
Erwan
2015-09-07 08:34 AM
Ok, but I will still have to modify mcuconf.h to declare:
#define SPC5_ICU_USE_EMIOS0_CH9 TRUE and this files is overwritten at each code generation.