parent
6da5c4c144
commit
89bfc476b9
@ -0,0 +1,86 @@
|
||||
#ifndef _INTERRUPT_H_
|
||||
#define _INTERRUPT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
typedef void (*intHandler_t)(void);
|
||||
|
||||
typedef enum {
|
||||
|
||||
}intType_t;
|
||||
|
||||
/**
|
||||
* @brief Initialize Interrupt
|
||||
*
|
||||
* Initialize Interrupt by choosing the interrupt type, passing the functionpointer to the handler
|
||||
* and selecting the priority.
|
||||
* The interrupt will be automatically enabled and will be able to run after intEnableAll is
|
||||
* called. If the interrupt should only run at a specific even one can controll it by calling
|
||||
* intDissable prior to calling intEnableAll and calling intEnbale at a specific point and
|
||||
* dissabling it again with intDissable
|
||||
* When the desired interrupt occures the handler will be called.
|
||||
* The interrupt type and priority level is dependent on the architecture of the target MCU.
|
||||
* To find more information on what can be done one must read the documentation specific to the
|
||||
* target MCU.
|
||||
*
|
||||
* @param intType interrupt type
|
||||
* @param handler the interrupthandler
|
||||
* @param priority the interrupt priority
|
||||
*/
|
||||
void intInit(
|
||||
intType_t intType
|
||||
intHandler_t handler,
|
||||
uint8_t priority);
|
||||
|
||||
/**
|
||||
* @brief Enable all Interrupts
|
||||
*
|
||||
* Enables all interrupts globally.
|
||||
*
|
||||
*/
|
||||
void intEnableAll();
|
||||
|
||||
/**
|
||||
* @brief Dissable all Interrups
|
||||
*
|
||||
* Dissables all interrupts globally exept the non maskable ones given by the architecture of the
|
||||
* MCU.
|
||||
*/
|
||||
void intDissableAll();
|
||||
|
||||
/**
|
||||
* @brief Enable one interrupt type
|
||||
*
|
||||
* The Interrupt for the desired interrupt will be enabled. This means that interrupt of that
|
||||
* type will occure. To revert this intDissable musst be called.
|
||||
* It can be called when interrupts are are globally allowed or when dissabled.
|
||||
*
|
||||
* @param intType interrupt type
|
||||
*/
|
||||
void intEnable(
|
||||
intType_t intType);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Dissable one interrupt type
|
||||
*
|
||||
* The Interrupt for the desired interrupt will be dissabled. This means that no interrupt of that
|
||||
* type will occure. To revert this intEnable musst be called.
|
||||
* It can be called when interrupts are are globally allowed or when dissabled.
|
||||
* It will not stop other all interrupts in contrast to intDissableAll.
|
||||
*
|
||||
* @param intType interrupt type
|
||||
*/
|
||||
void intDissable(
|
||||
intType_t intType);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in new issue