Loading...
Searching...
No Matches
bus.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include <assert.h>
22#include "msg_bus.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31typedef enum {
32#if MODULE_SYS_BUS_POWER
33 SYS_BUS_POWER,
34#endif
36} sys_bus_t;
37
41typedef enum {
46
47 /* add more if needed, but not more than 32 */
49
54
63static inline msg_bus_t *sys_bus_get(sys_bus_t bus)
64{
65 return &_sys_bus[bus];
66}
67
68#ifdef __cplusplus
69}
70#endif
71
POSIX.1-2008 compliant version of the assert macro.
sys_bus_power_event_t
Power Bus Events.
Definition bus.h:41
msg_bus_t _sys_bus[SYS_BUS_NUMOF]
The System Bus array - do not use directly.
static msg_bus_t * sys_bus_get(sys_bus_t bus)
Get a System Bus for a category of events.
Definition bus.h:63
sys_bus_t
System Bus types.
Definition bus.h:31
@ SYS_BUS_POWER_EVENT_LOW_VOLTAGE
Supply voltage fallen below threshold.
Definition bus.h:45
@ SYS_BUS_NUMOF
Number of enabled system buses.
Definition bus.h:35
Messaging Bus API for inter process message broadcast.
A message bus is just a list of subscribers.
Definition msg_bus.h:50