#include "config.h"
#include "pic_utils.h"
Go to the source code of this file.
Data Structures | |
struct | _rf_config |
Defines | |
#define | __pic_rf_2401a_h defined |
#define | ENABLE_1_MBPS 5 |
#define | ENABLE_CH2 7 |
#define | ENABLE_CRC 2 |
#define | ENABLE_RECEIVE 0 |
#define | ENABLE_SHOCKBURST 6 |
#define | LONG_CRC 1 |
#define | pic_rf_chip_enable(value) change_pin(rf_ce_port, rf_ce_pin, value); |
#define | pic_rf_chip_select(value) change_pin(rf_cs_port, rf_cs_pin, value); |
#define | pic_rf_init_inline(my_config) |
#define | pic_rf_receive_mode() pic_rf_set_mode(RECEIVE_MODE) |
#define | pic_rf_transmit_mode() pic_rf_set_mode(TRANSMIT_MODE) |
#define | RECEIVE_MODE 1 |
#define | TRANSMIT_MODE 0 |
Typedefs | |
typedef struct _rf_config | rf_config |
Functions | |
void | pic_rf_init (rf_config *my_config) |
void | pic_rf_quick_init (char *my_config, uns8 my_channel, bit my_receive_on) |
void | pic_rf_receive (uns8 *data, uns8 bytes_to_receive) |
void | pic_rf_send_byte (uns8 b) |
void | pic_rf_send_bytes (char *bytes, uns8 num_bytes) |
void | pic_rf_send_bytes_inline (char *bytes, uns8 num_bytes) |
void | pic_rf_set_channel (uns8 channel) |
void | pic_rf_set_mode (uns8 mode) |
void | pic_rf_setup () |
void | pic_rf_transmit (char *data, uns8 bytes_to_transmit) |
Variables | |
static uns8 | rf_current_channel = 2 |
static bit | rf_current_mode_receive = 0 |
#define __pic_rf_2401a_h defined |
Definition at line 2 of file pic_rf_2401a.h.
#define ENABLE_1_MBPS 5 |
Definition at line 56 of file pic_rf_2401a.h.
#define ENABLE_CH2 7 |
Definition at line 58 of file pic_rf_2401a.h.
#define ENABLE_CRC 2 |
Definition at line 54 of file pic_rf_2401a.h.
#define ENABLE_RECEIVE 0 |
Definition at line 52 of file pic_rf_2401a.h.
#define ENABLE_SHOCKBURST 6 |
Definition at line 57 of file pic_rf_2401a.h.
#define LONG_CRC 1 |
Definition at line 53 of file pic_rf_2401a.h.
#define pic_rf_chip_enable | ( | value | ) | change_pin(rf_ce_port, rf_ce_pin, value); |
Definition at line 93 of file pic_rf_2401a.h.
Referenced by pic_rf_init(), pic_rf_quick_init(), pic_rf_set_channel(), pic_rf_set_mode(), and pic_rf_transmit().
#define pic_rf_chip_select | ( | value | ) | change_pin(rf_cs_port, rf_cs_pin, value); |
Definition at line 92 of file pic_rf_2401a.h.
Referenced by pic_rf_init(), pic_rf_quick_init(), pic_rf_set_channel(), and pic_rf_set_mode().
#define pic_rf_init_inline | ( | my_config | ) |
Definition at line 95 of file pic_rf_2401a.h.
#define pic_rf_receive_mode | ( | ) | pic_rf_set_mode(RECEIVE_MODE) |
Definition at line 89 of file pic_rf_2401a.h.
#define pic_rf_transmit_mode | ( | ) | pic_rf_set_mode(TRANSMIT_MODE) |
Definition at line 90 of file pic_rf_2401a.h.
#define RECEIVE_MODE 1 |
Definition at line 60 of file pic_rf_2401a.h.
Referenced by pic_rf_set_mode(), and pic_rf_transmit().
#define TRANSMIT_MODE 0 |
Definition at line 61 of file pic_rf_2401a.h.
Referenced by pic_rf_set_mode(), and pic_rf_transmit().
typedef struct _rf_config rf_config |
Definition at line 48 of file pic_rf_2401a.h.
void pic_rf_init | ( | rf_config * | my_config | ) |
Definition at line 47 of file pic_rf_2401a.c.
void pic_rf_quick_init | ( | char * | my_config, | |
uns8 | my_channel, | |||
bit | my_receive_on | |||
) |
Definition at line 26 of file pic_rf_2401a.c.
void pic_rf_receive | ( | uns8 * | data, | |
uns8 | bytes_to_receive | |||
) |
!pic_rf_chip_enable(0); // save power
pic_rf_chip_enable(1); // turn chip back on
Definition at line 94 of file pic_rf_2401a.c.
References clear_pin, kill_interrupts, make_input, set_pin, test_pin, and uns8.
void pic_rf_send_byte | ( | uns8 | b | ) |
Definition at line 5 of file pic_rf_2401a.c.
void pic_rf_send_bytes | ( | char * | bytes, | |
uns8 | num_bytes | |||
) |
Definition at line 18 of file pic_rf_2401a.c.
void pic_rf_send_bytes_inline | ( | char * | bytes, | |
uns8 | num_bytes | |||
) | [inline] |
Definition at line 81 of file pic_rf_2401a.h.
References pic_rf_send_byte(), and uns8.
Referenced by pic_rf_transmit().
void pic_rf_set_channel | ( | uns8 | channel | ) |
Definition at line 163 of file pic_rf_2401a.c.
void pic_rf_set_mode | ( | uns8 | mode | ) |
Definition at line 142 of file pic_rf_2401a.c.
void pic_rf_setup | ( | ) |
Definition at line 185 of file pic_rf_2401a.c.
void pic_rf_transmit | ( | char * | data, | |
uns8 | bytes_to_transmit | |||
) |
Definition at line 118 of file pic_rf_2401a.c.
References kill_interrupts, make_output, pic_rf_chip_enable, pic_rf_send_bytes_inline(), pic_rf_set_mode(), RECEIVE_MODE, rf_current_mode_receive, TRANSMIT_MODE, and uns8.
Referenced by pkt_send_packet().
uns8 rf_current_channel = 2 [static] |
Definition at line 64 of file pic_rf_2401a.h.
Referenced by pic_rf_init(), pic_rf_quick_init(), and pic_rf_set_channel().
bit rf_current_mode_receive = 0 [static] |
Definition at line 63 of file pic_rf_2401a.h.
Referenced by pic_rf_init(), pic_rf_quick_init(), pic_rf_set_channel(), pic_rf_set_mode(), and pic_rf_transmit().