Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:rotary [03 Jul 2020 07:51] Sunny Fengresources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:rotary [21 Jul 2020 08:02] (current) cathy fang
Line 6: Line 6:
  
 ===== Hardware Setup ===== ===== Hardware Setup =====
-  * An ADSP-SC5xx EZ-Board: +An ADSP-SC5xx EZ-Board: 
     * ADSP-SC584 Ezkit v1.0 and above, or,     * ADSP-SC584 Ezkit v1.0 and above, or,
     * ADSP-SC573 Ezkit v1.2 (BOM 1.8) and above     * ADSP-SC573 Ezkit v1.2 (BOM 1.8) and above
Line 13: Line 13:
 {{:resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:lkad-rotary_driver-hw_setup.jpg?600|}} {{:resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:lkad-rotary_driver-hw_setup.jpg?600|}}
 ===== Software Configuration ===== ===== Software Configuration =====
 +
 +==== Configure Linux kernel  ====
 +
 +You need to enable the ADI rotary driver in Linux kernel. 
 +<code>
 +Device Drivers  --->
 +    Input device support  --->
 +        <*>   Event interface    
 +        [*]   Miscellaneous devices  --->
 +            <*>   ADI Rotary support
 +</code>
 +
 +==== Configure Packages ====
 +You should also enable the event test program to assist with testing.
 +Add the event test program in the filesystem images, it's enabled in adsp-sc5xx-full image by default.
 +<code>
 +vim build/conf/local.conf
 +IMAGE_INSTALL_append = "evtest"
 +</code>
 ==== ADSP-SC573 EZ-Board ==== ==== ADSP-SC573 EZ-Board ====
 As the Rotary hardware pin conflicts with MSI function on the ADSP-SC573 EZ-Board, thumb wheel switch is disabled by default in U-Boot for ADSP-SC573 EZ-Board out of box. To enable thumb wheel hardware switch, you should enable the thumb wheel switch in U-Boot and disable MSI function in Linux kernel. Please refer to ADSP-SC573 EZ-Board schematic and the section Mobile Storage Interface for MMC/SD for more information. As the Rotary hardware pin conflicts with MSI function on the ADSP-SC573 EZ-Board, thumb wheel switch is disabled by default in U-Boot for ADSP-SC573 EZ-Board out of box. To enable thumb wheel hardware switch, you should enable the thumb wheel switch in U-Boot and disable MSI function in Linux kernel. Please refer to ADSP-SC573 EZ-Board schematic and the section Mobile Storage Interface for MMC/SD for more information.
Line 20: Line 39:
  MMC/SD/SDIO card support  --->  MMC/SD/SDIO card support  --->
   [*] Synopsys DesignWare Memory Card Interface   [*] Synopsys DesignWare Memory Card Interface
-  [*]    Synopsys Designware MCI Support as platform device +    [*]    Synopsys Designware MCI Support as platform device 
- [N   ADI specific extensions for Synopsys DW Memory Card Interface  +   <N   ADI specific extensions for Synopsys DW Memory Card Interface  
 </code> </code>
  
Line 45: Line 64:
 </code> </code>
  
-==== Configure Linux kernel  ====+The driver provides two options. It can either send Key (KEY) or Relative (REL) events.
  
-You need to enable the ADI rotary driver in Linux kernel.  +**Option 1** – send Key events: Provide two KEY Codes for: 
-<code> +
-Device Drivers  ---> +
-    Input device support  ---> +
-        <*>   Event interface     +
-        [*]   Miscellaneous devices  ---> +
-            <*>   ADI Rotary support +
-</code> +
- +
-==== Configure Packages ==== +
-You should also enable the event test program to assist with testing. +
-Add the event test program in the filesystem images, it's enabled in adsp-sc5xx-full image by default. +
-<code> +
-vim build/conf/local.conf +
-IMAGE_INSTALL_append = "evtest" +
-</code> +
- +
-The driver provides two options. It can either send Key (KEY) or Relative (REL) events. +
-  - **Option 1** – send Key events: Provide two KEY Codes for: +
 <code> <code>
 rotary_up_key  =  KEY_PLUS rotary_up_key  =  KEY_PLUS
 rotary_down_key =  KEY_MINUS rotary_down_key =  KEY_MINUS
 </code>     </code>    
-  - **Option 2** – send REL events: Provide one REL event type:  +**Option 2** – send REL events: Provide one REL event type:  
-<code> +<code>rotary_rel_code =  REL_WHEEL    </code>
-rotary_rel_code =  REL_WHEEL     +
-</code>+
 In case your CZM input is connected (push-button signal of thumb wheels) Specify the KEY event – this will enable the CZM input. See include/linux/input.h for a full list of supported events. In case your CZM input is connected (push-button signal of thumb wheels) Specify the KEY event – this will enable the CZM input. See include/linux/input.h for a full list of supported events.
-<code> +<code>rotary_button_key = KEY_ENTER</code>
-rotary_button_key = KEY_ENTER +
-</code>+
 The debounce prescale value is used to select the noise filtering characteristic of the input pins. Must be in the range of  0..17 The debounce prescale value is used to select the noise filtering characteristic of the input pins. Must be in the range of  0..17
-<code> +<code>debounce = 10</code>
-debounce = 10 +
-</code>+
 The driver supports various Counter types The driver supports various Counter types
-<code> +<code>cnt_mode =  CNTMODE_QUADENC</code> 
-cnt_mode =  CNTMODE_QUADENC +
-</code>+
 ===== Example ===== ===== Example =====
  
Line 166: Line 160:
 </code> </code>
  
 +----
 **Back to** [[resources:tools-software/linuxdsp/docs/linux-kernel-and-drivers/start|Kernel Features and Device Drivers for ADSP-SC5xx Yocto Linux]] **Back to** [[resources:tools-software/linuxdsp/docs/linux-kernel-and-drivers/start|Kernel Features and Device Drivers for ADSP-SC5xx Yocto Linux]]
resources/tools-software/linuxdsp/docs/linux-kernel-and-drivers/rotary/rotary.txt · Last modified: 21 Jul 2020 08:02 by cathy fang