Ejemplo n.º 1
0
/* ===================================================================*/
void ExtIntLdd1_Enable(LDD_TDeviceData *DeviceDataPtr)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  PORT_PDD_ClearPinInterruptFlag(PORTC_BASE_PTR, ExtIntLdd1_PIN_INDEX);
  PORT_PDD_SetPinInterruptConfiguration(PORTC_BASE_PTR,
    ExtIntLdd1_PIN_INDEX, PORT_PDD_INTERRUPT_ON_RISING);
}
Ejemplo n.º 2
0
/*
** ===================================================================
**     Method      :  ExtIntLdd7_Enable (component ExtInt_LDD)
**
**     Description :
**         Enable the component - the external events are accepted.
**         This method is available only if HW module allows
**         enable/disable of the interrupt.
**     Parameters  :
**         NAME            - DESCRIPTION
**       * DeviceDataPtr   - Device data structure
**                           pointer returned by <Init> method.
**     Returns     : Nothing
** ===================================================================
*/
void ExtIntLdd7_Enable(LDD_TDeviceData *DeviceDataPtr)
{
  ExtIntLdd7_TDeviceData *DeviceDataPrv = (ExtIntLdd7_TDeviceData *)DeviceDataPtr;
  PORT_PDD_ClearPinInterruptFlag(ExtIntLdd7_PORTCONTROL_BASE_ADDRESS, ExtIntLdd7_PIN_INDEX);
  PORT_PDD_SetPinInterruptConfiguration(ExtIntLdd7_PORTCONTROL_BASE_ADDRESS,\
                                        ExtIntLdd7_PIN_INDEX, ExtIntLdd7_IRQ_CONFIG);

  DeviceDataPrv->UserEnabled = TRUE;   /* Set device as Enabled */
}
Ejemplo n.º 3
0
/*
** ===================================================================
**     Event       :  SW3_OnInterrupt (module Events)
**
**     Component   :  SW3 [ExtInt]
**     Description :
**         This event is called when an active signal edge/level has
**         occurred.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void SW3_OnInterrupt(void)
{
#ifdef PL_HAS_KBI
	if (PORT_PDD_GetPinInterruptFlag(PORTA_BASE_PTR, ExtIntLdd3_PIN_INDEX))
	{
		PORT_PDD_ClearPinInterruptFlag(PORTA_BASE_PTR, ExtIntLdd3_PIN_INDEX);
		KEY_OnInterrupt(KEY_BTN3);
	}
#endif
}
Ejemplo n.º 4
0
/*
** ===================================================================
**     Method      :  ExtIntLdd5_Interrupt (component ExtInt_LDD)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes event(s) of the component.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void ExtIntLdd5_Interrupt(void)
{
  /* {Default RTOS Adapter} ISR parameter is passed through the global variable */
  ExtIntLdd5_TDeviceDataPtr DeviceDataPrv = INT_PORTE__DEFAULT_RTOS_ISRPARAM;

  /* Check the pin interrupt flag of the shared interrupt */
  if (PORT_PDD_GetPinInterruptFlag(PORTE_BASE_PTR, ExtIntLdd5_PIN_INDEX)) {
    /* Clear the interrupt flag */
    PORT_PDD_ClearPinInterruptFlag(PORTE_BASE_PTR, ExtIntLdd5_PIN_INDEX);
    /* Call OnInterrupt event */
    ExtIntLdd5_OnInterrupt(DeviceDataPrv->UserData);
  }
}
Ejemplo n.º 5
0
/*
** ===================================================================
**     Event       :  SW3_OnInterrupt (module Events)
**
**     Component   :  SW3 [ExtInt]
**     Description :
**         This event is called when an active signal edge/level has
**         occurred.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void SW3_OnInterrupt(void)
{
#if PL_HAS_KBI
#if 1 /* Problem with Processor Expert and sharing PTA4/NMI interrupt: code below is missing in ExtIntLdd3_OnInterrupt() */
  /* Check the pin interrupt flag of the shared interrupt */
  if (PORT_PDD_GetPinInterruptFlag(PORTA_BASE_PTR, ExtIntLdd4_PIN_INDEX)) {
    /* Clear the interrupt flag */
    PORT_PDD_ClearPinInterruptFlag(PORTA_BASE_PTR, ExtIntLdd4_PIN_INDEX);
    /* call user event */
    KEY_OnInterrupt(KEY_BTN3);
  }
#else
  if (KEY3_Get()) {
    KEY_OnInterrupt(KEY_BTN3);
  }
#endif
#endif
}
Ejemplo n.º 6
0
/*
** ===================================================================
**     Method      :  ExtIntLdd7_Interrupt (component ExtInt_LDD)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes event(s) of the component.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void ExtIntLdd7_Interrupt(void)
{
  /* {Default RTOS Adapter} ISR parameter is passed through the global variable */
  ExtIntLdd7_TDeviceDataPtr DeviceDataPrv = INT_PORTD__DEFAULT_RTOS_ISRPARAM;

  /* Check if device is disabled */
  if( !DeviceDataPrv->UserEnabled ){
    return;
  }

  /* Check the pin interrupt flag of the shared interrupt */
  if (PORT_PDD_GetPinInterruptFlag(ExtIntLdd7_PORTCONTROL_BASE_ADDRESS, ExtIntLdd7_PIN_INDEX)) {

    /* Clear the interrupt flag */
    PORT_PDD_ClearPinInterruptFlag(ExtIntLdd7_PORTCONTROL_BASE_ADDRESS, ExtIntLdd7_PIN_INDEX);

    /* Call OnInterrupt event */
    ExtIntLdd7_OnInterrupt(DeviceDataPrv->UserData);
  }
}
Ejemplo n.º 7
0
void testa4() {
	if (PORT_PDD_GetPinInterruptFlag(PORTD_BASE_PTR, 3) ) {
		COLUNA_PutVal(0b110);
		if (GPIO_PDD_GetPortDataInput(LINHA_DEVICE) & GPIO_PIN(3)) {
			COLUNA_PutVal(0b101);
			if (GPIO_PDD_GetPortDataInput (LINHA_DEVICE) & GPIO_PIN(3)) {
				COLUNA_PutVal(0b011);
				if (GPIO_PDD_GetPortDataInput(LINHA_DEVICE) & GPIO_PIN(3)) {
					keypad_valor = '!';
				} else {
					keypad_valor = '*';
				}
			} else {
				keypad_valor = '0';
			}
		} else {
			keypad_valor = '#';
		}
		COLUNA_PutVal(0b000);
		PORT_PDD_ClearPinInterruptFlag(PORTD_BASE_PTR, 3);
	}
}