2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-05-27 16:16:24 +02:00
|
|
|
* arch/arm/src/stm32f0l0g0/stm32_exti.h
|
2019-01-09 21:38:00 +01:00
|
|
|
*
|
2021-03-24 09:35:39 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2019-01-09 21:38:00 +01:00
|
|
|
*
|
2021-03-24 09:35:39 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2019-01-09 21:38:00 +01:00
|
|
|
*
|
2021-03-24 09:35:39 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2019-01-09 21:38:00 +01:00
|
|
|
*
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
2019-05-27 16:16:24 +02:00
|
|
|
#ifndef __ARCH_ARM_SRC_STM32F0L0G0_STM32_EXTI_H
|
|
|
|
#define __ARCH_ARM_SRC_STM32F0L0G0_STM32_EXTI_H
|
2019-01-09 21:38:00 +01:00
|
|
|
|
2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-01-09 21:38:00 +01:00
|
|
|
* Included Files
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <nuttx/irq.h>
|
|
|
|
|
|
|
|
#include "chip.h"
|
|
|
|
#include "hardware/stm32_exti.h"
|
|
|
|
|
2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-01-09 21:38:00 +01:00
|
|
|
* Public Data
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-01-09 21:38:00 +01:00
|
|
|
* Public Function Prototypes
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-01-09 21:38:00 +01:00
|
|
|
* Name: stm32_gpiosetevent
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Sets/clears GPIO based event and interrupt triggers.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* - pinset: gpio pin configuration
|
|
|
|
* - rising/falling edge: enables
|
|
|
|
* - event: generate event when set
|
|
|
|
* - func: when non-NULL, generate interrupt
|
|
|
|
* - arg: Argument passed to the interrupt callback
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) on success; a negated errno value on failure indicating the
|
|
|
|
* nature of the failure.
|
|
|
|
*
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
|
|
|
int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
|
|
|
|
bool event, xcpt_t func, void *arg);
|
|
|
|
|
2021-03-24 09:36:01 +01:00
|
|
|
/****************************************************************************
|
2019-01-09 21:38:00 +01:00
|
|
|
* Name: stm32_exti_alarm
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Sets/clears EXTI alarm interrupt.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* - rising/falling edge: enables interrupt on rising/falling edges
|
|
|
|
* - event: generate event when set
|
|
|
|
* - func: when non-NULL, generate interrupt
|
|
|
|
* - arg: Argument passed to the interrupt callback
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) on success; a negated errno value on failure indicating the
|
|
|
|
* nature of the failure.
|
|
|
|
*
|
2021-03-24 09:36:01 +01:00
|
|
|
****************************************************************************/
|
2019-01-09 21:38:00 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_RTC_ALARM
|
2021-03-24 09:36:01 +01:00
|
|
|
int stm32_exti_alarm(bool risingedge, bool fallingedge,
|
|
|
|
bool event, xcpt_t func,
|
2019-01-09 21:38:00 +01:00
|
|
|
void *arg);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: stm32_exti_wakeup
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Sets/clears EXTI wakeup interrupt.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* - rising/falling edge: enables interrupt on rising/falling edges
|
|
|
|
* - event: generate event when set
|
|
|
|
* - func: when non-NULL, generate interrupt
|
|
|
|
* - arg: Argument passed to the interrupt callback
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) on success; a negated errno value on failure indicating the
|
|
|
|
* nature of the failure.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_RTC_PERIODIC
|
|
|
|
int stm32_exti_wakeup(bool risingedge, bool fallingedge, bool event,
|
|
|
|
xcpt_t func, void *arg);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
2019-05-27 16:16:24 +02:00
|
|
|
#endif /* __ARCH_ARM_SRC_STM32F0L0G0_STM32_EXTI_H */
|