@@ -86,8 +86,126 @@ extern "C" {
8686 * @return None
8787 */
8888 void INTERVAL_CaptureFour (uint16_t count , uint16_t mode , uint8_t prescaler );
89-
89+
90+ /**
91+ * @brief Reads DMA status registry data
92+ *
93+ * @description
94+ * This method will sequentially read register addresses at BUFFER pointer
95+ * and all four DMA channel pointers. It will also read digital state parameters.
96+ *
97+ * There are no input parameters to this method. The output of this method should
98+ * be read over serial in the following order.
99+ * 1. (int) BUFFER pointer
100+ * 2. (int) DMA Channel 0 pointer
101+ * 3. (int) DMA Channel 1 pointer
102+ * 4. (int) DMA Channel 2 pointer
103+ * 5. (int) DMA Channel 3 pointer
104+ * 6. (char) Digital states
105+ * 7. (char) Digital states error
106+ *
107+ * @return SUCCESS
108+ */
90109 response_t INTERVAL_GetState (void );
110+
111+ /**
112+ * @brief Measures the time interval between two pin state change events
113+ *
114+ * @description
115+ * This method will count the time difference between two pin change events
116+ * attached to two pins.
117+ * The events can be any event defined at the list of events in `IC_PARAMS_CAPTURE_MODE`.
118+ * The pins should be any pin in the list of `PIN_MANAGER_DIGITAL_PINS`.
119+ *
120+ * @param timeout : period of wait until the operation is aborted
121+ * @param pins : input pins defined at `PIN_MANAGER_DIGITAL_PINS`
122+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
123+ * | PIN EVENT 2 | PIN EVENT 1 |
124+ * @param modes : pin change event defined at `IC_PARAMS_CAPTURE_MODE`
125+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
126+ * | X | X | EVENT 2 | EVENT 1 |
127+ *
128+ * The output of this method should be read over serial in the following order.
129+ * 1. (int) IC1BUF - LSW
130+ * 2. (int) IC2BUF - MSW
131+ * Combine 1. and 2. to get the trigger time of the event 1
132+ * 3. (int) IC3BUF - LSW
133+ * 4. (int) IC4BUF - MSW
134+ * Combine 3. and 4. to get the trigger time of the event 2
135+ * 5. (int) IC2TMR
136+ *
137+ * @return SUCCESS
138+ */
139+ response_t INTERVAL_IntervalMeasure (void );
140+
141+ /**
142+ * @brief Measures the time between multiple pin state change events
143+ *
144+ * @description
145+ * This method will log time units for multiple changes occurred on
146+ * defined digital pins. Unlike `INTERVAL_IntervalMeasure` where it
147+ * measure only a single change of states, this method will measure
148+ * upto 4 change of pin states.
149+ * The events can be any event defined at the list of events in `IC_PARAMS_CAPTURE_MODE`.
150+ * The pins should be any pin in the list of `PIN_MANAGER_DIGITAL_PINS`.
151+ *
152+ * @param timeout : period of wait until the operation is aborted
153+ * @param pins : input pins defined at `PIN_MANAGER_DIGITAL_PINS`
154+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
155+ * | PIN EVENT 2 | PIN EVENT 1 |
156+ * @param modes : pin change event defined at `IC_PARAMS_CAPTURE_MODE`
157+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
158+ * | X | X | EVENT 2 | EVENT 1 |
159+ * @param intrpts : input pins defined at `PIN_MANAGER_DIGITAL_PINS`
160+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
161+ * | INTERRUPT 2 | INTERRUPT 1 |
162+ *
163+ * The output of this method should be read over serial in the following order.
164+ * 1. (int) IC1BUF - LSW
165+ * 2. (int) IC2BUF - MSW
166+ * Combine 1. and 2. to get the trigger time of the change event. Depending on the
167+ * intrpts, the two registers (1. and 2.) may need to be read repeatedly to capture
168+ * timing data for each event occurrence.
169+ * 3. (int) IC3BUF - LSW
170+ * 4. (int) IC4BUF - MSW
171+ * Combine 3. and 4. to get the trigger time of the change event. Depending on the
172+ * intrpts, the two registers (3. and 4.) may need to be read repeatedly to capture
173+ * timing data for each event occurrence.
174+ * Note: ICxBUF is a 4-level buffer that can store time log for four change events.
175+ * 5. (int) IC2TMR
176+ *
177+ * @return SUCCESS
178+ */
179+ response_t INTERVAL_TimeMeasure (void );
180+
181+ /**
182+ * @brief Measures the time until a pin state change event occurs
183+ *
184+ * @description
185+ * This method will stop counting time when the defined pin change event occurred.
186+ * The event can be any event defined at the list of events in `IC_PARAMS_CAPTURE_MODE`.
187+ * The pin should be any pin in the list of `PIN_MANAGER_DIGITAL_PINS`.
188+ *
189+ * @param timeout : period of wait until the operation is aborted
190+ * @param mode : pin change event defined at `IC_PARAMS_CAPTURE_MODE`
191+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
192+ * | X | X | X | X | X | EVENT |
193+ * @param pin : input pin defined at `PIN_MANAGER_DIGITAL_PINS`
194+ * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
195+ * | X | X | X | X | PIN EVENT |
196+ *
197+ * The output of this method should be read over serial in the following order.
198+ * 1. (int) IC2TMR
199+ * 2. (int) IC1BUF - LSW
200+ * 3. (int) IC2BUF - MSW
201+ * Combine 2. and 3. to get the trigger time of the change event. Depending on the mode,
202+ * the last two registers (2. and 3.) may need to be read repeatedly to capture timing
203+ * data for each event occurrence.
204+ * Note: ICxBUF is a 4-level buffer that can store time log for four change events.
205+ *
206+ * @return SUCCESS
207+ */
208+ response_t INTERVAL_UntilEvent (void );
91209
92210 // Getters and setters
93211
0 commit comments