Adding AttennaOff and get/set of AntennaGain #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation for changing the MFRC522 Receiver Gain (RxGain) as discussed in #43. Allowing the Sketch to change the detection/interaction range (distance at which the PCD can interact with the PICCs).
Adding the following functions:
PCD_GetAntennaGain()
- Get the current MFRC522 Receiver Gain (RxGain[2:0]) value.PCD_SetAntennaGain()
- Set the MFRC522 Receiver Gain (RxGain[2:0]) to given mask.PCD_AntennaOn()
:PCD_AntennaOff()
- Turns the antenna off by disabling pins TX1 and TX2.Where
RxGain[2:0]
is configured via theRFCfgReg
register as described in 9.3.3.6 / table 98 of the datasheet at http://www.nxp.com/documents/data_sheet/MFRC522.pdfTo support the Sketch developers, a
PCD_RxGain
enum is added to define the allowed values forRxGain[2:0]
(a 3 bit pattern within theRFCfgReg
register). Note that 9.3.3.6 of the datasheet shows that theRFCfgReg
register has some reserved bits as well.