Skip to content

Commit e8aea8c

Browse files
committed
Refereshed sensors and timers parameter table with a "type"
1 parent 97c7019 commit e8aea8c

2 files changed

Lines changed: 69 additions & 71 deletions

File tree

docs/reference/container-api/sensors.md

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ int ocre_sensors_init(int unused);
145145
146146
**Parameters**:
147147
148-
| Value | Description |
149-
| ------ | -----------|
150-
| `unused` | Reserved parameter (not used) |
148+
| Name | Type | Description |
149+
| ------ | ------ | ----------- |
150+
| `unused` | *int* | Reserved parameter (not used) |
151151
152152
**Returns**:
153153
154154
| Value | Description |
155-
| ------ | -----------|
155+
| ------ | ----------- |
156156
| `0` | on success |
157157
| negative value | on error |
158158
@@ -167,15 +167,15 @@ ocre_sensors_status_t ocre_sensors_discover_sensors(ocre_sensor_t *sensors, int
167167

168168
**Parameters**:
169169

170-
| Value | Description |
171-
| ------ | -----------|
172-
| `sensors` | Pointer to the sensor list to store the discovered info about available sensors |
173-
| `sensors_count` | Pointer to variable to store the number of discovered sensors |
170+
| Name | Type | Description |
171+
| ------ | ------ | ----------- |
172+
| `sensors` | *ocre_sensor_t** | Pointer to the sensor list to store the discovered info about available sensors |
173+
| `sensors_count` | *int** | Pointer to variable to store the number of discovered sensors |
174174

175175
**Returns**:
176176

177177
| Value | Description |
178-
| ------ | -----------|
178+
| ------ | ----------- |
179179
| `SENSOR_API_STATUS_OK` | on success |
180180
| other status code | on error |
181181

@@ -189,14 +189,14 @@ ocre_sensors_status_t ocre_sensors_open(ocre_sensor_handle_t *sensor_handle);
189189
190190
**Parameters**:
191191
192-
| Value | Description |
193-
| ------ | -----------|
194-
| `sensor_handle` | Pointer to the sensor handle to open |
192+
| Name | Type | Description |
193+
| ------ | ------ | ----------- |
194+
| `sensor_handle` | *ocre_sensor_handle_t** | Pointer to the sensor handle to open |
195195
196196
**Returns**:
197197
198198
| Value | Description |
199-
| ------ | -----------|
199+
| ------ | ----------- |
200200
| `SENSOR_API_STATUS_OK` | on success |
201201
| `SENSOR_API_STATUS_ERROR` | on error |
202202
@@ -211,14 +211,14 @@ ocre_sensors_sample_t sensor_read_sample(ocre_sensor_handle_t *sensor_handle);
211211

212212
**Parameters**:
213213

214-
| Value | Description |
215-
| ------ | -----------|
216-
| `sensor_handle` | Pointer to the sensor handle to read from |
214+
| Name | Type | Description |
215+
| ------ | ------ | ----------- |
216+
| `sensor_handle` | *ocre_sensor_handle_t** | Pointer to the sensor handle to read from |
217217

218218
**Returns**:
219219

220220
| Value | Description |
221-
| ------ | -----------|
221+
| ------ | ----------- |
222222
| `ocre_sensors_sample_t` | A structure containing the sensor data sample |
223223

224224

@@ -232,20 +232,19 @@ ocre_sensor_value_t sensor_get_channel(ocre_sensors_sample_t sample, sensor_chan
232232
233233
**Parameters**:
234234
235-
| Value | Description |
236-
| ------ | -----------|
237-
| `sample` | The sensor sample containing raw data |
238-
| `channel` | The specific channel to retrieve data for (e.g., `SENSOR_CHANNEL_TEMPERATURE`) |
235+
| Name | Type | Description |
236+
| ------ | ------ | ----------- |
237+
| `sample` | *ocre_sensors_sample_t* | The sensor sample containing raw data |
238+
| `channel` | *sensor_channel_t* | The specific channel to retrieve data for (e.g., `SENSOR_CHANNEL_TEMPERATURE`) |
239239
240240
**Returns**:
241241
242242
| Value | Description |
243-
| ------ | -----------|
243+
| ------ | ----------- |
244244
| `ocre_sensor_value_t` | The value from the requested channel |
245245
246-
:::note
246+
{: .note }
247247
If the channel is invalid or unavailable, the function may return an error code or placeholder value.
248-
:::
249248
250249
### Set Sensor Trigger
251250
@@ -259,18 +258,18 @@ ocre_sensors_status_t ocre_sensors_set_trigger(ocre_sensor_handle_t sensor_handl
259258

260259
**Parameters**:
261260

262-
| Value | Description |
263-
| ------ | -----------|
264-
| `sensor_handle` | Handle of the sensor |
265-
| `channel` | Channel to set the trigger on |
266-
| `trigger_type` | Type of trigger (e.g., data ready, threshold) |
267-
| `callback` | Function to be called when trigger occurs |
268-
| `subscription_id` | Pointer to store the subscription ID |
261+
| Name | Type | Description |
262+
| ------ | ------ | ----------- |
263+
| `sensor_handle` | *ocre_sensor_handle_t* | Handle of the sensor |
264+
| `channel` | *sensor_channel_t* | Channel to set the trigger on |
265+
| `trigger_type` | *enum sensor_trigger_type* | Type of trigger (e.g., data ready, threshold) |
266+
| `callback` | *ocre_sensor_trigger_cb* | Function to be called when trigger occurs |
267+
| `subscription_id` | *int** | Pointer to store the subscription ID |
269268

270269
**Returns**:
271270

272271
| Value | Description |
273-
| ------ | -----------|
272+
| ------ | ----------- |
274273
| `SENSOR_API_STATUS_OK` | on success |
275274
| other status code | on error |
276275

@@ -285,16 +284,16 @@ ocre_sensors_status_t ocre_sensors_clear_trigger(ocre_sensor_handle_t sensor_han
285284
286285
**Parameters**:
287286
288-
| Value | Description |
289-
| ------ | -----------|
290-
| `sensor_handle` | Handle of the sensor |
291-
| `channel` | The specific channel (e.g., `SENSOR_CHANNEL_TEMPERATURE`) from which the trigger should be removed |
292-
| `subscription_id` | ID of the subscription to remove |
287+
| Name | Type | Description |
288+
| ------ | ------ | ----------- |
289+
| `sensor_handle` | *ocre_sensor_handle_t* | Handle of the sensor |
290+
| `channel` | *sensor_channel_t* | The specific channel (e.g., `SENSOR_CHANNEL_TEMPERATURE`) from which the trigger should be removed |
291+
| `subscription_id` | *int* | ID of the subscription to remove |
293292
294293
**Returns**:
295294
296295
| Value | Description |
297-
| ------ | -----------|
296+
| ------ | ----------- |
298297
| `SENSOR_API_STATUS_OK` | on success |
299298
| other status code | on error |
300299
@@ -310,7 +309,7 @@ ocre_sensors_status_t ocre_sensors_cleanup();
310309
**Returns**:
311310

312311
| Value | Description |
313-
| ------ | -----------|
312+
| ------ | ----------- |
314313
| `SENSOR_API_STATUS_OK` | on success |
315314
| other status code | on error |
316315

@@ -321,7 +320,7 @@ ocre_sensors_status_t ocre_sensors_cleanup();
321320
Most functions return status codes from the `ocre_sensors_status_t` enumeration. Check the return value to determine if an operation succeeded or failed.
322321

323322
| Value | Description |
324-
| ------ | -----------|
323+
| ------ | ----------- |
325324
| `SENSOR_API_STATUS_OK` | Operation completed successfully |
326325
| `SENSOR_API_STATUS_ERROR` | General failure |
327326
| `SENSOR_API_STATUS_UNINITIALIZED` | API not initialized |

docs/reference/container-api/timers.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ int ocre_timer_create(int id);
7979

8080
**Parameters**:
8181

82-
| Value | Description |
83-
| ------ | -----------|
84-
| `id` | Timer identifier (must be between `1` and `MAX_TIMERS`) |
82+
| Name | Type | Description |
83+
| ------ | ------ | ----------- |
84+
| `id` | *int* | Timer identifier (must be between `1` and `MAX_TIMERS`) |
8585

8686
**Returns**:
8787

8888
| Value | Description |
89-
| ------ | -----------|
89+
| ------ | ----------- |
9090
| `0` | on success |
9191
| `-1` | on error with errno set |
9292

9393
**Errors**:
9494

9595
| Value | Description |
96-
| ------ | -----------|
96+
| ------ | ----------- |
9797
| `EINVAL` | Invalid timer ID or timer system not initialized |
9898
| `EEXIST` | Timer ID already in use |
9999

@@ -107,23 +107,23 @@ int ocre_timer_start(ocre_timer_t id, int interval, int is_periodic);
107107
108108
**Parameters**:
109109
110-
| Value | Description |
111-
| ------ | -----------|
112-
| `id` | Timer identifier |
113-
| `interval` | Timer interval in milliseconds |
114-
| `is_periodic`| `1` for periodic timer, `0` for one-shot
110+
| Name | Type | Description |
111+
| ------ | ------ | ----------- |
112+
| `id` | *ocre_timer_t* | Timer identifier |
113+
| `interval` | *int* | Timer interval in milliseconds |
114+
| `is_periodic` | *int* | `1` for periodic timer, `0` for one-shot |
115115
116116
**Returns**:
117117
118118
| Value | Description |
119-
| ------ | -----------|
119+
| ------ | ----------- |
120120
| `0` | on success |
121121
| `-1` | on error with errno set |
122122
123123
**Errors**:
124124
125125
| Value | Description |
126-
| ------ | -----------|
126+
| ------ | ----------- |
127127
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
128128
129129
### Stop Timer
@@ -136,21 +136,21 @@ int ocre_timer_stop(ocre_timer_t id);
136136

137137
**Parameters**:
138138

139-
| Value | Description |
140-
| ------ | -----------|
141-
| `id` | Timer identifier |
139+
| Name | Type | Description |
140+
| ------ | ------ | ----------- |
141+
| `id` | *ocre_timer_t* | Timer identifier |
142142

143143
**Returns**:
144144

145145
| Value | Description |
146-
| ------ | -----------|
146+
| ------ | ----------- |
147147
| `0` | on success |
148148
| `-1` | on error with errno set |
149149

150150
**Errors**:
151151

152152
| Value | Description |
153-
| ------ | -----------|
153+
| ------ | ----------- |
154154
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
155155

156156
### Get Remaining Time
@@ -163,21 +163,21 @@ int ocre_timer_get_remaining(ocre_timer_t id);
163163
164164
**Parameters**:
165165
166-
| Value | Description |
167-
| ------ | -----------|
168-
| `id` | Timer identifier |
166+
| Name | Type | Description |
167+
| ------ | ------ | ----------- |
168+
| `id` | *ocre_timer_t* | Timer identifier |
169169
170170
**Returns**:
171171
172172
| Value | Description |
173-
| ------ | -----------|
174-
| `>= 0` | Remaining time in milliseconds|
173+
| ------ | ----------- |
174+
| `>= 0` | Remaining time in milliseconds |
175175
| `-1` | Error occurred (check errno) |
176176
177177
**Errors**:
178178
179179
| Value | Description |
180-
| ------ | -----------|
180+
| ------ | ----------- |
181181
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
182182
183183
### Delete Timer
@@ -190,21 +190,21 @@ int ocre_timer_delete(ocre_timer_t id);
190190

191191
**Parameters**:
192192

193-
| Value | Description |
194-
| ------ | -----------|
195-
| `id` | Timer identifier |
193+
| Name | Type | Description |
194+
| ------ | ------ | ----------- |
195+
| `id` | *ocre_timer_t* | Timer identifier |
196196

197197
**Returns**:
198198

199199
| Value | Description |
200-
| ------ | -----------|
200+
| ------ | ----------- |
201201
| `0` | on success |
202202
| `-1` | on error with errno set |
203203

204204
**Errors**:
205205

206206
| Value | Description |
207-
| ------ | -----------|
207+
| ------ | ----------- |
208208
| `EINVAL` | Invalid timer ID, timer not found, or invalid interval |
209209

210210

@@ -216,9 +216,8 @@ Sets the WASM dispatcher function for timer callbacks. This function is used int
216216
void ocre_timer_set_dispatcher(void);
217217
```
218218
219-
:::info
219+
{: .note }
220220
This function is handled automatically by the Ocre runtime and is included here for completeness. Container applications should not call this function directly.
221-
:::
222221
223222
---
224223
## Error Handling
@@ -228,7 +227,7 @@ All functions, except `ocre_timer_set_module_inst` and `ocre_timer_set_dispatche
228227
**Errors:**
229228
230229
| Value | Description |
231-
| ------ | -----------|
230+
| ------ | ----------- |
232231
| `EINVAL` | Invalid timer ID or timer system not initialized |
233232
| `EEXIST` | Timer ID already in use |
234233

0 commit comments

Comments
 (0)