efm32 tinygecko: defined interrupts
there seems not to be anything family specific about the interrupt vectors of m3 based efm32 systems, thus renaming vector.h to irq.h
This commit is contained in:
parent
be62115f00
commit
f6025af859
36
include/libopencm3/efm32/tinygecko/irq.h
Normal file
36
include/libopencm3/efm32/tinygecko/irq.h
Normal file
@ -0,0 +1,36 @@
|
||||
/** @file
|
||||
*
|
||||
* Definitions of interrupt names on EFM32 Tiny Gecko systems
|
||||
*
|
||||
* The names and numbers are taken from d0034_efm32tg_reference_manual.pdf table 4.1.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENCM3_EFM32_TINYGECKO_VECTOR_H
|
||||
#define LIBOPENCM3_EFM32_TINYGECKO_VECTOR_H
|
||||
|
||||
#define IRQ_DMA 0
|
||||
#define IRQ_GPIO_EVEN 1
|
||||
#define IRQ_TIMER0 2
|
||||
#define IRQ_USART0_RX 3
|
||||
#define IRQ_USART0_TX 4
|
||||
#define IRQ_ACMP01 5
|
||||
#define IRQ_ADC0 6
|
||||
#define IRQ_DAC0 7
|
||||
#define IRQ_I2C0 8
|
||||
#define IRQ_GPIO_ODD 9
|
||||
#define IRQ_TIMER1 10
|
||||
#define IRQ_USART1_RX 11
|
||||
#define IRQ_USART1_TX 12
|
||||
#define IRQ_LESENSE 13
|
||||
#define IRQ_LEUART0 14
|
||||
#define IRQ_LETIMER0 15
|
||||
#define IRQ_PCNT0 16
|
||||
#define IRQ_RTC 17
|
||||
#define IRQ_CMU 18
|
||||
#define IRQ_VCMP 19
|
||||
#define IRQ_LCD 20
|
||||
#define IRQ_MSC 21
|
||||
#define IRQ_AES 22
|
||||
#define IRQ_COUNT 23 /**< See also d0002_efm32_cortex-m3_reference_manual.pdf's table 1.1's "number of interrupts" line, which shows that there are really no more interrupts and it is sufficient to allocate only 23 slots. */
|
||||
|
||||
#endif
|
@ -1,15 +0,0 @@
|
||||
/** @file
|
||||
*
|
||||
* Definitions for vector tables on Tiny Gecko systems.
|
||||
*
|
||||
* @see include/libopencm3/efm32/vector.h
|
||||
*
|
||||
* @todo The definitions of the individual IRQs will go here too.
|
||||
* */
|
||||
|
||||
#ifndef LIBOPENCM3_EFM32_TINYGECKO_VECTOR_H
|
||||
#define LIBOPENCM3_EFM32_TINYGECKO_VECTOR_H
|
||||
|
||||
#define EFM32_VECTOR_NIRQ 23 /**< See d0002_efm32_cortex-m3_reference_manual.pdf's table 1.1's "number of interrupts" line */
|
||||
|
||||
#endif
|
@ -7,6 +7,9 @@
|
||||
* The structure of the vector table is implemented independently of the system
|
||||
* vector table starting at memory position 0x0, as it can be relocated to
|
||||
* other memory locations too.
|
||||
*
|
||||
* The exact size of a vector interrupt table depends on the number of
|
||||
* interrupts IRQ_COUNT, which is defined per family.
|
||||
*/
|
||||
|
||||
#ifndef LIBOPENCM3_EFM32_VECTOR_H
|
||||
@ -15,12 +18,14 @@
|
||||
#include <libopencm3/cm3/common.h>
|
||||
|
||||
#ifdef TINYGECKO
|
||||
# include <libopencm3/efm32/tinygecko/vector.h>
|
||||
# include <libopencm3/efm32/tinygecko/irq.h>
|
||||
#else
|
||||
# error "efm32 family not defined."
|
||||
#endif
|
||||
|
||||
typedef void (*efm32_vector_table_entry_t)(void); /**< Type of an interrupt function. Only used to avoid hard-to-read function pointers in the efm32_vector_table_t struct. */
|
||||
/** Type of an interrupt function. Only used to avoid hard-to-read function
|
||||
* pointers in the efm32_vector_table_t struct. */
|
||||
typedef void (*efm32_vector_table_entry_t)(void);
|
||||
|
||||
typedef struct {
|
||||
unsigned int *initial_sp_value; /**< The value the stack pointer is set to initially */
|
||||
@ -36,7 +41,7 @@ typedef struct {
|
||||
efm32_vector_table_entry_t reserved_x0034;
|
||||
efm32_vector_table_entry_t pend_sv;
|
||||
efm32_vector_table_entry_t systick;
|
||||
efm32_vector_table_entry_t irq[EFM32_VECTOR_NIRQ];
|
||||
efm32_vector_table_entry_t irq[IRQ_COUNT];
|
||||
} efm32_vector_table_t;
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user