File tree Expand file tree Collapse file tree 3 files changed +51
-1
lines changed
TARGET_Ambiq_Micro/TARGET_Apollo3 Expand file tree Collapse file tree 3 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ target_sources(mbed-apollo3
5151 device/sleep.c
5252 device/spi_api.c
5353 device/us_ticker.c
54+ device/itm_api.c
5455
5556 sdk/CMSIS/AmbiqMicro/Source /system_apollo3.c
5657
Original file line number Diff line number Diff line change 1+ /* mbed Microcontroller Library
2+ * Copyright (c) 2017 ARM Limited
3+ * SPDX-License-Identifier: Apache-2.0
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ #if DEVICE_ITM
19+
20+ #include "hal/itm_api.h"
21+ #include "cmsis.h"
22+ #include "am_bsp.h"
23+
24+ #include <stdbool.h>
25+
26+ /* SWO frequency: 1000 kHz */
27+
28+ #ifndef AM_BSP_GPIO_ITM_SWO
29+ #define AM_GPIO_ITM_SWO 22
30+
31+ const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO =
32+ {
33+ .uFuncSel = AM_HAL_PIN_22_SWO ,
34+ .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA
35+ };
36+ #endif
37+
38+
39+ void itm_init (void )
40+ {
41+ #ifdef AM_BSP_GPIO_ITM_SWO
42+ am_bsp_itm_printf_enable ();
43+ #else
44+ am_bsp_itm_printf_enable (AM_GPIO_ITM_SWO ,g_AM_GPIO_ITM_SWO );
45+ #endif
46+ }
47+
48+ #endif
Original file line number Diff line number Diff line change 90619061 " FLASH" ,
90629062 " SPI" ,
90639063 " I2C" ,
9064- " SLEEP"
9064+ " SLEEP" ,
9065+ " ITM"
90659066 ],
90669067 "components" : [
90679068 " FLASHIAP"
You can’t perform that action at this time.
0 commit comments