eRPC API Reference
Rev. 1.12.0
NXP Semiconductors
|
Transport that uses Messaging Unit (MU) for interprocessor messaging. More...
#include <erpc_mu_transport.hpp>
Public Member Functions | |
MUTransport (void) | |
Constructor of MU transport. More... | |
virtual | ~MUTransport (void) |
Destructor of MU transport. | |
virtual erpc_status_t | init (MU_Type *muBase) |
Initialization of MU transport layer. More... | |
virtual erpc_status_t | receive (MessageBuffer *message) override |
Start receiving data and stores it to passed message buffer. More... | |
virtual erpc_status_t | send (MessageBuffer *message) override |
Function to send prepared message. More... | |
virtual bool | hasMessage (void) override |
Function to check if is new message to receive. More... | |
Public Member Functions inherited from erpc::Transport | |
Transport (void) | |
Constructor. | |
virtual | ~Transport (void) |
Transport destructor. | |
virtual uint8_t | reserveHeaderSize (void) |
Size of data placed in MessageBuffer before serializing eRPC data. More... | |
virtual void | setCrc16 (Crc16 *crcImpl) |
This functions sets the CRC-16 implementation. More... | |
virtual Crc16 * | getCrc16 (void) |
This functions gets the CRC-16 object. More... | |
Static Public Member Functions | |
static void | mu_irq_callback (void) |
Callback function called from MU IRQ. More... | |
Protected Member Functions | |
void | rx_cb (void) |
Function called from MU IRQ when the MU RX full flag is asserted and the IRQ is enabled. More... | |
void | tx_cb (void) |
Function called from MU IRQ when the MU TX empty flag is asserted and the IRQ is enabled. More... | |
Protected Attributes | |
volatile bool | m_newMessage |
volatile uint32_t | m_rxMsgSize |
uint32_t | m_rxCntBytes |
uint32_t *volatile | m_rxBuffer |
volatile uint32_t | m_txMsgSize |
uint32_t | m_txCntBytes |
uint32_t *volatile | m_txBuffer |
Semaphore | m_rxSemaphore |
Semaphore | m_txSemaphore |
Mutex | m_sendLock |
Mutex | m_receiveLock |
MU_Type * | m_muBase |
Transport that uses Messaging Unit (MU) for interprocessor messaging.
This transport layer use the Messaging Unit (MU), which enables two processors within the SoC to communicate and coordinate by passing messages (e.g. data, status and control) through the MU interface. The MU has four transmit and four receive registers used for communication between cores, the transport layer use count of registers defined by macro MU_REG_COUNT (default setting is use all MU registers). The communication uses the interrupt from the MU, to be possible use this transport layer on different platform must be specified this macros: MU_IRQ_HANDLER - name of the MU irq handler MU_IRQ - name of MU irq to be possible enable it by passing it as argument to function EnableIRQ() MU_IRQ_PRIORITY - number of priority passed as argument to function NVIC_SetPriority()
MUTransport::MUTransport | ( | void | ) |
Constructor of MU transport.
This function initializes object attributes.
|
virtual |
Initialization of MU transport layer.
Initialize MU peripheral and enable MU interrupt in NVIC.
[in] | Base | address of MU peripheral |
kErpcStatus_Success | When init function was executed successfully. |
kErpcStatus_InitFailed | When init function wasn't executed successfully. |
|
overridevirtual |
Start receiving data and stores it to passed message buffer.
Initialize receiving of message, it is blocking until doesn't receive complete message.
[in] | message | Message buffer, which will be filled by incoming message. |
Implements erpc::Transport.
|
overridevirtual |
Function to send prepared message.
[in] | message | Pass message buffer to send. |
kErpcStatus_SendFailed | Failed to send message buffer. |
kErpcStatus_Success | Successfully sent all data. |
Implements erpc::Transport.
|
overridevirtual |
Function to check if is new message to receive.
This function should be called before blocking function receive() to avoid waiting for new message.
Reimplemented from erpc::Transport.
|
static |
Callback function called from MU IRQ.
This function reads status flags of MU and base on the evnet which cause the irq calls function rx_cb() to handle rx full irq or tx_cb() to handle tx empty irq for the particular instance of the MUTransport
|
protected |
Function called from MU IRQ when the MU RX full flag is asserted and the IRQ is enabled.
When is this function invoked prior receive function (bare metal case) the m_newMessage flag is set and the MU rx full interrupt is disabled. When is this function invoked after receive function the data from MU registers is copied to this receiving buffer passed in receive function. When is received whole message unblock the receive function.
|
protected |
Function called from MU IRQ when the MU TX empty flag is asserted and the IRQ is enabled.
Write data from the buffer passed in send function to MU registers. When is sent whole message unblock the send function.
|
protected |
Flag used in function hasMessage() to inform server by polling function that message is ready for receiving
|
protected |
Size of received message - count of bytes to must be received to complete currently received message
|
protected |
Count of currently received bytes of message
|
protected |
Pointer to buffer to which is copied data from MU registers during receiving
|
protected |
Size of transmitted message - count of bytes to must be transmitted to send complete message
|
protected |
Count of currently received bytes of message
|
protected |
Pointer to buffer from which is copied data to MU registers during sending
|
protected |
Semaphore used by RTOS to block task until the receiving is not complete
|
protected |
Semaphore used by RTOS to block task until the sending is not complete
|
protected |
Base address of MU peripheral