cancel
Showing results for 
Search instead for 
Did you mean: 

AURIX™

Not applicable
Hello,

I've been recently using the GTM Standard Driver provided by the TC22x iLLD and I've discovered that there's some mistakes in enable/disable functions:

For the enable/disable updates function:

void IfxGtm_Tom_Tgc_enableChannelUpdate(Ifx_GTM_TOM_TGC *tgc, IfxGtm_Tom_Ch channel, boolean enabled)
{
tgc->GLB_CTRL.U |= IfxGtm_Tom_Tgc_buildFeatureForChannel(channel, enabled, IFX_GTM_TOM_TGC0_GLB_CTRL_UPEN_CTRL0_OFF);
}

If you step into the function “IfxGtm_Tom_Tgc_buildFeatureForChannel”, you can see that it returns a value that is OR masked to the GLB_CTRL register, and it doesn’t modify the value if you want to turn from “enable” status to “disable” status.
It is because if you had a “10” and is OR masked with an “01”, it turns “11”, and following the reference manual: “11B don’t care, bits 1:0 will not be changed”.

The same happends with IfxGtm_Tom_Tgc_enableChannel and IfxGtm_Tom_Tgc_enableChannelOutput functions.

I've had to make my own functions to use this features.
I hope it helps you when using this driver.

Alejandro.
0 Likes
0 Replies