Just a quick custom service

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wavr.h Source File

wavr.h

00001 /* Copyright (c) 2016 Aconno. All Rights Reserved.
00002  *
00003  * Licensees are granted free, non-transferable use of the information. NO
00004  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00005  * the file.
00006  *
00007  */
00008  
00009 #ifndef WAVR4
00010 #define WAVR4
00011 
00012 #include "drv8837.h"
00013 #include "mbed.h"
00014 #include <events/mbed_events.h>
00015 #include "ble/BLE.h"
00016 #include <stdbool.h>
00017 
00018 /**
00019  *  Settings for general behavior
00020  */
00021 #define PRODUCT_ID                  (0x05)          // WAVR product id
00022 #define VERSION_NUMBER              (0x01)          // version of the software         
00023 #define EVENT_QUEUE_SIZE            (16)             // size of the event queue
00024  
00025  /**
00026  *  General IO pins
00027  */
00028 #define PIN_LED_RED                 (p12)           // Module red LED
00029 #define PIN_LED_BLUE                (p14)           // Module blue LED
00030 #define PIN_LED_GREEN               (p15)           // Module green LED
00031 
00032 /** battery pins */
00033 #define PIN_BAT_VOL                 (p3)            // battery voltage
00034 #define MAX_BAT_V                   (4.2)           // maximum battery voltage
00035 #define MIN_BAT_V                   (3.7)           // minimum battery voltage
00036 #define R3                          (330000)        // upper voltage splitter R 
00037 #define R4                          (100000)        // lower voltage splitter R
00038  
00039 /**
00040  *  Pins for the DRV8837 motor controller
00041  */
00042 #define PIN_M_NSLEEP                (p21)           // inverted sleep motor driver
00043 #define PIN_M_IN1                   (p10)           // motor driver in1
00044 #define PIN_M_IN2                   (p9)            // motor driver in2
00045 #define PIN_M_CUR                   (p2)            // motor driver current sense
00046 #define M_STALL_CUR                 (0.09)           // stall current in ampere
00047 
00048 /**
00049  *  Settings for BT
00050  */
00051 #define DEVICE_NAME                 "aconno_roawr"  // BT name of the device
00052 #define TX_POWER                    (4)             // TX power (in dB)
00053 #define MSD_SIZE                    (29)            // Manufacturer Specific Data lenght (in B)
00054 #define ADVERTISING_INTERVAL_MS     (500)           // interval in which the device is advertised, at least 100ms
00055 
00056 const float V_MULTI =               3.3 * (R3 + R4) / R4; // multiplier for measured voltage to battery voltage
00057 
00058 #endif