Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rjrp44/st25dv-library
š½ A st25dv library for esp32 using the esp-idf framework
https://github.com/rjrp44/st25dv-library
esp32s3 idf ndef nfc st25 st25dv
Last synced: 4 days ago
JSON representation
š½ A st25dv library for esp32 using the esp-idf framework
- Host: GitHub
- URL: https://github.com/rjrp44/st25dv-library
- Owner: RJRP44
- License: mit
- Created: 2023-10-28T16:10:17.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-11T16:13:32.000Z (about 1 year ago)
- Last Synced: 2024-11-04T07:42:58.609Z (about 2 months ago)
- Topics: esp32s3, idf, ndef, nfc, st25, st25dv
- Language: C
- Homepage:
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ST25DV library for ESP32
This is a library for ST's [ST25DV-I2C series](https://www.st.com/en/nfc/st25dv-i2c-series-dynamic-nfc-tags.html). The ST25DV chip is an RFID/NFC dynamic tag. It can be accessed by any NFC smartphone or NFC/RFID HF reader, and also by an MCU (an esp32 for this library), using the IĀ²C wired link.
> **Warning**
> This Library is **not** compatible with Arduino framework## š Contents
* [Getting started](#Getting-started)
* [Wiring for the ST25DV š](#Wiring-the-ST25DV-)
* [Library Installation](#library-installation-)
* [Ndef](#ndef)
* [Examples](#examples-)## Getting started
### Wiring the ST25DV šThe wiring is made with the [reference board](https://www.st.com/en/evaluation-tools/ant7-t-25dv64kc.html). Check the [datasheet](https://www.st.com/resource/en/datasheet/st25dv64kc.pdf) to wire directly the chip.
| ST25DV Pins | ESP32S3 Pins |
|-------------|-----------------------------------------------|
| GND | GND |
| VCC | 3v3 |
| SCL | GPIO2, 4.7 kĪ© pullup resistor required to 3v3 |
| SDA | GPIO1, 4.7 kĪ© pullup resistor required to 3v3 |
| GPO (RF) | Not used in the examples |
### Library Installation š„The library is available at https://components.espressif.com/components/rjrp44/st25dv.
So, you can use the [IDF Component Manager](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html) to easily import this library into your project.
To add this component to your project, run:```log
idf.py add-dependency "rjrp44/st25dv^0.1.0"
```### Ndef
This library contains a basic implementation of ndef to read or write data. However, more specific data types like uri and text require their formats to be added.For simple write you can use this function `st25dv_ndef_write_content` as shown :
```c
st25dv_config st25dv_config = {
ST25DV_USER_ADDRESS,
ST25DV_SYSTEM_ADDRESS
};char record_type[] = "android.com:pkg";
char record_payload[] = "fr.ouchat.app";std25dv_ndef_record record = {
NDEF_ST25DV_TNF_EXTERNAL,
record_type,
record_payload
};st25dv_ndef_write_content(st25dv_config, &address, mb, me, ndef_record);
```
Arguments of the function :
- `st25dv_config` is your st25dv config
- `address` is the pointer of the value for the memory address, after writing it is updated to the end of what was written
- `mb` stands for "message begin" and should be true is this record is the first one
- `me` stands for "message end" and should be true for the last record
- `ndef_record` contains 3 values:
- `tnf` : Type Name Format, witch describes the content format. Theses are all the values :
- `0x00` : Empty
- `0x01` : Well known
- `0x02` : Mime
- `0x03` : URI
- `0x04` : External
- `0x05` : Unknown
- `0x06` : Unchanged
- `0x07` : Reserved
- `record_type` : The name of your record type
- `record_payload` : The payloadTo read data you can use this function `st25dv_ndef_read`
```c
std25dv_ndef_record *read = malloc(sizeof(std25dv_ndef_record));
memset(read, 0 , sizeof(std25dv_ndef_record));uint8_t record_num = 2;
uint8_t record_count = 0;
st25dv_ndef_read(st25dv_config, record_num,read, &record_count);//Delete record after use
st25dv_ndef_delete_records(read);
```
## Examples š
You can find in the `š /examples` folder an example project showcasing the main features of the library to help you understand how it works.## š License
Copyright Ā© 2023 [RJRP44](https://www.github.com/RJRP44).
This project is [MIT](https://opensource.org/license/mit/) licensed.
## āØ Show your support
Give a āļø if this project helped you!
## š¤ Authors
- [@RJRP44](https://www.github.com/RJRP44)