@@ -48,12 +48,12 @@ problem:
4848 time_pps_create().
4949
5050This implies that the source has a /dev/... entry. This assumption is
51- ok for the serial and parallel port, where you can do something
51+ OK for the serial and parallel port, where you can do something
5252useful besides(!) the gathering of timestamps as it is the central
53- task for a PPS- API. But this assumption does not work for a single
53+ task for a PPS API. But this assumption does not work for a single
5454purpose GPIO line. In this case even basic file-related functionality
5555(like read() and write()) makes no sense at all and should not be a
56- precondition for the use of a PPS- API.
56+ precondition for the use of a PPS API.
5757
5858The problem can be simply solved if you consider that a PPS source is
5959not always connected with a GPS data source.
@@ -88,13 +88,13 @@ Coding example
8888--------------
8989
9090To register a PPS source into the kernel you should define a struct
91- pps_source_info_s as follows:
91+ pps_source_info as follows:
9292
9393 static struct pps_source_info pps_ktimer_info = {
9494 .name = "ktimer",
9595 .path = "",
96- .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | \
97- PPS_ECHOASSERT | \
96+ .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
97+ PPS_ECHOASSERT |
9898 PPS_CANWAIT | PPS_TSFMT_TSPEC,
9999 .echo = pps_ktimer_echo,
100100 .owner = THIS_MODULE,
@@ -108,13 +108,13 @@ initialization routine as follows:
108108
109109The pps_register_source() prototype is:
110110
111- int pps_register_source(struct pps_source_info_s *info, int default_params)
111+ int pps_register_source(struct pps_source_info *info, int default_params)
112112
113113where "info" is a pointer to a structure that describes a particular
114114PPS source, "default_params" tells the system what the initial default
115115parameters for the device should be (it is obvious that these parameters
116116must be a subset of ones defined in the struct
117- pps_source_info_s which describe the capabilities of the driver).
117+ pps_source_info which describe the capabilities of the driver).
118118
119119Once you have registered a new PPS source into the system you can
120120signal an assert event (for example in the interrupt handler routine)
@@ -142,8 +142,10 @@ If the SYSFS filesystem is enabled in the kernel it provides a new class:
142142Every directory is the ID of a PPS sources defined in the system and
143143inside you find several files:
144144
145- $ ls /sys/class/pps/pps0/
146- assert clear echo mode name path subsystem@ uevent
145+ $ ls -F /sys/class/pps/pps0/
146+ assert dev mode path subsystem@
147+ clear echo name power/ uevent
148+
147149
148150Inside each "assert" and "clear" file you can find the timestamp and a
149151sequence number:
@@ -154,40 +156,40 @@ sequence number:
154156Where before the "#" is the timestamp in seconds; after it is the
155157sequence number. Other files are:
156158
157- * echo: reports if the PPS source has an echo function or not;
159+ * echo: reports if the PPS source has an echo function or not;
158160
159- * mode: reports available PPS functioning modes;
161+ * mode: reports available PPS functioning modes;
160162
161- * name: reports the PPS source's name;
163+ * name: reports the PPS source's name;
162164
163- * path: reports the PPS source's device path, that is the device the
164- PPS source is connected to (if it exists).
165+ * path: reports the PPS source's device path, that is the device the
166+ PPS source is connected to (if it exists).
165167
166168
167169Testing the PPS support
168170-----------------------
169171
170172In order to test the PPS support even without specific hardware you can use
171- the ktimer driver (see the client subsection in the PPS configuration menu)
173+ the pps- ktimer driver (see the client subsection in the PPS configuration menu)
172174and the userland tools available in your distribution's pps-tools package,
173- http://linuxpps.org , or https://github.com/ago /pps-tools .
175+ http://linuxpps.org , or https://github.com/redlab-i /pps-tools.
174176
175- Once you have enabled the compilation of ktimer just modprobe it (if
177+ Once you have enabled the compilation of pps- ktimer just modprobe it (if
176178not statically compiled):
177179
178- # modprobe ktimer
180+ # modprobe pps- ktimer
179181
180182and the run ppstest as follow:
181183
182- $ ./ppstest /dev/pps0
184+ $ ./ppstest /dev/pps1
183185 trying PPS source "/dev/pps1"
184186 found PPS source "/dev/pps1"
185187 ok, found 1 source(s), now start fetching data...
186188 source 0 - assert 1186592699.388832443, sequence: 364 - clear 0.000000000, sequence: 0
187189 source 0 - assert 1186592700.388931295, sequence: 365 - clear 0.000000000, sequence: 0
188190 source 0 - assert 1186592701.389032765, sequence: 366 - clear 0.000000000, sequence: 0
189191
190- Please, note that to compile userland programs you need the file timepps.h .
192+ Please note that to compile userland programs, you need the file timepps.h.
191193This is available in the pps-tools repository mentioned above.
192194
193195
0 commit comments