/* This function sends a I2C packet enclosed by a I2C start and stop to a SHA204 device.  */
static uint8_t sha204p_send(uint8_t word_address, uint8_t count, uint8_t *buffer)
/* This function sends a I2C packet enclosed by a I2C start and stop to a SHA204 device.  */
static uint8_t sha204p_send(uint8_t word_address, uint8_t count, uint8_t *buffer)
{
	twi_package_t twi_package = {
		.chip = device_address,
		.addr_length = 1,
		.length = count,
		.buffer = (void *) buffer,
		.addr[0] = word_address
	};
	return (twi_master_write(ATSHA204_TWI_PORT, &twi_package) ? SHA204_COMM_FAIL : SHA204_SUCCESS);
}