R1 code for micro:bit based train controller code, requires second micro:bit running rx code to operate - see https://meanderingpi.wordpress.com/ for more information
Fork of mbed-dev-bin by
TARGET_NRF51_MICROBIT/system_nrf51.h@4:98796b85dcf3, 2017-05-23 (annotated)
- Committer:
- DavidMS
- Date:
- Tue May 23 12:27:33 2017 +0000
- Revision:
- 4:98796b85dcf3
- Parent:
- 0:e1a608bb55e8
basic_microbit_tx_train_controller_code: R1 code for micro:bit based train controller code, requires second micro:bit running rx code to operate - see https://meanderingpi.wordpress.com/ for more details
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jamesadevine | 0:e1a608bb55e8 | 1 | /* Copyright (c) 2013, Nordic Semiconductor ASA |
jamesadevine | 0:e1a608bb55e8 | 2 | * All rights reserved. |
jamesadevine | 0:e1a608bb55e8 | 3 | * |
jamesadevine | 0:e1a608bb55e8 | 4 | * Redistribution and use in source and binary forms, with or without |
jamesadevine | 0:e1a608bb55e8 | 5 | * modification, are permitted provided that the following conditions are met: |
jamesadevine | 0:e1a608bb55e8 | 6 | * |
jamesadevine | 0:e1a608bb55e8 | 7 | * * Redistributions of source code must retain the above copyright notice, this |
jamesadevine | 0:e1a608bb55e8 | 8 | * list of conditions and the following disclaimer. |
jamesadevine | 0:e1a608bb55e8 | 9 | * |
jamesadevine | 0:e1a608bb55e8 | 10 | * * Redistributions in binary form must reproduce the above copyright notice, |
jamesadevine | 0:e1a608bb55e8 | 11 | * this list of conditions and the following disclaimer in the documentation |
jamesadevine | 0:e1a608bb55e8 | 12 | * and/or other materials provided with the distribution. |
jamesadevine | 0:e1a608bb55e8 | 13 | * |
jamesadevine | 0:e1a608bb55e8 | 14 | * * Neither the name of Nordic Semiconductor ASA nor the names of its |
jamesadevine | 0:e1a608bb55e8 | 15 | * contributors may be used to endorse or promote products derived from |
jamesadevine | 0:e1a608bb55e8 | 16 | * this software without specific prior written permission. |
jamesadevine | 0:e1a608bb55e8 | 17 | * |
jamesadevine | 0:e1a608bb55e8 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
jamesadevine | 0:e1a608bb55e8 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
jamesadevine | 0:e1a608bb55e8 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
jamesadevine | 0:e1a608bb55e8 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
jamesadevine | 0:e1a608bb55e8 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
jamesadevine | 0:e1a608bb55e8 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
jamesadevine | 0:e1a608bb55e8 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
jamesadevine | 0:e1a608bb55e8 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
jamesadevine | 0:e1a608bb55e8 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
jamesadevine | 0:e1a608bb55e8 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
jamesadevine | 0:e1a608bb55e8 | 28 | * |
jamesadevine | 0:e1a608bb55e8 | 29 | */ |
jamesadevine | 0:e1a608bb55e8 | 30 | #ifndef SYSTEM_NRF51_H |
jamesadevine | 0:e1a608bb55e8 | 31 | #define SYSTEM_NRF51_H |
jamesadevine | 0:e1a608bb55e8 | 32 | |
jamesadevine | 0:e1a608bb55e8 | 33 | #ifdef __cplusplus |
jamesadevine | 0:e1a608bb55e8 | 34 | extern "C" { |
jamesadevine | 0:e1a608bb55e8 | 35 | #endif |
jamesadevine | 0:e1a608bb55e8 | 36 | |
jamesadevine | 0:e1a608bb55e8 | 37 | #include <stdint.h> |
jamesadevine | 0:e1a608bb55e8 | 38 | |
jamesadevine | 0:e1a608bb55e8 | 39 | |
jamesadevine | 0:e1a608bb55e8 | 40 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ |
jamesadevine | 0:e1a608bb55e8 | 41 | |
jamesadevine | 0:e1a608bb55e8 | 42 | /** |
jamesadevine | 0:e1a608bb55e8 | 43 | * Initialize the system |
jamesadevine | 0:e1a608bb55e8 | 44 | * |
jamesadevine | 0:e1a608bb55e8 | 45 | * @param none |
jamesadevine | 0:e1a608bb55e8 | 46 | * @return none |
jamesadevine | 0:e1a608bb55e8 | 47 | * |
jamesadevine | 0:e1a608bb55e8 | 48 | * @brief Setup the microcontroller system. |
jamesadevine | 0:e1a608bb55e8 | 49 | * Initialize the System and update the SystemCoreClock variable. |
jamesadevine | 0:e1a608bb55e8 | 50 | */ |
jamesadevine | 0:e1a608bb55e8 | 51 | extern void SystemInit (void); |
jamesadevine | 0:e1a608bb55e8 | 52 | |
jamesadevine | 0:e1a608bb55e8 | 53 | /** |
jamesadevine | 0:e1a608bb55e8 | 54 | * Update SystemCoreClock variable |
jamesadevine | 0:e1a608bb55e8 | 55 | * |
jamesadevine | 0:e1a608bb55e8 | 56 | * @param none |
jamesadevine | 0:e1a608bb55e8 | 57 | * @return none |
jamesadevine | 0:e1a608bb55e8 | 58 | * |
jamesadevine | 0:e1a608bb55e8 | 59 | * @brief Updates the SystemCoreClock with current core Clock |
jamesadevine | 0:e1a608bb55e8 | 60 | * retrieved from cpu registers. |
jamesadevine | 0:e1a608bb55e8 | 61 | */ |
jamesadevine | 0:e1a608bb55e8 | 62 | extern void SystemCoreClockUpdate (void); |
jamesadevine | 0:e1a608bb55e8 | 63 | |
jamesadevine | 0:e1a608bb55e8 | 64 | #ifdef __cplusplus |
jamesadevine | 0:e1a608bb55e8 | 65 | } |
jamesadevine | 0:e1a608bb55e8 | 66 | #endif |
jamesadevine | 0:e1a608bb55e8 | 67 | |
jamesadevine | 0:e1a608bb55e8 | 68 | #endif /* SYSTEM_NRF51_H */ |