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 #include "pin_mux.h"
16
17 #include "fsl_iopctl.h"
18
BOARD_InitDEBUG_UARTPins()19 void BOARD_InitDEBUG_UARTPins() {
20 const uint32_t G16 =
21 (IOPCTL_PIO_FUNC1 | IOPCTL_PIO_PUPD_DI | IOPCTL_PIO_PULLDOWN_EN |
22 IOPCTL_PIO_INBUF_DI | IOPCTL_PIO_SLEW_RATE_NORMAL |
23 IOPCTL_PIO_FULLDRIVE_DI | IOPCTL_PIO_ANAMUX_DI | IOPCTL_PIO_PSEDRAIN_DI |
24 IOPCTL_PIO_INV_DI);
25
26 IOPCTL_PinMuxSet(IOPCTL, 0U, 1U, G16);
27
28 const uint32_t H16 =
29 (IOPCTL_PIO_FUNC1 | IOPCTL_PIO_PUPD_DI | IOPCTL_PIO_PULLDOWN_EN |
30 IOPCTL_PIO_INBUF_EN | IOPCTL_PIO_SLEW_RATE_NORMAL |
31 IOPCTL_PIO_FULLDRIVE_DI | IOPCTL_PIO_ANAMUX_DI | IOPCTL_PIO_PSEDRAIN_DI |
32 IOPCTL_PIO_INV_DI);
33
34 IOPCTL_PinMuxSet(IOPCTL, 0U, 2U, H16);
35
36 const uint32_t N3 =
37 (IOPCTL_PIO_FUNC1 | IOPCTL_PIO_PUPD_EN | IOPCTL_PIO_PULLUP_EN |
38 IOPCTL_PIO_INBUF_DI | IOPCTL_PIO_SLEW_RATE_NORMAL |
39 IOPCTL_PIO_FULLDRIVE_DI | IOPCTL_PIO_ANAMUX_DI | IOPCTL_PIO_PSEDRAIN_DI |
40 IOPCTL_PIO_INV_DI);
41
42 IOPCTL_PinMuxSet(IOPCTL, 2U, 24U, N3);
43 }
44
BOARD_InitBootPins()45 void BOARD_InitBootPins() { BOARD_InitDEBUG_UARTPins(); }
46