UART
Dependencies: BSP_DISCO_L476VG LCD_DISCO_L476VG mbed
main.h@0:7b78e040f288, 2016-10-05 (annotated)
- Committer:
- codebreaker7
- Date:
- Wed Oct 05 10:24:06 2016 +0000
- Revision:
- 0:7b78e040f288
UART
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
codebreaker7 | 0:7b78e040f288 | 1 | /** |
codebreaker7 | 0:7b78e040f288 | 2 | ****************************************************************************** |
codebreaker7 | 0:7b78e040f288 | 3 | * @file UART/UART_Printf/Inc/main.h |
codebreaker7 | 0:7b78e040f288 | 4 | * @author MCD Application Team |
codebreaker7 | 0:7b78e040f288 | 5 | * @version V1.5.0 |
codebreaker7 | 0:7b78e040f288 | 6 | * @date 29-April-2016 |
codebreaker7 | 0:7b78e040f288 | 7 | * @brief Header for main.c module |
codebreaker7 | 0:7b78e040f288 | 8 | ****************************************************************************** |
codebreaker7 | 0:7b78e040f288 | 9 | * @attention |
codebreaker7 | 0:7b78e040f288 | 10 | * |
codebreaker7 | 0:7b78e040f288 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
codebreaker7 | 0:7b78e040f288 | 12 | * |
codebreaker7 | 0:7b78e040f288 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
codebreaker7 | 0:7b78e040f288 | 14 | * are permitted provided that the following conditions are met: |
codebreaker7 | 0:7b78e040f288 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
codebreaker7 | 0:7b78e040f288 | 16 | * this list of conditions and the following disclaimer. |
codebreaker7 | 0:7b78e040f288 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
codebreaker7 | 0:7b78e040f288 | 18 | * this list of conditions and the following disclaimer in the documentation |
codebreaker7 | 0:7b78e040f288 | 19 | * and/or other materials provided with the distribution. |
codebreaker7 | 0:7b78e040f288 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
codebreaker7 | 0:7b78e040f288 | 21 | * may be used to endorse or promote products derived from this software |
codebreaker7 | 0:7b78e040f288 | 22 | * without specific prior written permission. |
codebreaker7 | 0:7b78e040f288 | 23 | * |
codebreaker7 | 0:7b78e040f288 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
codebreaker7 | 0:7b78e040f288 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
codebreaker7 | 0:7b78e040f288 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
codebreaker7 | 0:7b78e040f288 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
codebreaker7 | 0:7b78e040f288 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
codebreaker7 | 0:7b78e040f288 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
codebreaker7 | 0:7b78e040f288 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
codebreaker7 | 0:7b78e040f288 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
codebreaker7 | 0:7b78e040f288 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
codebreaker7 | 0:7b78e040f288 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
codebreaker7 | 0:7b78e040f288 | 34 | * |
codebreaker7 | 0:7b78e040f288 | 35 | ****************************************************************************** |
codebreaker7 | 0:7b78e040f288 | 36 | */ |
codebreaker7 | 0:7b78e040f288 | 37 | |
codebreaker7 | 0:7b78e040f288 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
codebreaker7 | 0:7b78e040f288 | 39 | #ifndef __MAIN_H |
codebreaker7 | 0:7b78e040f288 | 40 | #define __MAIN_H |
codebreaker7 | 0:7b78e040f288 | 41 | |
codebreaker7 | 0:7b78e040f288 | 42 | /* Includes ------------------------------------------------------------------*/ |
codebreaker7 | 0:7b78e040f288 | 43 | #include "stm32l4xx_hal.h" |
codebreaker7 | 0:7b78e040f288 | 44 | #include "stm32l476g_discovery.h" |
codebreaker7 | 0:7b78e040f288 | 45 | #include "stdio.h" |
codebreaker7 | 0:7b78e040f288 | 46 | |
codebreaker7 | 0:7b78e040f288 | 47 | /* Exported types ------------------------------------------------------------*/ |
codebreaker7 | 0:7b78e040f288 | 48 | /* Exported constants --------------------------------------------------------*/ |
codebreaker7 | 0:7b78e040f288 | 49 | /* User can use this section to tailor USARTx/UARTx instance used and associated |
codebreaker7 | 0:7b78e040f288 | 50 | resources */ |
codebreaker7 | 0:7b78e040f288 | 51 | /* Definition for USARTx clock resources */ |
codebreaker7 | 0:7b78e040f288 | 52 | #define USARTx USART1 |
codebreaker7 | 0:7b78e040f288 | 53 | #define USARTx_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE(); |
codebreaker7 | 0:7b78e040f288 | 54 | #define USARTx_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
codebreaker7 | 0:7b78e040f288 | 55 | #define USARTx_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
codebreaker7 | 0:7b78e040f288 | 56 | |
codebreaker7 | 0:7b78e040f288 | 57 | #define USARTx_FORCE_RESET() __HAL_RCC_USART1_FORCE_RESET() |
codebreaker7 | 0:7b78e040f288 | 58 | #define USARTx_RELEASE_RESET() __HAL_RCC_USART1_RELEASE_RESET() |
codebreaker7 | 0:7b78e040f288 | 59 | |
codebreaker7 | 0:7b78e040f288 | 60 | /* Definition for USARTx Pins */ |
codebreaker7 | 0:7b78e040f288 | 61 | #define USARTx_TX_PIN GPIO_PIN_6 |
codebreaker7 | 0:7b78e040f288 | 62 | #define USARTx_TX_GPIO_PORT GPIOB |
codebreaker7 | 0:7b78e040f288 | 63 | #define USARTx_TX_AF GPIO_AF7_USART1 |
codebreaker7 | 0:7b78e040f288 | 64 | #define USARTx_RX_PIN GPIO_PIN_7 |
codebreaker7 | 0:7b78e040f288 | 65 | #define USARTx_RX_GPIO_PORT GPIOB |
codebreaker7 | 0:7b78e040f288 | 66 | #define USARTx_RX_AF GPIO_AF7_USART1 |
codebreaker7 | 0:7b78e040f288 | 67 | |
codebreaker7 | 0:7b78e040f288 | 68 | /* Exported macro ------------------------------------------------------------*/ |
codebreaker7 | 0:7b78e040f288 | 69 | /* Exported functions ------------------------------------------------------- */ |
codebreaker7 | 0:7b78e040f288 | 70 | |
codebreaker7 | 0:7b78e040f288 | 71 | #endif /* __MAIN_H */ |
codebreaker7 | 0:7b78e040f288 | 72 | |
codebreaker7 | 0:7b78e040f288 | 73 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
codebreaker7 | 0:7b78e040f288 | 74 |