controller_bb_8_driver/src/lld_encoder.c
void lldEncoderInit( void )
{
    if( isInitialized )
        return; 

    commonExtDriverInit();

    // Motor 1
    EXTChannelConfig base1_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base1
    };
    extSetChannelMode( &EXTD1, ENC1_BASE, &base1_conf );

    // Motor 2
    EXTChannelConfig base2_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base2
    };
    extSetChannelMode( &EXTD1, ENC2_BASE, &base2_conf );

    // Motor 3
    EXTChannelConfig base3_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base3
    };
    extSetChannelMode( &EXTD1, ENC3_BASE, &base3_conf );

    isInitialized = true;
}
/**
 * @brief   Initialize periphery connected to encoder
 * @note    Stable for repeated calls
 */
@brief   Initialize periphery connected to encoder
@note    Stable for repeated calls
@brief Initialize periphery connected to encoder @note Stable for repeated calls
void lldEncoderInit( void )
{
    if( isInitialized )
        return; 
    commonExtDriverInit();
    EXTChannelConfig base1_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base1
    };
    extSetChannelMode( &EXTD1, ENC1_BASE, &base1_conf );
    EXTChannelConfig base2_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base2
    };
    extSetChannelMode( &EXTD1, ENC2_BASE, &base2_conf );
    EXTChannelConfig base3_conf = {
        .mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD,
        .cb = extcb_base3
    };
    extSetChannelMode( &EXTD1, ENC3_BASE, &base3_conf );
    isInitialized = true;
}
void lldEncoderInit ( void ) { if ( isInitialized ) return ; commonExtDriverInit ( ) ; EXTChannelConfig base1_conf = { . mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD , . cb = extcb_base1 } ; extSetChannelMode ( & EXTD1 , ENC1_BASE , & base1_conf ) ; EXTChannelConfig base2_conf = { . mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD , . cb = extcb_base2 } ; extSetChannelMode ( & EXTD1 , ENC2_BASE , & base2_conf ) ; EXTChannelConfig base3_conf = { . mode = EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOD , . cb = extcb_base3 } ; extSetChannelMode ( & EXTD1 , ENC3_BASE , & base3_conf ) ; isInitialized = true ; }
@brief   Initialize periphery connected to encoder
 @note    Stable for repeated calls
@brief Initialize periphery connected to encoder @note Stable for repeated calls
// Motor 1 // Motor 2 // Motor 3