# -*- coding: utf-8 -*-

# Nordic specific definitions
ROM_START = 0x00000000

NRF_POWER_BASE = 0x40000000
NRF_CLOCK_BASE = 0x40000000
NRF_MPU_BASE = 0x40000000
NRF_AMLI_BASE = 0x40000000
NRF_RADIO_BASE = 0x40001000
NRF_UART0_BASE = 0x40002000
NRF_SPI0_BASE = 0x40003000
NRF_TWI0_BASE = 0x40003000
NRF_SPI1_BASE = 0x40004000
NRF_TWI1_BASE = 0x40004000
NRF_SPIS1_BASE = 0x40004000
NRF_SPIM1_BASE = 0x40004000
NRF_GPIOTE_BASE = 0x40006000
NRF_ADC_BASE = 0x40007000
NRF_TIMER0_BASE = 0x40008000
NRF_TIMER1_BASE = 0x40009000
NRF_TIMER2_BASE = 0x4000A000
NRF_RTC0_BASE = 0x4000B000
NRF_TEMP_BASE = 0x4000C000
NRF_RNG_BASE = 0x4000D000
NRF_ECB_BASE = 0x4000E000
NRF_AAR_BASE = 0x4000F000
NRF_CCM_BASE = 0x4000F000
NRF_WDT_BASE = 0x40010000
NRF_RTC1_BASE = 0x40011000
NRF_QDEC_BASE = 0x40012000
NRF_LPCOMP_BASE = 0x40013000
NRF_SWI_BASE = 0x40014000
NRF_NVMC_BASE = 0x4001E000
NRF_PPI_BASE = 0x4001F000
NRF_FICR_BASE = 0x10000000
NRF_UICR_BASE = 0x10001000
NRF_GPIO_BASE = 0x50000000

RBPCONF = NRF_UICR_BASE + 0x04
FWID = NRF_UICR_BASE + 0x08
BOOTLOADERADDR = NRF_UICR_BASE + 0x14
UICR_CUSTOMER = NRF_UICR_BASE + 0x80
UICR_SIZE = 0x400

CODEPAGESIZE = NRF_FICR_BASE + 0x10
CODESIZE = NRF_FICR_BASE + 0x14
CLENR0 = NRF_FICR_BASE + 0x28
NUMRAMBLOCK = NRF_FICR_BASE + 0x34
DEVICEID_0 = NRF_FICR_BASE + 0x60
DEVICEID_1 = NRF_FICR_BASE + 0x64
FICR_SIZE = 0x400

PERR0 = NRF_MPU_BASE + 0x528
RLENR0 = NRF_MPU_BASE + 0x52C
PROTENSET0 = NRF_MPU_BASE + 0x600
PROTENSET1 = NRF_MPU_BASE + 0x604
DISABLEINDEBUG = NRF_MPU_BASE + 0x608
PROTBLOCKSIZE = NRF_MPU_BASE + 0x60C

NVMC_CONFIG = NRF_NVMC_BASE + 0x504
ERASEPCR1 = NRF_NVMC_BASE + 0x508
ERASEALL = NRF_NVMC_BASE + 0x50C
ERASEPCR0 = NRF_NVMC_BASE + 0x510
ERASEUICR = NRF_NVMC_BASE + 0x514
CONFIG_REN = 0x00
CONFIG_WEN = 0x01
CONFIG_EEN = 0x02

NRF_ECB_BASE = 0x4000E000
ECBDATAPTR = NRF_ECB_BASE + 0x504

CNFPTR = NRF_CCM_BASE + 0x508