Professional Documents
Culture Documents
GPIO's Assistance
Application Note
80-NP621-1 A
June 13, 2014
Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm or its
subsidiaries without the express approval of Qualcomm’s Configuration Management.
Not to be used, copied, reproduced, or modified in whole or in part, nor its contents revealed in any manner to others
without the express written permission of Qualcomm Technologies, Inc.
Qualcomm reserves the right to make changes to the product(s) or information contained herein without notice. No
liability is assumed for any damages arising directly or indirectly by their use or application. The information
provided in this document is provided on an “as is” basis.
This document contains confidential and proprietary information and must be shredded when discarded.
Qualcomm is a trademark of QUALCOMM Incorporated, registered in the United States and other countries. All
QUALCOMM Incorporated trademarks are used with permission. Other product and brand names may be
trademarks or registered trademarks of their respective owners.
This technical data may be subject to U.S. and international export, re-export, or transfer (“export”) laws. Diversion
contrary to U.S. and international law is strictly prohibited.
1 Introduction...................................................................................................... 5
1.1 Purpose.......................................................................................................................... 5
1.2 Scope............................................................................................................................. 5
1.3 Conventions .................................................................................................................. 5
1.4 References ..................................................................................................................... 5
1.5 Technical assistance ...................................................................................................... 5
1.6 Acronyms ...................................................................................................................... 6
Tables
Table 1-1 Reference documents and standards ............................................................................................ 5
2 1.1 Purpose
3 This document provides the UE code changes to detect the cards inserted in slot1 and slot2
4 through a tray using only one GPIO.
5 1.2 Scope
6 This document is intended for engineers using the Qualcomm Technologies, Inc. (QTI) solution
7 who need to understand the UE support of single GPIO to detect slot1 and slot2.
8 1.3 Conventions
9 Function declarations, function names, type declarations, and code samples appear in a different
10 font, e.g., #include.
11 Code variables appear in angle brackets, e.g., <number>.
12 If you are viewing this document using a color monitor, or if you print this document to a color
13 printer, red boldface indicates code that is to be added, and blue strikethrough indicates code
14 that is to be replaced or removed.
15 1.4 References
16 Reference documents are listed in Table 1-1. Reference documents that are no longer applicable
17 are deleted from this table; therefore, reference numbers may not be sequential.
Ref. Document
Qualcomm Technologies
Q1 Application Note: Software Glossary for Customers CL93-V3077-1
1 1.6 Acronyms
2 For definitions of terms and abbreviations, see [Q1].
17 2.3.1 Change 1
18 File: custuim.h
/*-------------------------------------------------------------------------
--
Task Related Defines
--------------------------------------------------------------------------
-*/
#ifdef TEST_FRAMEWORK
#include "custuim_qtf.h"
#endif /* TEST_FRAMEWORK */
#include "custsfs.h"
/* MMGSDI Task support */
#define FEATURE_GSDI
/* Enable the specific ATCSIM Support */
#define FEATURE_UIM_SUPPORT_ATCSIM
#define FEATURE_UIM1_UIM2_HOTSWAP_GPIO60
1 2.3.2 Change 2
2 File: uimdrv_uartdm.c
3 Function: uim_uartdm_uim_controller_config
4 Function: uim_uartdm_uim_controller_mask_carddet_int
}
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
uimUartdmUimControllerMaskCarddetInt(uim_ptr->id);
return;
} /* uim_uartdm_uim_controller_mask_carddet_int */
1 Function: uim_uartdm_uim_controller_clear_carddet_int
2 Function: uim_uartdm_uim_controller_card_presence
uim_hw_if.uart[uim_ptr->id].start_addr +
UART_DM_UIM_IO_STATUS) & UIM_CARD_INSERTED);
}
#else
uim_presence_status =
(uim_card_swap_enum_type)(UIM_HWIO_IN(
uim_hw_if.uart[uim_ptr->id].start_addr +
UART_DM_UIM_IO_STATUS) & UIM_CARD_INSERTED);
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
#endif /* FEATURE_UIM_TEST_FRAMEWORK */
return uim_presence_status;
} /* uim_uartdm_uim_controller_card_presence */
1 Function: uim_uartdm_uim_controller_card_ins_int
2 Function: uim_uartdm_uim_controller_card_rem_int
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
uimUartdmUimControllerCardRemInt(uim_instance);
uim_clk_busy_wait(200);
#endif /* FEATURE_UIM_TEST_FRAMEWORK */
return;
} /* uim_uartdm_uim_controller_card_rem_int */
1 2.3.3 Change 3
2 File: uimdrv.c
3 Function: uim_hotswap_isr
void uim_hotswap_isr
(
uim_instance_global_type *uim_ptr,
boolean hos_need_to_query,
uim_card_swap_enum_type hos_new_card_status
)
{
RETURN_IF_INSTANCE_INVALID(uim_ptr->id);
#ifdef FEATURE_UIM1_UIM2_HOTSWAP_GPIO60
if ( UIM_INSTANCE_2 == uim_ptr->id)
{
MSG_HIGH("No Need for UIM2 Hotswap Configuration",0,0,0);
return;
}
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
if(uim_hw_if.intctrl[uim_ptr->id].m_hs_enable == TRUE)
{
uim_card_swap_enum_type uim_query_card_status = UIM_CARD_UNCHANGED;
/* Check if we are already in debounce logic then do nothing */
if (uim_ptr->hotswap.hotswap_debounce_in_progress == TRUE)
{
MSG_LOW_UIM(uim_ptr->id,"HOTSWAP: Debounce is in progress",0,0,0);
return;
}
4 Function: uim_hotswap_slot_debounce_timer_expiry_cb
/* Check if the card detection status changes since the last ISR */
if(uim_new_query_status == uim_curr_hos_card_status )
{
/* Query status and ISR status is same , continue sampling */
if (*uim_hotswap_sample_couter_ptr >= uim_hotswap_max_sample_counter)
{
/* Debounce successfully completed !!!! */
/* Store the stable new card detect status */
/* send the hotswap signal to uim_task */
uim_hotswap_card_swap_debonce_end = TRUE;
if (uim_curr_hos_card_status == UIM_CARD_INSERTED)
{
MSG_HIGH_UIM(uim_ptr->id,"HOTSWAP: Debounce logic ended successfully,
processing card insertion", 0,0,0);
#ifdef FEATURE_UIM1_UIM2_HOTSWAP_GPIO60
if ( UIM_INSTANCE_1 == uim_ptr->id)
{
MSG_HIGH_UIM(UIM_INSTANCE_2,"HOTSWAP: Debounce logic ended successfully,
processing card insertion", 0,0,0);
}
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
}
else
{
MSG_HIGH_UIM(uim_ptr->id,"HOTSWAP:Debounce logic ended successfully,
processing card removal", 0,0,0);
#ifdef FEATURE_UIM1_UIM2_HOTSWAP_GPIO60
if ( UIM_INSTANCE_1 == uim_ptr->id)
{
MSG_HIGH_UIM(UIM_INSTANCE_2,"HOTSWAP:Debounce logic ended successfully,
processing card removal", 0,0,0);
}
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
}
if (FALSE == uim_hotswap_set_signal(uim_curr_hos_card_status, uim_ptr))
{
MSG_ERROR_UIM(uim_ptr->id,"HOTSWAP: Failed to set the CARD INSERTED or
REMOVED signal",0,0,0);
}
#ifdef FEATURE_UIM1_UIM2_HOTSWAP_GPIO60
if ( UIM_INSTANCE_1 == uim_ptr->id){
if (FALSE == uim_hotswap_set_signal(uim_curr_hos_card_status,
uim_get_instance_ptr(UIM_INSTANCE_2)))
{
MSG_ERROR_UIM(UIM_INSTANCE_2,"HOTSWAP: Failed to set the CARD INSERTED or
REMOVED signal",0,0,0);
}
}
#endif /* FEATURE_UIM1_UIM2_HOTSWAP_GPIO60 */
}
else
{
/* continue for next sampling */
uim_hotswap_reset_debounce_timer( uim_curr_hos_card_status, uim_ptr);
}
}
else
{
/* Query status and ISR status is not same, continue for next retry,
1 2.3.4 Change 4
2 File: uimdrv_gpio.c
3 Function: uim_config_hotswap_gpios
configHotswapGpios(uim_ptr->id);
return;
} /* uim_config_hotswap_gpios */