bsp/stm32h7: Split console configuration

This allows applications to individually provide configuration
structures.

Update #4209.
This commit is contained in:
Sebastian Huber
2021-01-04 19:21:11 +01:00
parent affc8de85f
commit 6600585fc8
22 changed files with 508 additions and 150 deletions

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_uart4_config = {
.gpio = {
.regs = GPIOH,
.config = {
.Pin = GPIO_PIN_13 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF6_UART4
}
},
.irq = UART4_IRQn,
.device_index = 3
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_uart4_config = {
.gpio = {
.regs = GPIOH,
.config = {
.Pin = GPIO_PIN_13 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF6_UART4
}
},
.irq = UART4_IRQn,
.device_index = 3
};
stm32h7_uart_context stm32h7_uart4_instance = {
.uart = {
.Instance = UART4,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_uart5_config = {
.gpio = {
.regs = GPIOD,
.config = {
.Pin = GPIO_PIN_1 | GPIO_PIN_2,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF8_UART5
}
},
.irq = UART5_IRQn,
.device_index = 4
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_uart5_config = {
.gpio = {
.regs = GPIOD,
.config = {
.Pin = GPIO_PIN_1 | GPIO_PIN_2,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF8_UART5
}
},
.irq = UART5_IRQn,
.device_index = 4
};
stm32h7_uart_context stm32h7_uart5_instance = {
.uart = {
.Instance = UART5,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_uart7_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_3 | GPIO_PIN_4,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_UART7
}
},
.irq = UART7_IRQn,
.device_index = 6
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_uart7_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_3 | GPIO_PIN_4,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_UART7
}
},
.irq = UART7_IRQn,
.device_index = 6
};
stm32h7_uart_context stm32h7_uart7_instance = {
.uart = {
.Instance = UART7,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_uart8_config = {
.gpio = {
.regs = GPIOE,
.config = {
.Pin = GPIO_PIN_0 | GPIO_PIN_1,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF8_UART8
}
},
.irq = UART8_IRQn,
.device_index = 7
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_uart8_config = {
.gpio = {
.regs = GPIOE,
.config = {
.Pin = GPIO_PIN_0 | GPIO_PIN_1,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF8_UART8
}
},
.irq = UART8_IRQn,
.device_index = 7
};
stm32h7_uart_context stm32h7_uart8_instance = {
.uart = {
.Instance = UART8,

View File

@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
#ifdef UART9
const stm32h7_uart_config stm32h7_uart9_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_15 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF11_UART9
}
},
.irq = UART9_IRQn,
.device_index = 8
};
#endif /* UART9 */

View File

@@ -33,21 +33,6 @@
#ifdef UART9
static const stm32h7_uart_config stm32h7_uart9_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_15 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF11_UART9
}
},
.irq = UART9_IRQn,
.device_index = 8
};
stm32h7_uart_context stm32h7_uart9_instance = {
.uart = {
.Instance = UART9,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_usart1_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_14 | GPIO_PIN_15,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF4_USART1
}
},
.irq = USART1_IRQn,
.device_index = 0
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_usart1_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_14 | GPIO_PIN_15,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF4_USART1
}
},
.irq = USART1_IRQn,
.device_index = 0
};
stm32h7_uart_context stm32h7_usart1_instance = {
.uart = {
.Instance = USART1,

View File

@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
#ifdef USART10
const stm32h7_uart_config stm32h7_usart10_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_15 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF11_USART10
}
},
.irq = USART10_IRQn,
.device_index = 9
};
#endif /* USART10 */

View File

