Beispiel #1
0
void Write_MFRC522(uchar addr, uchar val)
{
	HW_SPI_SELECT();
	SPI_transfer(FileDescriptor,(addr<<1)&0x7E);
	SPI_transfer(FileDescriptor,val);
	HW_SPI_UNSELECT();

}
void Write_MFRC522(uchar addr, uchar val)
{
	HW_SPI_SELECT();
	SPI_transfer((addr<<1)&0x7E);
	SPI_transfer(val);
	HW_SPI_UNSELECT();

}
Beispiel #3
0
uint8_t Read_MFRC522(uchar addr)
{
	uchar val;
	HW_SPI_SELECT();
	SPI_transfer(FileDescriptor,((addr<<1)&0x7E) | 0x80);
	val =SPI_transfer(FileDescriptor,0x00);
	HW_SPI_UNSELECT();
	return val;
}