Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 3 | mjames | 1 | /* |
| 2 | * spiInterface.h |
||
| 3 | * |
||
| 4 | * Created on: 10 Feb 2018 |
||
| 5 | * Author: Mike |
||
| 6 | */ |
||
| 7 | |||
| 8 | #pragma once |
||
| 9 | #include "ch.h" |
||
| 10 | #include "hal.h" |
||
| 11 | #include "ssd1306_config.h" |
||
| 12 | |||
| 13 | // Peripherial Clock 84MHz SPI1 SPI1 SPI2/3 |
||
| 14 | #define SPI_BaudRatePrescaler_2 ((uint16_t)0x0000) // 42 MHz 21 MHZ |
||
| 15 | #define SPI_BaudRatePrescaler_4 ((uint16_t)0x0008) // 21 MHz 10.5 MHz |
||
| 16 | #define SPI_BaudRatePrescaler_8 ((uint16_t)0x0010) // 10.5 MHz 5.25 MHz |
||
| 17 | #define SPI_BaudRatePrescaler_16 ((uint16_t)0x0018) // 5.25 MHz 2.626 MHz |
||
| 18 | #define SPI_BaudRatePrescaler_32 ((uint16_t)0x0020) // 2.626 MHz 1.3125 MHz |
||
| 19 | #define SPI_BaudRatePrescaler_64 ((uint16_t)0x0028) // 1.3125 MHz 656.25 KHz |
||
| 20 | #define SPI_BaudRatePrescaler_128 ((uint16_t)0x0030) // 656.25 KHz 328.125 KHz |
||
| 21 | #define SPI_BaudRatePrescaler_256 ((uint16_t)0x0038) // 328.125 KHz 164.06 KHz |
||
| 22 | |||
| 23 | #if !defined (SPI_CS_PIN) || !defined(SPI_CS_GPIO) |
||
| 24 | #error "Need to define SPI_CS_PIN and SPI_CS_GPIO" |
||
| 25 | #endif |
||
| 26 | #if !defined (SPI_CD_PIN) || !defined(SPI_CD_GPIO) |
||
| 27 | #error "Need to define SPI_CD_PIN and SPI_CD_GPIO" |
||
| 28 | #endif |
||
| 29 | #if !defined (SPI_RESET_PIN) || !defined(SPI_RESET_GPIO) |
||
| 30 | #error "Need to define SPI_RESET_PIN and SPI_RESET_GPIO" |
||
| 31 | #endif |
||
| 32 |