mirror of
https://github.com/dougg3/mac-rom-simm-programmer.git
synced 2025-02-19 08:31:38 +00:00
Oops! the MCP23S17's DDR is backwards from the AVR. 1 = input, 0 = output. After swapping them, my electrical test is working!
This commit is contained in:
parent
b475c28040
commit
918b615654
@ -98,7 +98,7 @@ void MCP23S17_Init()
|
||||
|
||||
void MCP23S17_SetDDR(uint16_t ddr)
|
||||
{
|
||||
MCP23S17_WriteBothRegs(MCP23S17_IODIRA, ddr);
|
||||
MCP23S17_WriteBothRegs(MCP23S17_IODIRA, ~ddr);
|
||||
}
|
||||
|
||||
void MCP23S17_SetPins(uint16_t data)
|
||||
@ -124,7 +124,7 @@ uint16_t MCP23S17_GetOutputs(void)
|
||||
|
||||
uint16_t MCP23S17_GetDDR(void)
|
||||
{
|
||||
return MCP23S17_ReadBothRegs(MCP23S17_IODIRA);
|
||||
return ~MCP23S17_ReadBothRegs(MCP23S17_IODIRA);
|
||||
}
|
||||
|
||||
uint16_t MCP23S17_GetPullups(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user