PowerBlocks SDK
 
Loading...
Searching...
No Matches
ipc.c File Reference

Inter Processor Communications. More...

#include "ipc.h"
#include "system/system.h"
#include "system/exceptions.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "utils/log.h"

Macros

#define IPC_PPCMSG   (*(volatile uint32_t*)0xcd800000)
 
#define IPC_PPCCTRL   (*(volatile uint32_t*)0xcd800004)
 
#define IPC_ARMMSG   (*(volatile uint32_t*)0xcd800008)
 
#define IPC_ARMCTRL   (*(volatile uint32_t*)0xcd80000c)
 
#define IPC_MAX_REQUEST_COUNT   32
 
#define IPC_PPCCTRL_X1   (1<<0)
 
#define IPC_PPCCTRL_Y2   (1<<1)
 
#define IPC_PPCCTRL_Y1   (1<<2)
 
#define IPC_PPCCTRL_X2   (1<<3)
 
#define IPC_PPCCTRL_IY1   (1<<4)
 
#define IPC_PPCCTRL_IY2   (1<<5)
 
#define IPC_MESSAGE_MAGIC   0x64e0eaed
 

Functions

void ipc_initialize ()
 Initializes the IPC Interface.
 
int ipc_request (ipc_message *message, ipc_async_handler_t handler, void *params)
 Puts a request in and gets the response.
 

Detailed Description

Inter Processor Communications.

IPC interface between Broadway and Starlet. Designed to implement IOS's protocol.

Author
Samuel Fitzsimons (rainbain)
Date
2025 @license MIT (see LICENSE file)

Function Documentation

◆ ipc_initialize()

void ipc_initialize ( )

Initializes the IPC Interface.

Usually called through ios_initialize

Initializes the IPC interface. Setups the FreeRTOS Mutexes and data structures for communications.

◆ ipc_request()

int ipc_request ( ipc_message * message,
ipc_async_handler_t handler,
void * params )

Puts a request in and gets the response.

Puts a request into the IPC interface. Then after its completion, the handler will be called from the interrupt service.

Parameters
messageData structure to the message to send to Starlet.
handlerHandler called from interrupt service upon compilation.
paramsPointer passed to the handler.
Returns
Result as int, negative if error.