SPI and pins cleanup

This commit is contained in:
Scott Lahteine
2020-12-30 22:00:36 -06:00
parent 811b5f8bc3
commit a9d18f0f57
20 changed files with 130 additions and 517 deletions

View File

@ -23,12 +23,14 @@
#if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI)
#include <U8glib.h>
#include "../../shared/HAL_SPI.h"
#undef SPI_SPEED
#define SPI_SPEED 0 // Fastest
//#define SPI_SPEED 2 // Slower
#ifndef LCD_SPI_SPEED
#define LCD_SPI_SPEED SPI_FULL_SPEED // Fastest
//#define LCD_SPI_SPEED SPI_QUARTER_SPEED // Slower
#endif
static uint8_t SPI_speed = SPI_SPEED;
static uint8_t SPI_speed = LCD_SPI_SPEED;
static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) {
LOOP_L_N(i, 8) {
@ -104,7 +106,7 @@ static uint8_t swSpiInit(const uint8_t spi_speed) {
uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
switch (msg) {
case U8G_COM_MSG_INIT:
SPI_speed = swSpiInit(SPI_SPEED);
SPI_speed = swSpiInit(LCD_SPI_SPEED);
break;
case U8G_COM_MSG_STOP:

View File

@ -37,7 +37,7 @@
#define TOUCH_SCK_PIN SCK_PIN
#endif
#ifndef TOUCH_CS_PIN
#define TOUCH_CS_PIN CS_PIN
#define TOUCH_CS_PIN SS_PIN
#endif
#ifndef TOUCH_INT_PIN
#define TOUCH_INT_PIN -1