diff --git a/Arduino_package/hardware/libraries/Analog/library.properties b/Arduino_package/hardware/libraries/Analog/library.properties index 6388df4f..69d76bf2 100644 --- a/Arduino_package/hardware/libraries/Analog/library.properties +++ b/Arduino_package/hardware/libraries/Analog/library.properties @@ -2,8 +2,8 @@ name=AmebaAnalog version=1.0.0 author=Realtek SG maintainer=Realtek SG -sentence=With this library you can find useful analog application. +sentence=Analog application usage paragraph= -category=Signal Input/Output +category=Signal IO url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/BLE/keywords.txt b/Arduino_package/hardware/libraries/BLE/keywords.txt index 67efe44e..e351e894 100644 --- a/Arduino_package/hardware/libraries/BLE/keywords.txt +++ b/Arduino_package/hardware/libraries/BLE/keywords.txt @@ -619,7 +619,3 @@ begin KEYWORD2 end KEYWORD2 addService KEYWORD2 advData KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/Arduino_package/hardware/libraries/BLE/library.properties b/Arduino_package/hardware/libraries/BLE/library.properties index 57c0d033..d650dcd1 100644 --- a/Arduino_package/hardware/libraries/BLE/library.properties +++ b/Arduino_package/hardware/libraries/BLE/library.properties @@ -1,8 +1,8 @@ name=AmebaBLE version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=Enables communication with devices that use Bluetooth. +author=Realtek SG +maintainer=Realtek SG +sentence=Enables communication with devices that use Bluetooth paragraph= category=Communication url= diff --git a/Arduino_package/hardware/libraries/Debugging/library.properties b/Arduino_package/hardware/libraries/Debugging/library.properties index acd5547b..285d8d49 100644 --- a/Arduino_package/hardware/libraries/Debugging/library.properties +++ b/Arduino_package/hardware/libraries/Debugging/library.properties @@ -1,8 +1,8 @@ -name=AmebaDebugExample +name=AmebaDebug version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=Debugging example for RTL8735B. +author=Realtek SG +maintainer=Realtek SG +sentence=Debugging mode paragraph= category=Debugging url= diff --git a/Arduino_package/hardware/libraries/FileSystem/library.properties b/Arduino_package/hardware/libraries/FileSystem/library.properties index 4416267d..150bb232 100644 --- a/Arduino_package/hardware/libraries/FileSystem/library.properties +++ b/Arduino_package/hardware/libraries/FileSystem/library.properties @@ -1,9 +1,9 @@ name=AmebaFileSystem version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=Access FAT file systems located on SD cards connected to the SDIO bus. +author=Realtek SG +maintainer=Realtek SG +sentence=Access FAT file systems located on SD cards connected to the SDIO bus paragraph= -category= +category=External Storage url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteStream/ReadWriteStream.ino b/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteStream/ReadWriteStream.ino new file mode 100644 index 00000000..8f607a97 --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteStream/ReadWriteStream.ino @@ -0,0 +1,48 @@ +/* + This sketch shows how to request flash memory read/write stream word. + + Example guide: TBD + */ + +#include + +#define TEST_SIZE 0x1000 +#define RESET_THRESHOLD 5 + +void setup() +{ + Serial.begin(115200); + + FlashMemory.begin(FLASH_MEMORY_APP_BASE, TEST_SIZE); + FlashMemory.read(); + + int i; + if (FlashMemory.buf[0] >= RESET_THRESHOLD) { + for (i = 0; i < TEST_SIZE; i++) { + FlashMemory.buf[i] = 0x00; + } + FlashMemory.write(); + Serial.print("Reset count to 0"); + } else { + for (i = 0; i < TEST_SIZE; i++) { + FlashMemory.buf[i]++; + } + FlashMemory.write(); + Serial.print("Boot count: "); + + for (i = 0; i < (TEST_SIZE - 1); i++) { + if (FlashMemory.buf[i] != FlashMemory.buf[i + 1]) { + Serial.print("error at "); + Serial.print(i); + Serial.print(" value "); + break; + } + } + Serial.println(FlashMemory.buf[i]); + } +} + +void loop() +{ + delay(1000); +} diff --git a/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteWord/ReadWriteWord.ino b/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteWord/ReadWriteWord.ino new file mode 100644 index 00000000..2d30f1dd --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/examples/ReadWriteWord/ReadWriteWord.ino @@ -0,0 +1,47 @@ +/* + This sketch shows how to request flash memory read/write one specific word. + + Example guide: TBD + */ + +#include + +void setup() +{ + Serial.begin(115200); + + unsigned int value; + unsigned int check_value; + + /* request flash size 0x1000 from FLASH_MEMORY_APP_BASE */ + FlashMemory.begin(FLASH_MEMORY_APP_BASE, 0x1000); + + /* read one word (32-bit) from FLASH_MEMORY_APP_BASE plus offset 0x1E00 */ + value = FlashMemory.readWord(0x1E00); + Serial.println(); + Serial.print("Read value is "); + Serial.println(value, HEX); + + if (value == 0xFFFFFFFF) { + value = 0; + } else { + value++; + } + + /* write one word (32-bit) to FLASH_MEMORY_APP_BASE plus offset 0x1F00 */ + Serial.print("Write value is "); + Serial.println(value, HEX); + FlashMemory.writeWord(0x1E00, value); + + check_value = FlashMemory.readWord(0x1E00); + if (check_value == value) { + Serial.println("Success! Read and Write flash memory by word."); + } else { + Serial.println("Error! Read and Write flash memory by word."); + } +} + +void loop() +{ + delay(1000); +} diff --git a/Arduino_package/hardware/libraries/FlashMemory/keywords.txt b/Arduino_package/hardware/libraries/FlashMemory/keywords.txt new file mode 100644 index 00000000..7d3b3946 --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/keywords.txt @@ -0,0 +1,29 @@ +####################################### +# Syntax Coloring Map for FlashMemory +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +FlashMemory KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +begin KEYWORD2 +end KEYWORD2 +read KEYWORD2 +write KEYWORD2 +readWord KEYWORD2 +writeWord KEYWORD2 +eraseSector KEYWORD2 +eraseWord KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### + +buf_size LITERAL1 +buf LITERAL1 diff --git a/Arduino_package/hardware/libraries/FlashMemory/library.properties b/Arduino_package/hardware/libraries/FlashMemory/library.properties new file mode 100644 index 00000000..c551d8aa --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/library.properties @@ -0,0 +1,9 @@ +name=AmebaFlashMemory +version=1.0.0 +author=Realtek SG +maintainer=Realtek SG +sentence=Flash memory lib that allows to eidt flash data +paragraph= +category=Storage +url= +architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.cpp b/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.cpp new file mode 100644 index 00000000..b504b6f5 --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.cpp @@ -0,0 +1,162 @@ +#include "FlashMemory.h" + +flash_t flash_obj; + +FlashMemoryClass::FlashMemoryClass() +{ + _flash_base_address = FLASH_MEMORY_APP_BASE; + buf_size = MAX_FLASH_MEMORY_APP_SIZE; + + buf = (unsigned char *)(malloc(MAX_FLASH_MEMORY_APP_SIZE)); + _pFlash = &flash_obj; +} + +FlashMemoryClass::~FlashMemoryClass() +{ + if (buf != NULL) { + free(buf); + buf = NULL; + } +} + +void FlashMemoryClass::begin(unsigned int flash_base_address, unsigned int flash_buf_size) +{ + if (buf != NULL) { + free(buf); + buf = NULL; + } + + if ((FLASH_MEMORY_APP_BASE <= flash_base_address) && (flash_base_address <= FLASH_MEMORY_SIZE)) { + _flash_base_address = flash_base_address; + } else { + _flash_base_address = FLASH_MEMORY_APP_BASE; + } + + if (flash_buf_size > MAX_FLASH_MEMORY_APP_SIZE) { + buf_size = MAX_FLASH_MEMORY_APP_SIZE; + } else { + buf_size = flash_buf_size; + } + buf = (unsigned char *)(malloc(buf_size)); +} + +void FlashMemoryClass::end() +{ + if (buf != NULL) { + free(buf); + buf = NULL; + } +} + +void FlashMemoryClass::read(unsigned int offset) +{ + if ((_flash_base_address + offset) < FLASH_MEMORY_APP_BASE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } else if ((_flash_base_address + offset + buf_size) > FLASH_MEMORY_SIZE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } + + flash_stream_read(_pFlash, (_flash_base_address + offset), buf_size, (uint8_t *)buf); +} + +void FlashMemoryClass::write(unsigned int offset) +{ + if ((_flash_base_address + offset) < FLASH_MEMORY_APP_BASE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } else if ((_flash_base_address + offset + buf_size) > FLASH_MEMORY_SIZE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } + + for (int i = 0; i < (MAX_FLASH_MEMORY_APP_SIZE / FLASH_SECTOR_SIZE); i++) { + flash_erase_sector(_pFlash, (_flash_base_address + (i * FLASH_SECTOR_SIZE))); + } + + flash_stream_write(_pFlash, (_flash_base_address + offset), buf_size, (uint8_t *)buf); +} + +unsigned int FlashMemoryClass::readWord(unsigned int offset) +{ + if ((_flash_base_address + offset) < FLASH_MEMORY_APP_BASE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return 0; + } else if ((_flash_base_address + offset) > (FLASH_MEMORY_SIZE - 4)) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return 0; + } + + unsigned int value; + + flash_read_word(_pFlash, _flash_base_address + offset, (uint32_t *)&value); + + return value; +} + +void FlashMemoryClass::writeWord(unsigned int offset, unsigned int data) +{ + if ((_flash_base_address + offset) < FLASH_MEMORY_APP_BASE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } else if ((_flash_base_address + offset) > (FLASH_MEMORY_SIZE - 4)) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } + + unsigned int check_val; + unsigned char *tmp_buf; + unsigned int *tmp_val; + unsigned int tmp_sector_adr; + + flash_write_word(_pFlash, _flash_base_address + offset, data); + flash_read_word(_pFlash, _flash_base_address + offset, (uint32_t *)&check_val); + + if (check_val != data) { + tmp_sector_adr = ((_flash_base_address + offset) / FLASH_SECTOR_SIZE) * FLASH_SECTOR_SIZE; + tmp_buf = (unsigned char *)(malloc(FLASH_SECTOR_SIZE)); + flash_stream_read(_pFlash, tmp_sector_adr, FLASH_SECTOR_SIZE, tmp_buf); + flash_erase_sector(_pFlash, tmp_sector_adr); + tmp_val = (unsigned int *)(tmp_buf + _flash_base_address + offset - tmp_sector_adr); + *tmp_val = data; + flash_stream_write(_pFlash, tmp_sector_adr, FLASH_SECTOR_SIZE, tmp_buf); + free(tmp_buf); + } +} + +void FlashMemoryClass::eraseSector(unsigned int sector_offset) +{ + if ((sector_offset % FLASH_SECTOR_SIZE) != 0) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } + + flash_erase_sector(_pFlash, (_flash_base_address + sector_offset)); +} + +void FlashMemoryClass::eraseWord(unsigned int offset) +{ + if ((_flash_base_address + offset) < FLASH_MEMORY_APP_BASE) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } else if ((_flash_base_address + offset) > (FLASH_MEMORY_SIZE - 4)) { + printf("\r\n[ERROR] %s. Invalid offset \n", __FUNCTION__); + return; + } + + unsigned char *tmp_buf; + unsigned int *tmp_val; + unsigned int tmp_sector_adr; + + tmp_sector_adr = ((_flash_base_address + offset) / FLASH_SECTOR_SIZE) * FLASH_SECTOR_SIZE; + tmp_buf = (unsigned char *)(malloc(FLASH_SECTOR_SIZE)); + flash_stream_read(_pFlash, tmp_sector_adr, FLASH_SECTOR_SIZE, tmp_buf); + flash_erase_sector(_pFlash, tmp_sector_adr); + tmp_val = (unsigned int *)(tmp_buf + _flash_base_address + offset - tmp_sector_adr); + *tmp_val = 0; + flash_stream_write(_pFlash, tmp_sector_adr, FLASH_SECTOR_SIZE, tmp_buf); + free(tmp_buf); +} + +FlashMemoryClass FlashMemory = FlashMemoryClass(); diff --git a/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.h b/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.h new file mode 100644 index 00000000..0bea58a4 --- /dev/null +++ b/Arduino_package/hardware/libraries/FlashMemory/src/FlashMemory.h @@ -0,0 +1,92 @@ +#ifndef _FLASH_MEMORY_H_ +#define _FLASH_MEMORY_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include "flash_api.h" + +#ifdef __cplusplus +} +#endif + +// #define NAND_FLASH_SIZE 0x100000 + +#define NOR_FLASH_SIZE 0x100000 +#define FLASH_MEMORY_APP_BASE 0xFD000 +#define FLASH_MEMORY_SIZE NOR_FLASH_SIZE +#define MAX_FLASH_MEMORY_APP_SIZE (FLASH_MEMORY_SIZE - FLASH_MEMORY_APP_BASE) + +#ifndef FLASH_SECTOR_SIZE +#define FLASH_SECTOR_SIZE 0x1000 +#endif + +// @class FlashMemoryClass FlashMemory.h +// @brief Flash memory api +class FlashMemoryClass { +public: + // @brief Constructor of FlashMemoryClass + FlashMemoryClass(); + + // @brief Destructor of FlashMemoryClass + ~FlashMemoryClass(); + + // @brief Initialize/Re-initialize the base address and size + // The base address shall align to size of 0x1000 (4kB). And the size shall be multiple of 0x1000. + // @param[in] flash_base_address The base address + // @param[in] flash_buf_size The desired work size + void begin(unsigned int flash_base_address = FLASH_MEMORY_APP_BASE, unsigned int flash_buf_size = MAX_FLASH_MEMORY_APP_SIZE); + + // @brief free the buf set by begin, deinit flash memory process + void end(); + + // @brief Read the content to buf + // Read flash memory into the buf. The size would be buf_size. + // @param[in] offset The offset according to base address + void read(unsigned int offset = 0); + + // @brief Write buf back to flash memory + // Write flash memory with the content of buf. The size is buf_size. + // @param[in] offset The offset according to base address + void write(unsigned int offset = 0); + + // @brief Read 4 bytes from flash memory + // Read 4 byte from specific offset based on base address. + // @param[in] offset The offset according to base address + // @return the read data with size of 4 bytes + unsigned int readWord(unsigned int offset); + + // @brief Write 4 bytes into flash memory + // It will try to write 4 bytes first. If the read data differ from the write data, then buffer the sector of flash memory, erase it, and + // write correct data back to it. + // @param[in] offset The offset according to base address + void writeWord(unsigned int offset, unsigned int data); + + // @brief Erase flash memory by sector + // Erase flash memory, the size is multiples of sector size. + // @param[in] offset The offset according to base address + void eraseSector(unsigned int sector_offset); + + // @brief Erase flash memory by word + // Erase flash memory, the size is word size. + // @param[in] offset The offset according to base address + void eraseWord(unsigned int offset); + + // @brief The buf size regarded as work size + unsigned int buf_size; + + // @brief The buf to be operated. + // @note Modify buf won't change the content of buf. It needs update to write back to flash memory. + unsigned char *buf; + +private: + unsigned int _flash_base_address; + flash_t *_pFlash; +}; + +extern FlashMemoryClass FlashMemory; + +#endif diff --git a/Arduino_package/hardware/libraries/GPIO/keywords.txt b/Arduino_package/hardware/libraries/GPIO/keywords.txt index bd261a16..12669cb3 100644 --- a/Arduino_package/hardware/libraries/GPIO/keywords.txt +++ b/Arduino_package/hardware/libraries/GPIO/keywords.txt @@ -12,9 +12,10 @@ DHT KEYWORD1 # Methods and Functions (KEYWORD2) ########################################### -########################################### -# Constants (LITERAL1) begin KEYWORD2 readTemperature KEYWORD2 readHumidity KEYWORD2 + +########################################### +# Constants (LITERAL1) ########################################### diff --git a/Arduino_package/hardware/libraries/GPIO/library.properties b/Arduino_package/hardware/libraries/GPIO/library.properties index 461e8f71..1d6c7a5e 100644 --- a/Arduino_package/hardware/libraries/GPIO/library.properties +++ b/Arduino_package/hardware/libraries/GPIO/library.properties @@ -1,9 +1,9 @@ name=AmebaGPIO version=1.4.3 -author=Adafruit&Realtek +author=Adafruit & Realtek SG maintainer=Realtek SG sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors -paragraph=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors -category=Signal Input/Output +paragraph= +category=Signal IO url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/GTimer/library.properties b/Arduino_package/hardware/libraries/GTimer/library.properties index 0cd47fec..e500e673 100644 --- a/Arduino_package/hardware/libraries/GTimer/library.properties +++ b/Arduino_package/hardware/libraries/GTimer/library.properties @@ -1,9 +1,9 @@ name=AmebaGTimer version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=With this library you can find hardware timer utility +author=Realtek SG +maintainer=Realtek SG +sentence=Hardware timer utility paragraph= -category=Signal Input/Output -url=http://www.amebaiot.com/ameba-arduino-peripherals-examples/ +category=Signal IO +url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/Http/keywords.txt b/Arduino_package/hardware/libraries/Http/keywords.txt index 2a2cb20d..e421ab21 100644 --- a/Arduino_package/hardware/libraries/Http/keywords.txt +++ b/Arduino_package/hardware/libraries/Http/keywords.txt @@ -31,6 +31,7 @@ contentLength KEYWORD2 ####################################### # Constants (LITERAL1) ####################################### + HTTP_SUCCESS LITERAL1 HTTP_ERROR_CONNECTION_FAILED LITERAL1 HTTP_ERROR_API LITERAL1 diff --git a/Arduino_package/hardware/libraries/Http/library.properties b/Arduino_package/hardware/libraries/Http/library.properties index 4708988a..0b3431cf 100644 --- a/Arduino_package/hardware/libraries/Http/library.properties +++ b/Arduino_package/hardware/libraries/Http/library.properties @@ -1,9 +1,9 @@ name=AmebaHttp version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=With this library you can send http request. +author=Realtek SG +maintainer=Realtek SG +sentence=Send http request paragraph= category=Communication -url=http://www.amebaiot.com/ameba-arduino-peripherals-examples/ +url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/MQTTClient/library.properties b/Arduino_package/hardware/libraries/MQTTClient/library.properties index cde10249..67b9dbe1 100644 --- a/Arduino_package/hardware/libraries/MQTTClient/library.properties +++ b/Arduino_package/hardware/libraries/MQTTClient/library.properties @@ -1,9 +1,9 @@ name=AmebaMQTTClient version=1.0.0 -author=Realtek -maintainer=Realtek -sentence=A client library for MQTT messaging. -paragraph=MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1 if needed. It supports all Arduino Ethernet Client compatible hardware, including the Intel Galileo/Edison, ESP8266 and TI CC3000. +author=Realtek SG +maintainer=Realtek SG +sentence=A client library for MQTT messaging +paragraph= category=Communication -url=http://www.amebaiot.com +url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/Multimedia/library.properties b/Arduino_package/hardware/libraries/Multimedia/library.properties index 921fdf74..ab55fce0 100644 --- a/Arduino_package/hardware/libraries/Multimedia/library.properties +++ b/Arduino_package/hardware/libraries/Multimedia/library.properties @@ -1,7 +1,7 @@ name=AmebaMultimedia version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Ameba Video API paragraph= category=MMF diff --git a/Arduino_package/hardware/libraries/NTPClient/library.properties b/Arduino_package/hardware/libraries/NTPClient/library.properties index 7488f403..fcc88877 100755 --- a/Arduino_package/hardware/libraries/NTPClient/library.properties +++ b/Arduino_package/hardware/libraries/NTPClient/library.properties @@ -1,7 +1,7 @@ name=NTPClient version=3.2.0 author=Fabrice Weinberg -maintainer=Realtek +maintainer=Realtek SG sentence=An NTPClient to connect to a time server paragraph=Get time from a NTP server and keep it in sync. category=Timing diff --git a/Arduino_package/hardware/libraries/NeuralNetwork/library.properties b/Arduino_package/hardware/libraries/NeuralNetwork/library.properties index e27b7206..87c89544 100644 --- a/Arduino_package/hardware/libraries/NeuralNetwork/library.properties +++ b/Arduino_package/hardware/libraries/NeuralNetwork/library.properties @@ -1,9 +1,9 @@ name=AmebaNN version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Ameba NN API paragraph= -category=MMF +category=NN url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/NeuralNetwork/src/NNAudioClassification.cpp b/Arduino_package/hardware/libraries/NeuralNetwork/src/NNAudioClassification.cpp index ec0ec283..1371de06 100644 --- a/Arduino_package/hardware/libraries/NeuralNetwork/src/NNAudioClassification.cpp +++ b/Arduino_package/hardware/libraries/NeuralNetwork/src/NNAudioClassification.cpp @@ -84,7 +84,7 @@ void NNAudioClassification::end(void) if (mm_module_close(_p_mmf_context) == NULL) { _p_mmf_context = NULL; } else { - printf("NNAudioClassification deinit failed\r\n"); + printf("\r\n[ERROR] NNAudioClassification deinit failed\n"); } } diff --git a/Arduino_package/hardware/libraries/NeuralNetwork/src/NNImageClassification.cpp b/Arduino_package/hardware/libraries/NeuralNetwork/src/NNImageClassification.cpp index 6d39f9bf..1725c808 100755 --- a/Arduino_package/hardware/libraries/NeuralNetwork/src/NNImageClassification.cpp +++ b/Arduino_package/hardware/libraries/NeuralNetwork/src/NNImageClassification.cpp @@ -156,7 +156,7 @@ void NNImageClassification::ICResultCallback(void *p, void *img_param) float *output = (float *)malloc(out->res_cnt * sizeof(float)); if (output == NULL) { - printf("malloc fail\n\r"); + printf("\r\n[ERROR] malloc fail\n"); return; } diff --git a/Arduino_package/hardware/libraries/PowerMode/library.properties b/Arduino_package/hardware/libraries/PowerMode/library.properties index 084b2813..dc941ed8 100644 --- a/Arduino_package/hardware/libraries/PowerMode/library.properties +++ b/Arduino_package/hardware/libraries/PowerMode/library.properties @@ -1,9 +1,9 @@ name=AmebaPowerMode version=1.0.0 -author=zzw -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Ameba PowerMode API paragraph= -category= +category=power save url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/QRCodeScanner/library.properties b/Arduino_package/hardware/libraries/QRCodeScanner/library.properties index 37c61c70..bcd5e3da 100755 --- a/Arduino_package/hardware/libraries/QRCodeScanner/library.properties +++ b/Arduino_package/hardware/libraries/QRCodeScanner/library.properties @@ -1,9 +1,9 @@ name=AmebaQR version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Ameba QRCode Scanning API paragraph= -category= +category=MMF url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/RTC/library.properties b/Arduino_package/hardware/libraries/RTC/library.properties index 39b95587..21f496f7 100644 --- a/Arduino_package/hardware/libraries/RTC/library.properties +++ b/Arduino_package/hardware/libraries/RTC/library.properties @@ -1,9 +1,9 @@ name=AmebaRTC version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=A simple Ameba RTC library paragraph= -category=Realtime Clock (RTC) +category=Realtime Clock url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/SPI/library.properties b/Arduino_package/hardware/libraries/SPI/library.properties index 08ab29fd..8819773b 100644 --- a/Arduino_package/hardware/libraries/SPI/library.properties +++ b/Arduino_package/hardware/libraries/SPI/library.properties @@ -1,9 +1,9 @@ name=AmebaSPI version=1.0.0 -author=Arduino -maintainer=Arduino -sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. For Arduino DUE only. +author=Realtek SG +maintainer=Realtek SG +sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus paragraph= category=Communication -url=http://www.arduino.cc/en/Reference/SPI +url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/Watchdog/library.properties b/Arduino_package/hardware/libraries/Watchdog/library.properties index 0a22b81f..0cd31365 100644 --- a/Arduino_package/hardware/libraries/Watchdog/library.properties +++ b/Arduino_package/hardware/libraries/Watchdog/library.properties @@ -1,9 +1,9 @@ name=AmebaWatchdog version=1.0.0 -author=zzw -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Ameba Watchdog API paragraph= -category= +category=Watchdog url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/WiFi/library.properties b/Arduino_package/hardware/libraries/WiFi/library.properties index 973ece75..94427438 100644 --- a/Arduino_package/hardware/libraries/WiFi/library.properties +++ b/Arduino_package/hardware/libraries/WiFi/library.properties @@ -1,9 +1,9 @@ name=WiFi version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Enables network connection (local and Internet). paragraph=With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. category=Communication -url=http://www.amebaiot.com/ameba-arduino-peripherals-examples/ +url= architectures=AmebaPro2 diff --git a/Arduino_package/hardware/libraries/Wire/keywords.txt b/Arduino_package/hardware/libraries/Wire/keywords.txt index ff314759..a20c42e2 100644 --- a/Arduino_package/hardware/libraries/Wire/keywords.txt +++ b/Arduino_package/hardware/libraries/Wire/keywords.txt @@ -6,6 +6,9 @@ # Datatypes (KEYWORD1) ####################################### +Wire KEYWORD1 +Wire1 KEYWORD1 + ####################################### # Methods and Functions (KEYWORD2) ####################################### @@ -20,13 +23,6 @@ receive KEYWORD2 onReceive KEYWORD2 onRequest KEYWORD2 -####################################### -# Instances (KEYWORD2) -####################################### - -Wire KEYWORD2 - ####################################### # Constants (LITERAL1) ####################################### - diff --git a/Arduino_package/hardware/libraries/Wire/library.properties b/Arduino_package/hardware/libraries/Wire/library.properties index bb34618f..e08d3152 100644 --- a/Arduino_package/hardware/libraries/Wire/library.properties +++ b/Arduino_package/hardware/libraries/Wire/library.properties @@ -1,10 +1,10 @@ name=AmebaWire version=1.0.0 -author=Realtek -maintainer=Realtek +author=Realtek SG +maintainer=Realtek SG sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. paragraph= category=Communication -url=http://www.amebaiot.com/ameba-arduino-peripherals-examples/ +url= architectures=AmebaPro2