diff --git a/drivers/nvic_regs.h b/drivers/nvic_regs.h new file mode 100644 index 0000000..7d9d02f --- /dev/null +++ b/drivers/nvic_regs.h @@ -0,0 +1,39 @@ +/** @file nvic_regs.h + * Module defining the Nested Vector Interrupt Controller (NVIC) registers. + * + * Mainly made to be used by the nvic module. It is recommanded to go through + * the functions provided by that module instead of directly using the registers + * defined here. + */ + +#ifndef _NVIC_REGS_H_ +#define _NVIC_REGS_H_ + +//--includes-------------------------------------------------------------------- + +#include "stdint.h" + + +//--type definitions------------------------------------------------------------ + +#define NVIC1_BASE_ADDRESS 0xE000E100 +#define NVIC2_BASE_ADDRESS 0xE000EF00 + +struct __attribute__((packed)) NVIC1 { + uint32_t ISERX[3]; + uint32_t ICERX[3]; + uint32_t ISPRX[3]; + uint32_t ICPRX[3]; + uint32_t IABRX[3]; + uint32_t IPRX[20]; +}; + +struct __attribute__((packed)) NVIC2 { + uint32_t INTID; +}; + + +//--functions------------------------------------------------------------------- + +#endif //_NVIC_REGS_H_ +