![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
#include "task_ptp.h"
#include <string.h>
#include "config.h"
#include "event.h"
#include "network_stack_driver.h"
#include "portmacro.h"
#include "profiles.h"
#include "projdefs.h"
#include "ptp_core.h"
#include "ptp_raw_msg_circbuf.h"
#include "settings_interface.h"
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
#include <flexptp_options.h>
Go to the source code of this file.
Macros | |
#define | MIN(a, b) (((a) < (b)) ? (a) : (b)) |
#define | RX_PACKET_FIFO_LENGTH (32) |
Receive packet FIFO length. | |
#define | TX_PACKET_FIFO_LENGTH (16) |
Transmit packet FIFO length. | |
#define | EVENT_FIFO_LENGTH (32) |
Event FIFO length. | |
Functions | |
static void | ptp_create_message_queues () |
static void | ptp_destroy_message_queues () |
void | reg_task_ptp () |
void | unreg_task_ptp () |
bool | ptp_event_enqueue (const PtpCoreEvent *event) |
void | ptp_receive_enqueue (const void *pPayload, uint32_t len, uint32_t ts_sec, uint32_t ts_ns, int tp) |
bool | ptp_transmit_enqueue (const RawPtpMessage *pMsg) |
static void | task_ptp (void *pParam) |
bool | task_ptp_is_operating () |
#define EVENT_FIFO_LENGTH (32) |
Event FIFO length.
Definition at line 45 of file task_ptp.c.
#define MIN | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Definition at line 26 of file task_ptp.c.
#define RX_PACKET_FIFO_LENGTH (32) |
Receive packet FIFO length.
Definition at line 43 of file task_ptp.c.
#define TX_PACKET_FIFO_LENGTH (16) |
Transmit packet FIFO length.
Definition at line 44 of file task_ptp.c.
|
static |
Definition at line 60 of file task_ptp.c.
|
static |
Definition at line 76 of file task_ptp.c.
bool ptp_event_enqueue | ( | const PtpCoreEvent * | event | ) |
Post an event.
event | pointer to a filled event object |
Definition at line 136 of file task_ptp.c.
void ptp_receive_enqueue | ( | const void * | pPayload, |
uint32_t | len, | ||
uint32_t | ts_sec, | ||
uint32_t | ts_ns, | ||
int | tp | ||
) |
Enqueue PTP message.
pPayload | message payload |
len | message length |
ts_sec | reception timestamp seconds part |
ts_ns | receptiopn timestamp nanoseconds part |
tp | transport portocol (L2/L4) |
Definition at line 141 of file task_ptp.c.
bool ptp_transmit_enqueue | ( | const RawPtpMessage * | pMsg | ) |
Put a PTP message into the transmit queue.
pMsg | pointer to raw PTP message. Can be discarded after the function has returned. |
Definition at line 171 of file task_ptp.c.
void reg_task_ptp | ( | ) |
Register PTP task.
Definition at line 90 of file task_ptp.c.
|
static |
Definition at line 193 of file task_ptp.c.
bool task_ptp_is_operating | ( | ) |
Is the PTP task operating?
Definition at line 237 of file task_ptp.c.
void unreg_task_ptp | ( | ) |
Unreg PTP task.
Definition at line 128 of file task_ptp.c.