twi_master: add routine twiReceiveByteSendAck.
This commit is contained in:
@@ -340,6 +340,32 @@ twiReceiveByte_error:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; twiReceiveByteSendAck
|
||||
;
|
||||
; Read a byte from the bus. Sends ACK bit.
|
||||
;
|
||||
; IN:
|
||||
; OUT:
|
||||
; - CARRY flag set: okay, cleared on error
|
||||
; - R16: byte received
|
||||
; USED: R16, R17, R18, R22
|
||||
|
||||
twiReceiveByteSendAck:
|
||||
rcall twiReceiveByte
|
||||
brcc twiReceiveByteSendAck_error
|
||||
push r16
|
||||
clr r16
|
||||
rcall twiWriteBit ; send ACK (R16, R22)
|
||||
pop r16
|
||||
sec
|
||||
ret
|
||||
twiReceiveByteSendAck_error:
|
||||
clc
|
||||
ret
|
||||
|
||||
|
||||
|
||||
TWI_Master_ScanNext:
|
||||
in r15, SREG
|
||||
cli
|
||||
|
||||
Reference in New Issue
Block a user