aversive_10-03-12/modules/comm/mf2_server/mf2_server.c File Reference

#include <stdio.h>
#include <aversive.h>
#include <aversive/wait.h>
#include <timer.h>
#include <mf2_server.h>
#include <mf2_server_config.h>

Go to the source code of this file.

Defines

#define data_Z()   do { cbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } while(0)
#define data_0()   do { sbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } while(0)
#define read_data()   (bit_is_set(PIN(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT))
#define data_is_Z()   (!bit_is_set(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT))
#define clk_Z()   do { cbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } while(0)
#define clk_0()   do { sbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } while(0)
#define read_clk()   (bit_is_set(PIN(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT))
#define clk_is_Z()   (!bit_is_set(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT))
#define MF2_SERVER_STATE_READY   0
#define MF2_SERVER_STATE_SEND   1
#define MF2_SERVER_STATE_RECV   2
#define WAIT_KBD_CYCLE   600
#define WAIT_KBD_CYCLE4   WAIT_KBD_CYCLE/4
#define dump()   do {} while(0)

Typedefs

typedef void( event )(char)

Functions

void recv (void)
int8_t mf2_server_ready (void)
void disp (char c)
void mf2_server_timer_cb (void)
int8_t mf2_server_send (char c)
void mf2_server_init (void)
void mf2_server_register_tx_event (void(*f)(char))
void mf2_server_register_rx_event (void(*f)(char))


Define Documentation

 
#define clk_0 (  )     do { sbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } while(0)

Definition at line 39 of file mf2_server.c.

 
#define clk_is_Z (  )     (!bit_is_set(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT))

Definition at line 41 of file mf2_server.c.

 
#define clk_Z (  )     do { cbi(DDR(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT); } while(0)

Definition at line 38 of file mf2_server.c.

 
#define data_0 (  )     do { sbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } while(0)

Definition at line 34 of file mf2_server.c.

 
#define data_is_Z (  )     (!bit_is_set(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT))

Definition at line 36 of file mf2_server.c.

 
#define data_Z (  )     do { cbi(DDR(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT); } while(0)

Definition at line 33 of file mf2_server.c.

 
#define dump (  )     do {} while(0)

Definition at line 147 of file mf2_server.c.

Referenced by mf2_server_timer_cb().

#define MF2_SERVER_STATE_READY   0

Definition at line 43 of file mf2_server.c.

Referenced by mf2_server_ready(), and mf2_server_timer_cb().

#define MF2_SERVER_STATE_RECV   2

Definition at line 45 of file mf2_server.c.

Referenced by mf2_server_timer_cb().

#define MF2_SERVER_STATE_SEND   1

Definition at line 44 of file mf2_server.c.

Referenced by mf2_server_send().

 
#define read_clk (  )     (bit_is_set(PIN(MF2_SERVER_CLK_PORT), MF2_SERVER_CLK_BIT))

Definition at line 40 of file mf2_server.c.

Referenced by mf2_server_timer_cb().

 
#define read_data (  )     (bit_is_set(PIN(MF2_SERVER_DATA_PORT), MF2_SERVER_DATA_BIT))

Definition at line 35 of file mf2_server.c.

Referenced by mf2_server_timer_cb(), and recv().

#define WAIT_KBD_CYCLE   600

Definition at line 58 of file mf2_server.c.

#define WAIT_KBD_CYCLE4   WAIT_KBD_CYCLE/4

Definition at line 59 of file mf2_server.c.

Referenced by recv().


Typedef Documentation

typedef void( event)(char)

Definition at line 49 of file mf2_server.c.


Function Documentation

void disp ( char  c  ) 

void mf2_server_init ( void   ) 

Definition at line 362 of file mf2_server.c.

References cbi, clk_Z, data_Z, and mf2_server_timer_cb().

int8_t mf2_server_ready ( void   ) 

Definition at line 122 of file mf2_server.c.

References MF2_SERVER_STATE_READY.

Referenced by mf2_server_send().

void mf2_server_register_rx_event ( void(*)(char)  f  ) 

Definition at line 387 of file mf2_server.c.

References parse_symbols::f, IRQ_LOCK, IRQ_UNLOCK, and rx_event.

void mf2_server_register_tx_event ( void(*)(char)  f  ) 

Definition at line 377 of file mf2_server.c.

References parse_symbols::f, IRQ_LOCK, IRQ_UNLOCK, and tx_event.

int8_t mf2_server_send ( char  c  ) 

void mf2_server_timer_cb ( void   ) 

void recv ( void   ) 

Definition at line 62 of file mf2_server.c.

References clk_0, clk_Z, data_0, data_Z, i, read_data, wait_4cyc, and WAIT_KBD_CYCLE4.


Generated on Fri Mar 12 06:32:05 2010 for AVR by  doxygen 1.5.6