Yann Gautier | 4518c59 | 2018-11-15 09:51:06 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef STM32_CONSOLE_H |
| 8 | #define STM32_CONSOLE_H |
| 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <drivers/console.h> |
Yann Gautier | 4518c59 | 2018-11-15 09:51:06 +0100 | [diff] [blame] | 11 | |
| 12 | #define CONSOLE_T_STM32_BASE CONSOLE_T_DRVDATA |
| 13 | |
| 14 | #ifndef __ASSEMBLY__ |
| 15 | |
| 16 | #include <stdint.h> |
| 17 | |
| 18 | struct console_stm32 { |
| 19 | console_t console; |
| 20 | uintptr_t base; |
| 21 | }; |
| 22 | |
| 23 | /* |
| 24 | * Initialize a new STM32 console instance and register it with the console |
| 25 | * framework. The |console| pointer must point to storage that will be valid |
| 26 | * for the lifetime of the console, such as a global or static local variable. |
| 27 | * Its contents will be reinitialized from scratch. |
| 28 | */ |
| 29 | int console_stm32_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud, |
| 30 | struct console_stm32 *console); |
| 31 | |
| 32 | #endif /*__ASSEMBLY__*/ |
| 33 | |
| 34 | #endif /* STM32_CONSOLE_H */ |