Fixed with HAL.
Fork of ST_L152_32MHZ by
Not finish yet. External crystal doesn't work.
ST_L152_32MHZ.h
- Committer:
- dreschpe
- Date:
- 2014-03-11
- Revision:
- 0:84e23a19e37d
- Child:
- 1:bdeac50afe1a
File content as of revision 0:84e23a19e37d:
/* mbed library for the ST NUCLEO board L152RE * to change the CPU clock to 32 MHz * A pll clock of 96 MHz is used to enable USB * * Copyright (c) 2014 Peter Drescher - DC2PD * Released under the MIT License: http://mbed.org/license/mit * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef MBED_ST_L152_32MHZ_H #define MBED_ST_L152_32MHZ_H /** Setup cpu speed to 32 MHz * * @code * #include "mbed.h" * #include "ST_L152_32MHZ.h" * * // place the init before other code to ensure right timing of other objects ! * L152_init32 myinit(0); // use the internal oscillator * */ class L152_init32 { public: /** Create a L152_init32 object to change the clock * @param external = 0 use internal oscillator * @param external = 1 use external 8 MHz crystal - you have to add some comonents to the pcb ! */ L152_init32(unsigned int external); int clk_err; protected: // do the magic ;-) int setup_clock_32MHZ(int external); }; #endif