18c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/triggerX/master_mode_available 28c2ecf20Sopenharmony_ciKernelVersion: 4.11 38c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 48c2ecf20Sopenharmony_ciDescription: 58c2ecf20Sopenharmony_ci Reading returns the list possible master modes which are: 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci - "reset" 98c2ecf20Sopenharmony_ci The UG bit from the TIMx_EGR register is 108c2ecf20Sopenharmony_ci used as trigger output (TRGO). 118c2ecf20Sopenharmony_ci - "enable" 128c2ecf20Sopenharmony_ci The Counter Enable signal CNT_EN is used 138c2ecf20Sopenharmony_ci as trigger output. 148c2ecf20Sopenharmony_ci - "update" 158c2ecf20Sopenharmony_ci The update event is selected as trigger output. 168c2ecf20Sopenharmony_ci For instance a master timer can then be used 178c2ecf20Sopenharmony_ci as a prescaler for a slave timer. 188c2ecf20Sopenharmony_ci - "compare_pulse" 198c2ecf20Sopenharmony_ci The trigger output send a positive pulse 208c2ecf20Sopenharmony_ci when the CC1IF flag is to be set. 218c2ecf20Sopenharmony_ci - "OC1REF" 228c2ecf20Sopenharmony_ci OC1REF signal is used as trigger output. 238c2ecf20Sopenharmony_ci - "OC2REF" 248c2ecf20Sopenharmony_ci OC2REF signal is used as trigger output. 258c2ecf20Sopenharmony_ci - "OC3REF" 268c2ecf20Sopenharmony_ci OC3REF signal is used as trigger output. 278c2ecf20Sopenharmony_ci - "OC4REF" 288c2ecf20Sopenharmony_ci OC4REF signal is used as trigger output. 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci Additional modes (on TRGO2 only): 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci - "OC5REF" 338c2ecf20Sopenharmony_ci OC5REF signal is used as trigger output. 348c2ecf20Sopenharmony_ci - "OC6REF" 358c2ecf20Sopenharmony_ci OC6REF signal is used as trigger output. 368c2ecf20Sopenharmony_ci - "compare_pulse_OC4REF": 378c2ecf20Sopenharmony_ci OC4REF rising or falling edges generate pulses. 388c2ecf20Sopenharmony_ci - "compare_pulse_OC6REF": 398c2ecf20Sopenharmony_ci OC6REF rising or falling edges generate pulses. 408c2ecf20Sopenharmony_ci - "compare_pulse_OC4REF_r_or_OC6REF_r": 418c2ecf20Sopenharmony_ci OC4REF or OC6REF rising edges generate pulses. 428c2ecf20Sopenharmony_ci - "compare_pulse_OC4REF_r_or_OC6REF_f": 438c2ecf20Sopenharmony_ci OC4REF rising or OC6REF falling edges generate 448c2ecf20Sopenharmony_ci pulses. 458c2ecf20Sopenharmony_ci - "compare_pulse_OC5REF_r_or_OC6REF_r": 468c2ecf20Sopenharmony_ci OC5REF or OC6REF rising edges generate pulses. 478c2ecf20Sopenharmony_ci - "compare_pulse_OC5REF_r_or_OC6REF_f": 488c2ecf20Sopenharmony_ci OC5REF rising or OC6REF falling edges generate 498c2ecf20Sopenharmony_ci pulses. 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci :: 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci +-----------+ +-------------+ +---------+ 548c2ecf20Sopenharmony_ci | Prescaler +-> | Counter | +-> | Master | TRGO(2) 558c2ecf20Sopenharmony_ci +-----------+ +--+--------+-+ |-> | Control +--> 568c2ecf20Sopenharmony_ci | | || +---------+ 578c2ecf20Sopenharmony_ci +--v--------+-+ OCxREF || +---------+ 588c2ecf20Sopenharmony_ci | Chx compare +----------> | Output | ChX 598c2ecf20Sopenharmony_ci +-----------+-+ | | Control +--> 608c2ecf20Sopenharmony_ci . | | +---------+ 618c2ecf20Sopenharmony_ci . | | . 628c2ecf20Sopenharmony_ci +-----------v-+ OC6REF | . 638c2ecf20Sopenharmony_ci | Ch6 compare +---------+> 648c2ecf20Sopenharmony_ci +-------------+ 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci Example with: "compare_pulse_OC4REF_r_or_OC6REF_r":: 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci X 698c2ecf20Sopenharmony_ci X X 708c2ecf20Sopenharmony_ci X . . X 718c2ecf20Sopenharmony_ci X . . X 728c2ecf20Sopenharmony_ci X . . X 738c2ecf20Sopenharmony_ci count X . . . . X 748c2ecf20Sopenharmony_ci . . . . 758c2ecf20Sopenharmony_ci . . . . 768c2ecf20Sopenharmony_ci +---------------+ 778c2ecf20Sopenharmony_ci OC4REF | . . | 788c2ecf20Sopenharmony_ci +-+ . . +-+ 798c2ecf20Sopenharmony_ci . +---+ . 808c2ecf20Sopenharmony_ci OC6REF . | | . 818c2ecf20Sopenharmony_ci +-------+ +-------+ 828c2ecf20Sopenharmony_ci +-+ +-+ 838c2ecf20Sopenharmony_ci TRGO2 | | | | 848c2ecf20Sopenharmony_ci +-+ +---+ +---------+ 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/triggerX/master_mode 878c2ecf20Sopenharmony_ciKernelVersion: 4.11 888c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 898c2ecf20Sopenharmony_ciDescription: 908c2ecf20Sopenharmony_ci Reading returns the current master modes. 918c2ecf20Sopenharmony_ci Writing set the master mode 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/triggerX/sampling_frequency 948c2ecf20Sopenharmony_ciKernelVersion: 4.11 958c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 968c2ecf20Sopenharmony_ciDescription: 978c2ecf20Sopenharmony_ci Reading returns the current sampling frequency. 988c2ecf20Sopenharmony_ci Writing an value different of 0 set and start sampling. 998c2ecf20Sopenharmony_ci Writing 0 stop sampling. 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_count0_preset 1028c2ecf20Sopenharmony_ciKernelVersion: 4.12 1038c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 1048c2ecf20Sopenharmony_ciDescription: 1058c2ecf20Sopenharmony_ci Reading returns the current preset value. 1068c2ecf20Sopenharmony_ci Writing sets the preset value. 1078c2ecf20Sopenharmony_ci When counting up the counter starts from 0 and fires an 1088c2ecf20Sopenharmony_ci event when reach preset value. 1098c2ecf20Sopenharmony_ci When counting down the counter start from preset value 1108c2ecf20Sopenharmony_ci and fire event when reach 0. 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available 1138c2ecf20Sopenharmony_ciKernelVersion: 4.12 1148c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 1158c2ecf20Sopenharmony_ciDescription: 1168c2ecf20Sopenharmony_ci Reading returns the list possible enable modes. 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode 1198c2ecf20Sopenharmony_ciKernelVersion: 4.12 1208c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 1218c2ecf20Sopenharmony_ciDescription: 1228c2ecf20Sopenharmony_ci Configure the device counter enable modes, in all case 1238c2ecf20Sopenharmony_ci counting direction is set by in_count0_count_direction 1248c2ecf20Sopenharmony_ci attribute and the counter is clocked by the internal clock. 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci always: 1278c2ecf20Sopenharmony_ci Counter is always ON. 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci gated: 1308c2ecf20Sopenharmony_ci Counting is enabled when connected trigger signal 1318c2ecf20Sopenharmony_ci level is high else counting is disabled. 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci triggered: 1348c2ecf20Sopenharmony_ci Counting is enabled on rising edge of the connected 1358c2ecf20Sopenharmony_ci trigger, and remains enabled for the duration of this 1368c2ecf20Sopenharmony_ci selected mode. 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available 1398c2ecf20Sopenharmony_ciKernelVersion: 4.13 1408c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 1418c2ecf20Sopenharmony_ciDescription: 1428c2ecf20Sopenharmony_ci Reading returns the list possible trigger modes. 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode 1458c2ecf20Sopenharmony_ciKernelVersion: 4.13 1468c2ecf20Sopenharmony_ciContact: benjamin.gaignard@st.com 1478c2ecf20Sopenharmony_ciDescription: 1488c2ecf20Sopenharmony_ci Configure the device counter trigger mode 1498c2ecf20Sopenharmony_ci counting direction is set by in_count0_count_direction 1508c2ecf20Sopenharmony_ci attribute and the counter is clocked by the connected trigger 1518c2ecf20Sopenharmony_ci rising edges. 152