From 691b360eb1b885e0d0631a916fcf6b9c9ffc6407 Mon Sep 17 00:00:00 2001 From: Steins7 Date: Thu, 27 Apr 2023 21:06:09 +0200 Subject: [PATCH] Create nvic's register map --- drivers/nvic_regs.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 drivers/nvic_regs.h 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_ +