![]() |
PS_Fgen_FW
4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
|
Public Member Functions | |
MCP23S08 (uint8_t deviceAddr) | |
void | begin () |
bool | digitalReadIO (uint8_t pin) |
void | digitalWriteIO (uint8_t pin, bool state) |
void | pinModeIO (uint8_t pin, MCP23S08_PinModes_t mode) |
void | setOutputStates (uint8_t states) |
void | setPinModes (uint8_t modes) |
void | enablePullups (uint8_t enables) |
void | setInterruptOnChange (uint8_t mask) |
void | setInterruptOnChangeDefaultCompare (uint8_t mask) |
void | setInterruptControl (uint8_t mask) |
void | setINTPinPushPullActiveState (bool activeLow) |
uint8_t | getInputStates () |
uint8_t | getOutputStates () |
uint8_t | getPinModes () |
uint8_t | getEnabledPullups () |
uint8_t | getInterruptOnChange () |
The GPINTEN register controls the interrupt-onchange feature for each pin. | |
uint8_t | getInterruptOnChangeDefaultCompare () |
The default comparison value is configured in the DEFVAL register. | |
uint8_t | getInterruptControl () |
The INTCON register controls how the associated pin value is compared for the interrupt-on-change feature. | |
uint8_t | getInterruptFlags () |
The INTF register reflects the interrupt condition on the port pins of any pin that is enabled for interrupts via the GPINTEN register. | |
uint8_t | getInterruptCaptures () |
The INTCAP register captures the GPIO port value at the time the interrupt occurred. | |
Private Member Functions | |
void | writeRegister (uint8_t address, uint8_t data) |
uint8_t | readRegister (uint8_t address) |
Private Attributes | |
uint8_t | deviceOpcode = 0x40 |
uint8_t MCP23S08::getInterruptCaptures | ( | ) |
The INTCAP register captures the GPIO port value at the time the interrupt occurred.
The register is �readonly� and is updated only when an interrupt occurs. The register will remain unchanged until the interrupt is cleared via a read of INTCAP or GPIO.
uint8_t MCP23S08::getInterruptControl | ( | ) |
The INTCON register controls how the associated pin value is compared for the interrupt-on-change feature.
If a bit is set, the corresponding I/O pin is compared against the associated bit in the DEFVAL register. If a bit value is clear, the corresponding I/O pin is compared against the previous value.
uint8_t MCP23S08::getInterruptFlags | ( | ) |
The INTF register reflects the interrupt condition on the port pins of any pin that is enabled for interrupts via the GPINTEN register.
A �set� bit indicates that the associated pin caused the interrupt
uint8_t MCP23S08::getInterruptOnChange | ( | ) |
The GPINTEN register controls the interrupt-onchange feature for each pin.
If a bit is set, the corresponding pin is enabled for interrupt-on-change. The DEFVAL and INTCON registers must also be configured if any pins are enabled for interrupt-on-change.
uint8_t MCP23S08::getInterruptOnChangeDefaultCompare | ( | ) |
The default comparison value is configured in the DEFVAL register.
If enabled (via GPINTEN and INTCON) to compare against the DEFVAL register, an opposite value on the associated pin will cause an interrupt to occur.