RTC auf true
hal/itm_api.h@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | /** \addtogroup hal */ |
kevman | 0:38ceb79fef03 | 2 | /** @{*/ |
kevman | 0:38ceb79fef03 | 3 | /* mbed Microcontroller Library |
kevman | 0:38ceb79fef03 | 4 | * Copyright (c) 2017 ARM Limited |
kevman | 0:38ceb79fef03 | 5 | * |
kevman | 0:38ceb79fef03 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kevman | 0:38ceb79fef03 | 7 | * you may not use this file except in compliance with the License. |
kevman | 0:38ceb79fef03 | 8 | * You may obtain a copy of the License at |
kevman | 0:38ceb79fef03 | 9 | * |
kevman | 0:38ceb79fef03 | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
kevman | 0:38ceb79fef03 | 11 | * |
kevman | 0:38ceb79fef03 | 12 | * Unless required by applicable law or agreed to in writing, software |
kevman | 0:38ceb79fef03 | 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
kevman | 0:38ceb79fef03 | 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kevman | 0:38ceb79fef03 | 15 | * See the License for the specific language governing permissions and |
kevman | 0:38ceb79fef03 | 16 | * limitations under the License. |
kevman | 0:38ceb79fef03 | 17 | */ |
kevman | 0:38ceb79fef03 | 18 | |
kevman | 0:38ceb79fef03 | 19 | #ifndef MBED_ITM_API_H |
kevman | 0:38ceb79fef03 | 20 | #define MBED_ITM_API_H |
kevman | 0:38ceb79fef03 | 21 | |
kevman | 0:38ceb79fef03 | 22 | #if defined(DEVICE_ITM) |
kevman | 0:38ceb79fef03 | 23 | |
kevman | 0:38ceb79fef03 | 24 | #include <stdint.h> |
kevman | 0:38ceb79fef03 | 25 | #include <stddef.h> |
kevman | 0:38ceb79fef03 | 26 | |
kevman | 0:38ceb79fef03 | 27 | #ifdef __cplusplus |
kevman | 0:38ceb79fef03 | 28 | extern "C" { |
kevman | 0:38ceb79fef03 | 29 | #endif |
kevman | 0:38ceb79fef03 | 30 | |
kevman | 0:38ceb79fef03 | 31 | /** |
kevman | 0:38ceb79fef03 | 32 | * \defgroup itm_hal Instrumented Trace Macrocell HAL API |
kevman | 0:38ceb79fef03 | 33 | * @{ |
kevman | 0:38ceb79fef03 | 34 | */ |
kevman | 0:38ceb79fef03 | 35 | |
kevman | 0:38ceb79fef03 | 36 | enum { |
kevman | 0:38ceb79fef03 | 37 | ITM_PORT_SWO = 0 |
kevman | 0:38ceb79fef03 | 38 | }; |
kevman | 0:38ceb79fef03 | 39 | |
kevman | 0:38ceb79fef03 | 40 | /** |
kevman | 0:38ceb79fef03 | 41 | * @brief Target specific initialization function. |
kevman | 0:38ceb79fef03 | 42 | * This function is responsible for initializing and configuring |
kevman | 0:38ceb79fef03 | 43 | * the debug clock for the ITM and setting up the SWO pin for |
kevman | 0:38ceb79fef03 | 44 | * debug output. |
kevman | 0:38ceb79fef03 | 45 | * |
kevman | 0:38ceb79fef03 | 46 | * The only Cortex-M register that should be modified is the clock |
kevman | 0:38ceb79fef03 | 47 | * prescaler in TPI->ACPR. |
kevman | 0:38ceb79fef03 | 48 | * |
kevman | 0:38ceb79fef03 | 49 | * The generic mbed_itm_init initialization function will setup: |
kevman | 0:38ceb79fef03 | 50 | * |
kevman | 0:38ceb79fef03 | 51 | * ITM->LAR |
kevman | 0:38ceb79fef03 | 52 | * ITM->TPR |
kevman | 0:38ceb79fef03 | 53 | * ITM->TCR |
kevman | 0:38ceb79fef03 | 54 | * ITM->TER |
kevman | 0:38ceb79fef03 | 55 | * TPI->SPPR |
kevman | 0:38ceb79fef03 | 56 | * TPI->FFCR |
kevman | 0:38ceb79fef03 | 57 | * DWT->CTRL |
kevman | 0:38ceb79fef03 | 58 | * |
kevman | 0:38ceb79fef03 | 59 | * for SWO output on stimulus port 0. |
kevman | 0:38ceb79fef03 | 60 | */ |
kevman | 0:38ceb79fef03 | 61 | void itm_init(void); |
kevman | 0:38ceb79fef03 | 62 | |
kevman | 0:38ceb79fef03 | 63 | /** |
kevman | 0:38ceb79fef03 | 64 | * @brief Initialization function for both generic registers and target specific clock and pin. |
kevman | 0:38ceb79fef03 | 65 | */ |
kevman | 0:38ceb79fef03 | 66 | void mbed_itm_init(void); |
kevman | 0:38ceb79fef03 | 67 | |
kevman | 0:38ceb79fef03 | 68 | /** |
kevman | 0:38ceb79fef03 | 69 | * @brief Send data over ITM stimulus port. |
kevman | 0:38ceb79fef03 | 70 | * |
kevman | 0:38ceb79fef03 | 71 | * @param[in] port The stimulus port to send data over. |
kevman | 0:38ceb79fef03 | 72 | * @param[in] data The 32-bit data to send. |
kevman | 0:38ceb79fef03 | 73 | * |
kevman | 0:38ceb79fef03 | 74 | * The data is written as a single 32-bit write to the port. |
kevman | 0:38ceb79fef03 | 75 | * |
kevman | 0:38ceb79fef03 | 76 | * @return value of data sent. |
kevman | 0:38ceb79fef03 | 77 | */ |
kevman | 0:38ceb79fef03 | 78 | uint32_t mbed_itm_send(uint32_t port, uint32_t data); |
kevman | 0:38ceb79fef03 | 79 | |
kevman | 0:38ceb79fef03 | 80 | /** |
kevman | 0:38ceb79fef03 | 81 | * @brief Send a block of data over ITM stimulus port. |
kevman | 0:38ceb79fef03 | 82 | * |
kevman | 0:38ceb79fef03 | 83 | * @param[in] port The stimulus port to send data over. |
kevman | 0:38ceb79fef03 | 84 | * @param[in] data The block of data to send. |
kevman | 0:38ceb79fef03 | 85 | * @param[in] len The number of bytes of data to send. |
kevman | 0:38ceb79fef03 | 86 | * |
kevman | 0:38ceb79fef03 | 87 | * The data is written using multiple appropriately-sized port accesses for |
kevman | 0:38ceb79fef03 | 88 | * efficient transfer. |
kevman | 0:38ceb79fef03 | 89 | */ |
kevman | 0:38ceb79fef03 | 90 | void mbed_itm_send_block(uint32_t port, const void *data, size_t len); |
kevman | 0:38ceb79fef03 | 91 | |
kevman | 0:38ceb79fef03 | 92 | /**@}*/ |
kevman | 0:38ceb79fef03 | 93 | |
kevman | 0:38ceb79fef03 | 94 | #ifdef __cplusplus |
kevman | 0:38ceb79fef03 | 95 | } |
kevman | 0:38ceb79fef03 | 96 | #endif |
kevman | 0:38ceb79fef03 | 97 | |
kevman | 0:38ceb79fef03 | 98 | #endif |
kevman | 0:38ceb79fef03 | 99 | |
kevman | 0:38ceb79fef03 | 100 | #endif /* MBED_ITM_API_H */ |
kevman | 0:38ceb79fef03 | 101 | |
kevman | 0:38ceb79fef03 | 102 | /**@}*/ |