aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand SIMONNET <bsimonnet@google.com>2016-03-09 10:29:47 -0800
committerBertrand SIMONNET <bsimonnet@google.com>2016-03-10 09:18:26 -0800
commite2d5fe09e909fbff34cba9d9c5f5e1464a194030 (patch)
treeace23a5813b4906bc35462ada41701611ad7dc74
parent7b331c0a446f1cdd3340d3aca0318531a9d1fe1b (diff)
downloadperipheralmanager-e2d5fe09e909fbff34cba9d9c5f5e1464a194030.tar.gz
Use errno instead of a custom error code.
Errno is expressive enough to cover all error cases we can encounter. It is also standard and more convinient to use. All errors will be reported across the AIDL interface via service specific error codes with values from errno. On success, we allow reporting Status::ok() for convenience which translates to a service specific error code 0. Bug: 27477643 Change-Id: Ifa453d9f350cc2e06aea0f6d5c64eb5928404d88
-rw-r--r--client/gpio_impl.cc23
-rw-r--r--client/gpio_impl.h2
-rw-r--r--client/peripheral_manager_client_impl.cc5
-rw-r--r--client/spi_device_impl.cc4
-rw-r--r--client/wrapper.cc9
-rw-r--r--daemon/gpio_manager.cc4
-rw-r--r--daemon/gpio_manager.h3
-rw-r--r--daemon/peripheral_manager_client.cc89
-rw-r--r--daemon/spi_manager.cc4
-rw-r--r--daemon/spi_manager.h2
-rw-r--r--example/peripheralmanager_example.cc13
-rw-r--r--example/pio_flash_apa10c.cc6
-rw-r--r--include/peripheralmanager/errors.h37
-rw-r--r--include/peripheralmanager/peripheral_manager_client.h1
14 files changed, 99 insertions, 103 deletions
diff --git a/client/gpio_impl.cc b/client/gpio_impl.cc
index d12f83a..383b2b5 100644
--- a/client/gpio_impl.cc
+++ b/client/gpio_impl.cc
@@ -19,7 +19,6 @@
#include <binder/Status.h>
#include "peripheralmanager/constants.h"
-#include "peripheralmanager/errors.h"
#include "peripheralmanager/gpio.h"
using android::binder::Status;
@@ -76,30 +75,30 @@ GpioImpl::GpioImpl(const std::string name,
android::sp<IPeripheralManagerClient> client)
: name_(name), client_(client) {}
+GpioImpl::~GpioImpl() {
+ client_->ReleaseGpio(name_);
+}
+
int GpioImpl::SetDirection(GpioDirection direction) {
- Status ret = client_->SetGpioDirection(name_, direction);
- return ret.serviceSpecificErrorCode();
+ return client_->SetGpioDirection(name_, direction).serviceSpecificErrorCode();
}
int GpioImpl::SetEdgeTriggerType(GpioEdgeType type) {
- Status ret = client_->SetGpioEdge(name_, type);
- return ret.serviceSpecificErrorCode();
+ return client_->SetGpioEdge(name_, type).serviceSpecificErrorCode();
}
int GpioImpl::SetActiveType(GpioActiveType type) {
- Status ret = client_->SetGpioActiveType(name_, type);
- return ret.serviceSpecificErrorCode();
+ return client_->SetGpioActiveType(name_, type).serviceSpecificErrorCode();
}
int GpioImpl::SetValue(int value) {
- Status ret = client_->SetGpioValue(name_, value != 0);
- return ret.serviceSpecificErrorCode();
+ return client_->SetGpioValue(name_, value != 0).serviceSpecificErrorCode();
}
int GpioImpl::GetValue(int* value) {
bool val = true;
Status ret = client_->GetGpioValue(name_, &val);
- if (ret.serviceSpecificErrorCode() == PERIPHERAL_IO_OK) {
+ if (ret.isOk()) {
*value = val ? 1 : 0;
}
return ret.serviceSpecificErrorCode();
@@ -108,6 +107,8 @@ int GpioImpl::GetValue(int* value) {
int GpioImpl::GetPollingFd(int* fd) {
ScopedFd scoped_fd;
Status ret = client_->GetGpioPollingFd(name_, &scoped_fd);
- *fd = scoped_fd.release();
+ if (ret.isOk()) {
+ *fd = scoped_fd.release();
+ }
return ret.serviceSpecificErrorCode();
}
diff --git a/client/gpio_impl.h b/client/gpio_impl.h
index 195cc68..089a4e3 100644
--- a/client/gpio_impl.h
+++ b/client/gpio_impl.h
@@ -32,6 +32,8 @@ class GpioImpl {
GpioImpl(const std::string name,
android::sp<android::os::IPeripheralManagerClient> client);
+ ~GpioImpl();
+
int SetDirection(android::GpioDirection direction);
int SetEdgeTriggerType(android::GpioEdgeType type);
diff --git a/client/peripheral_manager_client_impl.cc b/client/peripheral_manager_client_impl.cc
index 7ee67ff..eb1f5f5 100644
--- a/client/peripheral_manager_client_impl.cc
+++ b/client/peripheral_manager_client_impl.cc
@@ -18,7 +18,6 @@
#include <android/os/IPeripheralManager.h>
#include <binder/IServiceManager.h>
-#include <peripheralmanager/errors.h>
using android::binder::Status;
@@ -34,7 +33,7 @@ bool PeripheralManagerClientImpl::Init() {
int PeripheralManagerClientImpl::OpenGpio(const std::string& name,
std::unique_ptr<GpioImpl>* gpio) {
Status status = client_->OpenGpio(name);
- if (status.serviceSpecificErrorCode() == PERIPHERAL_IO_OK) {
+ if (status.isOk()) {
gpio->reset(new GpioImpl(name, client_));
}
return status.serviceSpecificErrorCode();
@@ -49,7 +48,7 @@ int PeripheralManagerClientImpl::OpenSpiDevice(
const std::string& name,
std::unique_ptr<SpiDeviceImpl>* device) {
Status status = client_->OpenSpiDevice(name);
- if (status.serviceSpecificErrorCode() == PERIPHERAL_IO_OK) {
+ if (status.isOk()) {
device->reset(new SpiDeviceImpl(name, client_));
}
return status.serviceSpecificErrorCode();
diff --git a/client/spi_device_impl.cc b/client/spi_device_impl.cc
index 07be067..81d863c 100644
--- a/client/spi_device_impl.cc
+++ b/client/spi_device_impl.cc
@@ -27,7 +27,9 @@ SpiDeviceImpl::SpiDeviceImpl(const std::string& name,
sp<IPeripheralManagerClient> client)
: name_(name), client_(client) {}
-SpiDeviceImpl::~SpiDeviceImpl() {}
+SpiDeviceImpl::~SpiDeviceImpl() {
+ client_->ReleaseSpiDevice(name_);
+}
int SpiDeviceImpl::WriteByte(uint8_t byte) {
return client_->SpiDeviceWriteByte(name_, byte).serviceSpecificErrorCode();
diff --git a/client/wrapper.cc b/client/wrapper.cc
index 77f45ce..82e74a1 100644
--- a/client/wrapper.cc
+++ b/client/wrapper.cc
@@ -76,7 +76,7 @@ int BPeripheralManagerClient_openGpio(const BPeripheralManagerClient* client,
BGpio** gpio) {
std::unique_ptr<GpioImpl> tmp;
int ret = client->impl->OpenGpio(name, &tmp);
- if (tmp) {
+ if (!ret) {
*gpio = new BGpio{tmp.release()};
}
return ret;
@@ -85,7 +85,7 @@ int BPeripheralManagerClient_openGpio(const BPeripheralManagerClient* client,
int BGpio_setDirection(const BGpio* gpio, int direction) {
android::GpioDirection dir;
if (!DirectionFromInt(direction, &dir))
- return PERIPHERAL_IO_UNKNOWN_ERROR;
+ return EINVAL;
return gpio->impl->SetDirection(dir);
}
@@ -93,7 +93,7 @@ int BGpio_setDirection(const BGpio* gpio, int direction) {
int BGpio_setEdgeTriggerType(const BGpio* gpio, int type) {
android::GpioEdgeType t;
if (!EdgeTypeFromInt(type, &t))
- return PERIPHERAL_IO_UNKNOWN_ERROR;
+ return EINVAL;
return gpio->impl->SetEdgeTriggerType(t);
}
@@ -101,7 +101,7 @@ int BGpio_setEdgeTriggerType(const BGpio* gpio, int type) {
int BGpio_setActiveType(const BGpio* gpio, int type) {
android::GpioActiveType t;
if (!ActiveTypeFromInt(type, &t))
- return PERIPHERAL_IO_UNKNOWN_ERROR;
+ return EINVAL;
return gpio->impl->SetActiveType(t);
}
@@ -141,6 +141,7 @@ int BPeripheralManagerClient_openSpiDevice(
if (impl) {
*dev = new BSpiDevice{impl.release()};
}
+
return ret;
}
diff --git a/daemon/gpio_manager.cc b/daemon/gpio_manager.cc
index 578a22b..062b3af 100644
--- a/daemon/gpio_manager.cc
+++ b/daemon/gpio_manager.cc
@@ -55,6 +55,10 @@ std::vector<std::string> GpioManager::GetGpioPins() {
return pins;
}
+bool GpioManager::HasGpio(const std::string& pin_name) {
+ return sysfs_pins_.count(pin_name);
+}
+
bool GpioManager::RegisterDriver(
std::unique_ptr<GpioDriverInfoBase> driver_info) {
std::string key = driver_info->Compat();
diff --git a/daemon/gpio_manager.h b/daemon/gpio_manager.h
index e56ceb4..dd60024 100644
--- a/daemon/gpio_manager.h
+++ b/daemon/gpio_manager.h
@@ -93,7 +93,10 @@ class GpioManager {
// Used by the BSP to tell PMan of an GPIO Pin.
bool RegisterGpioSysfs(const std::string& name, uint32_t index);
bool SetPinMux(const std::string& name, const std::string& mux);
+
+ // Query for available pins.
std::vector<std::string> GetGpioPins();
+ bool HasGpio(const std::string& pin_name);
bool RegisterDriver(std::unique_ptr<GpioDriverInfoBase> driver_info);
diff --git a/daemon/peripheral_manager_client.cc b/daemon/peripheral_manager_client.cc
index 41ec50c..5bffd6f 100644
--- a/daemon/peripheral_manager_client.cc
+++ b/daemon/peripheral_manager_client.cc
@@ -17,7 +17,6 @@
#include "peripheral_manager_client.h"
#include <base/logging.h>
-#include <peripheralmanager/errors.h>
namespace android {
@@ -30,10 +29,13 @@ Status PeripheralManagerClient::ListGpio(std::vector<std::string>* gpios) {
}
Status PeripheralManagerClient::OpenGpio(const std::string& name) {
+ if (!GpioManager::GetGpioManager()->HasGpio(name))
+ return Status::fromServiceSpecificError(ENODEV);
+
auto gpio = GpioManager::GetGpioManager()->OpenGpioPin(name);
if (!gpio) {
- LOG(WARNING) << "Failed to open GPIO " << name;
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ LOG(ERROR) << "Failed to open GPIO " << name;
+ return Status::fromServiceSpecificError(EBUSY);
}
gpios_.emplace(name, std::move(gpio));
@@ -47,57 +49,67 @@ Status PeripheralManagerClient::ReleaseGpio(const std::string& name) {
Status PeripheralManagerClient::SetGpioEdge(const std::string& name, int type) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
- gpios_.find(name)->second->SetEdgeType(GpioEdgeType(type));
- return Status::ok();
+ if (gpios_.find(name)->second->SetEdgeType(GpioEdgeType(type)))
+ return Status::ok();
+
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SetGpioActiveType(const std::string& name,
int type) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
- gpios_.find(name)->second->SetActiveType(GpioActiveType(type));
- return Status::ok();
+ if (gpios_.find(name)->second->SetActiveType(GpioActiveType(type)))
+ return Status::ok();
+
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SetGpioDirection(const std::string& name,
int direction) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
- gpios_.find(name)->second->SetDirection(GpioDirection(direction));
- return Status::ok();
+ if (gpios_.find(name)->second->SetDirection(GpioDirection(direction)))
+ return Status::ok();
+
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SetGpioValue(const std::string& name,
bool value) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
- gpios_.find(name)->second->SetValue(value);
- return Status::ok();
+ if (gpios_.find(name)->second->SetValue(value))
+ return Status::ok();
+
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::GetGpioValue(const std::string& name,
bool* value) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
- gpios_.find(name)->second->GetValue(value);
- return Status::ok();
+ if (gpios_.find(name)->second->GetValue(value))
+ return Status::ok();
+
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::GetGpioPollingFd(const std::string& name,
ScopedFd* fd) {
if (!gpios_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (gpios_.find(name)->second->GetPollingFd(fd))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::ListSpiBuses(std::vector<std::string>* buses) {
@@ -106,12 +118,15 @@ Status PeripheralManagerClient::ListSpiBuses(std::vector<std::string>* buses) {
}
Status PeripheralManagerClient::OpenSpiDevice(const std::string& name) {
+ if (!SpiManager::GetSpiManager()->HasSpiDevBus(name))
+ return Status::fromServiceSpecificError(ENODEV);
+
std::unique_ptr<SpiDevice> device =
SpiManager::GetSpiManager()->OpenSpiDevice(name);
if (!device) {
- LOG(WARNING) << "Failed to open device " << name;
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ LOG(ERROR) << "Failed to open device " << name;
+ return Status::fromServiceSpecificError(EBUSY);
}
spi_devices_.emplace(name, std::move(device));
@@ -120,7 +135,7 @@ Status PeripheralManagerClient::OpenSpiDevice(const std::string& name) {
Status PeripheralManagerClient::ReleaseSpiDevice(const std::string& name) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
spi_devices_.erase(name);
return Status::ok();
@@ -129,25 +144,25 @@ Status PeripheralManagerClient::ReleaseSpiDevice(const std::string& name) {
Status PeripheralManagerClient::SpiDeviceWriteByte(const std::string& name,
int8_t byte) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (spi_devices_.find(name)->second->WriteByte(byte))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceWriteBuffer(
const std::string& name,
const std::vector<uint8_t>& buffer) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (spi_devices_.find(name)->second->WriteBuffer(buffer.data(),
buffer.size()))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceTransfer(
@@ -156,7 +171,7 @@ Status PeripheralManagerClient::SpiDeviceTransfer(
std::unique_ptr<std::vector<uint8_t>>* rx_data,
int size) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
uint8_t* data_sent = tx_data ? tx_data->data() : nullptr;
if (!rx_data) {
@@ -171,53 +186,53 @@ Status PeripheralManagerClient::SpiDeviceTransfer(
}
}
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceSetMode(const std::string& name,
int mode) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (spi_devices_.find(name)->second->SetMode(SpiMode(mode)))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceSetFrequency(const std::string& name,
int frequency_hz) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (frequency_hz > 0 &&
spi_devices_.find(name)->second->SetFrequency(frequency_hz))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceSetBitJustification(
const std::string& name,
bool lsb_first) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (spi_devices_.find(name)->second->SetBitJustification(lsb_first))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
Status PeripheralManagerClient::SpiDeviceSetBitsPerWord(const std::string& name,
int nbits) {
if (!spi_devices_.count(name))
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_DEVICE);
+ return Status::fromServiceSpecificError(EPERM);
if (spi_devices_.find(name)->second->SetBitsPerWord(nbits))
return Status::ok();
- return Status::fromServiceSpecificError(PERIPHERAL_IO_UNKNOWN_ERROR);
+ return Status::fromServiceSpecificError(EREMOTEIO);
}
} // namespace android
diff --git a/daemon/spi_manager.cc b/daemon/spi_manager.cc
index e4df656..9e9dac8 100644
--- a/daemon/spi_manager.cc
+++ b/daemon/spi_manager.cc
@@ -50,6 +50,10 @@ std::vector<std::string> SpiManager::GetSpiDevBuses() {
return buses;
}
+bool SpiManager::HasSpiDevBus(const std::string& name) {
+ return spidev_buses_.count(name);
+}
+
bool SpiManager::RegisterDriver(
std::unique_ptr<SpiDriverInfoBase> driver_info) {
std::string key = driver_info->Compat();
diff --git a/daemon/spi_manager.h b/daemon/spi_manager.h
index 0aeb16d..f60e608 100644
--- a/daemon/spi_manager.h
+++ b/daemon/spi_manager.h
@@ -92,7 +92,9 @@ class SpiManager {
// that can be used by a PMan client.
// Will return false if the bus has already been registered.
bool RegisterSpiDevBus(const std::string& name, uint32_t bus, uint32_t cs);
+
std::vector<std::string> GetSpiDevBuses();
+ bool HasSpiDevBus(const std::string& name);
bool SetPinMux(const std::string& name, const std::string& mux);
bool SetPinMuxWithGroup(const std::string& name,
diff --git a/example/peripheralmanager_example.cc b/example/peripheralmanager_example.cc
index 136e0b9..36f5979 100644
--- a/example/peripheralmanager_example.cc
+++ b/example/peripheralmanager_example.cc
@@ -50,16 +50,17 @@ int main(int argc, char* argv[]) {
// Open GPIO pin.
BGpio* my_gpio;
- if (BPeripheralManagerClient_openGpio(client, pin_name.c_str(), &my_gpio) !=
- PERIPHERAL_IO_OK) {
- LOG(ERROR) << "Failed to open Gpio";
+ int ret =
+ BPeripheralManagerClient_openGpio(client, pin_name.c_str(), &my_gpio);
+ if (ret) {
+ LOG(ERROR) << "Failed to open Gpio: " << strerror(ret);
return 1;
}
// Set the direction to out.
- if (BGpio_setDirection(my_gpio, DIRECTION_OUT_INITIALLY_HIGH) !=
- PERIPHERAL_IO_OK) {
- LOG(ERROR) << "Failed to set gpio pin direction";
+ ret = BGpio_setDirection(my_gpio, DIRECTION_OUT_INITIALLY_HIGH);
+ if (ret) {
+ LOG(ERROR) << "Failed to set gpio pin direction: " << strerror(ret);
return 1;
}
diff --git a/example/pio_flash_apa10c.cc b/example/pio_flash_apa10c.cc
index 68abc49..2fb6227 100644
--- a/example/pio_flash_apa10c.cc
+++ b/example/pio_flash_apa10c.cc
@@ -57,9 +57,9 @@ int main(int argc, char* argv[]) {
// Open SPI bus.
BSpiDevice* my_spi;
- if (BPeripheralManagerClient_openSpiDevice(client, "SPI2", &my_spi) !=
- PERIPHERAL_IO_OK) {
- LOG(ERROR) << "Failed to open Spi";
+ int ret = BPeripheralManagerClient_openSpiDevice(client, "SPI2", &my_spi);
+ if (ret) {
+ LOG(ERROR) << "Failed to open Spi: " << strerror(ret);
return 1;
}
diff --git a/include/peripheralmanager/errors.h b/include/peripheralmanager/errors.h
deleted file mode 100644
index e57026b..0000000
--- a/include/peripheralmanager/errors.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSTEM_PERIPHERALMANAGER_ERRORS_H_
-#define SYSTEM_PERIPHERALMANAGER_ERRORS_H_
-
-#include <sys/cdefs.h>
-
-/// @defgroup Errors Peripheral IO Errors
-/// @brief Error Codes
-/// @{
-
-/// Peripherial IO common error codes
-enum peripheral_error_t {
- PERIPHERAL_IO_OK, /**< Ok */
- PERIPHERAL_IO_UNKNOWN_DEVICE, /**< Unknown device */
- PERIPHERAL_IO_DEVICE_IN_USE, /**< Device in use */
- PERIPHERAL_IO_FUNCTION_NOT_IMPLEMENTED, /**< Function not supported on device. */
- PERIPHERAL_IO_UNKNOWN_ERROR, /**< Generic error */
-};
-
-/// @}
-
-#endif // SYSTEM_PERIPHERALMANAGER_ERRORS_H_
diff --git a/include/peripheralmanager/peripheral_manager_client.h b/include/peripheralmanager/peripheral_manager_client.h
index bdfce86..a424ddb 100644
--- a/include/peripheralmanager/peripheral_manager_client.h
+++ b/include/peripheralmanager/peripheral_manager_client.h
@@ -19,7 +19,6 @@
#include <sys/cdefs.h>
-#include "peripheralmanager/errors.h"
#include "peripheralmanager/gpio.h"
#include "peripheralmanager/spi_device.h"