* \param[in] SPIOptions SPI Options, a mask consisting of one of each of the \c SPI_SPEED_*,
* \c SPI_SCK_*, \c SPI_SAMPLE_*, \c SPI_ORDER_* and \c SPI_MODE_* masks.
*/
- static inline void SPI_Init(const SPI_t* SPI,
+ static inline void SPI_Init(SPI_t* const SPI,
const uint8_t SPIOptions)
{
SPI->CTRL = (SPIOptions | SPI_ENABLE_bm);
/** Turns off the SPI driver, disabling and returning used hardware to their default configuration.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
*/
- static inline void SPI_Disable(const SPI_t* SPI)
+ static inline void SPI_Disable(SPI_t* const SPI)
{
SPI->CTRL &= ~SPI_ENABLE_bm;
}
/** Retrieves the currently selected SPI mode, once the SPI interface has been configured.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
*
* \return \ref SPI_MODE_MASTER if the interface is currently in SPI Master mode, \ref SPI_MODE_SLAVE otherwise
*/
- static inline uint8_t SPI_GetCurrentMode(const SPI_t* SPI) ATTR_ALWAYS_INLINE;
- static inline uint8_t SPI_GetCurrentMode(const SPI_t* SPI)
+ static inline uint8_t SPI_GetCurrentMode(SPI_t* const SPI) ATTR_ALWAYS_INLINE;
+ static inline uint8_t SPI_GetCurrentMode(SPI_t* const SPI)
{
return (SPI->CTRL & SPI_MASTER_bm);
}
*
* \return Response byte from the attached SPI device.
*/
- static inline uint8_t SPI_TransferByte(const SPI_t* SPI,
+ static inline uint8_t SPI_TransferByte(SPI_t* const SPI,
const uint8_t Byte) ATTR_ALWAYS_INLINE;
- static inline uint8_t SPI_TransferByte(const SPI_t* SPI,
+ static inline uint8_t SPI_TransferByte(SPI_t* const SPI,
const uint8_t Byte)
{
SPI->DATA = Byte;
* \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
* \param[in] Byte Byte to send through the SPI interface.
*/
- static inline void SPI_SendByte(const SPI_t* SPI,
+ static inline void SPI_SendByte(SPI_t* const SPI,
const uint8_t Byte) ATTR_ALWAYS_INLINE;
- static inline void SPI_SendByte(const SPI_t* SPI,
+ static inline void SPI_SendByte(SPI_t* const SPI,
const uint8_t Byte)
{
SPI->DATA = Byte;
*
* \return The response byte from the attached SPI device.
*/
- static inline uint8_t SPI_ReceiveByte(const SPI_t* SPI) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
- static inline uint8_t SPI_ReceiveByte(const SPI_t* SPI)
+ static inline uint8_t SPI_ReceiveByte(SPI_t* const SPI) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
+ static inline uint8_t SPI_ReceiveByte(SPI_t* const SPI)
{
SPI->DATA = 0;
while (!(SPI->STATUS & SPI_IF_bm));