BlockDevices: specify mbed namespace where needed

pull/14031/head
Martino Facchin 2019-10-04 15:52:47 +02:00 committed by pennam
parent 956b19775c
commit 8ca0e9f161
6 changed files with 17 additions and 17 deletions

View File

@ -197,7 +197,7 @@ private:
void _write_enable(bool enable); void _write_enable(bool enable);
int _sync(void); int _sync(void);
int _write_page(const uint8_t *buffer, uint32_t addr, uint32_t offset, uint32_t size); int _write_page(const uint8_t *buffer, uint32_t addr, uint32_t offset, uint32_t size);
uint32_t _translate_address(bd_addr_t addr); uint32_t _translate_address(mbed::bd_addr_t addr);
// Mutex for thread safety // Mutex for thread safety
mutable PlatformMutex _mutex; mutable PlatformMutex _mutex;

View File

@ -134,7 +134,7 @@ public:
* @param size Size to erase in bytes * @param size Size to erase in bytes
* @return True if erase is valid for underlying block device * @return True if erase is valid for underlying block device
*/ */
virtual bool is_valid_erase(bd_addr_t addr, bd_size_t size) const; virtual bool is_valid_erase(mbed::bd_addr_t addr, mbed::bd_size_t size) const;
private: private:

View File

@ -72,7 +72,7 @@ public:
*/ */
I2CEEBlockDevice( I2CEEBlockDevice(
PinName sda, PinName scl, uint8_t address, PinName sda, PinName scl, uint8_t address,
bd_size_t size, bd_size_t block = 32, mbed::bd_size_t size, mbed::bd_size_t block = 32,
int bus_speed = 400000, int bus_speed = 400000,
bool address_is_eight_bit = false); bool address_is_eight_bit = false);
@ -89,7 +89,7 @@ public:
*/ */
I2CEEBlockDevice( I2CEEBlockDevice(
mbed::I2C *i2c_obj, uint8_t address, mbed::I2C *i2c_obj, uint8_t address,
bd_size_t size, bd_size_t block = 32, mbed::bd_size_t size, mbed::bd_size_t block = 32,
bool address_is_eight_bit = false); bool address_is_eight_bit = false);
/** Destructor of I2CEEBlockDevice /** Destructor of I2CEEBlockDevice
@ -116,7 +116,7 @@ public:
* @param size Size to read in bytes, must be a multiple of read block size * @param size Size to read in bytes, must be a multiple of read block size
* @return 0 on success, negative error code on failure * @return 0 on success, negative error code on failure
*/ */
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size); virtual int read(void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size);
/** Program blocks to a block device /** Program blocks to a block device
* *
@ -127,7 +127,7 @@ public:
* @param size Size to write in bytes, must be a multiple of program block size * @param size Size to write in bytes, must be a multiple of program block size
* @return 0 on success, negative error code on failure * @return 0 on success, negative error code on failure
*/ */
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size); virtual int program(const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size);
/** Erase blocks on a block device /** Erase blocks on a block device
* *
@ -137,33 +137,33 @@ public:
* @param size Size to erase in bytes, must be a multiple of erase block size * @param size Size to erase in bytes, must be a multiple of erase block size
* @return 0 on success, negative error code on failure * @return 0 on success, negative error code on failure
*/ */
virtual int erase(bd_addr_t addr, bd_size_t size); virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size);
/** Get the size of a readable block /** Get the size of a readable block
* *
* @return Size of a readable block in bytes * @return Size of a readable block in bytes
*/ */
virtual bd_size_t get_read_size() const; virtual mbed::bd_size_t get_read_size() const;
/** Get the size of a programable block /** Get the size of a programable block
* *
* @return Size of a programable block in bytes * @return Size of a programable block in bytes
* @note Must be a multiple of the read size * @note Must be a multiple of the read size
*/ */
virtual bd_size_t get_program_size() const; virtual mbed::bd_size_t get_program_size() const;
/** Get the size of a eraseable block /** Get the size of a eraseable block
* *
* @return Size of a eraseable block in bytes * @return Size of a eraseable block in bytes
* @note Must be a multiple of the program size * @note Must be a multiple of the program size
*/ */
virtual bd_size_t get_erase_size() const; virtual mbed::bd_size_t get_erase_size() const;
/** Get the total size of the underlying device /** Get the total size of the underlying device
* *
* @return Size of the underlying device in bytes * @return Size of the underlying device in bytes
*/ */
virtual bd_size_t size() const; virtual mbed::bd_size_t size() const;
/** Get the BlockDevice class type. /** Get the BlockDevice class type.
* *
@ -189,7 +189,7 @@ private:
* @param address An address in the requested page. * @param address An address in the requested page.
* @return The device's I2C address for that page * @return The device's I2C address for that page
*/ */
uint8_t get_paged_device_address(bd_addr_t address); uint8_t get_paged_device_address(mbed::bd_addr_t address);
}; };

View File

@ -68,7 +68,7 @@
*/ */
enum ospif_bd_error { enum ospif_bd_error {
OSPIF_BD_ERROR_OK = 0, /*!< no error */ OSPIF_BD_ERROR_OK = 0, /*!< no error */
OSPIF_BD_ERROR_DEVICE_ERROR = BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */ OSPIF_BD_ERROR_DEVICE_ERROR = mbed::BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */
OSPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */ OSPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */
OSPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */ OSPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */
OSPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */ OSPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */
@ -331,7 +331,7 @@ private:
ospi_status_t _ospi_set_frequency(int freq); ospi_status_t _ospi_set_frequency(int freq);
// Update the 4-byte addressing extension register with the MSB of the address if it is in use // Update the 4-byte addressing extension register with the MSB of the address if it is in use
ospi_status_t _ospi_update_4byte_ext_addr_reg(bd_addr_t addr); ospi_status_t _ospi_update_4byte_ext_addr_reg(mbed::bd_addr_t addr);
/*********************************/ /*********************************/
/* Flash Configuration Functions */ /* Flash Configuration Functions */

View File

@ -53,7 +53,7 @@
*/ */
enum qspif_bd_error { enum qspif_bd_error {
QSPIF_BD_ERROR_OK = 0, /*!< no error */ QSPIF_BD_ERROR_OK = 0, /*!< no error */
QSPIF_BD_ERROR_DEVICE_ERROR = BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */ QSPIF_BD_ERROR_DEVICE_ERROR = mbed::BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */
QSPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */ QSPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */
QSPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */ QSPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */
QSPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */ QSPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */
@ -289,7 +289,7 @@ private:
qspi_status_t _qspi_set_frequency(int freq); qspi_status_t _qspi_set_frequency(int freq);
// Update the 4-byte addressing extension register with the MSB of the address if it is in use // Update the 4-byte addressing extension register with the MSB of the address if it is in use
qspi_status_t _qspi_update_4byte_ext_addr_reg(bd_addr_t addr); qspi_status_t _qspi_update_4byte_ext_addr_reg(mbed::bd_addr_t addr);
/*********************************/ /*********************************/
/* Flash Configuration Functions */ /* Flash Configuration Functions */

View File

@ -280,7 +280,7 @@ private:
mbed::sfdp_hdr_info _sfdp_info; mbed::sfdp_hdr_info _sfdp_info;
unsigned int _page_size_bytes; // Page size - 256 Bytes default unsigned int _page_size_bytes; // Page size - 256 Bytes default
bd_size_t _device_size_bytes; mbed::bd_size_t _device_size_bytes;
// Bus configuration // Bus configuration
unsigned int _address_size; // number of bytes for address unsigned int _address_size; // number of bytes for address