• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Pigweed Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 #pragma once
16 
17 #include "fsl_common.h"
18 #include "pw_preprocessor/util.h"
19 
20 #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart
21 #define BOARD_DEBUG_UART_BASEADDR (uint32_t)USART0
22 #define BOARD_DEBUG_UART_INSTANCE 0U
23 #define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFlexcommClkFreq(0)
24 #define BOARD_DEBUG_UART_FRG_CLK \
25   (&(const clock_frg_clk_config_t){0U, kCLOCK_FrgPllDiv, 255U, 0U})
26 #define BOARD_DEBUG_UART_CLK_ATTACH kFRG_to_FLEXCOMM0
27 #define BOARD_UART_IRQ_HANDLER FLEXCOMM0_IRQHandler
28 #define BOARD_UART_IRQ FLEXCOMM0_IRQn
29 #ifndef BOARD_DEBUG_UART_BAUDRATE
30 #define BOARD_DEBUG_UART_BAUDRATE 115200
31 #endif
32 
33 PW_EXTERN_C_START
34 
35 void BOARD_InitDebugConsole(void);
36 AT_QUICKACCESS_SECTION_CODE(void BOARD_SetFlexspiClock(FLEXSPI_Type* base,
37                                                        uint32_t src,
38                                                        uint32_t divider));
39 AT_QUICKACCESS_SECTION_CODE(void BOARD_DeinitFlash(FLEXSPI_Type* base));
40 AT_QUICKACCESS_SECTION_CODE(void BOARD_InitFlash(FLEXSPI_Type* base));
41 
42 PW_EXTERN_C_END
43