Skip to content

Commit

Permalink
AP_HAL: rename QSPIDevice to WSPIDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per authored and tridge committed Apr 27, 2023
1 parent cc086ab commit a73945c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions libraries/AP_HAL/AP_HAL_Namespace.h
Expand Up @@ -33,9 +33,9 @@ namespace AP_HAL {
class OpticalFlow;
class DSP;

class QSPIDevice;
class QSPIDeviceDriver;
class QSPIDeviceManager;
class WSPIDevice;
class WSPIDeviceDriver;
class WSPIDeviceManager;

class CANIface;
class CANFrame;
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL/Device.h
Expand Up @@ -34,7 +34,7 @@ class AP_HAL::Device {
BUS_TYPE_SITL = 4,
BUS_TYPE_MSP = 5,
BUS_TYPE_SERIAL = 6,
BUS_TYPE_QSPI = 7,
BUS_TYPE_WSPI = 7,
};

enum Speed {
Expand Down
8 changes: 4 additions & 4 deletions libraries/AP_HAL/HAL.h
Expand Up @@ -9,7 +9,7 @@ class AP_Param;
#include "RCInput.h"
#include "RCOutput.h"
#include "SPIDevice.h"
#include "QSPIDevice.h"
#include "WSPIDevice.h"
#include "Storage.h"
#include "UARTDriver.h"
#include "system.h"
Expand All @@ -32,7 +32,7 @@ class AP_HAL::HAL {
AP_HAL::UARTDriver* _uartJ, // extra5
AP_HAL::I2CDeviceManager* _i2c_mgr,
AP_HAL::SPIDeviceManager* _spi,
AP_HAL::QSPIDeviceManager* _qspi,
AP_HAL::WSPIDeviceManager* _wspi,
AP_HAL::AnalogIn* _analogin,
AP_HAL::Storage* _storage,
AP_HAL::UARTDriver* _console,
Expand Down Expand Up @@ -65,7 +65,7 @@ class AP_HAL::HAL {
uartJ(_uartJ),
i2c_mgr(_i2c_mgr),
spi(_spi),
qspi(_qspi),
wspi(_wspi),
analogin(_analogin),
storage(_storage),
console(_console),
Expand Down Expand Up @@ -128,7 +128,7 @@ class AP_HAL::HAL {
public:
AP_HAL::I2CDeviceManager* i2c_mgr;
AP_HAL::SPIDeviceManager* spi;
AP_HAL::QSPIDeviceManager* qspi;
AP_HAL::WSPIDeviceManager* wspi;
AP_HAL::AnalogIn* analogin;
AP_HAL::Storage* storage;
AP_HAL::UARTDriver* console;
Expand Down
22 changes: 11 additions & 11 deletions libraries/AP_HAL/QSPIDevice.h → libraries/AP_HAL/WSPIDevice.h
Expand Up @@ -23,16 +23,16 @@
#include "Device.h"
#include "utility/OwnPtr.h"

#ifndef HAL_USE_QSPI_DEFAULT_CFG
#define HAL_USE_QSPI_DEFAULT_CFG 1
#ifndef HAL_USE_WSPI_DEFAULT_CFG
#define HAL_USE_WSPI_DEFAULT_CFG 1
#endif

namespace AP_HAL
{

// Underlying HAL implementation can override these
#if HAL_USE_QSPI_DEFAULT_CFG
namespace QSPI
#if HAL_USE_WSPI_DEFAULT_CFG
namespace WSPI
{
constexpr uint32_t CFG_CMD_MODE_MASK = (3LU << 8LU);
constexpr uint32_t CFG_CMD_MODE_NONE = (0LU << 8LU);
Expand Down Expand Up @@ -80,13 +80,13 @@ constexpr uint32_t CFG_DATA_DDR = (1LU << 31LU);

constexpr uint32_t CFG_SIOO = (1LU << 28LU);
}
#endif //#if HAL_USE_QSPI_DEFAULT_CFG
#endif //#if HAL_USE_WSPI_DEFAULT_CFG

class QSPIDevice : public Device
class WSPIDevice : public Device
{
public:

QSPIDevice() : Device(BUS_TYPE_QSPI) { }
WSPIDevice() : Device(BUS_TYPE_WSPI) { }

/* See AP_HAL::Device::transfer() */
virtual bool transfer(const uint8_t *send, uint32_t send_len,
Expand All @@ -101,21 +101,21 @@ class QSPIDevice : public Device
uint32_t _trx_flags;
};

class QSPIDeviceManager
class WSPIDeviceManager
{
public:
virtual OwnPtr<QSPIDevice> get_device(const char *name)
virtual OwnPtr<WSPIDevice> get_device(const char *name)
{
return nullptr;
}

/* Return the number of QSPI devices currently registered. */
/* Return the number of WSPI devices currently registered. */
virtual uint8_t get_count() const
{
return 0;
}

/* Get qspi device name at @idx */
/* Get wspi device name at @idx */
virtual const char *get_device_name(uint8_t idx) const
{
return nullptr;
Expand Down

0 comments on commit a73945c

Please sign in to comment.