Functions | |
s32 | MIOS32_DIN_Init (u32 mode) |
s32 | MIOS32_DIN_PinGet (u32 pin) |
s32 | MIOS32_DIN_SRGet (u32 sr) |
u8 | MIOS32_DIN_SRChangedGetAndClear (u32 sr, u8 mask) |
s32 | MIOS32_DIN_Handler (void *_callback) |
DIN functions for MIOS32
s32 MIOS32_DIN_Handler | ( | void * | _callback | ) |
Initializes DIN driver
[in] | mode | currently only mode 0 supported |
Returns state of a DIN pin
[in] | pin | number (0..127) |
Returns the DIN pin toggle notifications after a SRIO scan. Should be used to check and clear these flags when processed by a DIN handler for exclusive access (avoid propagation of already handled DIN pin changes)
Examples:
1) if a scan matrix handler processes the DIN pins of the first SR, it should call
changed = MIOS32_DIN_SRChangedGetAndClear(0, 0xff)
to get a notification, if (and which) pins have toggled during the last scan. The flags will be cleared, so that the remaining handlers won't process the pins of the first DIN register anymore.
2) it's also possible, to check and clear only dedicated pins of the DIN register by applying a different pin mask. E.g.
changed = MIOS32_DIN_SRChangedGetAndClear(0, 0xc0)
will only check/clear D6 and D7 of the DIN register, the remaining toggle notifications won't be touched and will be forwarded to remaining handlers
[in] | sr | shift register number (0..15) |
[in] | mask | pin mask (8bit value) |