/** * @brief Ignores data on the SPI bus. * @details This asynchronous function starts the transmission of a series of * idle words on the SPI bus and ignores the received data. * @pre A slave must have been selected using @p spiSelect() or * @p spiSelectI(). * @post At the end of the operation the configured callback is invoked. * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored * * @api */ void spiStartIgnore(SPIDriver *spip, size_t n) { osalDbgCheck((spip != NULL) && (n > 0U)); osalSysLock(); osalDbgAssert(spip->state == SPI_READY, "not ready"); spiStartIgnoreI(spip, n); osalSysUnlock(); }
/** * @brief Ignores data on the SPI bus. * @details This asynchronous function starts the transmission of a series of * idle words on the SPI bus and ignores the received data. * @pre A slave must have been selected using @p spiSelect() or * @p spiSelectI(). * @post At the end of the operation the configured callback is invoked. * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored * * @api */ void spiStartIgnore(SPIDriver *spip, size_t n) { chDbgCheck((spip != NULL) && (n > 0), "spiStartIgnore"); chSysLock(); chDbgAssert(spip->state == SPI_READY, "spiStartIgnore(), #1", "not ready"); spiStartIgnoreI(spip, n); chSysUnlock(); }
/** * @brief Ignores data on the SPI bus. * @details This synchronous function performs the transmission of a series of * idle words on the SPI bus and ignores the received data. * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured * without callbacks (@p end_cb = @p NULL). * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored * * @api */ void spiIgnore(SPIDriver *spip, size_t n) { osalDbgCheck((spip != NULL) && (n > 0U)); osalSysLock(); osalDbgAssert(spip->state == SPI_READY, "not ready"); osalDbgAssert(spip->config->end_cb == NULL, "has callback"); spiStartIgnoreI(spip, n); (void) osalThreadSuspendS(&spip->thread); osalSysUnlock(); }
/** * @brief Ignores data on the SPI bus. * @details This synchronous function performs the transmission of a series of * idle words on the SPI bus and ignores the received data. * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured * without callbacks (@p end_cb = @p NULL). * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored * * @api */ void spiIgnore(SPIDriver *spip, size_t n) { chDbgCheck((spip != NULL) && (n > 0), "spiIgnoreWait"); chSysLock(); chDbgAssert(spip->state == SPI_READY, "spiIgnore(), #1", "not ready"); chDbgAssert(spip->config->end_cb == NULL, "spiIgnore(), #2", "has callback"); spiStartIgnoreI(spip, n); _spi_wait_s(spip); chSysUnlock(); }
/** * @brief Ignores data on the SPI bus. * @details This synchronous function performs the transmission of a series of * idle words on the SPI bus and ignores the received data. * @pre In order to use this function the option @p SPI_USE_WAIT must be * enabled. * @pre In order to use this function the driver must have been configured * without callbacks (@p end_cb = @p NULL). * * @param[in] spip pointer to the @p SPIDriver object * @param[in] n number of words to be ignored * * @api */ void spiIgnore(SPIDriver *spip, size_t n) { osalDbgCheck((spip != NULL) && (n > 0U)); #if SPI_SUPPORTS_CIRCULAR osalDbgCheck((spip->config->circular == false) || ((n & 1U) == 0U)); #endif osalSysLock(); osalDbgAssert(spip->state == SPI_READY, "not ready"); spiStartIgnoreI(spip, n); (void) osalThreadSuspendS(&spip->thread); osalSysUnlock(); }