TMRh20 ported to MBED

Fork of TMRh20 by BME SmartLab

Committer:
gume
Date:
Thu Mar 17 07:19:37 2016 +0000
Revision:
3:13e43d3101a5
Parent:
2:3332510eebba
Child:
4:c741eb877a4e
- Fixed SPI problems. The problems was the initilaztion order. SPI has to be initialized after its CE/CS pins

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gume 0:163155b607df 1
gume 0:163155b607df 2 /*
gume 0:163155b607df 3 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
gume 0:163155b607df 4
gume 0:163155b607df 5 This program is free software; you can redistribute it and/or
gume 0:163155b607df 6 modify it under the terms of the GNU General Public License
gume 0:163155b607df 7 version 2 as published by the Free Software Foundation.
gume 0:163155b607df 8 */
gume 0:163155b607df 9
gume 0:163155b607df 10 /* spaniakos <spaniakos@gmail.com>
gume 0:163155b607df 11 Added __ARDUINO_X86__ support
gume 0:163155b607df 12 */
gume 0:163155b607df 13
gume 0:163155b607df 14 #ifndef __RF24_CONFIG_H__
gume 0:163155b607df 15 #define __RF24_CONFIG_H__
gume 0:163155b607df 16
gume 0:163155b607df 17 #include <stdint.h>
gume 0:163155b607df 18
gume 0:163155b607df 19 #define rf24_max(a,b) (a>b?a:b)
gume 0:163155b607df 20 #define rf24_min(a,b) (a<b?a:b)
gume 0:163155b607df 21
gume 0:163155b607df 22 #define RF24_SPI_TRANSACTIONS
gume 0:163155b607df 23
gume 0:163155b607df 24 // RF modules support 10 Mhz SPI bus speed
gume 3:13e43d3101a5 25 const uint32_t RF24_SPI_SPEED = 2000000;
gume 0:163155b607df 26
gume 0:163155b607df 27 //typedef char const char;
gume 0:163155b607df 28
gume 0:163155b607df 29 typedef uint16_t prog_uint16_t;
gume 0:163155b607df 30 #define PSTR(x) (x)
gume 0:163155b607df 31 #define printf_P printf
gume 0:163155b607df 32 #define strlen_P strlen
gume 0:163155b607df 33 #define PROGMEM
gume 0:163155b607df 34 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
gume 0:163155b607df 35 #define pgm_read_word(p) (*(p))
gume 0:163155b607df 36
gume 0:163155b607df 37 #define PRIPSTR "%s"
gume 0:163155b607df 38
gume 0:163155b607df 39 #define HIGH 1
gume 0:163155b607df 40 #define LOW 0
gume 0:163155b607df 41 #define _BV(n) (1 << n)
gume 0:163155b607df 42
gume 0:163155b607df 43 #endif // __RF24_CONFIG_H__
gume 0:163155b607df 44