State Machine Driver.
More...
#include <stdint.h>
#include "util/macro.h"
#include "lm32soc/dev_soc.h"
#include <stddef.h>
#include <stdbool.h>
Go to the source code of this file.
State Machine Driver.
Definition in file stmach.h.
void _stmachOverflowBegin |
( |
uint32_t |
tdcFifo, |
|
|
uint32_t |
aesFifo |
|
) |
| |
Invoked when an AES or TDC fifo overflow occurs.
- Parameters
-
tdcFifo | TDC Fifo mask, each bits corresponds to a specific FIFO. |
aesFifo | AES Fifo mask |
Definition at line 85 of file sub_sys.c.
void _stmachOverflowEnd |
( |
uint32_t |
tdcFifo, |
|
|
uint32_t |
aesFifo |
|
) |
| |
Invoked when an AES or TDC fifo should be enabled again.
- Parameters
-
tdcFifo | TDC Fifo mask, each bits corresponds to a specific FIFO. |
aesFifo | AES Fifo mask |
Definition at line 130 of file sub_sys.c.
bool stmachConfig |
( |
uint32_t |
packSize, |
|
|
uint32_t |
duration |
|
) |
| |
Configures the stateMachine.
- Parameters
-
packSize | The maximum packet size in bytes (will be rounded to 16 bit words); |
duration | The duration in microseconds. Must fit integer number of times in one second. E.g. 100ms, 250ms is okay, but 300ms is not. |
Definition at line 98 of file stmach.c.
bool stmachEnable |
( |
uint32_t |
enable | ) |
|
Enables one or more STMACH channels.
- Parameters
-
enable | An OR-ed cobination of STMACH_CH_* values |
- Return values
-
True | Success |
False | On timeout |
Definition at line 127 of file stmach.c.
uint32_t stmachEnabled |
( |
| ) |
|
Returns which state-machine channels are enabled.
- Parameters
-
enable | An OR-ed cobination of STMACH_CH_* values |
Definition at line 144 of file stmach.c.
void stmachFlush |
( |
uint32_t |
flush, |
|
|
uint8_t |
op |
|
) |
| |
Flushes one or more state-machine channels.
- Parameters
-
flush | An OR-ed cobination of STMACH_CH_* values |
op | Flush operation to execute. |
Definition at line 113 of file stmach.c.
void stmachGetStCommit |
( |
uint16_t * |
tdc, |
|
|
uint16_t * |
aes |
|
) |
| |
Debug feature: Get TDC and AES state machine Fifo commits.
- Parameters
-
tdc | Pointer to uint16 to be set with FIFO commit of TDC |
aes | Pointer to uint16 to be set with FIFO commit of AES |
Definition at line 149 of file stmach.c.
bool stmachInit |
( |
uint32_t |
domId, |
|
|
void * |
monbuf, |
|
|
size_t |
monlen |
|
) |
| |
Initializes the state-machine with the DOM ID and the monitoring channel CPU data pointer.
Once configured the content of the pointer will be transferred to the monitoring channel packed. The buffer must be word (32 bits) aligned, and the length will be rounded up by 4 bytes.
- Parameters
-
domId | The DOM ID as transmitted with each packet. |
monbuf | Pointer to the data to transfer. |
monlen | Length of the data |
recoverTaskId | The task invoked when the state-machine buffers are overflowing. |
- Return values
-
true | Succesfully initialized |
false | Initialization failure, check error module for issue. |
Definition at line 72 of file stmach.c.
void stmachMUCfg |
( |
uint32_t |
intervalMs | ) |
|
Configure Monitor Update.
- Parameters
-
intervalMs | Interval to which this must occur. |
Definition at line 90 of file stmach.c.
static void stmachSetRunNo |
( |
uint32_t |
runNo | ) |
|
|
inlinestatic |
Sets the run-number.
- Parameters
-
Definition at line 84 of file stmach.h.
static void stmachWaitForTSlices |
( |
int |
tslice | ) |
|
|
inlinestatic |
Waits for at least the provided number of time-slices.
- Parameters
-
tslice | The number of time slices to wait (minimum) |
Definition at line 139 of file stmach.h.