This is the firmware for the base version of the OpenSTEM Ranging Board hardware.

Dependencies:   Servo USBDevice mbed

Fork of USBSerial_HelloWorld by Samuel Mokrani

core_defines.h

Committer:
matthewgascoyne
Date:
2016-08-10
Revision:
10:d74124f266cb

File content as of revision 10:d74124f266cb:

/////// FIRMWARE HEADER DETAILS
#define _FW_VERSION 0.0
#define _HW_VERSION "A"
#define _UNIQUE_NAME "STEM001"
#define _DAUGHTER_NAME "DAU_000"
#define _PARENT_NAME "RANGING"
#define _BOOT_MESSAGE "MBED DAUGHTER BOARD FIRMWARE\r\n"

////////////////////////////////// PIN DIRECTION
#define _disc0_Dir 0            // 1=output, 0=input
#define _disc1_Dir 0            // 1=output, 0=input
#define _disc2_Dir 1            // 1=output, 0=input
#define _sync_Dir 0             // 1=output, 0=input
#define _directsync_Dir 0       // output not allowed, 0=input
#define _fdetect_Dir 0          // output not allowed, 0=input
#define _p29_IO_Dir 1           // 1=output, 0=input
#define _p30_IO_Dir 1           // 1=output, 0=input

////////////////////////////////// PIN FUNCTION
#define _disc0_AD 1             // 1=analogue, 0=digital
#define _disc1_AD 1             // 1=analogue, 0=digital
#define _disc2_AD 0             // 1=analogue, 0=digital
#define _sync_AD 1              // 1=analogue, 0=digital
#define _directsync_AD 1        // 1=analogue, 0=digital
#define _fdetect_AD 0           // 1=analogue, 0=digital
#define _p29_IO_AD 0            // analogue unavailable, 0=digital
#define _p30_IO_AD 0            // analogue unavailable, 0=digital

/////// PIN DEFAULT VALUE
#define _def_disc0 0            
#define _def_disc1 0            
#define _def_disc2 0            
#define _def_sync 0         
#define _def_p29_out 0           
#define _def_p30_out 0           
#define _def_sdigioutA 0
#define _def_sdigioutB 0
#define _def_sdigioutC 0
#define _def_sdigioutD 0
#define _def_sdigioutE 0
#define _def_sdigioutF 0

/////// SERVO DEFAULT VALUE
#define _def_servo1 0.0            
#define _def_servo2 0.0            
#define _def_servo3 0.5 

/////// DEFAULT MUX CONFIG
#define _def_mux00_ch 3
#define _def_mux01_ch 2
#define _def_mux02_ch 3
#define _def_mux03_ch 1
#define _def_mux04_ch 2

/////// DEFAULT SERIAL CONFIG
#define _USB_BAUDRATE 57600
#define _USB_RECEIVE_BUF 255
#define _USB_TX_WAIT_US 10

/////// MESSAGE DELIMITERS
#define _HOST_MSG_START 0x23    // "#" character
#define _MBED_MSG_START 0x7E    // "~" character
#define _MSG_END 0x5C           // "\" character

/////// FOURIER PARAMETERS
#define _RPM_CHANGE_DELAY_MS 85

/////// RANGING PARAMETERS
#define _ROTATE_SPEED 0.1
#define _ROTATE_TIME_MS 75