RTEMS 6.1-rc1
regulator.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2023 On-Line Applications Research Corporation (OAR)
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
140#ifndef REGULATOR_H
141#define REGULATOR_H
142
143#include <stdlib.h>
144
145#include <rtems.h>
146
229 void *context,
230 void *message,
231 size_t length
232);
233
243typedef struct {
246
249
252
255
258
261
264
267
269
278typedef struct {
280 size_t obtained;
281
283 size_t released;
284
286 size_t delivered;
287
290
292
298struct _Regulator_Control;
299
308
344 rtems_regulator_attributes *attributes,
345 rtems_regulator_instance **regulator
346);
347
371 rtems_regulator_instance *regulator,
372 rtems_interval ticks
373);
374
401 rtems_regulator_instance *regulator,
402 void **buffer
403);
404
429 rtems_regulator_instance *regulator,
430 void *buffer
431);
432
474 rtems_regulator_instance *regulator,
475 void *message,
476 size_t length
477);
478
498 rtems_regulator_instance *regulator,
500);
501
502#endif /* REGULATOR_H */
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition: types.h:257
Watchdog_Interval rtems_interval
This type represents clock tick intervals.
Definition: types.h:114
struct _Regulator_Control * rtems_regulator_instance
Regulator Instance.
Definition: regulator.h:307
rtems_status_code rtems_regulator_delete(rtems_regulator_instance *regulator, rtems_interval ticks)
Delete a regulator.
Definition: regulator.c:456
rtems_status_code rtems_regulator_release_buffer(rtems_regulator_instance *regulator, void *buffer)
Release Previously Obtained Regulator Buffer.
Definition: regulator.c:535
rtems_status_code rtems_regulator_create(rtems_regulator_attributes *attributes, rtems_regulator_instance **regulator)
Create a regulator.
Definition: regulator.c:241
rtems_status_code rtems_regulator_obtain_buffer(rtems_regulator_instance *regulator, void **buffer)
Obtain Buffer from Regulator.
Definition: regulator.c:498
rtems_status_code rtems_regulator_get_statistics(rtems_regulator_instance *regulator, rtems_regulator_statistics *statistics)
Obtain statistics for regulator instance.
Definition: regulator.c:629
bool(* rtems_regulator_deliverer)(void *context, void *message, size_t length)
Regulator Delivery Function Type.
Definition: regulator.h:228
rtems_status_code rtems_regulator_send(rtems_regulator_instance *regulator, void *message, size_t length)
Send to regulator instance.
Definition: regulator.c:570
rtems_termios_device_context * context
Definition: console-config.c:62
This header file defines the RTEMS Classic API.
Regulator Instance Private Structure.
Definition: regulatorimpl.h:96
Definition: media-server.c:46
This structure provides the statistics of a period.
Definition: ratemon.h:119
Attributes for Regulator Instance.
Definition: regulator.h:243
size_t maximum_messages
Definition: regulator.h:254
rtems_task_priority delivery_thread_priority
Definition: regulator.h:257
size_t delivery_thread_stack_size
Definition: regulator.h:260
rtems_regulator_deliverer deliverer
Definition: regulator.h:245
rtems_interval delivery_thread_period
Definition: regulator.h:263
size_t maximum_to_dequeue_per_period
Definition: regulator.h:266
void * deliverer_context
Definition: regulator.h:248
size_t maximum_message_size
Definition: regulator.h:251
Statistics for Regulator Instance.
Definition: regulator.h:278
size_t delivered
Definition: regulator.h:286
size_t released
Definition: regulator.h:283
rtems_rate_monotonic_period_statistics period_statistics
Definition: regulator.h:289
size_t obtained
Definition: regulator.h:280