hsk_libs-dev  163:b63ae088cc97
High Speed Karlsruhe XC878 library collection
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
hsk_ex.h File Reference

HSK External Interrupt Routing headers. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EX_EXINT0   0
 External interrupt channel EXINT0. More...
 
#define EX_EXINT1   1
 External interrupt channel EXINT1. More...
 
#define EX_EXINT2   2
 External interrupt channel EXINT2. More...
 
#define EX_EXINT3   3
 External interrupt channel EXINT3. More...
 
#define EX_EXINT4   4
 External interrupt channel EXINT4. More...
 
#define EX_EXINT5   5
 External interrupt channel EXINT5. More...
 
#define EX_EXINT6   6
 External interrupt channel EXINT6. More...
 
#define EX_EDGE_RISING   0
 Trigger interrupt on rising edge. More...
 
#define EX_EDGE_FALLING   1
 Trigger interrupt on falling edge. More...
 
#define EX_EDGE_BOTH   2
 Trigger interrupt on both edges. More...
 
#define EX_EXINT0_P05   0
 External interrupt EXINT0 input port P0.5. More...
 
#define EX_EXINT3_P11   1
 External interrupt EXINT3 input port P1.1. More...
 
#define EX_EXINT0_P14   2
 External interrupt EXINT0 input port P1.4. More...
 
#define EX_EXINT5_P15   3
 External interrupt EXINT5 input port P1.5. More...
 
#define EX_EXINT6_P16   4
 External interrupt EXINT6 input port P1.6. More...
 
#define EX_EXINT3_P30   5
 External interrupt EXINT3 input port P3.0. More...
 
#define EX_EXINT4_P32   6
 External interrupt EXINT4 input port P3.2. More...
 
#define EX_EXINT5_P33   7
 External interrupt EXINT5 input port P3.3. More...
 
#define EX_EXINT6_P34   8
 External interrupt EXINT6 input port P3.4. More...
 
#define EX_EXINT4_P37   9
 External interrupt EXINT4 input port P3.7. More...
 
#define EX_EXINT3_P40   10
 External interrupt EXINT3 input port P4.0. More...
 
#define EX_EXINT4_P41   11
 External interrupt EXINT4 input port P4.1. More...
 
#define EX_EXINT6_P42   12
 External interrupt EXINT6 input port P4.2. More...
 
#define EX_EXINT5_P44   13
 External interrupt EXINT5 input port P4.4. More...
 
#define EX_EXINT6_P45   14
 External interrupt EXINT6 input port P4.5. More...
 
#define EX_EXINT1_P50   15
 External interrupt EXINT1 input port P5.0. More...
 
#define EX_EXINT2_P51   16
 External interrupt EXINT2 input port P5.1. More...
 
#define EX_EXINT5_P52   17
 External interrupt EXINT5 input port P5.2. More...
 
#define EX_EXINT1_P53   18
 External interrupt EXINT1 input port P5.3. More...
 
#define EX_EXINT2_P54   19
 External interrupt EXINT2 input port P5.4. More...
 
#define EX_EXINT3_P55   20
 External interrupt EXINT3 input port P5.5. More...
 
#define EX_EXINT4_P56   21
 External interrupt EXINT4 input port P5.6. More...
 
#define EX_EXINT6_P57   22
 External interrupt EXINT6 input port P5.7. More...
 

Typedefs

typedef ubyte hsk_ex_channel
 Typedef for externel interrupt channels. More...
 
typedef ubyte hsk_ex_port
 Typedef for externel interrupt ports. More...
 

Functions

void hsk_ex_channel_enable (const hsk_ex_channel channel, const ubyte edge, const void(*const callback)(void))
 Enable an external interrupt channel. More...
 
void hsk_ex_channel_disable (const hsk_ex_channel channel)
 Disables an external interrupt channel. More...
 
void hsk_ex_port_open (const hsk_ex_port port)
 Opens an input port for an external interrupt. More...
 
void hsk_ex_port_close (const hsk_ex_port port)
 Disconnects an input port from an external interrupt. More...
 

Detailed Description

HSK External Interrupt Routing headers.

This file offers functions to activate external interrupts and connect them to the available input pins.

Author
kami

Typedef Documentation

typedef ubyte hsk_ex_channel

Typedef for externel interrupt channels.

typedef ubyte hsk_ex_port

Typedef for externel interrupt ports.

Function Documentation

void hsk_ex_channel_disable ( const hsk_ex_channel  channel)

Disables an external interrupt channel.

Parameters
channelThe channel to disable, one of External Interrupt Channels
void hsk_ex_channel_enable ( const hsk_ex_channel  channel,
const ubyte  edge,
const void(*)(void)  callback 
)

Enable an external interrupt channel.

It is good practice to enable a port for the channel first, because port changes on an active interrupt may cause an undesired interrupt.

The callback function can be set to 0 if a change of the function is not desired. For channels EXINT0 and EXINT1 the callback is ignored, implement interrupts 0 and 2 instead.

Parameters
channelThe channel to activate, one of External Interrupt Channels
edgeThe triggering edge, one of External Interrupt Triggers
callbackThe callback function for an interrupt event

Setting up EXINT0/1 is somewhat confusing. Refer to UM 1.1 section 5.6.2 to make sense of this.

void hsk_ex_port_close ( const hsk_ex_port  port)

Disconnects an input port from an external interrupt.

Parameters
portThe port to close, one of External Interrupt Input Ports
void hsk_ex_port_open ( const hsk_ex_port  port)

Opens an input port for an external interrupt.

Parameters
portThe port to open, one of External Interrupt Input Ports