/* This function logs rx or tx data as hex-ascii.  */
void log_sha204(uint8_t length, uint8_t *buffer, bool is_rx)
/* This function logs rx or tx data as hex-ascii.  */
void log_sha204(uint8_t length, uint8_t *buffer, bool is_rx)
{
	uint8_t i;
	uint8_t nibble;
	usart_serial_write_packet(USART_SHA204, (uint8_t *) (is_rx ? "r" : "t"), 1);
	usart_serial_write_packet(USART_SHA204, (uint8_t *) "x: ", 3);
	for (i = 0; i < length; i++) {
		nibble = convert_nibble_to_hexascii(buffer[i] >> 4);
		usart_putchar(USART_SHA204, nibble);
		nibble = convert_nibble_to_hexascii(buffer[i] & 0x0F);
		usart_putchar(USART_SHA204, nibble);
		usart_putchar(USART_SHA204, ' ');
	}
	usart_write_crlf();
}