This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:rotary [03 Jul 2020 07:47] – Sunny Feng | resources:tools-software:linuxdsp:docs:linux-kernel-and-drivers:rotary:rotary [09 Jul 2020 10:08] – [ADSP-SC573 EZ-Board] Sunny Feng | ||
---|---|---|---|
Line 13: | Line 13: | ||
{{: | {{: | ||
===== Software Configuration ===== | ===== Software Configuration ===== | ||
+ | |||
+ | ==== Configure Linux kernel ==== | ||
+ | |||
+ | You need to enable the ADI rotary driver in Linux kernel. | ||
+ | < | ||
+ | Device Drivers ---> | ||
+ | Input device support ---> | ||
+ | < | ||
+ | [*] Miscellaneous devices ---> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ==== 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. | ||
+ | < | ||
+ | vim build/ | ||
+ | IMAGE_INSTALL_append = " | ||
+ | </ | ||
==== 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/ | MMC/ | ||
[*] Synopsys DesignWare Memory Card Interface | [*] Synopsys DesignWare Memory Card Interface | ||
- | [*] 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 |
</ | </ | ||
Line 45: | Line 64: | ||
</ | </ | ||
- | ==== 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: |
< | < | ||
- | Device Drivers ---> | ||
- | Input device support ---> | ||
- | < | ||
- | [*] Miscellaneous devices ---> | ||
- | < | ||
- | </ | ||
- | |||
- | ==== 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. | ||
- | < | ||
- | vim build/ | ||
- | IMAGE_INSTALL_append = " | ||
- | </ | ||
- | |||
- | 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: | ||
rotary_up_key | rotary_up_key | ||
- | rotary_down_key = KEY_MINUS | + | rotary_down_key = KEY_MINUS |
- | | + | </ |
- | rotary_rel_code = REL_WHEEL | + | **Option 2** – send REL events: Provide one REL event type: |
+ | < | ||
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/ | 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/ | ||
- | + | < | |
- | rotary_button_key = KEY_ENTER | + | |
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 | ||
- | + | < | |
- | debounce = 10 | + | |
The driver supports various Counter types | The driver supports various Counter types | ||
+ | < | ||
- | cnt_mode | + | ===== Example |
- | === Example === | + | |
You will get following information when the rotary hardware device is turned left, right or pushed. | You will get following information when the rotary hardware device is turned left, right or pushed. | ||
Line 159: | Line 159: | ||
Event: time 179.719841, -------------- Report Sync ------------ | Event: time 179.719841, -------------- Report Sync ------------ | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | **Back to** [[resources: |