poppy_com  0.1
Poppy2.0 communication library
 All Classes Files Functions Variables Enumerations Enumerator Pages
Classes | Typedefs | Enumerations | Functions
poppyNetwork.h File Reference

Poppy communication main include file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  msg_t
 Message structure. More...
 

Typedefs

typedef void(* RX_CB )(msg_dir_t dir, msg_t *msg)
 
typedef void(* TX_CB )(msg_t *msg)
 

Enumerations

enum  msg_dir_t { TX, RX, RXGC, END }
 Message direction enum. More...
 

Functions

void poppyNetwork_init (TX_CB tx_cb, RX_CB rx_cb, RX_CB rxgc_cb)
 Initialisation of the Poppy communication lib. More...
 
unsigned char poppyNetwork_read (unsigned char addr, msg_t *msg, unsigned char reply_size)
 
unsigned char poppyNetwork_write (unsigned char addr, msg_t *msg)
 Master mode write function. More...
 

Detailed Description

Poppy communication main include file.

Author
Nicolas Rabault
Version
0.1
Date
22 Avril 2015

Include this file to use the poppy communication protocole.

Definition in file poppyNetwork.h.

Enumeration Type Documentation

enum msg_dir_t

Message direction enum.

Module specific register enumerator.

This structure is used to get the message direction but it seems to be useles because we have defferent interrupt for each msg_dir case.

This is the minimal include you will need to use poppy_com in a module application

This structure is used to list all the specific module register. The first register should be equal to PROTOCOL_REGISTER_NB, because is the first free register. The last register should be MODULE_REGISTER_NB, for the user space register enumerator...

Enumerator
TX 

Slave transmiter mode.

RX 

Slave receiver mode.

RXGC 

Slave receiver général call mode.

END 

Slave receiver stop.

Definition at line 22 of file poppyNetwork.h.

Function Documentation

void poppyNetwork_init ( TX_CB  tx_cb,
RX_CB  rx_cb,
RX_CB  rxgc_cb 
)

Initialisation of the Poppy communication lib.

Parameters
tx_cbfunction pointer into the tx callback.
rx_cbfunction pointer into the rx callback.
rxgc_cbfunction pointer into the rx general call callback.

Definition at line 17 of file poppyNetwork.c.

unsigned char poppyNetwork_write ( unsigned char  addr,
msg_t msg 
)

Master mode write function.

Parameters
addrAddress of the slave.
msgMessage to send to the slave.

Definition at line 85 of file poppyNetwork.c.