Exemplo n.º 1
0
/**
  * @brief  This function handles EXTI Lines 4 to 15 interrupts requests.
  * @param  None
  * @retval None
  */
void EXTI4_15_IRQHandler(void)
{  
  STM_EVAL_LEDOff(LED1);
  STM_EVAL_LEDOff(LED2);
  STM_EVAL_LEDOff(LED3);
  STM_EVAL_LEDOff(LED4);

  /* Generate rising edge on Joystick button to detect when we push Joystick button to initiate 
  transmission */
  if(EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET)
  {
    /* Build the Header block to send */
    HeaderBlockValueToSend = (((MyLogicalAddress1 & 0xF) << 4)|(MyFollowerAddress1 & 0xF));

    /* Clear RIGHT Button EXTI line pending bit */
    EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE);
  }
  else if(EXTI_GetITStatus(LEFT_BUTTON_EXTI_LINE) != RESET)
  {
    /* Build the Header block to send */
    HeaderBlockValueToSend = (((MyLogicalAddress1 & 0xF) << 4)|(MyFollowerAddress2 & 0xF));

    /* Clear LEFT Button EXTI line pending bit */
    EXTI_ClearITPendingBit(LEFT_BUTTON_EXTI_LINE);
  }

  /* Write single Data in the TX Buffer to Transmit through the CEC peripheral */
  CEC_SendData(HeaderBlockValueToSend);

  /* Initiate Message Transmission */
  CEC_StartOfMessage();
}
Exemplo n.º 2
0
/**
  * @brief  This function handles EXTI Lines 4 to 15 interrupts requests.
  * @param  None
  * @retval None
  */
void EXTI4_15_IRQHandler(void)
{
  
  for (send_inc=0;send_inc<10;send_inc++)
  {
    TransmitBuffer[send_inc]=0;
  }

  send_inc =0;
  STM_EVAL_LEDOff(LED1);
  STM_EVAL_LEDOff(LED2);
  STM_EVAL_LEDOff(LED3);
  STM_EVAL_LEDOff(LED4);

  /* Generate rising edge on Joystick button to detect when we push Joystick button to initiate 
  transmission */
  if(EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET)
  {
    TransmitBuffer[send_inc++] = 0x46;
    ByteNumber = 0x02;

    /* Clear RIGHT Button EXTI line pending bit */
    EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE);
  }
  else if(EXTI_GetITStatus(LEFT_BUTTON_EXTI_LINE) != RESET)
  {
    TransmitBuffer[send_inc++] = 0x9F;
    ByteNumber = 0x02;

    /* Clear LEFT Button EXTI line pending bit */
    EXTI_ClearITPendingBit(LEFT_BUTTON_EXTI_LINE);
  }
  else
    if(EXTI_GetITStatus(UP_BUTTON_EXTI_LINE) != RESET)
  {
    TransmitBuffer[send_inc++] = 0x44;
    TransmitBuffer[send_inc++] = 0x41;
    ByteNumber = 0x03;

    /* Clear UP Button EXTI line pending bit */
    EXTI_ClearITPendingBit(UP_BUTTON_EXTI_LINE);
  }
  else if(EXTI_GetITStatus(DOWN_BUTTON_EXTI_LINE) != RESET)
  {
    TransmitBuffer[send_inc++] = 0x44;
    TransmitBuffer[send_inc++] = 0x42;
    ByteNumber = 0x03;

    /* Clear DOWN Button EXTI line pending bit */
    EXTI_ClearITPendingBit(DOWN_BUTTON_EXTI_LINE);
  }
  
  send_inc =0;
  /* Write single Data in the TX Buffer to Transmit through the CEC peripheral */
  CEC_SendData(HeaderBlockValueToSend);

  /* Initiate Message Transmission */
  CEC_StartOfMessage();
}
Exemplo n.º 3
0
/**
  * @brief  This function handles EXTI4_15 interrupt request.
  * @param  None
  * @retval None
  */
void EXTI4_15_IRQHandler(void)
{
    /* Get the button interrupt bit state */
    if(EXTI_GetIntBitState(EXTI_LINE7) != RESET)
    {
        ByteNumber = 2;
        CEC_SendData(0x12);
        SendBuffer = TransmitBuffer1;
        CEC_StartOfMessage();
        EXTI_ClearIntBitState(EXTI_LINE7);
    }
    /* Get the button interrupt bit state */
    else if(EXTI_GetIntBitState(EXTI_LINE13) != RESET)
    {
        ByteNumber = 2;
        CEC_SendData(0x12);
        SendBuffer = TransmitBuffer2;
        CEC_StartOfMessage();
        EXTI_ClearIntBitState(EXTI_LINE13);
    }
}
Exemplo n.º 4
0
/**
  * @brief  This function handles External lines 15 to 10 interrupt request.
  * @param  None
  * @retval None
  */
void EXTI15_10_IRQHandler(void)
{
  if(EXTI_GetITStatus(EXTI_Line13) != RESET)
  {
    Tab_Tx[0] = 0x44;
    Tab_Tx[1] = 0x42;
    TxSize    = 0x03; 
    EXTI_ClearITPendingBit(EXTI_Line13);
  }

  /* Write single Data in the TX Buffer to Transmit through the CEC peripheral */
  CEC_SendData(HeaderBlockValueToSend);

  /* Initiate Message Transmission */
  CEC_StartOfMessage();
}