Alarm Sensor Module  0.1
⇒ back to Project Page
rfm12_io.c
Go to the documentation of this file.
1 /***************************************************************************
32 ***************************************************************************/
33 
34 #include <avr/io.h>
35 #include <util/delay.h>
36 #include <stdint.h>
37 #include <stdlib.h>
38 
39 #include "port_definitions.h"
40 #include "rfm12_io.h"
41 //#include "glcd.h"
42 
43 //program dependend includes
44 //#include "babyfone_sender.h"
45 
46 
47 /****************************************************************************/
76 /****************************************************************************/
77 
78 int16_t rfm12_data_io(volatile uint16_t *tx_data, volatile uint16_t *rx_data, uint8_t number_bytes,
79  uint8_t di_flag, uint8_t power_safe_mode) {
80 
81  uint8_t i;
82  uint8_t byte_count = 0;
83  uint16_t power_config_value_u16;
84  uint16_t timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
85 
86 
88  if (di_flag == RFM12_REGISTER_DATA) {
89 
90  //Start of transmission --> Chip Select to '0'
91  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
92  _delay_us(1);
93 
94  SPDR = (*tx_data >> 8) & 0xff; //send high byte to slave
95 
96  //wait until data transmission to RFM12 is complete...
97  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
98  while (!(SPSR & (1 << SPIF))) {
99  if (timeout_counter_u16 > 0u) { //check the timeout counter value
100  timeout_counter_u16--;
101  } else { //return error in case of timeout
102  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
104  }
105  }
106  *rx_data = SPDR; //read high byte from slave
107 
108  SPDR = *tx_data & 0xff; //send low byte to slave
109 
110  //wait until data transmission to RFM12 is complete
111  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
112  while (!(SPSR & (1 << SPIF))) {
113  if (timeout_counter_u16 > 0u) { //check the timeout counter value
114  timeout_counter_u16--;
115  } else { //return error in case of timeout
116  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
118  }
119  }
120  *rx_data = (*rx_data << 8) | SPDR; //read low byte from slave
121 
122  _delay_us(1);
123 
124  //end of transmission --> Chip Select to '1'
125  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
126 
127  byte_count++;
128 
129 
130 
132  } else if (di_flag == RFM12_TX_DATA) {
133 
134 #if LED_INDICATOR == 1
135  //TX LED on
136  RFM12_PORT = RFM12_PORT | (1 << RFM12_LEDY);
137 #endif
138 
139  //Start of transmission --> Chip Select to '0'
140  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
141  _delay_us(1);
142 
143 
145  SPDR = (RFM12_CONFIG_VALUE >> 8) & 0xff; //send high byte to slave
146 
147  //wait until data transmission to RFM12 is complete...
148  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
149  while (!(SPSR & (1 << SPIF))) {
150  if (timeout_counter_u16 > 0u) { //check the timeout counter value
151  timeout_counter_u16--;
152  } else { //return error in case of timeout
153  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
155  }
156  }
157  SPDR = RFM12_CONFIG_VALUE & 0xff; //send low byte to slave
158 
159  //wait until data transmission to RFM12 is complete...
160  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
161  while (!(SPSR & (1 << SPIF))) {
162  if (timeout_counter_u16 > 0u) { //check the timeout counter value
163  timeout_counter_u16--;
164  } else { //return error in case of timeout
165  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
167  }
168  }
169 
170 #if RFM12_TRANSMISSION_BURST == 0
171  _delay_us(1);
172  //end of transmission --> Chip Select to '1'
173  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
174 
175  _delay_us(1);
176 
177  //Start of transmission --> Chip Select to '0'
178  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
179  _delay_us(1);
180 #endif
181 
183  SPDR = (RFM12_POWERMANAGEMENT_TX_VALUE >> 8) & 0xff; //send high byte to slave
184 
185  //wait until data transmission to RFM12 is complete...
186  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
187  while (!(SPSR & (1 << SPIF))) {
188  if (timeout_counter_u16 > 0u) { //check the timeout counter value
189  timeout_counter_u16--;
190  } else { //return error in case of timeout
191  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
193  }
194  }
195  SPDR = RFM12_POWERMANAGEMENT_TX_VALUE & 0xff; //send low byte to slave
196 
197  //wait until data transmission to RFM12 is complete...
198  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
199  while (!(SPSR & (1 << SPIF))) {
200  if (timeout_counter_u16 > 0u) { //check the timeout counter value
201  timeout_counter_u16--;
202  } else { //return error in case of timeout
203  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
205  }
206  }
207 
208  //wait until RFM12 is ready for the next byte
209  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
210  while (!(RFM12_PIN & (1 << RFM12_SDO))) {
211  if (timeout_counter_u16 > 0u) { //check the timeout counter value
212  timeout_counter_u16--;
213  } else { //return error in case of timeout
214  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
216  }
217  }
218 
219 
221  for (i = 0; i < number_bytes; i++) {
222 
223 #if RFM12_TRANSMISSION_BURST == 0
224  _delay_us(1);
225  //end of transmission --> Chip Select to '1'
226  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
227 
228  _delay_us(1);
229 
230  //Start of transmission --> Chip Select to '0'
231  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
232  _delay_us(1);
233 #endif
234 
235  SPDR = (tx_data[i] >> 8) & 0xff; //send high byte to slave
236 
237  //wait until data transmission to RFM12 is complete...
238  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
239  while (!(SPSR & (1 << SPIF))) {
240  if (timeout_counter_u16 > 0u) { //check the timeout counter value
241  timeout_counter_u16--;
242  } else { //return error in case of timeout
243  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
245  }
246  }
247  SPDR = tx_data[i] & 0xff; //send low byte to slave
248 
249  //wait until data transmission to RFM12 is complete
250  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
251  while (!(SPSR & (1 << SPIF))) {
252  if (timeout_counter_u16 > 0u) { //check the timeout counter value
253  timeout_counter_u16--;
254  } else { //return error in case of timeout
255  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
257  }
258  }
259 
260  //wait until RFM12 is ready for the next byte
261  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
262  while (!(RFM12_PIN & (1 << RFM12_SDO))) {
263  if (timeout_counter_u16 > 0u) { //check the timeout counter value
264  timeout_counter_u16--;
265  } else { //return error in case of timeout
266  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
268  }
269  }
270 
271  byte_count++;
272 
273  }
274 //#if RFM12_TRANSMISSION_BURST == 0
275  _delay_us(1);
276  //end of transmission --> Chip Select to '1'
277  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
278 
279  _delay_us(1);
280 
281  //Start of transmission --> Chip Select to '0'
282  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
283  _delay_us(1);
284 //#endif
285 
287  SPDR = (RFM12_CONFIG_TX_OFF_VALUE >> 8) & 0xff; //send high byte to slave
288 
289  //wait until data transmission to RFM12 is complete...
290  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
291  while (!(SPSR & (1 << SPIF))) {
292  if (timeout_counter_u16 > 0u) { //check the timeout counter value
293  timeout_counter_u16--;
294  } else { //return error in case of timeout
295  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
297  }
298  }
299  SPDR = RFM12_CONFIG_TX_OFF_VALUE & 0xff; //send low byte to slave
300 
301  //wait until data transmission to RFM12 is complete...
302  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
303  while (!(SPSR & (1 << SPIF))) {
304  if (timeout_counter_u16 > 0u) { //check the timeout counter value
305  timeout_counter_u16--;
306  } else { //return error in case of timeout
307  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
309  }
310  }
311 
312  _delay_us(1);
313 
315 
316  SPDR = (RFM12_STATUSREAD_VALUE >> 8) & 0xff; //send high byte to slave
317 
318  //wait until data transmission to RFM12 is complete...
319  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
320  while (!(SPSR & (1 << SPIF))) {
321  if (timeout_counter_u16 > 0u) { //check the timeout counter value
322  timeout_counter_u16--;
323  } else { //return error in case of timeout
324  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
326  }
327  }
328  *rx_data = SPDR; //read high byte from slave
329 
330 
331  SPDR = RFM12_STATUSREAD_VALUE & 0xff; //send low byte to slave
332 
333  //wait until data transmission to RFM12 is complete...
334  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
335  while (!(SPSR & (1 << SPIF))) {
336  if (timeout_counter_u16 > 0u) { //check the timeout counter value
337  timeout_counter_u16--;
338  } else { //return error in case of timeout
339  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
341  }
342  }
343 
344  *rx_data = (*rx_data << 8) | SPDR; //read low byte from slave
345 
346  _delay_us(1);
347 
349 
351  if (power_safe_mode > 0u) {
352  power_config_value_u16 = (uint16_t) RFM12_POWERMANAGEMENT_SLEEP_VALUE; //go to sleep
353  } else {
354  power_config_value_u16 = (uint16_t) RFM12_POWERMANAGEMENT_RX_VALUE; //go to RX mode
355  }
356 
357  SPDR = (power_config_value_u16 >> 8) & 0xff; //send high byte to slave
358 
359  //wait until data transmission to RFM12 is complete...
360  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
361  while (!(SPSR & (1 << SPIF))) {
362  if (timeout_counter_u16 > 0u) { //check the timeout counter value
363  timeout_counter_u16--;
364  } else { //return error in case of timeout
365  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
367  }
368  }
369  //*rx_data = SPDR; //read high byte from slave
370 
371  SPDR = power_config_value_u16 & 0xff; //send low byte to slave
372 
373  //wait until data transmission to RFM12 is complete...
374  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
375  while (!(SPSR & (1 << SPIF))) {
376  if (timeout_counter_u16 > 0u) { //check the timeout counter value
377  timeout_counter_u16--;
378  } else { //return error in case of timeout
379  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
381  }
382  }
383 
384  //*rx_data = (*rx_data << 8) | SPDR; //read low byte from slave
385 
386  _delay_us(1);
387 
388  //end of transmission --> Chip Select to '1'
389  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
390 
391 #if LED_INDICATOR == 1
392  //TX LED off
393  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_LEDY);
394 #endif
395 
396 
397 
399  } else if (di_flag == RFM12_RX_DATA) {
400 
401 #if LED_INDICATOR == 1
402  //RX LED on
403  RFM12_PORT = RFM12_PORT | (1 << RFM12_LEDG);
404 #endif
405 
406  //Start of transmission --> Chip Select to '0'
407  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
408  _delay_us(1);
409 
410  //wait until RFM12 is ready for the next byte
411  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
412  while (!(RFM12_PIN & (1 << RFM12_SDO))) {
413  if (timeout_counter_u16 > 0u) { //check the timeout counter value
414  timeout_counter_u16--;
415  } else { //return error in case of timeout
416  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
418  }
419  }
420 
421 
423 
424  SPDR = (*tx_data >> 8) & 0xff; //send high byte to slave
425 
426  //wait until data transmission to RFM12 is complete...
427  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
428  while (!(SPSR & (1 << SPIF))) {
429  if (timeout_counter_u16 > 0u) { //check the timeout counter value
430  timeout_counter_u16--;
431  } else { //return error in case of timeout
432  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
434  }
435  }
436  *rx_data = SPDR; //read high byte from slave
437 
438  SPDR = *tx_data & 0xff; //send low byte to slave
439 
440  //wait until data transmission to RFM12 is complete
441  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
442  while (!(SPSR & (1 << SPIF))) {
443  if (timeout_counter_u16 > 0u) { //check the timeout counter value
444  timeout_counter_u16--;
445  } else { //return error in case of timeout
446  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
448  }
449  }
450  *rx_data = (*rx_data << 8) | SPDR; //read low byte from slave
451 
452  byte_count++;
453 
454  _delay_us(1);
455  //end of transmission --> Chip Select to '1'
456  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
457 
458  //go to power safe mode and not to RX mode if requested
459  if (power_safe_mode > 0u) {
460 
461  power_config_value_u16 = (uint16_t) RFM12_POWERMANAGEMENT_SLEEP_VALUE; //go to sleep
462 
463  _delay_us(1);
464 
465  //Start of transmission --> Chip Select to '0'
466  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nSEL);
467 
468  _delay_us(1);
469 
470 
471  SPDR = (power_config_value_u16 >> 8) & 0xff; //send high byte to slave
472 
473  //wait until data transmission to RFM12 is complete...
474  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
475  while (!(SPSR & (1 << SPIF))) {
476  if (timeout_counter_u16 > 0u) { //check the timeout counter value
477  timeout_counter_u16--;
478  } else { //return error in case of timeout
479  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
481  }
482  }
483  *rx_data = SPDR; //read high byte from slave
484 
485  SPDR = power_config_value_u16 & 0xff; //send low byte to slave
486 
487  //wait until data transmission to RFM12 is complete
488  timeout_counter_u16 = RFM12_COMMAND_TIMEOUT;
489  while (!(SPSR & (1 << SPIF))) {
490  if (timeout_counter_u16 > 0u) { //check the timeout counter value
491  timeout_counter_u16--;
492  } else { //return error in case of timeout
493  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
495  }
496  }
497 
498  _delay_us(1);
499  //end of transmission --> Chip Select to '1'
500  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
501 
502  }
503 
504 #if LED_INDICATOR == 1
505  //RX LED off
506  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_LEDG);
507 #endif
508 
509  }
510 
511  RFM12_PORT = RFM12_PORT | (1 << RFM12_nSEL);
512 
513  return byte_count;
514 
515 }
516 
517 
518 /****************************************************************************/
536 /****************************************************************************/
537 
538 uint16_t rfm12_init(uint8_t power_safe_mode) {
539 
540  uint16_t rx_data, tx_data;
541 #if GLCD_ENABLED == 1
542  char tmp_char[16];
543 #endif
544 
546  _delay_ms(RFM12_POR_DELAY_MS);
547 
548 #if LED_INDICATOR == 1
549  RFM12_PORT = RFM12_PORT | (1 << RFM12_LEDG) | (1 << RFM12_LEDY); //reset indication
550 #endif
551  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_nRES);
552  _delay_ms(RFM12_RESET_WIDTH_MS);
553  RFM12_PORT = RFM12_PORT | (1 << RFM12_nRES);
554 #if LED_INDICATOR == 1
555  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_LEDG) & ~(1 << RFM12_LEDY); //reset indication
556 #endif
557 
558  _delay_ms(RFM12_POR_DELAY_MS);
559 
560 
562  tx_data = RFM12_STATUSREAD_VALUE;
563  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
564 #if GLCD_ENABLED == 1
565  itoa(rx_data, tmp_char, 16);
566  glcd_send_string("\nRFM12 Status: ", FALSE);
567  glcd_send_string(tmp_char, FALSE);
568  _delay_ms(RFM12_POR_DELAY_MS);
569  _delay_ms(RFM12_POR_DELAY_MS);
570 #endif
571 
573  if (power_safe_mode > 0u) {
574  tx_data = RFM12_CONFIG_TX_OFF_VALUE;
575  } else {
576  tx_data = RFM12_CONFIG_VALUE;
577  }
578  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
579 
581  if (power_safe_mode > 0u) {
583  } else {
585  }
586  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
587 
589  tx_data = RFM12_FREQUENCY_VALUE;
590  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
591 
593  tx_data = RFM12_DATARATE_VALUE;
594  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
595 
597  tx_data = RFM12_POWERSETTING_VALUE;
598  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
599 
601  tx_data = RFM12_DATAFILTER_VALUE;
602  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
603 
605  tx_data = RFM12_FIFOMODE_VALUE;
606  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
607 
609  tx_data = RFM12_AFC_VALUE;
610  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
611 
613  tx_data = RFM12_TXCONFIG_VALUE;
614  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
615 
617  tx_data = RFM12_PLLSETTING_VALUE;
618  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
619 
621  tx_data = RFM12_WAKEUPTIMER_VALUE;
622  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
623 
625  tx_data = RFM12_LOWDUTYCYCLE_VALUE;
626  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
627 
629  tx_data = RFM12_SYNCHRONPATTERN_VALUE;
630  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
631 
633  tx_data = RFM12_LOWBATDET_VALUE;
634  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
635 
636 
638  tx_data = RFM12_STATUSREAD_VALUE;
639  rfm12_data_io(&tx_data, &rx_data, 1, RFM12_REGISTER_DATA, power_safe_mode);
640 #if GLCD_ENABLED == 1
641  itoa(rx_data, tmp_char, 16);
642  glcd_send_string("\nRFM12 Status: ", FALSE);
643  glcd_send_string(tmp_char, FALSE);
644  _delay_ms(RFM12_POR_DELAY_MS);
645  _delay_ms(RFM12_POR_DELAY_MS);
646  _delay_ms(RFM12_POR_DELAY_MS);
647  _delay_ms(RFM12_POR_DELAY_MS);
648  _delay_ms(RFM12_POR_DELAY_MS);
649 #endif
650 
651  _delay_ms(RFM12_POR_DELAY_MS);
652 
653  return rx_data;
654 
655 
656 }
657 
658 
659 
660 
661 /****************************************************************************/
677 /****************************************************************************/
678 
679 void rfm12_pin_init(void) {
680 
681  //setup port (values)
682  RFM12_PORT = RFM12_PORT | (1 << RFM12_nIRQ) | (1 << RFM12_nRES) | (1 << RFM12_nSEL) |
683  (1 << RFM12_SDI) | (1 << RFM12_SDO) | (1 << RFM12_SCK); //RFM12_LEDG and RFM12_LEDY = 0x00
684 #if LED_INDICATOR == 1
685  RFM12_PORT = RFM12_PORT & ~(1 << RFM12_LEDG) & ~(1 << RFM12_LEDY);
686 #endif
687 
688 
689  //set data direction register
690 #if LED_INDICATOR == 1
691  RFM12_DDR = RFM12_DDR | (1 << RFM12_LEDG) | (1 << RFM12_LEDY);
692 #endif
693 
694  RFM12_DDR = RFM12_DDR | (1 << RFM12_nRES)
695  | (1 << RFM12_SDI) | (1 << RFM12_SCK) | (1 << RFM12_nSEL); //output
696  RFM12_DDR = RFM12_DDR & ~(1 << RFM12_nIRQ) & ~(1 << RFM12_SDO); //input
697 
698 
699  //enable SPI interface
700  SPCR = 0x00 | (1 << SPE) | (1 << MSTR) | (1 << SPR0); //SPI enabled, Master, MCU_CLK/16
701 
702 
703 }
704 
705 
#define RFM12_SCK
#define RFM12_LOWBATDET_VALUE
Definition: rfm12_io.h:95
#define RFM12_nSEL
#define RFM12_RW_LOW_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:106
uint16_t rfm12_init(uint8_t power_safe_mode)
Definition: rfm12_io.c:538
#define RFM12_POWERMANAGEMENT_TX_VALUE
Definition: rfm12_io.h:79
#define RFM12_TXCONFIG_VALUE
Definition: rfm12_io.h:90
#define RFM12_LEDY
#define RFM12_POWERMANAGEMENT_SLEEP_VALUE
Definition: rfm12_io.h:81
#define RFM12_CFG_LOW_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:108
#define RFM12_POWERMANAGEMENT_RX_VALUE
Definition: rfm12_io.h:80
#define RFM12_RX_HIGH_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:114
#define RFM12_SDO
void rfm12_pin_init(void)
Definition: rfm12_io.c:679
#define RFM12_TX_DATA
Definition: rfm12_io.h:65
#define RFM12_LEDG
#define RFM12_RESET_WIDTH_MS
Definition: rfm12_io.h:54
#define RFM12_TX_HIGH_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:112
#define RFM12_FIFOMODE_VALUE
Definition: rfm12_io.h:87
#define RFM12_COMMAND_TIMEOUT
Definition: rfm12_io.h:56
#define RFM12_PM_HIGH_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:109
#define RFM12_RDY_NEXT_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:111
#define RFM12_FREQUENCY_VALUE
Definition: rfm12_io.h:84
#define RFM12_PLLSETTING_VALUE
Definition: rfm12_io.h:92
#define RFM12_POR_DELAY_MS
Definition: rfm12_io.h:53
#define RFM12_TX_LOW_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:113
#define RFM12_RX_DATA
Definition: rfm12_io.h:66
#define RFM12_WAKEUPTIMER_VALUE
Definition: rfm12_io.h:93
#define RFM12_SDI
#define RFM12_REGISTER_DATA
Definition: rfm12_io.h:64
#define RFM12_LOWDUTYCYCLE_VALUE
Definition: rfm12_io.h:94
#define RFM12_DATAFILTER_VALUE
Definition: rfm12_io.h:86
#define FALSE
value for FALSE
Definition: alarm_sensor.h:64
#define RFM12_POWERSETTING_VALUE
Definition: rfm12_io.h:82
int16_t rfm12_data_io(volatile uint16_t *tx_data, volatile uint16_t *rx_data, uint8_t number_bytes, uint8_t di_flag, uint8_t power_safe_mode)
Definition: rfm12_io.c:78
#define RFM12_AFC_VALUE
Definition: rfm12_io.h:89
#define RFM12_RW_HIGH_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:105
#define RFM12_RX_LOW_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:115
#define RFM12_CFG_HIGH_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:107
#define RFM12_nRES
#define RFM12_CONFIG_VALUE
Definition: rfm12_io.h:77
#define RFM12_CONFIG_TX_OFF_VALUE
Definition: rfm12_io.h:78
#define RFM12_STATUSREAD_VALUE
Definition: rfm12_io.h:83
#define RFM12_DDR
#define RFM12_PIN
#define RFM12_PORT
#define RFM12_SYNCHRONPATTERN_VALUE
Definition: rfm12_io.h:97
#define RFM12_DATARATE_VALUE
Definition: rfm12_io.h:85
#define RFM12_nIRQ
#define RFM12_PM_LOW_BYTE_SET_TIMEOUT
Definition: rfm12_io.h:110