mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 10:27:34 +00:00
Small fixes for smt32 support
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
UART::UART(Mutex * mutex)
|
||||
: Interface{mutex}
|
||||
UART::UART(UARTSettings & settings, Mutex * mutex)
|
||||
: Interface{mutex}, settings_{settings}
|
||||
{
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include <sta/devices/stm32/bus/spi.hpp>
|
||||
#ifdef STA_STM32_SPI_ENABLED
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/endian.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace sta
|
||||
}
|
||||
|
||||
|
||||
STM32SPI::STM32SPI(SPI_HandleTypeDef * handle, uint32_t pclkFreq, Mutex * mutex = nullptr)
|
||||
STM32SPI::STM32SPI(SPI_HandleTypeDef * handle, uint32_t pclkFreq, Mutex * mutex)
|
||||
: SPI(getSPISettings(handle, pclkFreq), mutex), handle_{handle}
|
||||
{
|
||||
STA_ASSERT(handle != nullptr);
|
||||
@@ -157,10 +157,8 @@ namespace sta
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
STM32SPIDevice::STM32SPIDevice(STM32SPI * intf, STM32GpioPin csPin)
|
||||
: SPIDevice(intf, &csPin_), csPin_{csPin}
|
||||
STM32SPIDevice::STM32SPIDevice(STM32SPI * intf, STM32GpioPin * csPin)
|
||||
: SPIDevice(intf, csPin)
|
||||
{}
|
||||
} // namespace sta
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
#include <sta/devices/stm32/bus/uart.hpp>
|
||||
#ifdef STA_STM32_UART_ENABLED
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <cstring>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
STM32UART::STM32UART(UART_HandleTypeDef * handle, Mutex * mutex)
|
||||
: UART{mutex}, handle_{handle}
|
||||
STM32UART::STM32UART(UART_HandleTypeDef * handle, UARTSettings & settings, Mutex * mutex)
|
||||
: UART{settings, mutex}, handle_{handle}
|
||||
{
|
||||
STA_ASSERT(handle != nullptr);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include <sta/devices/stm32/can.hpp>
|
||||
#ifdef STA_STM32_CAN_ENABLED
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include <sta/devices/stm32/hal.hpp>
|
||||
#include <sta/devices/stm32/clocks.hpp>
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include <sta/devices/stm32/gpio_pin.hpp>
|
||||
#ifdef STA_STM32_GPIO_ENABLED
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/lang.hpp>
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@ namespace sta
|
||||
HAL_GPIO_WritePin(port_, pin_, (state == GpioPinState::GPIO_LOW) ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
GpioPinState STM32GpioPin::getState()
|
||||
{
|
||||
return HAL_GPIO_ReadPin(port_, pin_) == GPIO_PIN_RESET ? GpioPinState::GPIO_LOW : GpioPinState::GPIO_HIGH;
|
||||
}
|
||||
|
||||
GPIO_TypeDef * STM32GpioPin::getPort() const
|
||||
{
|
||||
return port_;
|
||||
|
Reference in New Issue
Block a user