include/drivers: Move 2 specific intc headers into public location
sam0 and stm32 specific interrupt controller headers are meant to be public, and as such should be found in include/drivers/interrupt_controller and not in drivers/interrupt_controllers. Fixing documentation issues as well. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
4ada2f65d2
commit
9abc0e2efd
6 changed files with 10 additions and 8 deletions
|
@ -19,7 +19,7 @@
|
|||
#include <device.h>
|
||||
#include <soc.h>
|
||||
#include <sys/__assert.h>
|
||||
#include "intc_exti_stm32.h"
|
||||
#include <drivers/interrupt_controller/exti_stm32.h>
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_STM32F0X) || \
|
||||
defined(CONFIG_SOC_SERIES_STM32L0X) || \
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Open-RnD Sp. z o.o.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Driver for External interrupt/event controller in STM32 MCUs
|
||||
*
|
||||
* Based on reference manuals:
|
||||
* RM0008 Reference Manual: STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx
|
||||
* and STM32F107xx advanced ARM(r)-based 32-bit MCUs
|
||||
* and
|
||||
* RM0368 Reference manual STM32F401xB/C and STM32F401xD/E
|
||||
* advanced ARM(r)-based 32-bit MCUs
|
||||
*
|
||||
* Chapter 10.2: External interrupt/event controller (EXTI)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_EXTI_STM32_H_
|
||||
#define ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_EXTI_STM32_H_
|
||||
|
||||
#include <zephyr/types.h>
|
||||
|
||||
/* device name */
|
||||
#define STM32_EXTI_NAME "stm32-exti"
|
||||
|
||||
/**
|
||||
* @brief enable EXTI interrupt for specific line
|
||||
*
|
||||
* @param line EXTI# line
|
||||
*/
|
||||
int stm32_exti_enable(int line);
|
||||
|
||||
/**
|
||||
* @brief disable EXTI interrupt for specific line
|
||||
*
|
||||
* @param line EXTI# line
|
||||
*/
|
||||
void stm32_exti_disable(int line);
|
||||
|
||||
/**
|
||||
* @brief EXTI trigger flags
|
||||
*/
|
||||
enum stm32_exti_trigger {
|
||||
/* trigger on rising edge */
|
||||
STM32_EXTI_TRIG_RISING = 0x1,
|
||||
/* trigger on falling endge */
|
||||
STM32_EXTI_TRIG_FALLING = 0x2,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief set EXTI interrupt line triggers
|
||||
*
|
||||
* @param line EXTI# line
|
||||
* @param trg OR'ed stm32_exti_trigger flags
|
||||
*/
|
||||
void stm32_exti_trigger(int line, int trg);
|
||||
|
||||
/* callback for exti interrupt */
|
||||
typedef void (*stm32_exti_callback_t) (int line, void *user);
|
||||
|
||||
/**
|
||||
* @brief set EXTI interrupt callback
|
||||
*
|
||||
* @param line EXI# line
|
||||
* @param cb user callback
|
||||
* @param arg user arg
|
||||
*/
|
||||
int stm32_exti_set_callback(int line, int port, stm32_exti_callback_t cb,
|
||||
void *data);
|
||||
|
||||
/**
|
||||
* @brief unset EXTI interrupt callback
|
||||
*
|
||||
* @param line EXI# line
|
||||
*/
|
||||
void stm32_exti_unset_callback(int line);
|
||||
|
||||
#endif /* ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_EXTI_STM32_H_ */
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <device.h>
|
||||
#include <soc.h>
|
||||
#include "intc_sam0_eic.h"
|
||||
#include <drivers/interrupt_controller/sam0_eic.h>
|
||||
#include "intc_sam0_eic_priv.h"
|
||||
|
||||
struct sam0_eic_line_assignment {
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Derek Hageman <hageman@inthat.cloud>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_H_
|
||||
#define ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_H_
|
||||
|
||||
#include <zephyr/types.h>
|
||||
|
||||
/* callback for EIC interrupt */
|
||||
typedef void (*sam0_eic_callback_t)(u32_t pins, void *data);
|
||||
|
||||
/**
|
||||
* @brief EIC trigger condition
|
||||
*/
|
||||
enum sam0_eic_trigger {
|
||||
/* Rising edge */
|
||||
SAM0_EIC_RISING,
|
||||
/* Falling edge */
|
||||
SAM0_EIC_FALLING,
|
||||
/* Both edges */
|
||||
SAM0_EIC_BOTH,
|
||||
/* High level detection */
|
||||
SAM0_EIC_HIGH,
|
||||
/* Low level detection */
|
||||
SAM0_EIC_LOW,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Acquire an EIC interrupt for specific port and pin combination
|
||||
*
|
||||
* This acquires the EIC interrupt for a specific port and pin combination,
|
||||
* or returns an error if the required line is not available. Only a single
|
||||
* callback per port is supported and supplying a different one will
|
||||
* change it for all lines on that port.
|
||||
*
|
||||
* @param port port index (A=0, etc)
|
||||
* @param pin pin in the port
|
||||
* @param trigger trigger condition
|
||||
* @param cb interrupt callback
|
||||
* @param data parameter to the interrupt callback
|
||||
*/
|
||||
int sam0_eic_acquire(int port, int pin, enum sam0_eic_trigger trigger,
|
||||
bool filter, sam0_eic_callback_t cb, void *data);
|
||||
|
||||
/**
|
||||
* @brief Release the EIC interrupt for a specific port and pin combination
|
||||
*
|
||||
* Release the EIC configuration for a specific port and pin combination.
|
||||
* No effect if that combination does not currently hold the associated
|
||||
* EIC line.
|
||||
*
|
||||
* @param port port index (A=0, etc)
|
||||
* @param pin pin in the port
|
||||
*/
|
||||
int sam0_eic_release(int port, int pin);
|
||||
|
||||
/**
|
||||
* @brief Enable the EIC interrupt for a specific port and pin combination
|
||||
*
|
||||
* @param port port index (A=0, etc)
|
||||
* @param pin pin in the port
|
||||
*/
|
||||
int sam0_eic_enable_interrupt(int port, int pin);
|
||||
|
||||
/**
|
||||
* @brief Disable the EIC interrupt for a specific port and pin combination
|
||||
*
|
||||
* @param port port index (A=0, etc)
|
||||
* @param pin pin in the port
|
||||
*/
|
||||
int sam0_eic_disable_interrupt(int port, int pin);
|
||||
|
||||
/**
|
||||
* @brief Test if there is an EIC interrupt pending for a port
|
||||
*
|
||||
* @param port port index (A=0, etc)
|
||||
*/
|
||||
u32_t sam0_eic_interrupt_pending(int por);
|
||||
|
||||
#endif /* ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue