The TWIM hal functions don't check for zero-length buffers, and write 0 to TXD.MAXCNT / RXD.MAXCNT.
However Nordic's docs say the value should be in range [1..0xFFFF], so 0 is not allowed: https://infocenter.nordicsemi.com/topic/ps_nrf52840/twim.html?cp=4_0_0_5_30_6_22#register.RXD.MAXCNT
In practice. doing a zero-length write or read makes the current implementation hang forever. Maybe this should be checked, and return an error like Error::ZeroLengthBuffer
The TWIM hal functions don't check for zero-length buffers, and write 0 to TXD.MAXCNT / RXD.MAXCNT.
However Nordic's docs say the value should be in range
[1..0xFFFF], so 0 is not allowed: https://infocenter.nordicsemi.com/topic/ps_nrf52840/twim.html?cp=4_0_0_5_30_6_22#register.RXD.MAXCNTIn practice. doing a zero-length write or read makes the current implementation hang forever. Maybe this should be checked, and return an error like
Error::ZeroLengthBuffer