Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
pipe.h File Reference

arch independent PIPE API More...

#include "std.h"
#include "mcu_periph/pipe_arch.h"
#include "pprzlink/pprzlink_device.h"
+ Include dependency graph for pipe.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pipe_periph
 

Functions

void pipe_arch_init (void)
 
void pipe_arch_periph_init (struct pipe_periph *p, char *read_name, char *write_name)
 Initialize the PIPE peripheral. More...
 
void pipe_periph_init (struct pipe_periph *p, char *name, char *write_name)
 Initialize the PIPE peripheral. More...
 
int pipe_char_available (struct pipe_periph *p)
 Get number of bytes available in receive buffer. More...
 
uint8_t pipe_getch (struct pipe_periph *p)
 Get the last character from the receive buffer. More...
 
void pipe_receive (struct pipe_periph *p)
 Read bytes from PIPE. More...
 
void pipe_send_message (struct pipe_periph *p, long fd)
 Send a message. More...
 
void pipe_send_raw (struct pipe_periph *p, long fd, uint8_t *buffer, uint16_t size)
 Send a packet from another buffer. More...
 
int pipe_check_free_space (struct pipe_periph *p, long *fd, uint16_t len)
 Check if there is enough free space in the transmit buffer. More...
 
void pipe_put_byte (struct pipe_periph *p, long fd, uint8_t data)
 Add one data byte to the tx buffer. More...
 
void pipe_put_buffer (struct pipe_periph *p, long fd, const uint8_t *data, uint16_t len)
 

Detailed Description

arch independent PIPE API

Definition in file pipe.h.


Data Structure Documentation

◆ pipe_periph

struct pipe_periph

Definition at line 35 of file pipe.h.

+ Collaboration diagram for pipe_periph:
Data Fields
struct link_device device Generic device interface.
int fd_read PIPE file descriptor.
int fd_write
uint8_t rx_buf[PIPE_RX_BUFFER_SIZE] Receive buffer.
uint16_t rx_extract_idx
uint16_t rx_insert_idx
uint8_t tx_buf[PIPE_TX_BUFFER_SIZE] Transmit buffer.
uint16_t tx_insert_idx

Function Documentation

◆ pipe_arch_init()

void pipe_arch_init ( void  )

Definition at line 48 of file pipe_arch.c.

References pipe_mutex, and pipe_thread().

+ Here is the call graph for this function:

◆ pipe_arch_periph_init()

void pipe_arch_periph_init ( struct pipe_periph p,
char *  read_name,
char *  write_name 
)

Initialize the PIPE peripheral.

Allocate UdpSocket struct and create and bind the PIPE socket.

Definition at line 76 of file pipe_arch.c.

References p.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_char_available()

int pipe_char_available ( struct pipe_periph p)

Get number of bytes available in receive buffer.

Parameters
ppointer to PIPE peripheral
Returns
number of bytes available in receive buffer

Definition at line 104 of file pipe_arch.c.

References p, pipe_mutex, and PIPE_RX_BUFFER_SIZE.

Referenced by pipe_periph_init(), and pipe_receive().

+ Here is the caller graph for this function:

◆ pipe_check_free_space()

int pipe_check_free_space ( struct pipe_periph p,
long *  fd,
uint16_t  len 
)

Check if there is enough free space in the transmit buffer.

Parameters
ppointer to PIPE peripheral
lenhow many bytes of free space to check for
Returns
number of bytes available or 0 if not enough

Definition at line 94 of file pipe.c.

References p, and PIPE_TX_BUFFER_SIZE.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_getch()

uint8_t pipe_getch ( struct pipe_periph p)

Get the last character from the receive buffer.

Parameters
ppointer to PIPE peripheral
Returns
last byte

Definition at line 120 of file pipe_arch.c.

References p, pipe_mutex, and PIPE_RX_BUFFER_SIZE.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_periph_init()

void pipe_periph_init ( struct pipe_periph p,
char *  name,
char *  write_name 
)

Initialize the PIPE peripheral.

Definition at line 72 of file pipe.c.

References p, pipe_arch_periph_init(), pipe_char_available(), pipe_check_free_space(), pipe_getch(), pipe_put_buffer(), pipe_put_byte(), and pipe_send_message().

+ Here is the call graph for this function:

◆ pipe_put_buffer()

void pipe_put_buffer ( struct pipe_periph p,
long  fd,
const uint8_t data,
uint16_t  len 
)

Definition at line 115 of file pipe.c.

References p, and PIPE_TX_BUFFER_SIZE.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_put_byte()

void pipe_put_byte ( struct pipe_periph p,
long  fd,
uint8_t  data 
)

Add one data byte to the tx buffer.

Parameters
ppointer to PIPE peripheral
databyte to add to tx buffer

Definition at line 105 of file pipe.c.

References p, and PIPE_TX_BUFFER_SIZE.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_receive()

void pipe_receive ( struct pipe_periph p)

Read bytes from PIPE.

Definition at line 132 of file pipe_arch.c.

References p, pipe_char_available(), pipe_mutex, and PIPE_RX_BUFFER_SIZE.

Referenced by pipe_thread().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pipe_send_message()

void pipe_send_message ( struct pipe_periph p,
long  fd 
)

Send a message.

Definition at line 160 of file pipe_arch.c.

References p.

Referenced by pipe_periph_init().

+ Here is the caller graph for this function:

◆ pipe_send_raw()

void pipe_send_raw ( struct pipe_periph p,
long  fd,
uint8_t buffer,
uint16_t  size 
)

Send a packet from another buffer.

Definition at line 182 of file pipe_arch.c.

References p.