,

Dependencies:   mbed

Committer:
jjeong
Date:
Sat Dec 03 08:21:37 2022 +0000
Revision:
0:9d06cdd73bc7
controller for quadrotor with RF24 driver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jjeong 0:9d06cdd73bc7 1 /*
jjeong 0:9d06cdd73bc7 2 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
jjeong 0:9d06cdd73bc7 3 This program is free software; you can redistribute it and/or
jjeong 0:9d06cdd73bc7 4 modify it under the terms of the GNU General Public License
jjeong 0:9d06cdd73bc7 5 version 2 as published by the Free Software Foundation.
jjeong 0:9d06cdd73bc7 6 */
jjeong 0:9d06cdd73bc7 7
jjeong 0:9d06cdd73bc7 8 /*
jjeong 0:9d06cdd73bc7 9 * Mbed support added by Akash Vibhute <akash.roboticist@gmail.com>
jjeong 0:9d06cdd73bc7 10 * Porting completed on Nov/05/2015
jjeong 0:9d06cdd73bc7 11 *
jjeong 0:9d06cdd73bc7 12 * Updated 1: Synced with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20
jjeong 0:9d06cdd73bc7 13 * Updated 2: Synced with TMRh20's RF24 library on Apr/18/2015 from https://github.com/TMRh20
jjeong 0:9d06cdd73bc7 14 *
jjeong 0:9d06cdd73bc7 15 */
jjeong 0:9d06cdd73bc7 16
jjeong 0:9d06cdd73bc7 17
jjeong 0:9d06cdd73bc7 18 #ifndef __RF24_CONFIG_H__
jjeong 0:9d06cdd73bc7 19 #define __RF24_CONFIG_H__
jjeong 0:9d06cdd73bc7 20
jjeong 0:9d06cdd73bc7 21 /*** USER DEFINES: ***/
jjeong 0:9d06cdd73bc7 22 //#define FAILURE_HANDLING
jjeong 0:9d06cdd73bc7 23 //#define SERIAL_DEBUG
jjeong 0:9d06cdd73bc7 24 //#define MINIMAL
jjeong 0:9d06cdd73bc7 25 /**********************/
jjeong 0:9d06cdd73bc7 26 #define rf24_max(a,b) (a>b?a:b)
jjeong 0:9d06cdd73bc7 27 #define rf24_min(a,b) (a<b?a:b)
jjeong 0:9d06cdd73bc7 28
jjeong 0:9d06cdd73bc7 29
jjeong 0:9d06cdd73bc7 30 #include <mbed.h>
jjeong 0:9d06cdd73bc7 31
jjeong 0:9d06cdd73bc7 32 // RF modules support 10 Mhz SPI bus speed
jjeong 0:9d06cdd73bc7 33 const uint32_t RF_SPI_SPEED = 10000000;
jjeong 0:9d06cdd73bc7 34
jjeong 0:9d06cdd73bc7 35 #define HIGH 1
jjeong 0:9d06cdd73bc7 36 #define LOW 0
jjeong 0:9d06cdd73bc7 37
jjeong 0:9d06cdd73bc7 38 //#include <stdint.h>
jjeong 0:9d06cdd73bc7 39 //#include <stdio.h>
jjeong 0:9d06cdd73bc7 40 //#include <string.h>
jjeong 0:9d06cdd73bc7 41
jjeong 0:9d06cdd73bc7 42 #define _BV(x) (1<<(x))
jjeong 0:9d06cdd73bc7 43 #define _SPI SPI
jjeong 0:9d06cdd73bc7 44
jjeong 0:9d06cdd73bc7 45 #ifdef SERIAL_DEBUG
jjeong 0:9d06cdd73bc7 46 #define IF_SERIAL_DEBUG(x) ({x;})
jjeong 0:9d06cdd73bc7 47 #else
jjeong 0:9d06cdd73bc7 48 #define IF_SERIAL_DEBUG(x)
jjeong 0:9d06cdd73bc7 49 #endif
jjeong 0:9d06cdd73bc7 50
jjeong 0:9d06cdd73bc7 51 //#define printf_P printf
jjeong 0:9d06cdd73bc7 52 #define printf_P
jjeong 0:9d06cdd73bc7 53 //#define _BV(bit) (1<<(bit))
jjeong 0:9d06cdd73bc7 54 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
jjeong 0:9d06cdd73bc7 55
jjeong 0:9d06cdd73bc7 56 typedef uint16_t prog_uint16_t;
jjeong 0:9d06cdd73bc7 57 #define PSTR(x) (x)
jjeong 0:9d06cdd73bc7 58 #define sprintf(...) os_sprintf( __VA_ARGS__ )
jjeong 0:9d06cdd73bc7 59 //#define printf_P printf
jjeong 0:9d06cdd73bc7 60 #define printf_P
jjeong 0:9d06cdd73bc7 61 #define strlen_P strlen
jjeong 0:9d06cdd73bc7 62 #define PROGMEM
jjeong 0:9d06cdd73bc7 63 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
jjeong 0:9d06cdd73bc7 64 #define pgm_read_word(p) (*(p))
jjeong 0:9d06cdd73bc7 65 #define PRIPSTR "%s"
jjeong 0:9d06cdd73bc7 66
jjeong 0:9d06cdd73bc7 67 #endif // __RF24_CONFIG_H__
jjeong 0:9d06cdd73bc7 68