mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jul 17 09:15:10 2015 +0100
Revision:
592:a274ee790e56
Parent:
579:53297373a894
Synchronized with git revision e7144f83a8d75df80c4877936b6ffe552b0be9e6

Full URL: https://github.com/mbedmicro/mbed/commit/e7144f83a8d75df80c4877936b6ffe552b0be9e6/

More API implementation for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 #include <system.h>
mbed_official 579:53297373a894 2
mbed_official 579:53297373a894 3 /**
mbed_official 579:53297373a894 4 * \internal
mbed_official 579:53297373a894 5 * Dummy initialization function, used as a weak alias target for the various
mbed_official 579:53297373a894 6 * init functions called by \ref system_init().
mbed_official 579:53297373a894 7 */
mbed_official 579:53297373a894 8 void _system_dummy_init(void);
mbed_official 579:53297373a894 9 void _system_dummy_init(void)
mbed_official 579:53297373a894 10 {
mbed_official 579:53297373a894 11 return;
mbed_official 579:53297373a894 12 }
mbed_official 579:53297373a894 13
mbed_official 579:53297373a894 14 #if !defined(__DOXYGEN__)
mbed_official 579:53297373a894 15 # if defined(__GNUC__)
mbed_official 579:53297373a894 16 void system_clock_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 579:53297373a894 17 void system_board_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 579:53297373a894 18 void _system_events_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 579:53297373a894 19 void _system_extint_init(void) WEAK __attribute__((alias("_system_dummy_init")));
mbed_official 579:53297373a894 20 # elif defined(__ICCARM__)
mbed_official 579:53297373a894 21 void system_clock_init(void);
mbed_official 579:53297373a894 22 void system_board_init(void);
mbed_official 579:53297373a894 23 void _system_events_init(void);
mbed_official 579:53297373a894 24 void _system_extint_init(void);
mbed_official 579:53297373a894 25 # pragma weak system_clock_init=_system_dummy_init
mbed_official 579:53297373a894 26 # pragma weak system_board_init=_system_dummy_init
mbed_official 579:53297373a894 27 # pragma weak _system_events_init=_system_dummy_init
mbed_official 579:53297373a894 28 # pragma weak _system_extint_init=_system_dummy_init
mbed_official 579:53297373a894 29 # endif
mbed_official 579:53297373a894 30 #endif
mbed_official 579:53297373a894 31
mbed_official 579:53297373a894 32 /**
mbed_official 579:53297373a894 33 * \brief Initialize system.
mbed_official 579:53297373a894 34 *
mbed_official 579:53297373a894 35 * This function will call the various initialization functions within the
mbed_official 579:53297373a894 36 * system namespace. If a given optional system module is not available, the
mbed_official 579:53297373a894 37 * associated call will effectively be a NOP (No Operation).
mbed_official 579:53297373a894 38 *
mbed_official 579:53297373a894 39 * Currently the following initialization functions are supported:
mbed_official 579:53297373a894 40 * - System clock initialization (via the SYSTEM CLOCK sub-module)
mbed_official 579:53297373a894 41 * - Board hardware initialization (via the Board module)
mbed_official 579:53297373a894 42 * - Event system driver initialization (via the EVSYS module)
mbed_official 579:53297373a894 43 * - External Interrupt driver initialization (via the EXTINT module)
mbed_official 579:53297373a894 44 */
mbed_official 579:53297373a894 45 void system_init(void)
mbed_official 579:53297373a894 46 {
mbed_official 579:53297373a894 47 /* Configure GCLK and clock sources according to conf_clocks.h */
mbed_official 579:53297373a894 48 system_clock_init();
mbed_official 579:53297373a894 49
mbed_official 579:53297373a894 50 /* Initialize board hardware */
mbed_official 579:53297373a894 51 system_board_init();
mbed_official 579:53297373a894 52
mbed_official 579:53297373a894 53 /* Initialize EVSYS hardware */
mbed_official 579:53297373a894 54 _system_events_init();
mbed_official 579:53297373a894 55
mbed_official 579:53297373a894 56 /* Initialize External hardware */
mbed_official 579:53297373a894 57 _system_extint_init();
mbed_official 579:53297373a894 58 }
mbed_official 579:53297373a894 59