Software APIs
Data Structures | Macros | Typedefs | Functions
dif_mbx.h File Reference

(8a1a5fe)

DOE Mailbox Device Interface Functions More...

#include <stdint.h>
#include "sw/device/lib/dif/autogen/dif_mbx_autogen.h"

Go to the source code of this file.

Data Structures

struct  dif_mbx_range_config
 Inbound and outbound range for DOE Mailbox. More...
 
struct  dif_mbx_transaction
 DOE object transferred on the inbound or outbound mailbox. More...
 

Macros

#define DOE_MAILBOX_MAX_OBJECT_SIZE   1024
 A DOE transaction is allowed to have at maximum 1024 double words (32-bit each).
 

Typedefs

typedef struct dif_mbx_range_config dif_mbx_range_config_t
 Inbound and outbound range for DOE Mailbox.
 
typedef struct dif_mbx_transaction dif_mbx_transaction_t
 DOE object transferred on the inbound or outbound mailbox.
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_range_set (const dif_mbx_t *mbx, dif_mbx_range_config_t config)
 Configures the mailbox inbound and outbound ranges and validates them. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_is_busy (const dif_mbx_t *mbx, bool *is_busy)
 Returns whether the mailbox is busy or not. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_range_get (const dif_mbx_t *mbx, dif_mbx_range_config_t *config)
 Reads the mailbox range configuration. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_ipi_configuration_get (const dif_mbx_t *mbx, uint32_t *doe_intr_addr, uint32_t *doe_intr_data)
 Reads the DOE interrupt configuration for inter-processor interrupts (IPI). More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_process_request (const dif_mbx_t *mbx, dif_mbx_transaction_t *request)
 Reads the DoE Mailbox request from internal SRAM. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_generate_response (const dif_mbx_t *mbx, const dif_mbx_transaction_t response)
 Host writes the DoE Mailbox response to the internal SRAM. More...
 

Detailed Description

DOE Mailbox Device Interface Functions

Definition in file dif_mbx.h.


Data Structure Documentation

◆ dif_mbx_range_config

struct dif_mbx_range_config

Inbound and outbound range for DOE Mailbox.

Definition at line 24 of file dif_mbx.h.

Data Fields
uint32_t imbx_base_addr
uint32_t imbx_limit_addr
uint32_t ombx_base_addr
uint32_t ombx_limit_addr

◆ dif_mbx_transaction

struct dif_mbx_transaction

DOE object transferred on the inbound or outbound mailbox.

Definition at line 40 of file dif_mbx.h.

Data Fields
uint32_t * data_dwords
uint32_t nr_dwords

Function Documentation

◆ dif_mbx_generate_response()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_generate_response ( const dif_mbx_t mbx,
const dif_mbx_transaction_t  response 
)

Host writes the DoE Mailbox response to the internal SRAM.

Parameters
mbxA DOE Mailbox handle.
responseDOE object written to the the internal SRAM.
Returns
The result of the operation.

Definition at line 121 of file dif_mbx.c.

◆ dif_mbx_ipi_configuration_get()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_ipi_configuration_get ( const dif_mbx_t mbx,
uint32_t *  doe_intr_addr,
uint32_t *  doe_intr_data 
)

Reads the DOE interrupt configuration for inter-processor interrupts (IPI).

Parameters
mbxA DOE Mailbox handle.
[out]doe_intr_addrMailbox interrupt address.
[out]doe_intr_dataMailbox interrupt value.
Returns
The result of the operation.

Definition at line 75 of file dif_mbx.c.

◆ dif_mbx_is_busy()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_is_busy ( const dif_mbx_t mbx,
bool *  is_busy 
)

Returns whether the mailbox is busy or not.

Parameters
mbxA DOE Mailbox handle.
[out]is_busyTrue if the mailbox is busy, false if not.
Returns
The result of the operation.

Definition at line 64 of file dif_mbx.c.

◆ dif_mbx_process_request()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_process_request ( const dif_mbx_t mbx,
dif_mbx_transaction_t request 
)

Reads the DoE Mailbox request from internal SRAM.

The request->nr_words field specifies the maximum number of words that can be stored in the internal request array. After reading, this function updates request->nr_words to indicate the actual number of words read.

Parameters
mbxA handle to the DoE Mailbox.
[out]requestA pointer to the DoE object where the request data from internal SRAM will be stored.
Returns
The result of the operation:
  • kDifBadArg: One or more input arguments are invalid.
  • kDifOutOfRange: The response exceeds the buffer size.
  • kDifOk: The operation was successful.

Definition at line 90 of file dif_mbx.c.

◆ dif_mbx_range_get()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_range_get ( const dif_mbx_t mbx,
dif_mbx_range_config_t config 
)

Reads the mailbox range configuration.

Parameters
mbxA DOE Mailbox handle.
[out]configMailbox inbound and outbound range configuration.
Returns
The result of the operation.

Definition at line 47 of file dif_mbx.c.

◆ dif_mbx_range_set()

OT_WARN_UNUSED_RESULT dif_result_t dif_mbx_range_set ( const dif_mbx_t mbx,
dif_mbx_range_config_t  config 
)

Configures the mailbox inbound and outbound ranges and validates them.

Parameters
mbxA DOE Mailbox handle.
configMailbox inbound and outbound range configuration.
Returns
The result of the operation.

Definition at line 13 of file dif_mbx.c.