controllerCC2420.c File Reference

Controller of the module HF using pseudo csma-ca. More...

#include <TimeManage.h>
#include <tracage.h>
#include <reprogrammation.h>

Include dependency graph for controllerCC2420.c:

Go to the source code of this file.

Defines

#define NB_TENTATIVES   ( 60 )
#define WAIT_100us(t)

Functions

char controller_read (void *frame, int *distance)
 Receive a frame.
int controller_read_alarm_frame (unsigned int *x, unsigned int *y)
 Read an alarm frame from the transmitter "x", "y".
char controller_write (void *frame, unsigned int size, char priority)
 Write a frame to the channel of communication.

Variables

UINT16 buffer_phy [64]
UINT16 buffer_reprog [64]
flag_execution flag_exec
info_Reveil Frame_alarm


Detailed Description

Controller of the module HF using pseudo csma-ca.

Author:
BRONNER Vinciane
Version:
1.0
Date:
2006 / 03 / 24

2007 / 07 / 10 modified by ANGER Thomas and SAVIGNY Christophe

2008/ 11/ 26 code review and documentation by ANGER Thomas

Version:
2.0

Definition in file controllerCC2420.c.


Define Documentation

#define NB_TENTATIVES   ( 60 )

Definition at line 43 of file controllerCC2420.c.

#define WAIT_100us (  ) 

Value:

{\
    if(t>0) \
    {\
      TACTL = TACLR;\
      TACCR0 = 57 * ( t ) ;\
      TACTL = TASSEL_2 + MC_1 + ID_0 ;\
      while ( ! ( TACTL & 1 ) );\
      TACTL = 0;\
    }\
  }

Definition at line 49 of file controllerCC2420.c.

Referenced by controller_read(), and controller_write().


Function Documentation

char controller_read ( void *  frame,
int *  distance 
)

Receive a frame.

Parameters:
[out] frame : Points to the buffer to receive data that is being read from the channel.
[out] distance : Mesure of the distance between this and the sender of the frame
Returns:
0 : Success.

"other" : Error.

Definition at line 94 of file controllerCC2420.c.

References buffer_phy, buffer_reprog, cc2420_powerdown(), CDISPLAY_INFO_MAC, CSERIAL_PUTCHAR_MAC, CSERIAL_PUTS_MAC, Flag_PT, nbytes, flag_execution::recep_coll, flag_execution::recep_notrans, flag_execution::recep_ok, flag_execution::recep_overflow, RecepFrame(), REVEIL, sendFrame(), flag_execution::trans_underflow, WAIT_100us, WAIT_DATA_AFTER_WB, and wakeup_cc2420().

Referenced by PT_THREAD().

Here is the call graph for this function:

Here is the caller graph for this function:

int controller_read_alarm_frame ( unsigned int *  x,
unsigned int *  y 
)

Read an alarm frame from the transmitter "x", "y".

Parameters:
[out] x : Points to the received transmitter identity.
[out] y : Points to the received transmitter identity.
Returns:
0 : Success.

1 : not awake trame

2 : size of packet invalid

3 : time out

Definition at line 196 of file controllerCC2420.c.

References buffer_phy, cc2420_powerdown(), CDISPLAY_NUMBER_MAC, CSERIAL_PUTS_MAC, info_Reveil::id_x, info_Reveil::id_y, nbytes, RANDMAX_WAKEUP_INTERVAL, RecepFrame(), REVEIL, TIME_BASE, flag_execution::trans_nowakeup, info_Reveil::type, wakeup_cc2420(), and wakeup_interval.

Referenced by check_online_code_version(), and PT_THREAD().

Here is the call graph for this function:

Here is the caller graph for this function:

char controller_write ( void *  frame,
unsigned int  size,
char  priority 
)

Write a frame to the channel of communication.

Parameters:
[in] frame : Points to the frame containing the data to be written to the channel.
[in] size : size of the frame in byte
[in] priority : indicate the priority of the frame
Returns:
0 : Success.

1 : Error.

Definition at line 264 of file controllerCC2420.c.

References cc2420_change_emission_power(), cc2420_powerdown(), CSERIAL_PUTS_MAC, HIGH_PRIORITY, NO_PRIORITY, sendFrame(), flag_execution::trans_coll, flag_execution::trans_ok, flag_execution::trans_underflow, WAIT_100us, and wakeup_cc2420().

Referenced by PT_THREAD().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 64 of file controllerCC2420.c.

Referenced by controller_read(), and PT_THREAD().

Definition at line 83 of file Bootloader/CONFIG/VG.C.

Referenced by PT_THREAD().

Definition at line 12 of file Bootloader/CONFIG/VG.C.

Referenced by initWB().


Generated on Wed Jun 3 12:05:44 2009 for PowWow v1.0 by  doxygen 1.5.6