#include <stdio.h>
#include <aversive.h>
#include <mf2_client.h>
#include <mf2_client_config.h>
#include <aversive/wait.h>
Go to the source code of this file.
Defines | |
#define | WATCHDOG_TIMEOUT 10000 |
#define | MF2_CLIENT_STATE_IDLE 0 |
#define | MF2_CLIENT_STATE_RECV 1 |
#define | MF2_CLIENT_STATE_XMIT 2 |
#define | MF2_CLIENT_STATE_ACK 3 |
#define | data_Z() cbi(DDR(MF2_CLIENT_DATA_PORT), MF2_CLIENT_DATA_BIT) |
#define | data_0() sbi(DDR(MF2_CLIENT_DATA_PORT), MF2_CLIENT_DATA_BIT) |
#define | clk_Z() cbi(DDR(MF2_CLIENT_CLK_PORT), MF2_CLIENT_CLK_BIT) |
#define | clk_0() sbi(DDR(MF2_CLIENT_CLK_PORT), MF2_CLIENT_CLK_BIT) |
#define | START_BIT 0x0001 |
#define | PARITY_BIT 0x0200 |
#define | STOP_BIT 0x0400 |
Typedefs | |
typedef void( | event )(char) |
Functions | |
SIGNAL (MF2_CLIENT_INTERRUPT) | |
void | mf2_client_init (void) |
s08 | mf2_client_ready (void) |
s08 | mf2_client_send (char c) |
void | mf2_client_register_tx_event (void(*f)(char)) |
void | mf2_client_register_rx_event (void(*f)(char)) |
#define clk_0 | ( | ) | sbi(DDR(MF2_CLIENT_CLK_PORT), MF2_CLIENT_CLK_BIT) |
Definition at line 46 of file mf2_client.c.
Referenced by mf2_client_send(), mf2_server_timer_cb(), recv(), and SIGNAL().
#define clk_Z | ( | ) | cbi(DDR(MF2_CLIENT_CLK_PORT), MF2_CLIENT_CLK_BIT) |
Definition at line 45 of file mf2_client.c.
Referenced by mf2_client_init(), mf2_server_init(), mf2_server_send(), mf2_server_timer_cb(), recv(), and SIGNAL().
#define data_0 | ( | ) | sbi(DDR(MF2_CLIENT_DATA_PORT), MF2_CLIENT_DATA_BIT) |
Definition at line 44 of file mf2_client.c.
Referenced by mf2_server_timer_cb(), recv(), and SIGNAL().
#define data_Z | ( | ) | cbi(DDR(MF2_CLIENT_DATA_PORT), MF2_CLIENT_DATA_BIT) |
Definition at line 43 of file mf2_client.c.
Referenced by mf2_client_init(), mf2_server_init(), mf2_server_send(), mf2_server_timer_cb(), recv(), and SIGNAL().
#define MF2_CLIENT_STATE_ACK 3 |
#define MF2_CLIENT_STATE_IDLE 0 |
Definition at line 38 of file mf2_client.c.
Referenced by mf2_client_init(), mf2_client_ready(), and SIGNAL().
#define MF2_CLIENT_STATE_RECV 1 |
#define MF2_CLIENT_STATE_XMIT 2 |
#define PARITY_BIT 0x0200 |
#define START_BIT 0x0001 |
Definition at line 73 of file mf2_client.c.
#define STOP_BIT 0x0400 |
Definition at line 75 of file mf2_client.c.
#define WATCHDOG_TIMEOUT 10000 |
typedef void( event)(char) |
Definition at line 59 of file mf2_client.c.
void mf2_client_init | ( | void | ) |
Definition at line 183 of file mf2_client.c.
References cbi, clk_Z, data_Z, IRQ_LOCK, IRQ_UNLOCK, and MF2_CLIENT_STATE_IDLE.
s08 mf2_client_ready | ( | void | ) |
Definition at line 226 of file mf2_client.c.
References MF2_CLIENT_STATE_IDLE.
Referenced by mf2_client_send().
void mf2_client_register_rx_event | ( | void(*)(char) | f | ) |
Definition at line 314 of file mf2_client.c.
References parse_symbols::f, IRQ_LOCK, IRQ_UNLOCK, and rx_event.
void mf2_client_register_tx_event | ( | void(*)(char) | f | ) |
Definition at line 304 of file mf2_client.c.
References parse_symbols::f, IRQ_LOCK, IRQ_UNLOCK, and tx_event.
s08 mf2_client_send | ( | char | c | ) |
Definition at line 255 of file mf2_client.c.
References clk_0, IRQ_LOCK, IRQ_UNLOCK, mf2_client_ready(), MF2_CLIENT_STATE_XMIT, PARITY_BIT, and SCHEDULER_UNIT.
SIGNAL | ( | MF2_CLIENT_INTERRUPT | ) |
Definition at line 77 of file mf2_client.c.
References clk_0, clk_Z, data_0, data_Z, MF2_CLIENT_STATE_ACK, MF2_CLIENT_STATE_IDLE, MF2_CLIENT_STATE_RECV, MF2_CLIENT_STATE_XMIT, PIN, rx_event, scheduler_del_event(), SCHEDULER_UNIT, tx_event, and WATCHDOG_TIMEOUT.