| | |
| | | #include "dw_driver.h" |
| | | #include "deca_device_api.h" |
| | | |
| | | void Reset_DW1000(void) |
| | | { |
| | |
| | | EXTI_InitStructure.EXTI_Line = DECAIRQ_EXTI; |
| | | EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; |
| | | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; //MPW3 IRQ polarity is high by default |
| | | EXTI_InitStructure.EXTI_LineCmd = DISABLE; |
| | | EXTI_InitStructure.EXTI_LineCmd = ENABLE; |
| | | EXTI_Init(&EXTI_InitStructure); |
| | | |
| | | } |
| | | |
| | | //读åå¤é¨ä¸æç¶æ |
| | | ITStatus Get_Ext_IRQ_Statues(void) |
| | | { |
| | | return EXTI_GetITStatus(DECAIRQ_EXTI); |
| | | } |
| | | |
| | | |
| | | //使è½å¤é¨ä¸æ |
| | |
| | | //ç¦æ¢å¤é¨ä¸æ |
| | | void Disable_Ext_IRQ(void) |
| | | { |
| | | NVIC_DisnableIRQ(DECAIRQ_EXTI_IRQn); |
| | | NVIC_DisableIRQ(DECAIRQ_EXTI_IRQn); |
| | | } |
| | | |
| | | /*! ------------------------------------------------------------------------------------------------------------------ |
| | |
| | | */ |
| | | decaIrqStatus_t decamutexon(void) |
| | | { |
| | | decaIrqStatus_t s = port_GetEXT_IRQStatus(); |
| | | decaIrqStatus_t s = Get_Ext_IRQ_Statues(); |
| | | |
| | | if(s) |
| | | { |
| | | port_DisableEXT_IRQ(); //disable the external interrupt line |
| | | Disable_Ext_IRQ(); //disable the external interrupt line |
| | | } |
| | | return s ; // return state before disable, value is used to re-enable in decamutexoff call |
| | | } |
| | |
| | | { |
| | | if(s) //need to check the port state as we can't use level sensitive interrupt on the STM ARM |
| | | { |
| | | port_EnableEXT_IRQ(); |
| | | Enable_Ext_IRQ(); |
| | | } |
| | | } |
| | | } |
| | | |