15#include "boards/board_traits.h"
24 using board_traits::SPI_trait;
28 SPI_trait::DDR = (SPI_trait::DDR &
bits::CBV8(SPI_trait::MISO))
29 |
bits::BV8(SPI_trait::MOSI, SPI_trait::SCK, SPI_trait::SS);
31 SPI_trait::PORT = (SPI_trait::PORT |
bits::BV8(SPI_trait::MISO))
32 & ~(
bits::BV8(SPI_trait::MOSI, SPI_trait::SCK));
41 using board_traits::SPI_trait;
44 SPI_trait::DDR = (SPI_trait::DDR &
bits::CBV8(SPI_trait::MISO))
45 |
bits::BV8(SPI_trait::MOSI, SPI_trait::SCK);
static constexpr uint8_t CBV8(uint8_t bit)
Create a uint8_t inverted bitmask for the given bit number.
static constexpr uint8_t BV8(uint8_t bit)
Create a uint8_t bitmask for the given bit number.
void init()
This function must be called once in your program, before any use of an SPI device.