lpc2387/include/cpu.h
1 /*
2  * Copyright (C) 2013, Freie Universitaet Berlin (FUB). All rights reserved.
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #ifndef CPU_H
10 #define CPU_H
11 
19 #include <stdio.h>
20 #include <stdbool.h>
21 
22 #include "lpc2387.h"
23 #include "arm_cpu.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 extern uintptr_t __stack_start;
30 
34 void lpc2387_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale);
35 
36 
40 bool install_irq(int IntNumber, void (*HandlerAddr)(void), int Priority);
41 
42 #ifdef MODULE_PERIPH
43 void gpio_init_ports(void);
44 #endif
45 
49 static inline void cpu_print_last_instruction(void)
50 {
51  register uint32_t *lr_ptr;
52  __asm__ __volatile__("mov %0, lr" : "=r"(lr_ptr));
53  printf("%p\n", (void*) lr_ptr);
54 }
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
61 #endif /* CPU_H */
static void cpu_print_last_instruction(void)
Prints the current content of the link register (lr)
bool install_irq(int IntNumber, void(*HandlerAddr)(void), int Priority)
install lpc2387 irq
stdio.h wrapper for MSP430
void lpc2387_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale)
Scale lpc2387 cpu speed.
uintptr_t __stack_start
end of user stack memory space