PebbleOS v4.44.0-199-g465b7d28c
Loading...
Searching...
No Matches
mbox.h File Reference
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/kernel/timer.h>

Data Structures

struct  pbl_mbox_chan
 A channel, as used by a consumer. More...
 
struct  pbl_mbox_client
 Channel client. More...
 
struct  pbl_mbox_chan_state
 Channel state, kept by the class. More...
 
struct  pbl_mbox_controller_state
 Controller state, kept by the class. More...
 
struct  pbl_mbox_controller_ops
 Controller operations, implemented by the providers. More...
 
struct  pbl_mbox_controller
 Mailbox controller. More...
 

Macros

#define PBL_MBOX_MAX_CELLS   2U
 Maximum number of specifier cells.
 
#define PBL_MBOX_CHAN(_ctrl, ...)
 Initializer of a struct pbl_mbox_chan.
 
#define PBL_MBOX_CONTROLLER_STATE_DEFINE(sym, _num_chans)
 Define the state of a controller, for providers.
 
#define PBL_MBOX_CONTROLLER_INIT(sym, _name, _init, _deps, _ops, _txpoll_period_ms)
 Initializer of a struct pbl_mbox_controller, for providers.
 

Functions

int pbl_mbox_request (const struct pbl_mbox_chan *chan, const struct pbl_mbox_client *cl)
 Request a channel and enable it.
 
void pbl_mbox_free (const struct pbl_mbox_chan *chan)
 Disable a channel and release it, dropping any message in flight.
 
int pbl_mbox_send (const struct pbl_mbox_chan *chan, const void *msg)
 Send a message.
 
void pbl_mbox_chan_received (const struct pbl_mbox_controller *ctrl, uint8_t idx, const void *msg)
 Report a message from the remote, for providers.
 
void pbl_mbox_chan_txdone (const struct pbl_mbox_controller *ctrl, uint8_t idx, int ret)
 Report that the remote took the last message, for providers with a completion interrupt.
 

Variables

const struct pbl_device_class pbl_mbox_class
 Class of the mailbox controllers.