pn532

package
v0.0.0-...-f612f80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PN532_PREAMBLE   = 0x00
	PN532_STARTCODE1 = 0x00
	PN532_STARTCODE2 = 0xFF
	PN532_POSTAMBLE  = 0x00

	PN532_HOSTTOPN532 = 0xD4

	PN532_FIRMWAREVERSION     = 0x02
	PN532_GETGENERALSTATUS    = 0x04
	PN532_SAMCONFIGURATION    = 0x14
	PN532_INLISTPASSIVETARGET = 0x4A
	PN532_INDATAEXCHANGE      = 0x40
	PN532_MIFARE_READ         = 0x30
	PN532_MIFARE_WRITE        = 0xA0

	PN532_AUTH_WITH_KEYA = 0x60
	PN532_AUTH_WITH_KEYB = 0x61

	PN532_WAKEUP = 0x55

	PN532_SPI_STATREAD  = 0x02
	PN532_SPI_DATAWRITE = 0x01
	PN532_SPI_DATAREAD  = 0x03
	PN532_SPI_READY     = 0x01

	PN532_MIFARE_ISO14443A = 0x0

	KEY_A = 1
	KEY_B = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PN532

type PN532 struct {
	// contains filtered or unexported fields
}

func New

func New(clk, miso, mosi, ss byte) *PN532

func (*PN532) AuthenticateBlock

func (this *PN532) AuthenticateBlock(cardno byte, addr byte, cid uint32, authtype byte, keys []byte) bool

func (*PN532) GetFirmwareVersion

func (this *PN532) GetFirmwareVersion() uint32

func (*PN532) ReadMemoryBlock

func (this *PN532) ReadMemoryBlock(cardno byte, addr byte, block []byte) bool

func (*PN532) ReadPassiveTargetID

func (this *PN532) ReadPassiveTargetID(cardbaudrate byte) uint32

func (*PN532) SAMConfig

func (this *PN532) SAMConfig() bool

func (*PN532) WriteMemoryBlock

func (this *PN532) WriteMemoryBlock(cardno byte, addr byte, block []byte) bool

cardno: 1~2 addr: 0~63 block: len == 16

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL