Altera_avalon_mailbox_get(), Altera_avalon_mailbox_open(), Altera_avalon_mailbox_pend() – Altera Embedded Peripherals IP User Manual

Page 268: Altera_avalon_mailbox_get() -5, Altera_avalon_mailbox_open() -5, Altera_avalon_mailbox_pend() -5

Advertising
background image

altera_avalon_mailbox_get()

Prototype:

alt_u32 altera_avalon_mailbox_get (alt_mailbox_dev* dev, int*

err);

Thread-safe:

Yes.

Available from

ISR:

No.

Include:

<

altera_avalon_mailbox.h

>

Parameters:

dev

—the mailbox handle.

err

—pointer to an error code that is returned.

Returns:

Returns a message if one is available in the mailbox, otherwise returns 0. The

value pointed to by

err

is 0 if the message was read correctly, or

EWOULDBLOCK

if

there is no message to read.

Description:

altera_avalon_mailbox_get()

returns a message if one is present, but does

not block waiting for a message.

altera_avalon_mailbox_open()

Prototype:

alt_mailbox_dev* altera_avalon_mailbox_open (const char* name);

Thread-safe:

Yes.

Available from

ISR:

No.

Include:

<

altera_avalon_mailbox.h

>

Parameters:

name

—the name of the mailbox device to open.

Returns:

Returns a handle to the mailbox, or NULL if this mailbox does not exist.

Description:

altera_avalon_mailbox_open()

opens a mailbox.

altera_avalon_mailbox_pend()

Prototype:

alt_u32 altera_avalon_mailbox_pend (alt_mailbox_dev* dev);

Thread-safe:

Yes.

Available from

ISR:

No.

Include:

<

altera_avalon_mailbox.h

>

Parameters:

dev

—the mailbox device to read a message from.

Returns:

Returns the message.

Description:

altera_avalon_mailbox_pend()

is a blocking routine that waits for a

message to appear in the mailbox and then reads it.

UG-01085

2014.24.07

altera_avalon_mailbox_get()

27-5

Mailbox Core

Altera Corporation

Send Feedback

Advertising