mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-05 18:21:54 +00:00
Fixed gpio pin implementation and SPI chip select
This commit is contained in:
@@ -24,8 +24,7 @@ namespace sta
|
||||
* @ingroup sta_core_spi
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief %SPI clock polarity.
|
||||
*/
|
||||
|
@@ -7,6 +7,8 @@
|
||||
#include <sta/bus/spi/device.hpp>
|
||||
#include <sta/bus/spi/spi.hpp>
|
||||
|
||||
#include <sta/devices/arduino/gpio_pin.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
class ArduinoSPI : public SPI
|
||||
@@ -31,7 +33,7 @@ namespace sta
|
||||
class ArduinoSPIDevice : public SPIDevice
|
||||
{
|
||||
public:
|
||||
ArduinoSPIDevice(ArduinoSPI * intf);
|
||||
ArduinoSPIDevice(ArduinoSPI * intf, ArduinoGpioPin * csPin);
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
|
@@ -16,6 +16,16 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @brief Describes the pin mode of the GPIO pin.
|
||||
*
|
||||
*/
|
||||
enum class PinMode
|
||||
{
|
||||
GPIO_INPUT,
|
||||
GPIO_OUTPUT
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A wrapper class for Arduino GPIO pins.
|
||||
*
|
||||
@@ -24,10 +34,11 @@ namespace sta
|
||||
class ArduinoGpioPin : public GpioPin
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param pin Pin index
|
||||
/**
|
||||
* @param pin Pin index
|
||||
* @param pinMode The pin mode
|
||||
*/
|
||||
ArduinoGpioPin(uint16_t pin);
|
||||
ArduinoGpioPin(uint16_t pin, PinMode mode);
|
||||
|
||||
void setState(GpioPinState state) override;
|
||||
|
||||
|
@@ -15,7 +15,6 @@ namespace sta
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief GPIO pin state.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user