1# Copyright (c) 2022 Meta 2# Copyright (c) 2024 SILA Embedded Solutions GmbH 3# SPDX-License-Identifier: Apache-2.0 4 5description: Lattice iCE40 FPGA GPIO bitbang based driver 6 7compatible: "lattice,ice40-fpga-bitbang" 8 9include: lattice,ice40-fpga-base.yaml 10 11properties: 12 clk-gpios: 13 type: phandle-array 14 required: true 15 description: | 16 SPI Clock GPIO input on iCE40. 17 Example usage: 18 clk-gpios = <&gpio0 5 GPIO_PUSH_PULL>; 19 pico-gpios: 20 type: phandle-array 21 required: true 22 description: | 23 Peripheral-In Controller-Out GPIO input on iCE40. 24 Example usage: 25 pico-gpios = <&gpio0 7 GPIO_PUSH_PULL>; 26 gpios-set-reg: 27 type: int 28 required: true 29 description: | 30 Register address for setting a GPIO. 31 Example usage: 32 gpios-set-reg = <0x60004008>; 33 gpios-clear-reg: 34 type: int 35 required: true 36 description: | 37 Register address for clearing a GPIO. 38 Example usage: 39 gpios-clear-reg = <0x6000400c>; 40 mhz-delay-count: 41 type: int 42 default: 0 43 description: | 44 in order to create a 1 MHz square wave in the following 45 process. 46 while(true) { 47 *gpios_set_reg |= BIT(n); 48 for(int i = mhz_delay_count; i > 0; --i); 49 *gpios_clear_reg |= BIT(n); 50 for(int i = mhz_delay_count; i > 0; --i); 51 } 52 The default disables the delay. 53