-
Notifications
You must be signed in to change notification settings - Fork 1
Custom configuration of the PN7160
The PN7160 has many parameters that can be finetuned. Some of these are reset at power-on (so they need to be configured at every power-on), others are stored in the non-volatile EEPROM of the PN7160. As this EEPROM has a limited number of write-cycles, I decided to only write them when changes are required.
So during the initialization of the PN7160, we will read all needed configurations (CORE_GET_CONFIG), and then write them if modification is needed (CORE_SET_CONFIG).
In pn7160configcollection.hpp
you can set the number of configurations needed in static constexpr uint32_t nmbrOfConfigs{2};
In pn7160configcollection.cpp
you can then define them, eg. as const pn7160Config setTotalDurationConfig{0x0000, 0x02, setTotalDurationConfigData};
which takes the raw config data from a const array const uint8_t setTotalDurationConfigData[2]{0xF4, 0x01};
The default configuration of the driver does:
- set TOTAL_DURATION to 500 ms, to detect tags a bit faster than the chip default of 1000ms
- selects CFG1 for power management (depends on your hardware)