Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/hic_hal/freescale/k26f/usb_phy.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /* |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * All rights reserved. |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * are permitted provided that the following conditions are met: |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * of conditions and the following disclaimer. |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * other materials provided with the distribution. |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * contributors may be used to endorse or promote products derived from this |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * software without specific prior written permission. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Pawel Zarembski |
0:01f31e923fe2 | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Pawel Zarembski |
0:01f31e923fe2 | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Pawel Zarembski |
0:01f31e923fe2 | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Pawel Zarembski |
0:01f31e923fe2 | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Pawel Zarembski |
0:01f31e923fe2 | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Pawel Zarembski |
0:01f31e923fe2 | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Pawel Zarembski |
0:01f31e923fe2 | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Pawel Zarembski |
0:01f31e923fe2 | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Pawel Zarembski |
0:01f31e923fe2 | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Pawel Zarembski |
0:01f31e923fe2 | 29 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 30 | #ifndef __USB_PHY_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 31 | #define __USB_PHY_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 32 | |
Pawel Zarembski |
0:01f31e923fe2 | 33 | /*! |
Pawel Zarembski |
0:01f31e923fe2 | 34 | * @brief EHCI PHY initialization. |
Pawel Zarembski |
0:01f31e923fe2 | 35 | * |
Pawel Zarembski |
0:01f31e923fe2 | 36 | * This function initializes the EHCI PHY IP. |
Pawel Zarembski |
0:01f31e923fe2 | 37 | * |
Pawel Zarembski |
0:01f31e923fe2 | 38 | * @param[in] controllerId EHCI controller ID; See the #usb_controller_index_t. |
Pawel Zarembski |
0:01f31e923fe2 | 39 | * @param[in] freq The external input clock. |
Pawel Zarembski |
0:01f31e923fe2 | 40 | * |
Pawel Zarembski |
0:01f31e923fe2 | 41 | * @retval kStatus_USB_Success Cancel successfully. |
Pawel Zarembski |
0:01f31e923fe2 | 42 | * @retval kStatus_USB_Error The freq value is incorrect. |
Pawel Zarembski |
0:01f31e923fe2 | 43 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 44 | extern uint32_t USB_EhciPhyInit(uint8_t controllerId, uint32_t freq); |
Pawel Zarembski |
0:01f31e923fe2 | 45 | |
Pawel Zarembski |
0:01f31e923fe2 | 46 | /*! |
Pawel Zarembski |
0:01f31e923fe2 | 47 | * @brief ehci phy initialization for suspend and resume. |
Pawel Zarembski |
0:01f31e923fe2 | 48 | * |
Pawel Zarembski |
0:01f31e923fe2 | 49 | * This function initialize ehci phy IP for suspend and resume. |
Pawel Zarembski |
0:01f31e923fe2 | 50 | * |
Pawel Zarembski |
0:01f31e923fe2 | 51 | * @param[in] controllerId ehci controller id, please reference to #usb_controller_index_t. |
Pawel Zarembski |
0:01f31e923fe2 | 52 | * @param[in] freq the external input clock. |
Pawel Zarembski |
0:01f31e923fe2 | 53 | * for example: if the external input clock is 16M, the parameter freq should be 16000000. |
Pawel Zarembski |
0:01f31e923fe2 | 54 | * |
Pawel Zarembski |
0:01f31e923fe2 | 55 | * @retval kStatus_USB_Success cancel successfully. |
Pawel Zarembski |
0:01f31e923fe2 | 56 | * @retval kStatus_USB_Error the freq value is incorrect. |
Pawel Zarembski |
0:01f31e923fe2 | 57 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 58 | extern uint32_t USB_EhciLowPowerPhyInit(uint8_t controllerId, uint32_t freq); |
Pawel Zarembski |
0:01f31e923fe2 | 59 | |
Pawel Zarembski |
0:01f31e923fe2 | 60 | /*! |
Pawel Zarembski |
0:01f31e923fe2 | 61 | * @brief EHCI PHY deinitialization. |
Pawel Zarembski |
0:01f31e923fe2 | 62 | * |
Pawel Zarembski |
0:01f31e923fe2 | 63 | * This function deinitializes the EHCI PHY IP. |
Pawel Zarembski |
0:01f31e923fe2 | 64 | * |
Pawel Zarembski |
0:01f31e923fe2 | 65 | * @param[in] controllerId EHCI controller ID; See #usb_controller_index_t. |
Pawel Zarembski |
0:01f31e923fe2 | 66 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 67 | extern void USB_EhciPhyDeinit(uint8_t controllerId); |
Pawel Zarembski |
0:01f31e923fe2 | 68 | |
Pawel Zarembski |
0:01f31e923fe2 | 69 | /*! |
Pawel Zarembski |
0:01f31e923fe2 | 70 | * @brief EHCI PHY disconnect detection enable or disable. |
Pawel Zarembski |
0:01f31e923fe2 | 71 | * |
Pawel Zarembski |
0:01f31e923fe2 | 72 | * This function enable/disable the host EHCI disconnect detection. |
Pawel Zarembski |
0:01f31e923fe2 | 73 | * |
Pawel Zarembski |
0:01f31e923fe2 | 74 | * @param[in] controllerId EHCI controller ID; See #usb_controller_index_t. |
Pawel Zarembski |
0:01f31e923fe2 | 75 | * @param[in] enable |
Pawel Zarembski |
0:01f31e923fe2 | 76 | * 1U - enable; |
Pawel Zarembski |
0:01f31e923fe2 | 77 | * 0U - disable; |
Pawel Zarembski |
0:01f31e923fe2 | 78 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 79 | extern void USB_EhcihostPhyDisconnectDetectCmd(uint8_t controllerId, uint8_t enable); |
Pawel Zarembski |
0:01f31e923fe2 | 80 | |
Pawel Zarembski |
0:01f31e923fe2 | 81 | #endif /* __USB_PHY_H__ */ |