Pn532 Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
PN532 RFID/NFC reader
public class Pn532 : Iot.Device.Card.CardTransceiver, IDisposable
type Pn532 = class
inherit CardTransceiver
interface IDisposable
Public Class Pn532
Inherits CardTransceiver
Implements IDisposable
- Inheritance
- Implements
Constructors
Pn532(I2cDevice, Boolean) |
Create a PN532 using I2C |
Pn532(I2cDevice, LogLevel) |
Create a PN532 using I2C |
Pn532(I2cDevice) |
Create a PN532 using I2C |
Pn532(SpiDevice, Int32, GpioController, Boolean, Boolean) |
Create a PN532 using SPI |
Pn532(SpiDevice, Int32, GpioController, Boolean) |
Create a PN532 using SPI |
Pn532(SpiDevice, Int32, GpioController, LogLevel, Boolean) |
Create a PN532 using SPI |
Pn532(SpiDevice, LogLevel) |
Create a PN532 using SPI |
Pn532(String, Boolean) |
Create a PN532 using Serial Port |
Pn532(String, LogLevel) |
Create a PN532 using Serial Port |
Pn532(String) |
Create a PN532 using Serial Port |
Fields
I2cDefaultAddress |
The default I2C address |
SpiClockFrequency |
PN532 SPI Clock Frequency |
SpiMode |
Only SPI Mode supported is Mode0 |
SupportedProtocols |
The set of NFC protocols that are supported by this transceiver. |
Properties
FirmwareVersion |
Firmware version information |
LogLevel |
The Log level |
LogTo |
The location to log the info |
MaximumReadSize |
The maximum number of bytes that can be read from the card in a single transaction, (excluding CRC). This is constrained by the operating mode as well as transceiver limitations (such as the size of a FIFO buffer in the transceiver). |
MaximumReadSize |
The maximum number of bytes that can be read from the card in a single transaction, (excluding CRC). This is constrained by the operating mode as well as transceiver limitations (such as the size of a FIFO buffer in the transceiver). (Inherited from CardTransceiver) |
MaximumWriteSize |
The maximum number of bytes that can be written to the card in a single transaction, (excluding CRC). This is constrained by the operating mode as well as transceiver limitations (such as the size of a FIFO buffer in the transceiver). |
MaximumWriteSize |
The maximum number of bytes that can be written to the card in a single transaction, (excluding CRC). This is constrained by the operating mode as well as transceiver limitations (such as the size of a FIFO buffer in the transceiver). (Inherited from CardTransceiver) |
ParametersFlags |
Get or set the Security Access Module parameters |
ReadTimeOut |
Set or get the read timeout for I2C and SPI Please refer to the documentation to set the right timeout value depending on the communication mode you are using |
SecurityAccessModuleMode |
Get or set the Security Access Module Mode |
VirtualCardTimeout |
Get or set the timeout when PN532 is in virtual card mode |
Methods
AutoPoll(Byte, UInt16, PollingType[]) |
Automatically poll specific types of devices |
DeselectTarget(Byte) |
Deselect a specific target number card |
Dispose() |
Dispose |
InitAsTarget(TargetModeInitialization, TargetMifareParameters, TargetFeliCaParameters, TargetPiccParameters) |
Set the PN532 as a target, so as a card |
ListPassiveTarget(MaxTarget, TargetBaudRate, ReadOnlySpan<Byte>) |
List all targets cards in range When using this function, you can't determine which target you've read So you'll need to use the Decode functions to try to get a card type So use this function only with a specific card type. Prefer the AutoPoll function As the type identified is returned |
ListPassiveTarget(MaxTarget, TargetBaudRate) |
List all targets cards in range When using this function, you can't determine which target you've read So you'll need to use the Decode functions to try to get a card type So use this function only with a specific card type. Prefer the AutoPoll function As the type identified is returned |
PowerDown(WakeUpEnable) |
Power down the PN532 |
ReadDataAsTarget(Span<Byte>) |
read data from the reader when PN532 is a target |
ReadGpio(Port3, Port7, OperatingMode) |
Read the PN532 GPIO |
ReadGpio(Port7, Port3, OperatingMode) |
Read the PN532 GPIO |
ReadRegister(UInt16, Byte) |
Read a single register |
ReadRegister(UInt16[], Span<Byte>) |
Read any register from the XRAM |
ReadRegisterSfr(SfrRegister[], Span<Byte>) |
Read an array of SFR registers |
ReleaseTarget(Byte) |
Release a specific target number card |
ReselectTarget(Byte) |
Once you have an authentication operation failing with Mifare cards or a read/write, the card stop. TYhe only way to have it back is to send the unselect and anti collision. This function provides this feature |
ReselectTarget(Byte) |
Once you have an authentication operation failing with Mifare cards or a read/write, the card stop. TYhe only way to have it back is to send the unselect and anti collision. This function provides this feature (Inherited from CardTransceiver) |
RunSelfTest(DiagnoseMode) |
Run self tests Note: some self tests are not implemented yet |
SelectTarget(Byte) |
Select a specific target number card |
SetAnalog106kbpsTypeA(Analog106kbpsTypeAMode) |
Set the specific 106 kbps card Type A modes |
SetAnalog212_424_848kbps(Analog212_424_848kbpsMode) |
Configure analog mode |
SetAnalog212_424Kbps(Analog212_424kbpsMode) |
Set the specific 212 424 kbps card modes |
SetAnalogTypeB(AnalogSettingsTypeBMode) |
Set the specific 106 kbps card Type B modes |
SetMaxRetriesInitialization(MaxRetriesMode) |
Set the MAximu Retries during the various initialization modes |
SetMaxRetryWriteRead(Byte) |
Set the Maximum Retry in the 2 WriteRead modes |
SetRfField(RfFieldMode) |
Set the Radio Frequency Field Mode |
SetSerialBaudRate(BaudRate) |
Setup the baud rate communication when using the HSU Serial Port mode |
SetVariousTimings(VariousTimingsMode) |
Set the Various Timing Mode |
Transceive(Byte, ReadOnlySpan<Byte>, Span<Byte>, NfcProtocol) |
This function has to be implemented by all NFC/RFID/Card readers. This function is used in exchange of data with the reader and the cards. |
Transceive(Byte, ReadOnlySpan<Byte>, Span<Byte>, NfcProtocol) |
This function has to be implemented by all NFC/RFID/Card readers. This function is used in exchange of data with the reader and the cards. (Inherited from CardTransceiver) |
Transceive(Byte, ReadOnlySpan<Byte>, Span<Byte>) |
Write data to a card and read what the card responses |
Transceive(Byte, ReadOnlySpan<Byte>, Span<Byte>) |
This function has to be implemented by all NFC/RFID/Card readers. This function is used in exchange of data with the reader and the cards. (Inherited from CardTransceiver) |
TransceiveAdvance(Byte, ReadOnlySpan<Byte>, Span<Byte>) |
Use the built in feature to transceive the data to the card. This add specific logic for some cards. |
TryDecode106kbpsTypeA(Span<Byte>) |
Try to decode a raw byte array containing target information to a 106 kbps Type A card |
TryDecodeData106kbpsInnovisionJewel(Span<Byte>) |
Try to decode a raw byte array containing target information to a 106 kbps Innovision Jewel card |
TryDecodeData106kbpsTypeB(Span<Byte>) |
Try to decode a raw byte array containing target information to a 106 kbps Type B card |
TryDecodeData212_424Kbps(Span<Byte>) |
Try to decode a raw byte array containing target information to a 212 424 kbps card |
WakeUp() |
Wake Up the PN532 |
WriteDataAsTarget(ReadOnlySpan<Byte>) |
Write data to the reader when PN532 is a target |
WriteGpio(Port3) |
Write the PN532 GPIO port 3 leaving port 7 in it's current state |
WriteGpio(Port7, Port3) |
Write the PN532 GPIO ports 3 and 7 |
WriteGpio(Port7) |
Write the PN532 GPIO port 7 leaving port 3 in it's current state |
WriteReadDirect(ReadOnlySpan<Byte>, Span<Byte>) |
Write an array of data directly to the card without adding anything from the PN532 and read the raw data |
WriteReadDirect(Span<Byte>, Span<Byte>) |
Write an array of data directly to the card without adding anything from the PN532 and read the raw data |
WriteRegister(UInt16, Byte) |
Write a single register |
WriteRegister(UInt16[], Span<Byte>) |
Write an array of register |
WriteRegisterSfr(SfrRegister[], Span<Byte>) |
Write an array of SFR registers |