Loading...
Searching...
No Matches
bus.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 ML!PA Consulting GmbH
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
23
24#include <assert.h>
25#include "msg_bus.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
34typedef enum {
35#if MODULE_SYS_BUS_POWER
36 SYS_BUS_POWER,
37#endif
39} sys_bus_t;
40
44typedef enum {
49
50 /* add more if needed, but not more than 32 */
52
57
66static inline msg_bus_t *sys_bus_get(sys_bus_t bus)
67{
68 return &_sys_bus[bus];
69}
70
71#ifdef __cplusplus
72}
73#endif
74
POSIX.1-2008 compliant version of the assert macro.
sys_bus_power_event_t
Power Bus Events.
Definition bus.h:44
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:66
sys_bus_t
System Bus types.
Definition bus.h:34
@ SYS_BUS_POWER_EVENT_LOW_VOLTAGE
Supply voltage fallen below threshold.
Definition bus.h:48
@ SYS_BUS_NUMOF
Number of enabled system buses.
Definition bus.h:38
Messaging Bus API for inter process message broadcast.
A message bus is just a list of subscribers.
Definition msg_bus.h:53