STM32F1xx support for TFTGLCD (#20515)
This commit is contained in:
		
							parent
							
								
									aa65c6e477
								
							
						
					
					
						commit
						256e94980e
					
				@ -972,6 +972,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      MeshFlags done_flags{0};
 | 
					      MeshFlags done_flags{0};
 | 
				
			||||||
      const xy_int8_t &lpos = location.pos;
 | 
					      const xy_int8_t &lpos = location.pos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      #if IS_TFTGLCD_PANEL
 | 
				
			||||||
 | 
					        lcd_mesh_edit_setup(0);                             // Change current screen before calling ui.ubl_plot
 | 
				
			||||||
 | 
					        safe_delay(50);
 | 
				
			||||||
 | 
					      #endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      do {
 | 
					      do {
 | 
				
			||||||
        location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags);
 | 
					        location = find_closest_mesh_point_of_type(SET_IN_BITMAP, pos, false, &done_flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -32,7 +32,7 @@
 | 
				
			|||||||
 * and supports color output.
 | 
					 * and supports color output.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if NONE(__AVR__, TARGET_LPC1768, __STM32F1__, STM32F4xx)
 | 
					#if NONE(__AVR__, TARGET_LPC1768, STM32F1, STM32F4xx)
 | 
				
			||||||
  #warning "Selected platform not yet tested. Please contribute your good pin mappings."
 | 
					  #warning "Selected platform not yet tested. Please contribute your good pin mappings."
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -129,7 +129,7 @@ static uint8_t PanelDetected = 0;
 | 
				
			|||||||
#if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
 | 
					#if ANY(__AVR__, TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
 | 
				
			||||||
  #define SPI_SEND_ONE(V) SPI.transfer(V);
 | 
					  #define SPI_SEND_ONE(V) SPI.transfer(V);
 | 
				
			||||||
  #define SPI_SEND_TWO(V) SPI.transfer16(V);
 | 
					  #define SPI_SEND_TWO(V) SPI.transfer16(V);
 | 
				
			||||||
#elif defined(STM32F4xx)
 | 
					#elif EITHER(STM32F4xx, STM32F1xx)
 | 
				
			||||||
  #define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE);
 | 
					  #define SPI_SEND_ONE(V) SPI.transfer(V, SPI_CONTINUE);
 | 
				
			||||||
  #define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE);
 | 
					  #define SPI_SEND_TWO(V) SPI.transfer16(V, SPI_CONTINUE);
 | 
				
			||||||
#elif defined(ARDUINO_ARCH_ESP32)
 | 
					#elif defined(ARDUINO_ARCH_ESP32)
 | 
				
			||||||
@ -139,7 +139,7 @@ static uint8_t PanelDetected = 0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
 | 
					#if ANY(__AVR__, ARDUINO_ARCH_SAM, __SAMD51__, __MK20DX256__, __MK64FX512__)
 | 
				
			||||||
  #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L);
 | 
					  #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L);
 | 
				
			||||||
#elif defined(STM32F4xx)
 | 
					#elif EITHER(STM32F4xx, STM32F1xx)
 | 
				
			||||||
  #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L, SPI_CONTINUE);
 | 
					  #define SPI_SEND_SOME(V,L,Z)  SPI.transfer(&V[Z], L, SPI_CONTINUE);
 | 
				
			||||||
#elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32)
 | 
					#elif ANY(TARGET_LPC1768, __STM32F1__, ARDUINO_ARCH_ESP32)
 | 
				
			||||||
  #define SPI_SEND_SOME(V,L,Z)  do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0)
 | 
					  #define SPI_SEND_SOME(V,L,Z)  do{ for (uint16_t i = 0; i < L; i++) SPI_SEND_ONE(V[(Z)+i]); }while(0)
 | 
				
			||||||
@ -276,7 +276,7 @@ uint8_t MarlinUI::read_slow_buttons(void) {
 | 
				
			|||||||
    Wire.endTransmission();
 | 
					    Wire.endTransmission();
 | 
				
			||||||
    #ifdef __AVR__
 | 
					    #ifdef __AVR__
 | 
				
			||||||
      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1);
 | 
					      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 2, 0, 0, 1);
 | 
				
			||||||
    #elif defined(__STM32F1__)
 | 
					    #elif defined(STM32F1)
 | 
				
			||||||
      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2);
 | 
					      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, (uint8_t)2);
 | 
				
			||||||
    #elif EITHER(STM32F4xx, TARGET_LPC1768)
 | 
					    #elif EITHER(STM32F4xx, TARGET_LPC1768)
 | 
				
			||||||
      Wire.requestFrom(LCD_I2C_ADDRESS, 2);
 | 
					      Wire.requestFrom(LCD_I2C_ADDRESS, 2);
 | 
				
			||||||
@ -330,7 +330,7 @@ void MarlinUI::init_lcd() {
 | 
				
			|||||||
    Wire.endTransmission(); // send buffer
 | 
					    Wire.endTransmission(); // send buffer
 | 
				
			||||||
    #ifdef __AVR__
 | 
					    #ifdef __AVR__
 | 
				
			||||||
      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1);
 | 
					      Wire.requestFrom((uint8_t)LCD_I2C_ADDRESS, 1, 0, 0, 1);
 | 
				
			||||||
    #elif ANY(__STM32F1__, STM32F4xx, TARGET_LPC1768)
 | 
					    #elif ANY(STM32F1, STM32F4xx, TARGET_LPC1768)
 | 
				
			||||||
      Wire.requestFrom(LCD_I2C_ADDRESS, 1);
 | 
					      Wire.requestFrom(LCD_I2C_ADDRESS, 1);
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
    t = (uint8_t)Wire.read();
 | 
					    t = (uint8_t)Wire.read();
 | 
				
			||||||
@ -626,7 +626,7 @@ Equal to 20x10 text LCD
 | 
				
			|||||||
| ttc  ttc   %       | ttc - current temperature
 | 
					| ttc  ttc   %       | ttc - current temperature
 | 
				
			||||||
| tts  tts  %%%      | tts - setted temperature, %%% - percent for FAN
 | 
					| tts  tts  %%%      | tts - setted temperature, %%% - percent for FAN
 | 
				
			||||||
| ICO  ICO  ICO  ICO | ICO - icon 48x48, placed in 2 text lines
 | 
					| ICO  ICO  ICO  ICO | ICO - icon 48x48, placed in 2 text lines
 | 
				
			||||||
| ICO  ICO  ICO  ICO | ICO /
 | 
					| ICO  ICO  ICO  ICO | ICO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
or
 | 
					or
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -30,7 +30,7 @@
 | 
				
			|||||||
 * MORPHEUS Board pin assignments
 | 
					 * MORPHEUS Board pin assignments
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if NOT_TARGET(__STM32F1__)
 | 
					#if NOT_TARGET(__STM32F1__, STM32F1xx)
 | 
				
			||||||
  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
 | 
					  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -90,3 +90,4 @@
 | 
				
			|||||||
#define LED_PIN                             PC13
 | 
					#define LED_PIN                             PC13
 | 
				
			||||||
#define SDSS                                PA3
 | 
					#define SDSS                                PA3
 | 
				
			||||||
#define TFTGLCD_CS                          PA4
 | 
					#define TFTGLCD_CS                          PA4
 | 
				
			||||||
 | 
					#define SD_DETECT_PIN                       PC14
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user