The **Board Support Package** is a module that contains the hardware initialization and configuration of the microcontroller.
The `bsp.cpp` and `bsp_impl.h` files can be found under: `/libs/miosix-kernel/arch/<your-arch>/<your-board>/interfaces_impl/`.
The **Board Support Package** is a module that contains the hardware initialization and configuration of the microcontroller.
The `bsp.cpp` and `bsp_impl.h` files can be found under: `/libs/miosix-kernel/arch/<your-arch>/<your-board>/interfaces_impl/`.
The `bsp.cpp` contains the implementation of some functions that are called when the board is powered up and initialized.
## IRQbspInit
In this function the speed of the GPIO ports is configured. Here you can also configure the GPIO mode (e.g. configuring the correct alternate mode for the pins that belong to an SPI bus), the default serial port along with its speed and so on.
In this function the speed of the GPIO ports is configured. Here you can also configure the GPIO mode (e.g. configuring the correct alternate mode for the pins that belong to an SPI bus), the default serial port along with its speed and so on.
```cpp
voidIRQbspInit()
{
...
...
@@ -46,6 +47,7 @@ Note that `myspi` and `mysensor` along with their corresponding GPIOs are define
## bspInit2
This function contains the configurations needed to access other `USART` ports of the microcontroller.
```cpp
voidbspInit2()
{
...
...
@@ -57,7 +59,8 @@ void bspInit2()
}
```
## Shutdown and Reboot
Usually for safety reasons when designing a new board for a rocket, we never want the board to completely shotdown. So in that case the *shutdown()* function performs a *reboot()*.
Usually for safety reasons when designing a new board for a rocket, we never want the board to completely shotdown. So in that case the _shutdown()_ function performs a _reboot()_.