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
22#ifndef SYS_BUS_H
23#define SYS_BUS_H
24
25#include <assert.h>
26#include "msg_bus.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
35typedef enum {
36#if MODULE_SYS_BUS_POWER
37 SYS_BUS_POWER,
38#endif
41
45typedef enum {
50
51 /* add more if needed, but not more than 32 */
53
58
67static inline msg_bus_t *sys_bus_get(sys_bus_t bus)
68{
69 return &_sys_bus[bus];
70}
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif /* SYS_BUS_H */
POSIX.1-2008 compliant version of the assert macro.
sys_bus_power_event_t
Power Bus Events.
Definition bus.h:45
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:67
sys_bus_t
System Bus types.
Definition bus.h:35
@ SYS_BUS_POWER_EVENT_LOW_VOLTAGE
Supply voltage fallen below threshold.
Definition bus.h:49
@ SYS_BUS_NUMOF
Number of enabled system buses.
Definition bus.h:39
Messaging Bus API for inter process message broadcast.
A message bus is just a list of subscribers.
Definition msg_bus.h:54