5.2.1 - Updated I2C files
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
targets/TARGET_STM/TARGET_STM32F2/mbed_overrides.c@1:f30bdcd2b33b, 2017-02-27 (annotated)
- Committer:
- jacobjohnson
- Date:
- Mon Feb 27 17:45:05 2017 +0000
- Revision:
- 1:f30bdcd2b33b
- Parent:
- 0:098463de4c5d
changed the inputscale from 1 to 7 in analogin_api.c. This will need to be changed later, and accessed from the main level, but for now this allows the adc to read a value from 0 to 3.7V, instead of just up to 1V.;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
group-onsemi | 0:098463de4c5d | 1 | /* mbed Microcontroller Library |
group-onsemi | 0:098463de4c5d | 2 | * Copyright (c) 2016, STMicroelectronics |
group-onsemi | 0:098463de4c5d | 3 | * All rights reserved. |
group-onsemi | 0:098463de4c5d | 4 | * |
group-onsemi | 0:098463de4c5d | 5 | * Redistribution and use in source and binary forms, with or without |
group-onsemi | 0:098463de4c5d | 6 | * modification, are permitted provided that the following conditions are met: |
group-onsemi | 0:098463de4c5d | 7 | * |
group-onsemi | 0:098463de4c5d | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
group-onsemi | 0:098463de4c5d | 9 | * this list of conditions and the following disclaimer. |
group-onsemi | 0:098463de4c5d | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
group-onsemi | 0:098463de4c5d | 11 | * this list of conditions and the following disclaimer in the documentation |
group-onsemi | 0:098463de4c5d | 12 | * and/or other materials provided with the distribution. |
group-onsemi | 0:098463de4c5d | 13 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
group-onsemi | 0:098463de4c5d | 14 | * may be used to endorse or promote products derived from this software |
group-onsemi | 0:098463de4c5d | 15 | * without specific prior written permission. |
group-onsemi | 0:098463de4c5d | 16 | * |
group-onsemi | 0:098463de4c5d | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
group-onsemi | 0:098463de4c5d | 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
group-onsemi | 0:098463de4c5d | 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
group-onsemi | 0:098463de4c5d | 20 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
group-onsemi | 0:098463de4c5d | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
group-onsemi | 0:098463de4c5d | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
group-onsemi | 0:098463de4c5d | 23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
group-onsemi | 0:098463de4c5d | 24 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
group-onsemi | 0:098463de4c5d | 25 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
group-onsemi | 0:098463de4c5d | 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
group-onsemi | 0:098463de4c5d | 27 | */ |
group-onsemi | 0:098463de4c5d | 28 | #include "cmsis.h" |
group-onsemi | 0:098463de4c5d | 29 | #include "us_ticker_api.h" |
group-onsemi | 0:098463de4c5d | 30 | |
group-onsemi | 0:098463de4c5d | 31 | // This function is called after RAM initialization and before main. |
group-onsemi | 0:098463de4c5d | 32 | void mbed_sdk_init() |
group-onsemi | 0:098463de4c5d | 33 | { |
group-onsemi | 0:098463de4c5d | 34 | // Update the SystemCoreClock variable. |
group-onsemi | 0:098463de4c5d | 35 | SystemCoreClockUpdate(); |
group-onsemi | 0:098463de4c5d | 36 | // Need to restart HAL driver after the RAM is initialized |
group-onsemi | 0:098463de4c5d | 37 | HAL_Init(); |
group-onsemi | 0:098463de4c5d | 38 | } |
group-onsemi | 0:098463de4c5d | 39 | |
group-onsemi | 0:098463de4c5d | 40 | /** |
group-onsemi | 0:098463de4c5d | 41 | * @brief This function provides accurate delay (in milliseconds) based |
group-onsemi | 0:098463de4c5d | 42 | * on variable incremented. |
group-onsemi | 0:098463de4c5d | 43 | * @note This function is the modified version of the __weak version contained in |
group-onsemi | 0:098463de4c5d | 44 | * stm32f2xx_hal.c, using us_ticker |
group-onsemi | 0:098463de4c5d | 45 | * @param Delay: specifies the delay time length, in milliseconds. |
group-onsemi | 0:098463de4c5d | 46 | * @retval None |
group-onsemi | 0:098463de4c5d | 47 | */ |
group-onsemi | 0:098463de4c5d | 48 | void HAL_Delay(__IO uint32_t Delay) |
group-onsemi | 0:098463de4c5d | 49 | { |
group-onsemi | 0:098463de4c5d | 50 | uint32_t start = us_ticker_read(); |
group-onsemi | 0:098463de4c5d | 51 | while ((us_ticker_read() - start) < (uint32_t)(Delay * 1000)); |
group-onsemi | 0:098463de4c5d | 52 | } |
group-onsemi | 0:098463de4c5d | 53 |