Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Jul 08 11:22:30 2015 +0100
Revision:
102:da0ca467f8b5
Release 102 of the mbed library

Changes:
- new platform: MPS2
- K64f - mac address fix
- Freescale Kinetis - Serial NC handling fix
- Asynch constnes fixes
- startup files .s - change extension to .S
- APPNEARME_MICRONFCBOARD rename to MICRONFCBOARD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 102:da0ca467f8b5 1 /* mbed Microcontroller Library - Vectors
Kojto 102:da0ca467f8b5 2 * Copyright (c) 2006-2015 ARM Limited. All rights reserved.
Kojto 102:da0ca467f8b5 3 */
Kojto 102:da0ca467f8b5 4
Kojto 102:da0ca467f8b5 5 #ifndef MBED_VECTOR_DEFNS_H
Kojto 102:da0ca467f8b5 6 #define MBED_VECTOR_DEFNS_H
Kojto 102:da0ca467f8b5 7
Kojto 102:da0ca467f8b5 8 // Assember Macros
Kojto 102:da0ca467f8b5 9 #ifdef __ARMCC_VERSION
Kojto 102:da0ca467f8b5 10 #define EXPORT(x) EXPORT x
Kojto 102:da0ca467f8b5 11 #define WEAK_EXPORT(x) EXPORT x [WEAK]
Kojto 102:da0ca467f8b5 12 #define IMPORT(x) IMPORT x
Kojto 102:da0ca467f8b5 13 #define LABEL(x) x
Kojto 102:da0ca467f8b5 14 #else
Kojto 102:da0ca467f8b5 15 #define EXPORT(x) .global x
Kojto 102:da0ca467f8b5 16 #define WEAK_EXPORT(x) .weak x
Kojto 102:da0ca467f8b5 17 #define IMPORT(x) .global x
Kojto 102:da0ca467f8b5 18 #define LABEL(x) x:
Kojto 102:da0ca467f8b5 19 #endif
Kojto 102:da0ca467f8b5 20
Kojto 102:da0ca467f8b5 21 // RealMonitor
Kojto 102:da0ca467f8b5 22 // Requires RAM (0x40000040-0x4000011F) to be allocated by the linker
Kojto 102:da0ca467f8b5 23
Kojto 102:da0ca467f8b5 24 // RealMonitor entry points
Kojto 102:da0ca467f8b5 25 #define rm_init_entry 0x7fffff91
Kojto 102:da0ca467f8b5 26 #define rm_undef_handler 0x7fffffa0
Kojto 102:da0ca467f8b5 27 #define rm_prefetchabort_handler 0x7fffffb0
Kojto 102:da0ca467f8b5 28 #define rm_dataabort_handler 0x7fffffc0
Kojto 102:da0ca467f8b5 29 #define rm_irqhandler2 0x7fffffe0
Kojto 102:da0ca467f8b5 30 //#define rm_RunningToStopped 0x7ffff808 // ARM - MBED64
Kojto 102:da0ca467f8b5 31 #define rm_RunningToStopped 0x7ffff820 // ARM - PHAT40
Kojto 102:da0ca467f8b5 32
Kojto 102:da0ca467f8b5 33 // Unofficial RealMonitor entry points and variables
Kojto 102:da0ca467f8b5 34 #define RM_MSG_SWI 0x00940000
Kojto 102:da0ca467f8b5 35 #define StateP 0x40000040
Kojto 102:da0ca467f8b5 36
Kojto 102:da0ca467f8b5 37 // VIC register addresses
Kojto 102:da0ca467f8b5 38 #define VIC_Base 0xfffff000
Kojto 102:da0ca467f8b5 39 #define VICAddress_Offset 0xf00
Kojto 102:da0ca467f8b5 40 #define VICVectAddr0_Offset 0x100
Kojto 102:da0ca467f8b5 41 #define VICVectAddr2_Offset 0x108
Kojto 102:da0ca467f8b5 42 #define VICVectAddr3_Offset 0x10c
Kojto 102:da0ca467f8b5 43 #define VICVectAddr31_Offset 0x17c
Kojto 102:da0ca467f8b5 44 #define VICIntEnClr_Offset 0x014
Kojto 102:da0ca467f8b5 45 #define VICIntEnClr (*(volatile unsigned long *)(VIC_Base + 0x014))
Kojto 102:da0ca467f8b5 46 #define VICVectAddr2 (*(volatile unsigned long *)(VIC_Base + 0x108))
Kojto 102:da0ca467f8b5 47 #define VICVectAddr3 (*(volatile unsigned long *)(VIC_Base + 0x10C))
Kojto 102:da0ca467f8b5 48
Kojto 102:da0ca467f8b5 49 // ARM Mode bits and Interrupt flags in PSRs
Kojto 102:da0ca467f8b5 50 #define Mode_USR 0x10
Kojto 102:da0ca467f8b5 51 #define Mode_FIQ 0x11
Kojto 102:da0ca467f8b5 52 #define Mode_IRQ 0x12
Kojto 102:da0ca467f8b5 53 #define Mode_SVC 0x13
Kojto 102:da0ca467f8b5 54 #define Mode_ABT 0x17
Kojto 102:da0ca467f8b5 55 #define Mode_UND 0x1B
Kojto 102:da0ca467f8b5 56 #define Mode_SYS 0x1F
Kojto 102:da0ca467f8b5 57 #define I_Bit 0x80 // when I bit is set, IRQ is disabled
Kojto 102:da0ca467f8b5 58 #define F_Bit 0x40 // when F bit is set, FIQ is disabled
Kojto 102:da0ca467f8b5 59
Kojto 102:da0ca467f8b5 60 // MCU RAM
Kojto 102:da0ca467f8b5 61 #define LPC2460_RAM_ADDRESS 0x40000000 // RAM Base
Kojto 102:da0ca467f8b5 62 #define LPC2460_RAM_SIZE 0x10000 // 64KB
Kojto 102:da0ca467f8b5 63
Kojto 102:da0ca467f8b5 64 // ISR Stack Allocation
Kojto 102:da0ca467f8b5 65 #define UND_stack_size 0x00000040
Kojto 102:da0ca467f8b5 66 #define SVC_stack_size 0x00000040
Kojto 102:da0ca467f8b5 67 #define ABT_stack_size 0x00000040
Kojto 102:da0ca467f8b5 68 #define FIQ_stack_size 0x00000000
Kojto 102:da0ca467f8b5 69 #define IRQ_stack_size 0x00000040
Kojto 102:da0ca467f8b5 70
Kojto 102:da0ca467f8b5 71 #define ISR_stack_size (UND_stack_size + SVC_stack_size + ABT_stack_size + FIQ_stack_size + IRQ_stack_size)
Kojto 102:da0ca467f8b5 72
Kojto 102:da0ca467f8b5 73 // Full Descending Stack, so top-most stack points to just above the top of RAM
Kojto 102:da0ca467f8b5 74 #define LPC2460_STACK_TOP (LPC2460_RAM_ADDRESS + LPC2460_RAM_SIZE)
Kojto 102:da0ca467f8b5 75 #define USR_STACK_TOP (LPC2460_STACK_TOP - ISR_stack_size)
Kojto 102:da0ca467f8b5 76
Kojto 102:da0ca467f8b5 77 #endif