nuttx/arch/arm/src/sama5/sam_twi.c
/*******************************************************************************
 * Name: twi_startwrite
 *
 * Description:
 *   Start the next write message
 *
 *******************************************************************************/
twi_startwrite
Description:
Start the next write message
twi_startwrite Description : Start the next write message
static void twi_startwrite(struct twi_dev_s *priv, struct i2c_msg_s *msg)
{
  priv->result = -EBUSY;
  priv->xfrd   = 0;
  twi_putrel(priv, SAM_TWI_MMR_OFFSET, 0);
  twi_putrel(priv, SAM_TWI_MMR_OFFSET, TWI_MMR_IADRSZ_NONE | TWI_MMR_DADR(msg->addr));
  twi_putrel(priv, SAM_TWI_IADR_OFFSET, 0);
  twi_putrel(priv, SAM_TWI_THR_OFFSET, msg->buffer[priv->xfrd++]);
  twi_putrel(priv, SAM_TWI_IER_OFFSET, TWI_INT_TXRDY | TWI_INT_ERRORS);
}
static void twi_startwrite ( struct twi_dev_s * priv , struct i2c_msg_s * msg ) { priv -> result = - EBUSY ; priv -> xfrd = 0 ; twi_putrel ( priv , SAM_TWI_MMR_OFFSET , 0 ) ; twi_putrel ( priv , SAM_TWI_MMR_OFFSET , TWI_MMR_IADRSZ_NONE | TWI_MMR_DADR ( msg -> addr ) ) ; twi_putrel ( priv , SAM_TWI_IADR_OFFSET , 0 ) ; twi_putrel ( priv , SAM_TWI_THR_OFFSET , msg -> buffer [ priv -> xfrd ++ ] ) ; twi_putrel ( priv , SAM_TWI_IER_OFFSET , TWI_INT_TXRDY | TWI_INT_ERRORS ) ; }
Name: twi_startwrite
 Description:
   Start the next write message
Name : twi_startwrite Description : Start the next write message
/* Setup for the transfer */ /* Set slave address and number of internal address bytes. */ /* Set internal address bytes (not used) */ /* Write first byte to send.*/ /* Enable write interrupt */