mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add the WeiKai SPI/I2C UART/IO Expander components to esphome (#5218)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							f9ce35c894
						
					
				
				
					commit
					f8cdb087fc
				
			
							
								
								
									
										20
									
								
								tests/components/wk2132_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								tests/components/wk2132_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| i2c: | ||||
|   id: i2c_bus | ||||
|   scl: ${scl_pin} | ||||
|   sda: ${sda_pin} | ||||
|   scan: true | ||||
|   frequency: 600kHz | ||||
|  | ||||
| wk2132_i2c: | ||||
|   - id: wk2132_i2c_id | ||||
|     address: 0x70 | ||||
|     i2c_id: i2c_bus | ||||
|     uart: | ||||
|       - id: wk2132_id_0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2132_id_1 | ||||
|         channel: 1 | ||||
|         baud_rate: 19200 | ||||
							
								
								
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2132_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										21
									
								
								tests/components/wk2132_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								tests/components/wk2132_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| spi: | ||||
|   id: spi_bus | ||||
|   clk_pin: ${clk_pin} | ||||
|   mosi_pin: ${mosi_pin} | ||||
|   miso_pin: ${miso_pin} | ||||
|  | ||||
| wk2132_spi: | ||||
|   - id: wk2132_spi_id | ||||
|     cs_pin: ${cs_pin} | ||||
|     spi_id: spi_bus | ||||
|     crystal: 11059200 | ||||
|     data_rate: 1MHz | ||||
|     uart: | ||||
|       - id: wk2132_spi_id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2132_spi_id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 921600 | ||||
							
								
								
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2132_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2132_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2132_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										63
									
								
								tests/components/wk2168_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								tests/components/wk2168_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| i2c: | ||||
|   id: i2c_bus | ||||
|   scl: ${scl_pin} | ||||
|   sda: ${sda_pin} | ||||
|   scan: true | ||||
|   frequency: 600kHz | ||||
|  | ||||
| #  component declaration | ||||
| wk2168_i2c: | ||||
|   - id: bridge_i2c | ||||
|     i2c_id: i2c_bus | ||||
|     address: 0x70 | ||||
|     uart: | ||||
|       - id: id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 115200 | ||||
|       - id: id2 | ||||
|         channel: 2 | ||||
|         baud_rate: 115200 | ||||
|       - id: id3 | ||||
|         channel: 3 | ||||
|         baud_rate: 115200 | ||||
|  | ||||
| # individual binary_sensor inputs | ||||
| binary_sensor: | ||||
|   - platform: gpio | ||||
|     name: "pin_0" | ||||
|     pin: | ||||
|       wk2168_i2c: bridge_i2c | ||||
|       number: 0 | ||||
|       mode: | ||||
|         input: true | ||||
|   - platform: gpio | ||||
|     name: "pin_1" | ||||
|     pin: | ||||
|       wk2168_i2c: bridge_i2c | ||||
|       number: 1 | ||||
|       mode: | ||||
|         input: true | ||||
|       inverted: true | ||||
|  | ||||
| # Individual binary outputs | ||||
| switch: | ||||
|   - platform: gpio | ||||
|     name: "pin_2" | ||||
|     pin: | ||||
|       wk2168_i2c: bridge_i2c | ||||
|       number: 2 | ||||
|       mode: | ||||
|         output: true | ||||
|   - platform: gpio | ||||
|     name: "pin_3" | ||||
|     pin: | ||||
|       wk2168_i2c: bridge_i2c | ||||
|       number: 3 | ||||
|       mode: | ||||
|         output: true | ||||
|       inverted: true | ||||
							
								
								
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2168_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										63
									
								
								tests/components/wk2168_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								tests/components/wk2168_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| spi: | ||||
|   id: spi_bus | ||||
|   clk_pin: ${clk_pin} | ||||
|   mosi_pin: ${mosi_pin} | ||||
|   miso_pin: ${miso_pin} | ||||
|  | ||||
| wk2168_spi: | ||||
|   - id: bridge_spi | ||||
|     cs_pin: ${cs_pin} | ||||
|     spi_id: spi_bus | ||||
|     crystal: 11059200 | ||||
|     data_rate: 1MHz | ||||
|     uart: | ||||
|       - id: id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 115200 | ||||
|       - id: id2 | ||||
|         channel: 2 | ||||
|         baud_rate: 115200 | ||||
|       - id: id3 | ||||
|         channel: 3 | ||||
|         baud_rate: 115200 | ||||
|  | ||||
| # individual binary_sensor inputs | ||||
| binary_sensor: | ||||
|   - platform: gpio | ||||
|     name: "pin_0" | ||||
|     pin: | ||||
|       wk2168_spi: bridge_spi | ||||
|       number: 0 | ||||
|       mode: | ||||
|         input: true | ||||
|   - platform: gpio | ||||
|     name: "pin_1" | ||||
|     pin: | ||||
|       wk2168_spi: bridge_spi | ||||
|       number: 1 | ||||
|       mode: | ||||
|         input: true | ||||
|       inverted: true | ||||
|  | ||||
| # Individual binary outputs | ||||
| switch: | ||||
|   - platform: gpio | ||||
|     name: "pin_2" | ||||
|     pin: | ||||
|       wk2168_spi: bridge_spi | ||||
|       number: 2 | ||||
|       mode: | ||||
|         output: true | ||||
|   - platform: gpio | ||||
|     name: "pin_3" | ||||
|     pin: | ||||
|       wk2168_spi: bridge_spi | ||||
|       number: 3 | ||||
|       mode: | ||||
|         output: true | ||||
|       inverted: true | ||||
							
								
								
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2168_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2168_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2168_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										28
									
								
								tests/components/wk2204_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								tests/components/wk2204_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| i2c: | ||||
|   id: i2c_bus | ||||
|   scl: ${scl_pin} | ||||
|   sda: ${sda_pin} | ||||
|   scan: true | ||||
|   frequency: 600kHz | ||||
|  | ||||
| wk2204_i2c: | ||||
|   - id: wk2204_i2c_id | ||||
|     i2c_id: i2c_bus | ||||
|     address: 0x70 | ||||
|     uart: | ||||
|       - id: wk2204_id_0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2204_id_1 | ||||
|         channel: 1 | ||||
|         baud_rate: 19200 | ||||
|       - id: wk2204_id_2 | ||||
|         channel: 2 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2204_id_3 | ||||
|         channel: 3 | ||||
|         baud_rate: 19200 | ||||
							
								
								
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2204_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										29
									
								
								tests/components/wk2204_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								tests/components/wk2204_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| spi: | ||||
|   id: spi_bus | ||||
|   clk_pin: ${clk_pin} | ||||
|   mosi_pin: ${mosi_pin} | ||||
|   miso_pin: ${miso_pin} | ||||
|  | ||||
| wk2204_spi: | ||||
|   - id: wk2204_spi_id | ||||
|     cs_pin: ${cs_pin} | ||||
|     spi_id: spi_bus | ||||
|     crystal: 11059200 | ||||
|     data_rate: 1MHz | ||||
|     uart: | ||||
|       - id: wk2204_spi_id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2204_spi_id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 921600 | ||||
|       - id: wk2204_spi_id2 | ||||
|         channel: 2 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: wk2204_spi_id3 | ||||
|         channel: 3 | ||||
|         baud_rate: 921600 | ||||
							
								
								
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2204_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2204_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2204_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										59
									
								
								tests/components/wk2212_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								tests/components/wk2212_i2c/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| i2c: | ||||
|   id: i2c_bus | ||||
|   scl: ${scl_pin} | ||||
|   sda: ${sda_pin} | ||||
|   scan: true | ||||
|   frequency: 600kHz | ||||
|  | ||||
| #  component declaration | ||||
| wk2212_i2c: | ||||
|   - id: bridge_i2c | ||||
|     i2c_id: i2c_bus | ||||
|     address: 0x70 | ||||
|     uart: | ||||
|       - id: uart_i2c_id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: uart_i2c_id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|  | ||||
| # individual binary_sensor inputs | ||||
| binary_sensor: | ||||
|   - platform: gpio | ||||
|     name: "pin_0" | ||||
|     pin: | ||||
|       wk2212_i2c: bridge_i2c | ||||
|       number: 0 | ||||
|       mode: | ||||
|         input: true | ||||
|   - platform: gpio | ||||
|     name: "pin_1" | ||||
|     pin: | ||||
|       wk2212_i2c: bridge_i2c | ||||
|       number: 1 | ||||
|       mode: | ||||
|         input: true | ||||
|       inverted: true | ||||
|  | ||||
| # Individual binary outputs | ||||
| switch: | ||||
|   - platform: gpio | ||||
|     name: "pin_2" | ||||
|     pin: | ||||
|       wk2212_i2c: bridge_i2c | ||||
|       number: 2 | ||||
|       mode: | ||||
|         output: true | ||||
|   - platform: gpio | ||||
|     name: "pin_3" | ||||
|     pin: | ||||
|       wk2212_i2c: bridge_i2c | ||||
|       number: 3 | ||||
|       mode: | ||||
|         output: true | ||||
|       inverted: true | ||||
							
								
								
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO40 | ||||
|   sda_pin: GPIO41 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/components/wk2212_i2c/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| substitutions: | ||||
|   scl_pin: GPIO22 | ||||
|   sda_pin: GPIO21 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										58
									
								
								tests/components/wk2212_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								tests/components/wk2212_spi/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,58 @@ | ||||
| spi: | ||||
|   id: spi_bus | ||||
|   clk_pin: ${clk_pin} | ||||
|   mosi_pin: ${mosi_pin} | ||||
|   miso_pin: ${miso_pin} | ||||
|  | ||||
| wk2212_spi: | ||||
|   - id: bridge_spi | ||||
|     cs_pin: ${cs_pin} | ||||
|     spi_id: spi_bus | ||||
|     crystal: 11059200 | ||||
|     data_rate: 1MHz | ||||
|     uart: | ||||
|       - id: id0 | ||||
|         channel: 0 | ||||
|         baud_rate: 115200 | ||||
|         stop_bits: 1 | ||||
|         parity: none | ||||
|       - id: id1 | ||||
|         channel: 1 | ||||
|         baud_rate: 115200 | ||||
|  | ||||
| # individual binary_sensor inputs | ||||
| binary_sensor: | ||||
|   - platform: gpio | ||||
|     name: "pin_0" | ||||
|     pin: | ||||
|       wk2212_spi: bridge_spi | ||||
|       number: 0 | ||||
|       mode: | ||||
|         input: true | ||||
|   - platform: gpio | ||||
|     name: "pin_1" | ||||
|     pin: | ||||
|       wk2212_spi: bridge_spi | ||||
|       number: 1 | ||||
|       mode: | ||||
|         input: true | ||||
|       inverted: true | ||||
|  | ||||
| # Individual binary outputs | ||||
| switch: | ||||
|   - platform: gpio | ||||
|     name: "pin_2" | ||||
|     pin: | ||||
|       wk2212_spi: bridge_spi | ||||
|       number: 2 | ||||
|       mode: | ||||
|         output: true | ||||
|   - platform: gpio | ||||
|     name: "pin_3" | ||||
|     pin: | ||||
|       wk2212_spi: bridge_spi | ||||
|       number: 3 | ||||
|       mode: | ||||
|         output: true | ||||
|       inverted: true | ||||
|  | ||||
							
								
								
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-s3-idf.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2212_spi/test.esp32-s3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO40 | ||||
|   miso_pin: GPIO41 | ||||
|   mosi_pin: GPIO6 | ||||
|   cs_pin: GPIO19 | ||||
|  | ||||
| <<: !include common.yaml | ||||
							
								
								
									
										7
									
								
								tests/components/wk2212_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/components/wk2212_spi/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| substitutions: | ||||
|   clk_pin: GPIO18 | ||||
|   miso_pin: GPIO19 | ||||
|   mosi_pin: GPIO23 | ||||
|   cs_pin: GPIO5 | ||||
|  | ||||
| <<: !include common.yaml | ||||
		Reference in New Issue
	
	Block a user