-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
now i don't/haven't used this library but it appears to me that you have a few errors.
your defined address for DEFVALB is incorrect and should be 0x07 rather than DEFVALB = 0x06 which is actually the address of DEFVALA
Also attempting to read a single hw register, your r/w is setup for buffer 3 and then returning buffer 4?
public static byte ReadRegister8(byte register)
{
// This function will read a single register, and return it
WriteBuffer3[0] = (BaseAddR | (Address << 1)); // Send the MCP23S17 opcode, chip address, and read bit
WriteBuffer3[1] = register;
spi0.TransferFullDuplex(WriteBuffer3, ReadBuffer3);
return ReadBuffer4[2];
// convertToInt(readBuffer); // Return the constructed word, the format is 0x(register value)
}
HastPiControl/Hastarin.Devices.MCP23S17/MCP23S17.cs
Metadata
Metadata
Assignees
Labels
No labels