/* This function both reads and writes data. For write operations, include data to be written as argument. For read ops, use dummy data as arg. Returned data is read byte val.  */
uint8_t w25q16bv_TransferByte(uint8_t data)
/* This function both reads and writes data. For write operations, include data to be written as argument. For read ops, use dummy data as arg. Returned data is read byte val.  */
uint8_t w25q16bv_TransferByte(uint8_t data)
{
    while ((SSP_SSP0SR & (SSP_SSP0SR_TNF_MASK | SSP_SSP0SR_BSY_MASK)) != SSP_SSP0SR_TNF_NOTFULL);
    SSP_SSP0DR = data;
    while ((SSP_SSP0SR & (SSP_SSP0SR_BSY_MASK | SSP_SSP0SR_RNE_MASK)) != SSP_SSP0SR_RNE_NOTEMPTY);
    return SSP_SSP0DR;
}