@@ -33,21 +33,6 @@
#ifdef USART10
static const stm32h7_uart_config stm32h7_usart10_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_15 | GPIO_PIN_14,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF11_USART10
}
},
.irq = USART10_IRQn,
.device_index = 9
};
stm32h7_uart_context stm32h7_usart10_instance = {
.uart = {
.Instance = USART10,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_usart2_config = {
.gpio = {
.regs = GPIOA,
.config = {
.Pin = GPIO_PIN_2 | GPIO_PIN_3,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART2
}
},
.irq = USART2_IRQn,
.device_index = 1
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_usart2_config = {
.gpio = {
.regs = GPIOA,
.config = {
.Pin = GPIO_PIN_2 | GPIO_PIN_3,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART2
}
},
.irq = USART2_IRQn,
.device_index = 1
};
stm32h7_uart_context stm32h7_usart2_instance = {
.uart = {
.Instance = USART2,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_usart3_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_9 | GPIO_PIN_10,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART3
}
},
.irq = USART3_IRQn,
.device_index = 2
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_usart3_config = {
.gpio = {
.regs = GPIOB,
.config = {
.Pin = GPIO_PIN_9 | GPIO_PIN_10,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART3
}
},
.irq = USART3_IRQn,
.device_index = 2
};
stm32h7_uart_context stm32h7_usart3_instance = {
.uart = {
.Instance = USART3,

View File

@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stm32h7/hal.h>
const stm32h7_uart_config stm32h7_usart6_config = {
.gpio = {
.regs = GPIOC,
.config = {
.Pin = GPIO_PIN_6 | GPIO_PIN_7,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART6
}
},
.irq = USART6_IRQn,
.device_index = 5
};

View File

@@ -31,21 +31,6 @@
#include <stm32h7/hal.h>
static const stm32h7_uart_config stm32h7_usart6_config = {
.gpio = {
.regs = GPIOC,
.config = {
.Pin = GPIO_PIN_6 | GPIO_PIN_7,
.Mode = GPIO_MODE_AF_PP,
.Pull = GPIO_NOPULL,
.Speed = GPIO_SPEED_FREQ_LOW,
.Alternate = GPIO_AF7_USART6
}
},
.irq = USART6_IRQn,
.device_index = 5
};
stm32h7_uart_context stm32h7_usart6_instance = {
.uart = {
.Instance = USART6,

View File

@@ -112,24 +112,44 @@ int stm32h7_uart_polled_read(rtems_termios_device_context *base);
extern stm32h7_uart_context stm32h7_usart1_instance;
extern const stm32h7_uart_config stm32h7_usart1_config;
extern stm32h7_uart_context stm32h7_usart2_instance;
extern const stm32h7_uart_config stm32h7_usart2_config;
extern stm32h7_uart_context stm32h7_usart3_instance;
extern const stm32h7_uart_config stm32h7_usart3_config;
extern stm32h7_uart_context stm32h7_uart4_instance;
extern const stm32h7_uart_config stm32h7_uart4_config;
extern stm32h7_uart_context stm32h7_uart5_instance;
extern const stm32h7_uart_config stm32h7_uart5_config;
extern stm32h7_uart_context stm32h7_usart6_instance;
extern const stm32h7_uart_config stm32h7_usart6_config;
extern stm32h7_uart_context stm32h7_uart7_instance;
extern const stm32h7_uart_config stm32h7_uart7_config;
extern stm32h7_uart_context stm32h7_uart8_instance;
extern const stm32h7_uart_config stm32h7_uart8_config;
extern stm32h7_uart_context stm32h7_uart9_instance;
extern const stm32h7_uart_config stm32h7_uart9_config;
extern stm32h7_uart_context stm32h7_usart10_instance;
extern const stm32h7_uart_config stm32h7_usart10_config;
extern const uint32_t stm32h7_config_pwr_regulator_voltagescaling;
extern const RCC_OscInitTypeDef stm32h7_config_oscillator;

View File

@@ -268,15 +268,25 @@ source:
- bsps/arm/shared/start/bsp-start-memcpy.S
- bsps/arm/stm32h7/console/console.c
- bsps/arm/stm32h7/console/console-uart4.c
- bsps/arm/stm32h7/console/console-uart4-cfg.c
- bsps/arm/stm32h7/console/console-uart5.c
- bsps/arm/stm32h7/console/console-uart5-cfg.c
- bsps/arm/stm32h7/console/console-uart7.c
- bsps/arm/stm32h7/console/console-uart7-cfg.c
- bsps/arm/stm32h7/console/console-uart8.c
- bsps/arm/stm32h7/console/console-uart8-cfg.c
- bsps/arm/stm32h7/console/console-uart9.c
- bsps/arm/stm32h7/console/console-uart9-cfg.c
- bsps/arm/stm32h7/console/console-usart10.c
- bsps/arm/stm32h7/console/console-usart10-cfg.c
- bsps/arm/stm32h7/console/console-usart1.c
- bsps/arm/stm32h7/console/console-usart1-cfg.c
- bsps/arm/stm32h7/console/console-usart2.c
- bsps/arm/stm32h7/console/console-usart2-cfg.c
- bsps/arm/stm32h7/console/console-usart3.c
- bsps/arm/stm32h7/console/console-usart3-cfg.c
- bsps/arm/stm32h7/console/console-usart6.c
- bsps/arm/stm32h7/console/console-usart6-cfg.c
- bsps/arm/stm32h7/console/printk-support.c
- bsps/arm/stm32h7/hal/stm32h7xx_hal_adc.c
- bsps/arm/stm32h7/hal/stm32h7xx_hal_adc_ex.c