Lib to switch the clock speed of the ST Nucleo to 84MHz. The internal RC oscillator is multiplied with the PLL.

Dependents:   Nucleo_spi_master_20MHz Nucleo_vs_Arduino_Speed_Test DMA_I2S_Test MPU9150AHRS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ST_F401_84MHZ.h Source File

ST_F401_84MHZ.h

00001 /* mbed library for the ST NUCLEO board F401RE 
00002  * to change the CPU clock to 84 MHz
00003  *
00004  * Copyright (c) 2014 Peter Drescher - DC2PD
00005  * Released under the MIT License: http://mbed.org/license/mit
00006  *
00007  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00008  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00009  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00010  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00011  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00012  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00013  * THE SOFTWARE.
00014  */
00015 #ifndef MBED_ST_F401_84MHZ_H
00016 #define MBED_ST_F401_84MHZ_H
00017 
00018 /** Setup speed to 84 MHz
00019  *
00020  * @code
00021  * #include "mbed.h"
00022  * #include "ST_F401_84MHZ.h"
00023  *
00024  * // place the init before other code to ensure right timing of other objects !
00025  * F401_init84 myinit(0);   // use the internal oscillator 
00026  * 
00027  */
00028 
00029 class F401_init84
00030 {
00031 public:
00032  /** Create a F401_init84 object to change the clock
00033    * @param external = 0 use internal oscillator
00034    * @param external = 1 use external 8 MHz crystal - you have to add some comonents to the pcb !
00035 */
00036 F401_init84(unsigned int external);
00037 
00038 protected:
00039 // do the magic ;-)
00040 void SystemClock_Config_84MHz_internal(void);   
00041 void SystemClock_Config_84MHz_external(void);
00042 };
00043 
00044 #endif