mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 10:27:34 +00:00
Fixed gpio pin implementation and SPI chip select
This commit is contained in:
@@ -54,6 +54,8 @@ namespace sta
|
||||
|
||||
void ArduinoSPI::acquire()
|
||||
{
|
||||
SPI::acquire();
|
||||
|
||||
const SPISettings & set = settings();
|
||||
|
||||
uint8_t dataMode;
|
||||
@@ -98,5 +100,13 @@ namespace sta
|
||||
void ArduinoSPI::release()
|
||||
{
|
||||
SPIClass::endTransaction();
|
||||
|
||||
SPI::release();
|
||||
}
|
||||
|
||||
ArduinoSPIDevice::ArduinoSPIDevice(ArduinoSPI * intf, ArduinoGpioPin * csPin)
|
||||
: SPIDevice{intf, csPin}
|
||||
{
|
||||
csPin->setState(GpioPinState::GPIO_HIGH);
|
||||
}
|
||||
} // namespace sta
|
||||
|
@@ -6,7 +6,11 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
ArduinoGpioPin::ArduinoGpioPin(uint16_t pin) : pin_{pin} { }
|
||||
ArduinoGpioPin::ArduinoGpioPin(uint16_t pin, PinMode mode)
|
||||
: pin_{pin}
|
||||
{
|
||||
pinMode(pin, (mode == PinMode::GPIO_OUTPUT) ? OUTPUT : INPUT);
|
||||
}
|
||||
|
||||
void ArduinoGpioPin::setState(GpioPinState state)
|
||||
{
|
||||
|
Reference in New Issue
Block a user