diff --git a/.github/workflows/Continuous-integration.yml b/.github/workflows/Continuous-integration.yml new file mode 100644 index 0000000..7bafe89 --- /dev/null +++ b/.github/workflows/Continuous-integration.yml @@ -0,0 +1,70 @@ +name: X_NUCLEO_53L7A1 Continuous Integration +on: + push: + branches: + - main + paths-ignore: + - '*' + - '**.md' + - '**.txt' + pull_request: + paths-ignore: + - '*' + - '**.md' + - '**.txt' +jobs: + astyle_check: + runs-on: ubuntu-latest + name: AStyle check + steps: + # First of all, clone the repo using the checkout action. + - name: Checkout + uses: actions/checkout@main + + - name: Astyle check + id: Astyle + uses: stm32duino/actions/astyle-check@main + + # Use the output from the `Astyle` step + - name: Astyle Errors + if: failure() + run: | + cat ${{ steps.Astyle.outputs.astyle-result }} + exit 1 + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + + # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md + - name: Spell check + uses: codespell-project/actions-codespell@master + with: + check_filenames: true + check_hidden: true + # In the event of a false positive, add the word in all lower case to this file: + ignore_words_file: ./extras/codespell-ignore-words-list.txt + lib_build: + runs-on: ubuntu-latest + name: Library compilation + steps: + + # First of all, clone the repo using the checkout action. + - name: Checkout + uses: actions/checkout@main + + - name: Compilation + id: compile + uses: stm32duino/actions/compile-examples@main + with: + board-pattern: "NUCLEO_L476RG" + libraries: "STM32duino VL53L7CX" + + # Use the output from the `Compilation` step + - name: Compilation Errors + if: failure() + run: | + cat ${{ steps.compile.outputs.compile-result }} + exit 1 diff --git a/README.md b/README.md index 89185dd..89926bf 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ When the NFC module is started and ready, the message "Sytstem init done!" is di Next, the tag is written, we wait few seconds, we read the same tag and print it on the monitor window. You can test this application by connecting it with your smartphone. -On Android, donwload a NFC Tools. Then start the app, check if NFC is activated +On Android, download a NFC Tools. Then start the app, check if NFC is activated on your smartphone. Put your smartphone near the tag, you can read it. You can write a tag with this app. -* X_NUCLEO_NFC04A1_SimpleWrite: This application writes a NDEF message, containg a URI record, to the tag. +* X_NUCLEO_NFC04A1_SimpleWrite: This application writes a NDEF message, containing a URI record, to the tag. When the NFC module is started and ready, the message "System init done!" is displayed on the monitor window. Next, the tag is written with a URI. @@ -31,7 +31,7 @@ Next, the tag is written with a URI. You can test this application by tapping the tag with your smartphone. On Android, check if NFC is activated on your smartphone. Put your smartphone near the tag to read it. -The prefered Internet Browser is automatically opened with the provided URI. +The preferred Internet Browser is automatically opened with the provided URI. # Dependencies diff --git a/examples/X_NUCLEO_NFC04A1_HelloWorld/X_NUCLEO_NFC04A1_HelloWorld.ino b/examples/X_NUCLEO_NFC04A1_HelloWorld/X_NUCLEO_NFC04A1_HelloWorld.ino old mode 100644 new mode 100755 index ef91609..1f25f4f --- a/examples/X_NUCLEO_NFC04A1_HelloWorld/X_NUCLEO_NFC04A1_HelloWorld.ino +++ b/examples/X_NUCLEO_NFC04A1_HelloWorld/X_NUCLEO_NFC04A1_HelloWorld.ino @@ -53,7 +53,7 @@ all LED's blink. You can also use your smartphone to read/write a tag. - On Android, donwload a NFC Tools. Then start the app, check if NFC is activated + On Android, download a NFC Tools. Then start the app, check if NFC is activated on your smartphone. Put your smartphone near the tag, you can read it. You can write a tag with this app. ****************************************************************************** @@ -61,55 +61,58 @@ #include "x_nucleo_nfc04.h" +#define DEV_I2C Wire +X_Nucleo_NFC04 Nfc(12, -1, &DEV_I2C); + void setup() { const char uri_write_message[] = "st.com/st25"; // Uri message to write in the tag const char uri_write_protocol[] = URI_ID_0x01_STRING; // Uri protocol to write in the tag String uri_write = String(uri_write_protocol) + String(uri_write_message); String uri_read; - if (X_Nucleo_Nfc04.begin()) { + if (Nfc.begin()) { while (1) { - X_Nucleo_Nfc04.ledOn(GREEN_LED); + Nfc.ledOn(GREEN_LED); delay(100); - X_Nucleo_Nfc04.ledOff(GREEN_LED); + Nfc.ledOff(GREEN_LED); delay(100); } } - X_Nucleo_Nfc04.ledOn(GREEN_LED); + Nfc.ledOn(GREEN_LED); - if (X_Nucleo_Nfc04.writeURI(uri_write_protocol, uri_write_message, "")) { + if (Nfc.writeURI(uri_write_protocol, uri_write_message, "")) { while (1) { - X_Nucleo_Nfc04.ledOn(BLUE_LED); + Nfc.ledOn(BLUE_LED); delay(100); - X_Nucleo_Nfc04.ledOff(BLUE_LED); + Nfc.ledOff(BLUE_LED); delay(100); } } - X_Nucleo_Nfc04.ledOn(BLUE_LED); + Nfc.ledOn(BLUE_LED); delay(100); - if (X_Nucleo_Nfc04.readURI(&uri_read)) { + if (Nfc.readURI(&uri_read)) { while (1) { - X_Nucleo_Nfc04.ledOn(YELLOW_LED); + Nfc.ledOn(YELLOW_LED); delay(100); - X_Nucleo_Nfc04.ledOff(YELLOW_LED); + Nfc.ledOff(YELLOW_LED); delay(100); } } - X_Nucleo_Nfc04.ledOn(YELLOW_LED); + Nfc.ledOn(YELLOW_LED); if (strcmp(uri_read.c_str(), uri_write.c_str()) != 0) { while (1) { - X_Nucleo_Nfc04.ledOn(GREEN_LED); - X_Nucleo_Nfc04.ledOn(BLUE_LED); - X_Nucleo_Nfc04.ledOn(YELLOW_LED); + Nfc.ledOn(GREEN_LED); + Nfc.ledOn(BLUE_LED); + Nfc.ledOn(YELLOW_LED); delay(100); - X_Nucleo_Nfc04.ledOff(GREEN_LED); - X_Nucleo_Nfc04.ledOff(BLUE_LED); - X_Nucleo_Nfc04.ledOff(YELLOW_LED); + Nfc.ledOff(GREEN_LED); + Nfc.ledOff(BLUE_LED); + Nfc.ledOff(YELLOW_LED); delay(100); } } @@ -117,4 +120,4 @@ void setup() { void loop() { //empty loop -} \ No newline at end of file +} diff --git a/examples/X_NUCLEO_NFC04A1_SimpleWrite/X_NUCLEO_NFC04A1_SimpleWrite.ino b/examples/X_NUCLEO_NFC04A1_SimpleWrite/X_NUCLEO_NFC04A1_SimpleWrite.ino old mode 100644 new mode 100755 index 7aa6895..ff9dc5f --- a/examples/X_NUCLEO_NFC04A1_SimpleWrite/X_NUCLEO_NFC04A1_SimpleWrite.ino +++ b/examples/X_NUCLEO_NFC04A1_SimpleWrite/X_NUCLEO_NFC04A1_SimpleWrite.ino @@ -53,13 +53,15 @@ You can use your smartphone to read the tag. On Android, check if NFC is activated on your smartphone. Put your smartphone near the tag to natively read it. - The prefered Internet Browser is automatically opened with the provided URI. + The preferred Internet Browser is automatically opened with the provided URI. ****************************************************************************** */ #include "x_nucleo_nfc04.h" #define SerialPort Serial +#define DEV_I2C Wire +X_Nucleo_NFC04 Nfc(12, -1, &DEV_I2C); void setup() { const char uri_write_message[] = "st.com/st25"; // Uri message to write in the tag @@ -69,23 +71,23 @@ void setup() { // Initialize serial for output. SerialPort.begin(115200); - if (X_Nucleo_Nfc04.begin() == 0) { + if (Nfc.begin() == 0) { SerialPort.println("System Init done!"); - X_Nucleo_Nfc04.ledOn(GREEN_LED); + Nfc.ledOn(GREEN_LED); } else { SerialPort.println("System Init failed!"); while (1); } - if (X_Nucleo_Nfc04.writeURI(uri_write_protocol, uri_write_message, "")) { + if (Nfc.writeURI(uri_write_protocol, uri_write_message, "")) { SerialPort.println("Write failed!"); while (1); } - X_Nucleo_Nfc04.ledOn(BLUE_LED); + Nfc.ledOn(BLUE_LED); } void loop() { //empty loop -} \ No newline at end of file +} diff --git a/extras/codespell-ignore-words-list.txt b/extras/codespell-ignore-words-list.txt new file mode 100644 index 0000000..ae11f32 --- /dev/null +++ b/extras/codespell-ignore-words-list.txt @@ -0,0 +1 @@ +msbuid diff --git a/library.properties b/library.properties index a1e81da..8f0a7aa 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=STM32duino X-NUCLEO-NFC04A1 -version=1.1.1 +version=2.0.0 author=STMicroelectronics maintainer=stm32duino sentence=Allows controlling the ST X-NUCLEO-NFC04A1 expansion board diff --git a/src/BSP/x_nucleo_nfc04a1.cpp b/src/BSP/x_nucleo_nfc04a1.cpp deleted file mode 100644 index a388ccd..0000000 --- a/src/BSP/x_nucleo_nfc04a1.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - ****************************************************************************** - * @file x_nucleo_nfc04a1.c - * @author MMY Application Team - * @version $Revision: 3351 $ - * @date $Date: 2017-01-25 17:28:08 +0100 (Wed, 25 Jan 2017) $ - * @brief This file provides nfc04a1 specific functions - ****************************************************************************** - * @attention - * - *