KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
IPMUX Driver for CLBv2. More...
Go to the source code of this file.
Data Structures | |
struct | IpMuxCfg |
IPMux configuration structure. More... | |
Macros | |
#define | IPMUX_CH_0 BIT(0) |
Channel 1. | |
#define | IPMUX_CH_1 BIT(1) |
Channel 2. | |
#define | IPMUX_CH_2 BIT(2) |
Channel 3. | |
#define | IPMUX_CH_3 BIT(3) |
Channel 4. | |
#define | IPMUX_CH_CPU BIT(4) |
CPU channel. | |
#define | IPMUX_FLUSH_OP_START 0x1 |
#define | IPMUX_FLUSH_OP_END 0x2 |
#define | IPMUX_FLUSH_OP_TOGGLE (IPMUX_FLUSH_OP_START | IPMUX_FLUSH_OP_END) |
Functions | |
void | ipMuxInit (IpMuxCfg *modCfg, bool flush) |
Initializes the IPMux local (module) only. More... | |
void | ipMuxCfgRemote (IpMuxCfg *svrCfg) |
Configure IPmux with remote settings. | |
void | ipMuxSetDest (uint8_t *destIp) |
Set the mux destination (server / destination) More... | |
bool | ipMuxRxAvail () |
Returns whether or not there is data available for reception. More... | |
bool | ipMuxRx (void *buf, uint32_t buflen, uint32_t *rxlen) |
Received data from the IPMux's CPU interface. More... | |
bool | ipMuxTx (void *buf, uint32_t txlen, bool done) |
Sends data to the IPMux's CPU interface. More... | |
void | ipMuxFlush (uint32_t channelMask, uint8_t ipmFlushOp) |
Flushes the IPMUX's FIFO's. More... | |
static void | ipMuxFlushCPU () |
Flushes the. | |
void | ipMuxDumpRegs () |
Debug function to see whats inside. | |
IPMUX Driver for CLBv2.
This implements all required functionality for configuring and controlling the IPMux.
Definition in file ipmux.h.
void ipMuxFlush | ( | uint32_t | channelMask, |
uint8_t | ipmFlushOp | ||
) |
Flushes the IPMUX's FIFO's.
Good to use if recovering from an error.
For example:
Flushes channel 0 and 1.
channelMask | The channels to flush |
void ipMuxInit | ( | IpMuxCfg * | modCfg, |
bool | flush | ||
) |
bool ipMuxRx | ( | void * | buf, |
uint32_t | buflen, | ||
uint32_t * | rxlen | ||
) |
Received data from the IPMux's CPU interface.
buf | The buffer to write into |
buflen | The length of the buffer |
rxlen | Pointer to int32 to fill with actual number of bytes read |
true | On success |
false | If reception failed, check errCode() for more info. |
Possible errors:
bool ipMuxRxAvail | ( | ) |
void ipMuxSetDest | ( | uint8_t * | destIp | ) |
Set the mux destination (server / destination)
destIp | The IP address, as a char array of 4 bytes. |
bool ipMuxTx | ( | void * | buf, |
uint32_t | txlen, | ||
bool | done | ||
) |