Beispiel #1
0
/* gpio_init: initialize general purpose input/output pins. */
void gpio_init (void) {
  /* initialize all PORTB GPIO to hi-z. */
  DDRB = 0;
  PORTB = 0;

  /* initialize all PORTC GPIO to hi-z. */
  DDRC = 0;
  PORTC = 0;

  /* initialize all PORTD GPIO to hi-z. */
  DDRD = 0;
  PORTD = 0;

  /* initialize the spi digital-to-analog converter. */
  gpio_dac_init ();

  /* initialize the high current regulator. */
  gpio_ldo_init ();

  /* initialize the led indicator. */
  gpio_led_init ();

  /* signal that general purpose i/o has initialized by turning on the
   * indicator led.
   */
  gpio_led_comm_on ();
}
Beispiel #2
0
/*****************************************************************************
 * FUNCTION
 *  l4c_init
 * DESCRIPTION
 *  This is l4c_init function of L4C module.
 *  will be called when stack init
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
kal_bool l4c_init()
{
    kal_bool ret_val = KAL_FALSE;
    kal_int8 i = 1;

    for (i = L4_MAX_SIM_NUM-1; i >= 0; i--)
    {
        l4c_ptr_g = &l4c_cntxt_g[i];
        kal_mem_set((kal_uint8*) L4C_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_context_struct));
        l4c_current_mod_id = L4_MODULE(MOD_L4C, i);

    #if !defined(__MMI_FMI__) && defined(__GEMINI__)
        l4c_ptr_g->dual_sim_mode_setting_command = RMMI_EDSIM_NORMAL; // for AT+EDSIM set mode
    #endif /* no __MMI_FMI__ */
        
        ret_val = l4c_init_context();

    #ifdef __HOMEZONE_SUPPORT__
        HZ_PTR = &l4c_hz_cntxt_g[i];

        kal_mem_set((kal_uint8*) HZ_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_hz_context_struct));

        l4c_hz_init_context();
    #endif 

        L4C_PTR->event_scheduler_ptr = evshed_create("L4CTIMER", l4c_current_mod_id, 0, 0);  //evshed_create, mtk02285, 20110328
    }

    /* For GPRS_FLC_UT MAUI_02419672 mtk02126 */
    #if 0
    #if !defined(__MTK_TARGET__) && defined(__RMMI_UT__) && defined(__MOD_TCM__)    
/* under construction !*/
/* under construction !*/
    #endif /*~ __MOD_TCM__*/
    #endif

    l4c_comm_ptr_g = &l4c_comm_cntxt_g;
    ret_val = l4c_init_common_context();

#if defined(__GEMINI__)
    l4c_root_ptr_g = &l4c_root_cntxt_g;    
    ret_val = l4c_init_root_context();
#endif

#if defined(__MTK_TARGET__) && defined(DRV_GPIO_FOR_LED_AND_15_SEGMENT)
    gpio_led_init();
    gpio_15_segment_led_init();
#endif

    return ret_val;
}