Subversion Repositories ChibiGauge

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * spiInterface.h
  3.  *
  4.  *  Created on: 10 Feb 2018
  5.  *      Author: Mike
  6.  */
  7.  
  8. #pragma once
  9.  
  10. extern void ssd1306spiInit(void);
  11.  
  12. extern void ssd1306fastSPIwrite(uint8_t d);
  13.  
  14. extern void ssd1306commandSPIwrite(uint8_t c);
  15.  
  16. extern void ssd1306resetDisplay(void);
  17.  
  18. extern void ssd1306SendDisplay(uint8_t * buff, uint8_t len);
  19. // Peripherial Clock 84MHz SPI1                                SPI1        SPI2/3
  20. #define SPI_BaudRatePrescaler_2         ((uint16_t)0x0000) //  42 MHz      21 MHZ
  21. #define SPI_BaudRatePrescaler_4         ((uint16_t)0x0008) //  21 MHz      10.5 MHz
  22. #define SPI_BaudRatePrescaler_8         ((uint16_t)0x0010) //  10.5 MHz    5.25 MHz
  23. #define SPI_BaudRatePrescaler_16        ((uint16_t)0x0018) //  5.25 MHz    2.626 MHz
  24. #define SPI_BaudRatePrescaler_32        ((uint16_t)0x0020) //  2.626 MHz   1.3125 MHz
  25. #define SPI_BaudRatePrescaler_64        ((uint16_t)0x0028) //  1.3125 MHz  656.25 KHz
  26. #define SPI_BaudRatePrescaler_128       ((uint16_t)0x0030) //  656.25 KHz  328.125 KHz
  27. #define SPI_BaudRatePrescaler_256       ((uint16_t)0x0038) //  328.125 KHz 164.06 KHz
  28.  
  29.  
  30. #define SPI_CS_PIN 6
  31. #define SPI_CS_GPIO GPIOB
  32.  
  33. #define SPI_CD_PIN 7
  34. #define SPI_CD_GPIO GPIOB
  35.  
  36. #define SPI_RESET_PIN 8
  37. #define SPI_RESET_GPIO GPIOB
  38.  
  39.  
  40.