File: msgbox.h

package info (click to toggle)
crust-firmware 0.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,900 kB
  • sloc: ansic: 19,341; yacc: 596; lex: 479; makefile: 334; asm: 215; sh: 136; python: 42
file content (49 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Copyright © 2017-2022 The Crust Firmware Authors.
 * SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only
 */

#ifndef DRIVERS_MSGBOX_H
#define DRIVERS_MSGBOX_H

#include <device.h>
#include <stdbool.h>
#include <stdint.h>

/**
 * Acknowledge a message received on a message box channel.
 *
 * @param dev  The message box device.
 * @param chan The message box channel.
 */
void msgbox_ack_rx(const struct device *dev, uint8_t chan);

/**
 * Check if the last transmission on a message box channel has completed, or if
 * it is still pending. A message is pending until the reception IRQ has been
 * cleared on the remote interface.
 *
 * @param dev  The message box device.
 * @param chan The message box channel.
 */
bool msgbox_last_tx_done(const struct device *dev, uint8_t chan);

/**
 * Receive a message via a message box channel.
 *
 * @param dev     The message box device.
 * @param chan    The channel to use within the message box.
 * @param message The message to receive.
 */
int msgbox_receive(const struct device *dev, uint8_t chan, uint32_t *message);

/**
 * Send a message via a message box channel.
 *
 * @param dev     The message box device.
 * @param chan    The channel to use within the message box.
 * @param message The message to send.
 */
int msgbox_send(const struct device *dev, uint8_t chan, uint32_t message);

#endif /* DRIVERS_MSGBOX_H */