Skip to content

[AE-158] Arduinofy Library Name #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unified Storage Library

The UnifiedStorage library provides a unified interface to access different types of storage, including internal storage, SD cards, and USB mass storage devices. It simplifies the handling of files and directories across multiple storage mediums on Portenta, Opta, and some Nicla boards.
The Arduino_UnifiedStorage library provides a unified interface to access different types of storage, including internal storage, SD cards, and USB mass storage devices. It simplifies the handling of files and directories across multiple storage mediums on Portenta, Opta, and some Nicla boards.


## Examples
Expand Down
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
### Use QSPI Flash, SD cards, and USB mass storage devices
This library allows you to easily switch between different storage mediums on supported boards, check the "Compatibility" section for more details about what storage medium is supported on what board.

To initialise the storage medium you need to create a `UnifiedStorage` object, and to mount it you need to call it's `begin()` method:
To initialise the storage medium you need to create a `Arduino_UnifiedStorage` object, and to mount it you need to call it's `begin()` method:

```c
UnifiedStorage storageMedium = USBStorage(); // or
// UnifiedStorage sd = SDStorage();
// UnifiedStorage internal = InternalStorage();
Arduino_UnifiedStorage storageMedium = USBStorage(); // or
// Arduino_UnifiedStorage sd = SDStorage();
// Arduino_UnifiedStorage internal = InternalStorage();

void setup(){
storageMedium.begin();
}
```
You can initialize a UnifiedStorage object of each type (QSPI, SD, USB), and copy files and folders from one medium to another.
You can initialize a Arduino_UnifiedStorage object of each type (QSPI, SD, USB), and copy files and folders from one medium to another.

### Open, Write, and Read Files

Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/advanced.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This example demonstrates the usage of the "UnifiedStorage" library with USB storage and internal storage.
This example demonstrates the usage of the "Arduino_UnifiedStorage" library with USB storage and internal storage.
The code includes the necessary library and defines instances of the "USBStorage" and "InternalStorage" classes.
In the setup function, the code initializes the serial communication and mounts the USB storage and internal storage.
Expand All @@ -13,7 +13,7 @@ After the file operations, the code prints the contents of both the USB storage
It recursively prints the directories (marked as "[D]") and files (marked as "[F]") using the "printFolderContents" function.
*/

#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"


USBStorage usbStorage = USBStorage();
Expand Down
4 changes: 2 additions & 2 deletions examples/opta_logger/opta_logger.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This example demonstrates the usage of the "UnifiedStorage" library for logging and backing up data to USB storage in case a USB Mass Storage device is inserted.
This example demonstrates the usage of the "Arduino_UnifiedStorage" library for logging and backing up data to USB storage in case a USB Mass Storage device is inserted.
The code defines two main functions: "logData" and "performUpdate".
The "logData" function logs sensor data by reading an analog sensor and writing the data to the log file.
Expand All @@ -21,7 +21,7 @@ INSTRUCTIONS
The skecth will log to internal storage in the meantime, and wait for the USB drive to be inserted again.
*/

#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"
#include <vector>

#define USB_MOUNTED_LED LED_BLUE
Expand Down
4 changes: 2 additions & 2 deletions examples/simple/simple.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This examples demonstrates the usage of the "UnifiedStorage" library,
This examples demonstrates the usage of the "Arduino_UnifiedStorage" library,
which allows the program to easily switch between different storage mediums.
By uncommenting the appropriate lines, you can choose to use either an SD card,
Expand All @@ -16,7 +16,7 @@ It changes the mode of the files to read mode, moves the file pointers to the be
The read data is printed to the serial monitor.
*/

#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

SDStorage unifiedStorage = SDStorage(); // or
//USBStorage unifiedStorage = USBStorage() // or
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=UnifiedStorage
name=Arduino_UnifiedStorage
version=1.0.0
author=Arduino
maintainer=Arduino <info@arduino.cc>
Expand All @@ -7,4 +7,4 @@ paragraph=Adds ability to access different storage mediums
category=Storage
url=https://arduino.cc
architectures=renesas,mbed_portenta
includes=UnifiedStorage.h
includes=Arduino_UnifiedStorage.h
6 changes: 4 additions & 2 deletions src/UnifiedStorage.h → src/Arduino_UnifiedStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#if defined(ARDUINO_PORTENTA_C33)
#include "Types.h"
#include "Arduino.h"
#include "POSIXStorage.h"
#include "Arduino_POSIXStorage.h"

#endif

Expand All @@ -28,7 +28,7 @@
#include "FATFileSystem.h"
#endif

class UnifiedStorage {
class Arduino_UnifiedStorage {
public:
virtual int begin() = 0;

Expand All @@ -50,5 +50,7 @@ class UnifiedStorage {
#endif


extern Arduino_UnifiedStorage UnifiedStorage;

#endif

2 changes: 1 addition & 1 deletion src/InternalStorage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

InternalStorage::InternalStorage(){
#if defined(ARDUINO_PORTENTA_C33)
Expand Down
2 changes: 1 addition & 1 deletion src/InternalStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef InternalStorage_H
#define InternalStorage_H

#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

class InternalStorage : public UnifiedStorage {

Expand Down
2 changes: 1 addition & 1 deletion src/SDStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef SDStorage_H
#define SDStorage_H

#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_C33) || !defined(ARDUINO_OPTA)

Expand Down
2 changes: 1 addition & 1 deletion src/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define PATH_MAX 255

#include "Arduino.h"
#include "POSIXStorage.h"
#include "Arduino_POSIXStorage.h"
#include <iostream>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion src/USBStorage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

#ifndef USBStorage_H
#define USBStorage_H
Expand Down
2 changes: 1 addition & 1 deletion tests/test_qspi_usb_sd/test_c33
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
arduino-cli compile -b arduino:renesas_portenta:portenta_c33 --library "../../POSIXStorage" --library "/home/c.dragomir/ArduinoWorkspace/arduino_UnifiedStorage"
arduino-cli compile -b arduino:renesas_portenta:portenta_c33 --library "../../Arduino_POSIXStorage" --library "/home/c.dragomir/ArduinoWorkspace/Arduino_UnifiedStorage"
arduino-cli upload -b arduino:renesas_portenta:portenta_c33
2 changes: 1 addition & 1 deletion tests/test_qspi_usb_sd/test_h7
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
arduino-cli compile -b arduino:mbed_portenta:envie_m7 --library "../../POSIXStorage" --library "/home/c.dragomir/ArduinoWorkspace/arduino_UnifiedStorage"
arduino-cli compile -b arduino:mbed_portenta:envie_m7 --library "../../Arduino_POSIXStorage" --library "/home/c.dragomir/ArduinoWorkspace/Arduino_UnifiedStorage"
arduino-cli upload -b arduino:mbed_portenta:envie_m7
2 changes: 1 addition & 1 deletion tests/test_qspi_usb_sd/test_qspi_usb_sd.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <Arduino.h>
#include "UnifiedStorage.h"
#include "Arduino_UnifiedStorage.h"

#define HAS_USB 1
#define HAS_SD 1
Expand Down