mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Parent:
583:967d0d8b7aed
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 469:fc4922e0c183 1 /* mbed Microcontroller Library
mbed_official 469:fc4922e0c183 2 * Copyright (c) 2014, STMicroelectronics
mbed_official 469:fc4922e0c183 3 * All rights reserved.
mbed_official 469:fc4922e0c183 4 *
mbed_official 469:fc4922e0c183 5 * Redistribution and use in source and binary forms, with or without
mbed_official 469:fc4922e0c183 6 * modification, are permitted provided that the following conditions are met:
mbed_official 469:fc4922e0c183 7 *
mbed_official 469:fc4922e0c183 8 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 469:fc4922e0c183 9 * this list of conditions and the following disclaimer.
mbed_official 469:fc4922e0c183 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 469:fc4922e0c183 11 * this list of conditions and the following disclaimer in the documentation
mbed_official 469:fc4922e0c183 12 * and/or other materials provided with the distribution.
mbed_official 469:fc4922e0c183 13 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 469:fc4922e0c183 14 * may be used to endorse or promote products derived from this software
mbed_official 469:fc4922e0c183 15 * without specific prior written permission.
mbed_official 469:fc4922e0c183 16 *
mbed_official 469:fc4922e0c183 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 469:fc4922e0c183 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 469:fc4922e0c183 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 469:fc4922e0c183 20 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 469:fc4922e0c183 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 469:fc4922e0c183 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 469:fc4922e0c183 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 469:fc4922e0c183 24 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 469:fc4922e0c183 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 469:fc4922e0c183 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 469:fc4922e0c183 27 */
mbed_official 469:fc4922e0c183 28 #include <stddef.h>
mbed_official 469:fc4922e0c183 29 #include "us_ticker_api.h"
mbed_official 469:fc4922e0c183 30 #include "PeripheralNames.h"
mbed_official 469:fc4922e0c183 31
mbed_official 583:967d0d8b7aed 32
mbed_official 583:967d0d8b7aed 33 #if defined(TARGET_STM32F030R8) || defined(TARGET_STM32F070RB)
mbed_official 469:fc4922e0c183 34
mbed_official 469:fc4922e0c183 35 // Timer selection
mbed_official 469:fc4922e0c183 36 #define TIM_MST TIM1
mbed_official 469:fc4922e0c183 37
mbed_official 469:fc4922e0c183 38 static TIM_HandleTypeDef TimMasterHandle;
mbed_official 469:fc4922e0c183 39 static int us_ticker_inited = 0;
mbed_official 469:fc4922e0c183 40
mbed_official 469:fc4922e0c183 41 volatile uint32_t SlaveCounter = 0;
mbed_official 469:fc4922e0c183 42 volatile uint32_t oc_int_part = 0;
mbed_official 469:fc4922e0c183 43 volatile uint16_t oc_rem_part = 0;
mbed_official 469:fc4922e0c183 44
mbed_official 630:825f75ca301e 45 void set_compare(uint16_t count) {
mbed_official 469:fc4922e0c183 46 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 47 // Set new output compare value
mbed_official 469:fc4922e0c183 48 __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_1, count);
mbed_official 469:fc4922e0c183 49 // Enable IT
mbed_official 469:fc4922e0c183 50 __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 51 }
mbed_official 469:fc4922e0c183 52
mbed_official 630:825f75ca301e 53 void us_ticker_init(void) {
mbed_official 469:fc4922e0c183 54 if (us_ticker_inited) return;
mbed_official 469:fc4922e0c183 55 us_ticker_inited = 1;
mbed_official 469:fc4922e0c183 56
mbed_official 469:fc4922e0c183 57 HAL_InitTick(0); // The passed value is not used
mbed_official 469:fc4922e0c183 58 }
mbed_official 469:fc4922e0c183 59
mbed_official 630:825f75ca301e 60 uint32_t us_ticker_read() {
mbed_official 469:fc4922e0c183 61 uint32_t counter, counter2;
mbed_official 469:fc4922e0c183 62 if (!us_ticker_inited) us_ticker_init();
mbed_official 469:fc4922e0c183 63 // A situation might appear when Master overflows right after Slave is read and before the
mbed_official 469:fc4922e0c183 64 // new (overflowed) value of Master is read. Which would make the code below consider the
mbed_official 469:fc4922e0c183 65 // previous (incorrect) value of Slave and the new value of Master, which would return a
mbed_official 469:fc4922e0c183 66 // value in the past. Avoid this by computing consecutive values of the timer until they
mbed_official 469:fc4922e0c183 67 // are properly ordered.
mbed_official 469:fc4922e0c183 68 counter = (uint32_t)(SlaveCounter << 16);
mbed_official 469:fc4922e0c183 69 counter += TIM_MST->CNT;
mbed_official 469:fc4922e0c183 70 while (1) {
mbed_official 469:fc4922e0c183 71 counter2 = (uint32_t)(SlaveCounter << 16);
mbed_official 469:fc4922e0c183 72 counter2 += TIM_MST->CNT;
mbed_official 469:fc4922e0c183 73 if (counter2 > counter) {
mbed_official 469:fc4922e0c183 74 break;
mbed_official 469:fc4922e0c183 75 }
mbed_official 469:fc4922e0c183 76 counter = counter2;
mbed_official 469:fc4922e0c183 77 }
mbed_official 469:fc4922e0c183 78 return counter2;
mbed_official 469:fc4922e0c183 79 }
mbed_official 469:fc4922e0c183 80
mbed_official 630:825f75ca301e 81 void us_ticker_set_interrupt(timestamp_t timestamp) {
mbed_official 469:fc4922e0c183 82 int delta = (int)((uint32_t)timestamp - us_ticker_read());
mbed_official 469:fc4922e0c183 83 uint16_t cval = TIM_MST->CNT;
mbed_official 469:fc4922e0c183 84
mbed_official 469:fc4922e0c183 85 if (delta <= 0) { // This event was in the past
mbed_official 469:fc4922e0c183 86 us_ticker_irq_handler();
mbed_official 469:fc4922e0c183 87 } else {
mbed_official 469:fc4922e0c183 88 oc_int_part = (uint32_t)(delta >> 16);
mbed_official 469:fc4922e0c183 89 oc_rem_part = (uint16_t)(delta & 0xFFFF);
mbed_official 469:fc4922e0c183 90 if (oc_rem_part <= (0xFFFF - cval)) {
mbed_official 469:fc4922e0c183 91 set_compare(cval + oc_rem_part);
mbed_official 469:fc4922e0c183 92 oc_rem_part = 0;
mbed_official 469:fc4922e0c183 93 } else {
mbed_official 469:fc4922e0c183 94 set_compare(0xFFFF);
mbed_official 469:fc4922e0c183 95 oc_rem_part = oc_rem_part - (0xFFFF - cval);
mbed_official 469:fc4922e0c183 96 }
mbed_official 469:fc4922e0c183 97 }
mbed_official 469:fc4922e0c183 98 }
mbed_official 469:fc4922e0c183 99
mbed_official 630:825f75ca301e 100 void us_ticker_disable_interrupt(void) {
mbed_official 469:fc4922e0c183 101 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 102 __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 103 }
mbed_official 469:fc4922e0c183 104
mbed_official 630:825f75ca301e 105 void us_ticker_clear_interrupt(void) {
mbed_official 469:fc4922e0c183 106 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 107 if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
mbed_official 469:fc4922e0c183 108 __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
mbed_official 469:fc4922e0c183 109 }
mbed_official 469:fc4922e0c183 110 }
mbed_official 469:fc4922e0c183 111
mbed_official 583:967d0d8b7aed 112 #elif defined (TARGET_STM32F051R8)
mbed_official 469:fc4922e0c183 113
mbed_official 469:fc4922e0c183 114 // Timer selection:
mbed_official 469:fc4922e0c183 115 #define TIM_MST TIM1
mbed_official 469:fc4922e0c183 116 #define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn
mbed_official 469:fc4922e0c183 117 #define TIM_MST_OC_IRQ TIM1_CC_IRQn
mbed_official 469:fc4922e0c183 118 #define TIM_MST_RCC __TIM1_CLK_ENABLE()
mbed_official 469:fc4922e0c183 119
mbed_official 469:fc4922e0c183 120 static TIM_HandleTypeDef TimMasterHandle;
mbed_official 469:fc4922e0c183 121
mbed_official 469:fc4922e0c183 122
mbed_official 469:fc4922e0c183 123 static int us_ticker_inited = 0;
mbed_official 469:fc4922e0c183 124 static volatile uint32_t SlaveCounter = 0;
mbed_official 469:fc4922e0c183 125 static volatile uint32_t oc_int_part = 0;
mbed_official 469:fc4922e0c183 126 static volatile uint16_t oc_rem_part = 0;
mbed_official 469:fc4922e0c183 127
mbed_official 630:825f75ca301e 128 void set_compare(uint16_t count) {
mbed_official 469:fc4922e0c183 129 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 130
mbed_official 469:fc4922e0c183 131 // Set new output compare value
mbed_official 469:fc4922e0c183 132 __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_1, count);
mbed_official 469:fc4922e0c183 133 // Enable IT
mbed_official 469:fc4922e0c183 134 __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 135 }
mbed_official 469:fc4922e0c183 136
mbed_official 469:fc4922e0c183 137 // Used to increment the slave counter
mbed_official 630:825f75ca301e 138 static void tim_update_irq_handler(void) {
mbed_official 469:fc4922e0c183 139 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 140
mbed_official 469:fc4922e0c183 141 // Clear Update interrupt flag
mbed_official 469:fc4922e0c183 142 if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_UPDATE) == SET) {
mbed_official 469:fc4922e0c183 143 __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_UPDATE);
mbed_official 469:fc4922e0c183 144 SlaveCounter++;
mbed_official 469:fc4922e0c183 145 }
mbed_official 469:fc4922e0c183 146 }
mbed_official 469:fc4922e0c183 147
mbed_official 469:fc4922e0c183 148 // Used by interrupt system
mbed_official 630:825f75ca301e 149 static void tim_oc_irq_handler(void) {
mbed_official 469:fc4922e0c183 150 uint16_t cval = TIM_MST->CNT;
mbed_official 469:fc4922e0c183 151 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 152
mbed_official 469:fc4922e0c183 153 // Clear CC1 interrupt flag
mbed_official 469:fc4922e0c183 154 if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
mbed_official 469:fc4922e0c183 155 __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
mbed_official 469:fc4922e0c183 156 }
mbed_official 469:fc4922e0c183 157 if (oc_rem_part > 0) {
mbed_official 469:fc4922e0c183 158 set_compare(oc_rem_part); // Finish the remaining time left
mbed_official 469:fc4922e0c183 159 oc_rem_part = 0;
mbed_official 469:fc4922e0c183 160 } else {
mbed_official 469:fc4922e0c183 161 if (oc_int_part > 0) {
mbed_official 469:fc4922e0c183 162 set_compare(0xFFFF);
mbed_official 469:fc4922e0c183 163 oc_rem_part = cval; // To finish the counter loop the next time
mbed_official 469:fc4922e0c183 164 oc_int_part--;
mbed_official 469:fc4922e0c183 165 } else {
mbed_official 469:fc4922e0c183 166 us_ticker_irq_handler();
mbed_official 469:fc4922e0c183 167 }
mbed_official 469:fc4922e0c183 168 }
mbed_official 469:fc4922e0c183 169
mbed_official 469:fc4922e0c183 170 }
mbed_official 469:fc4922e0c183 171
mbed_official 630:825f75ca301e 172 void us_ticker_init(void) {
mbed_official 469:fc4922e0c183 173
mbed_official 469:fc4922e0c183 174 if (us_ticker_inited) return;
mbed_official 469:fc4922e0c183 175 us_ticker_inited = 1;
mbed_official 469:fc4922e0c183 176
mbed_official 469:fc4922e0c183 177 // Enable timer clock
mbed_official 469:fc4922e0c183 178 TIM_MST_RCC;
mbed_official 469:fc4922e0c183 179
mbed_official 469:fc4922e0c183 180 // Configure time base
mbed_official 469:fc4922e0c183 181 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 182 TimMasterHandle.Init.Period = 0xFFFF;
mbed_official 469:fc4922e0c183 183 TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 �s tick
mbed_official 469:fc4922e0c183 184 TimMasterHandle.Init.ClockDivision = 0;
mbed_official 469:fc4922e0c183 185 TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
mbed_official 469:fc4922e0c183 186 HAL_TIM_Base_Init(&TimMasterHandle);
mbed_official 469:fc4922e0c183 187
mbed_official 469:fc4922e0c183 188 // Configure interrupts
mbed_official 469:fc4922e0c183 189 __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_UPDATE);
mbed_official 469:fc4922e0c183 190
mbed_official 469:fc4922e0c183 191 // Update interrupt used for 32-bit counter
mbed_official 469:fc4922e0c183 192 NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)tim_update_irq_handler);
mbed_official 469:fc4922e0c183 193 NVIC_EnableIRQ(TIM_MST_UP_IRQ);
mbed_official 469:fc4922e0c183 194
mbed_official 469:fc4922e0c183 195 // Output compare interrupt used for timeout feature
mbed_official 469:fc4922e0c183 196 NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)tim_oc_irq_handler);
mbed_official 469:fc4922e0c183 197 NVIC_EnableIRQ(TIM_MST_OC_IRQ);
mbed_official 469:fc4922e0c183 198
mbed_official 469:fc4922e0c183 199 // Enable timer
mbed_official 469:fc4922e0c183 200 HAL_TIM_Base_Start(&TimMasterHandle);
mbed_official 469:fc4922e0c183 201 }
mbed_official 469:fc4922e0c183 202
mbed_official 630:825f75ca301e 203 uint32_t us_ticker_read() {
mbed_official 469:fc4922e0c183 204 uint32_t counter, counter2;
mbed_official 469:fc4922e0c183 205 if (!us_ticker_inited) us_ticker_init();
mbed_official 469:fc4922e0c183 206 // A situation might appear when Master overflows right after Slave is read and before the
mbed_official 469:fc4922e0c183 207 // new (overflowed) value of Master is read. Which would make the code below consider the
mbed_official 469:fc4922e0c183 208 // previous (incorrect) value of Slave and the new value of Master, which would return a
mbed_official 469:fc4922e0c183 209 // value in the past. Avoid this by computing consecutive values of the timer until they
mbed_official 469:fc4922e0c183 210 // are properly ordered.
mbed_official 469:fc4922e0c183 211 counter = (uint32_t)(SlaveCounter << 16);
mbed_official 469:fc4922e0c183 212 counter += TIM_MST->CNT;
mbed_official 469:fc4922e0c183 213 while (1) {
mbed_official 469:fc4922e0c183 214 counter2 = (uint32_t)(SlaveCounter << 16);
mbed_official 469:fc4922e0c183 215 counter2 += TIM_MST->CNT;
mbed_official 469:fc4922e0c183 216 if (counter2 > counter) {
mbed_official 469:fc4922e0c183 217 break;
mbed_official 469:fc4922e0c183 218 }
mbed_official 469:fc4922e0c183 219 counter = counter2;
mbed_official 469:fc4922e0c183 220 }
mbed_official 469:fc4922e0c183 221 return counter2;
mbed_official 469:fc4922e0c183 222 }
mbed_official 469:fc4922e0c183 223
mbed_official 630:825f75ca301e 224 void us_ticker_set_interrupt(timestamp_t timestamp) {
mbed_official 469:fc4922e0c183 225 int delta = (int)((uint32_t)timestamp - us_ticker_read());
mbed_official 469:fc4922e0c183 226 uint16_t cval = TIM_MST->CNT;
mbed_official 469:fc4922e0c183 227
mbed_official 469:fc4922e0c183 228 if (delta <= 0) { // This event was in the past
mbed_official 469:fc4922e0c183 229 us_ticker_irq_handler();
mbed_official 469:fc4922e0c183 230 } else {
mbed_official 469:fc4922e0c183 231 oc_int_part = (uint32_t)(delta >> 16);
mbed_official 469:fc4922e0c183 232 oc_rem_part = (uint16_t)(delta & 0xFFFF);
mbed_official 469:fc4922e0c183 233 if (oc_rem_part <= (0xFFFF - cval)) {
mbed_official 469:fc4922e0c183 234 set_compare(cval + oc_rem_part);
mbed_official 469:fc4922e0c183 235 oc_rem_part = 0;
mbed_official 469:fc4922e0c183 236 } else {
mbed_official 469:fc4922e0c183 237 set_compare(0xFFFF);
mbed_official 469:fc4922e0c183 238 oc_rem_part = oc_rem_part - (0xFFFF - cval);
mbed_official 469:fc4922e0c183 239 }
mbed_official 469:fc4922e0c183 240 }
mbed_official 469:fc4922e0c183 241 }
mbed_official 469:fc4922e0c183 242
mbed_official 630:825f75ca301e 243 void us_ticker_disable_interrupt(void) {
mbed_official 469:fc4922e0c183 244 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 245 __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 246 }
mbed_official 469:fc4922e0c183 247
mbed_official 630:825f75ca301e 248 void us_ticker_clear_interrupt(void) {
mbed_official 469:fc4922e0c183 249 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 250 if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
mbed_official 469:fc4922e0c183 251 __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);
mbed_official 469:fc4922e0c183 252 }
mbed_official 469:fc4922e0c183 253 }
mbed_official 469:fc4922e0c183 254
mbed_official 469:fc4922e0c183 255 #else
mbed_official 469:fc4922e0c183 256
mbed_official 469:fc4922e0c183 257 // 32-bit timer selection
mbed_official 469:fc4922e0c183 258 #define TIM_MST TIM2
mbed_official 469:fc4922e0c183 259
mbed_official 469:fc4922e0c183 260 static TIM_HandleTypeDef TimMasterHandle;
mbed_official 469:fc4922e0c183 261 static int us_ticker_inited = 0;
mbed_official 469:fc4922e0c183 262
mbed_official 630:825f75ca301e 263 void us_ticker_init(void) {
mbed_official 469:fc4922e0c183 264 if (us_ticker_inited) return;
mbed_official 469:fc4922e0c183 265 us_ticker_inited = 1;
mbed_official 469:fc4922e0c183 266
mbed_official 469:fc4922e0c183 267 TimMasterHandle.Instance = TIM_MST;
mbed_official 469:fc4922e0c183 268
mbed_official 469:fc4922e0c183 269 HAL_InitTick(0); // The passed value is not used
mbed_official 469:fc4922e0c183 270 }
mbed_official 469:fc4922e0c183 271
mbed_official 630:825f75ca301e 272 uint32_t us_ticker_read() {
mbed_official 469:fc4922e0c183 273 if (!us_ticker_inited) us_ticker_init();
mbed_official 469:fc4922e0c183 274 return TIM_MST->CNT;
mbed_official 469:fc4922e0c183 275 }
mbed_official 469:fc4922e0c183 276
mbed_official 630:825f75ca301e 277 void us_ticker_set_interrupt(timestamp_t timestamp) {
mbed_official 469:fc4922e0c183 278 // Set new output compare value
mbed_official 469:fc4922e0c183 279 __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_1, (uint32_t)timestamp);
mbed_official 469:fc4922e0c183 280 // Enable IT
mbed_official 469:fc4922e0c183 281 __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 282 }
mbed_official 469:fc4922e0c183 283
mbed_official 630:825f75ca301e 284 void us_ticker_disable_interrupt(void) {
mbed_official 469:fc4922e0c183 285 __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 286 }
mbed_official 469:fc4922e0c183 287
mbed_official 630:825f75ca301e 288 void us_ticker_clear_interrupt(void) {
mbed_official 469:fc4922e0c183 289 __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1);
mbed_official 469:fc4922e0c183 290 }
mbed_official 469:fc4922e0c183 291 #endif