| 27 | #endif |
| 28 | |
| 29 | static void spi_init(uint8_t spre_spr, uint8_t copl, uint8_t cpha) |
| 30 | { |
| 31 | SET_SPI(SPSR, 0xc0); |
| 32 | SET_SPI(PARAM, 0x40); |
| 33 | SET_SPI(PARAM2, 0x01); |
| 34 | SET_SPI(SPER, (spre_spr & 0b00001100) >> 2); |
| 35 | SET_SPI(SPCR, 0x50 | copl << 3 | cpha << 2 | (spre_spr & 0b00000011)); |
| 36 | SET_SPI(SOFTCS, 0xff); |
| 37 | } |
| 38 | |
| 39 | rt_inline void spi_set_csn(uint8_t val) |
| 40 | { |
no outgoing calls
no test coverage detected