src/TLx4966/TLx4966.c
/**
 * @brief       Enables the sensor
 *              - If the "Switch power mode" is configured, the sensor is powered up.
 *              - If the "Interrupt measuring mode" is configured, the interrupt are enabled. 
 *              - The measuring speed timer is started. 
 *              
 * @param[in]   handle  Pointer to the sensor entity handle
 * @return      TLx4966 error code    
 * @retval      TLx4966_OK if success
 * @retval      TLx4966_INTF_ERROR if hardware interface error            
 */
@brief       Enables the sensor
- If the "Switch power mode" is configured, the sensor is powered up.
- If the "Interrupt measuring mode" is configured, the interrupt are enabled.
- The measuring speed timer is started.

@param[in]   handle  Pointer to the sensor entity handle
@return      TLx4966 error code
@retval      TLx4966_OK if success
@retval      TLx4966_INTF_ERROR if hardware interface error
@brief Enables the sensor - If the " Switch power mode " is configured the sensor is powered up . - If the " Interrupt measuring mode " is configured the interrupt are enabled . - The measuring speed timer is started . @param [ in ] handle Pointer to the sensor entity handle @return TLx4966 error code @retval TLx4966_OK if success @retval TLx4966_INTF_ERROR if hardware interface error
TLx4966_Error_t TLx4966_Enable(TLx4966_Handle_t *handle)
{
    TLx4966_Error_t err = TLx4966_OK;
    if(handle->powMode == TLx4966_POWMODE_SWITCH)
        INTF_ASSERT(handle->hwIntf->power->enable());
    INTF_ASSERT(handle->hwIntf->timer->delay(TLx4966_STARTUP_TIME));
    if(handle->measMode == TLx4966_MEASMODE_INTERRUPT)
    {
        INTF_ASSERT(handle->hwIntf->dir->enableInt((TLx4966_GPIO_IntCallback)TLx4966_DirectionCallback,handle));
        INTF_ASSERT(handle->hwIntf->speed->enableInt((TLx4966_GPIO_IntCallback)TLx4966_SpeedCallback,handle));
    }
    handle->hwIntf->timer->start();
    handle->status = TLx4966_ON;
    return err;
}
TLx4966_Error_t TLx4966_Enable ( TLx4966_Handle_t * handle ) { TLx4966_Error_t err = TLx4966_OK ; if ( handle -> powMode == TLx4966_POWMODE_SWITCH ) INTF_ASSERT ( handle -> hwIntf -> power -> enable ( ) ) ; INTF_ASSERT ( handle -> hwIntf -> timer -> delay ( TLx4966_STARTUP_TIME ) ) ; if ( handle -> measMode == TLx4966_MEASMODE_INTERRUPT ) { INTF_ASSERT ( handle -> hwIntf -> dir -> enableInt ( ( TLx4966_GPIO_IntCallback ) TLx4966_DirectionCallback , handle ) ) ; INTF_ASSERT ( handle -> hwIntf -> speed -> enableInt ( ( TLx4966_GPIO_IntCallback ) TLx4966_SpeedCallback , handle ) ) ; } handle -> hwIntf -> timer -> start ( ) ; handle -> status = TLx4966_ON ; return err ; }
@brief       Enables the sensor
              - If the "Switch power mode" is configured, the sensor is powered up.
@brief Enables the sensor - If the " Switch power mode " is configured the sensor is powered up .