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 "lpc23xx.h"
23 #include "arm_cpu.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 extern uintptr_t __stack_start;
34 void cpu_init_pll(void);
35 
39 void cpu_init_mam(void);
40 
44 void lpc23xx_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale);
45 
49 void cpu_init_clks(void);
50 
54 bool install_irq(int IntNumber, void (*HandlerAddr)(void), int Priority);
55 
56 #ifdef MODULE_PERIPH
57 void gpio_init_ports(void);
58 #endif
59 
63 static inline bool cpu_woke_from_backup(void) {
64  return RSIR == 0;
65 }
66 
71 
75 #define CPU_HAS_BACKUP_RAM (1)
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
82 #endif /* CPU_H */
uintptr_t __stack_start
end of user stack memory space
void cpu_init_clks(void)
Initialize lpc23xx cpu clocks.
static bool cpu_woke_from_backup(void)
Returns true if the CPU woke from Deep Sleep.
Definition: cpu.h:63
bool cpu_backup_ram_is_initialized(void)
Returns true if the backup RAM has been initialized.
void lpc23xx_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale)
Scale lpc23xx cpu speed.
void cpu_init_mam(void)
Initialize the Memory Acceleration Module.
void cpu_init_pll(void)
Initialize the phase lock loop oscillator.
bool install_irq(int IntNumber, void(*HandlerAddr)(void), int Priority)
install lpc23xx irq
stdio wrapper to extend the C libs stdio