PK ‹IMIÓ Ž Ž % PsiSwarm_V7_Blank/GettingStarted.html
Page Redirection
If you are not redirected automatically, please follow the
link to the online exporter documentation
PK zOI:OXÚ Ú PsiSwarm_V7_Blank/Makefile# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
# cross-platform directory manipulation
ifeq ($(shell echo $$OS),$$OS)
MAKEDIR = if not exist "$(1)" mkdir "$(1)"
RM = rmdir /S /Q "$(1)"
else
MAKEDIR = $(SHELL) -c "mkdir -p \"$(1)\""
RM = $(SHELL) -c "rm -rf \"$(1)\""
endif
ifeq (,$(filter .build,$(notdir $(CURDIR))))
.SUFFIXES:
OBJDIR := .build
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(mkfile_path) \
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
.PHONY: $(OBJDIR) clean
all:
+@$(call MAKEDIR,$(OBJDIR))
+@$(MAKETARGET)
$(OBJDIR): all
Makefile : ;
% :: $(OBJDIR) ; :
clean :
$(call RM,$(OBJDIR))
else
VPATH = ..
GCC_BIN =
PROJECT = PsiSwarm_V7_Blank
OBJECTS = main.o PsiSwarmV7/eprom.o PsiSwarmV7/sensors.o PsiSwarmV7/basic.o PsiSwarmV7/demo.o PsiSwarmV7/psiswarm.o PsiSwarmV7/pic.o PsiSwarmV7/dances.o PsiSwarmV7/display.o PsiSwarmV7/colour.o PsiSwarmV7/led.o PsiSwarmV7/i2c.o PsiSwarmV7/motors.o PsiSwarmV7/serial.o
SYS_OBJECTS = mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/cmsis_nvic.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/mbed_board.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/retarget.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/system_LPC17xx.o
INCLUDE_PATHS = -I../. -I../PsiSwarmV7 -I../mbed/. -I../mbed/TARGET_LPC1768 -I../mbed/TARGET_LPC1768/TARGET_NXP -I../mbed/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X -I../mbed/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768 -I../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM
LIBRARY_PATHS = -L../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM
LIBRARIES = -lmbed
LINKER_SCRIPT = ../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/LPC1768.ld
###############################################################################
AS = $(GCC_BIN)arm-none-eabi-as
CC = $(GCC_BIN)arm-none-eabi-gcc
CPP = $(GCC_BIN)arm-none-eabi-g++
LD = $(GCC_BIN)arm-none-eabi-gcc
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
SIZE = $(GCC_BIN)arm-none-eabi-size
CPU = -mcpu=cortex-m3 -mthumb
CC_FLAGS = -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os -std=gnu99 -DDEVICE_ERROR_PATTERN=1 -D__MBED_CMSIS_RTOS_CM -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DTARGET_NXP -DTARGET_LPC176X -DMBED_BUILD_TIMESTAMP=1476544608.02 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DDEVICE_ETHERNET=1 -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -D__MBED__=1 -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -DDEVICE_PORTIN=1 -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1 -include mbed_config.h -MMD -MP
CPPC_FLAGS = -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os -std=gnu++98 -fno-rtti -Wvla -DDEVICE_ERROR_PATTERN=1 -D__MBED_CMSIS_RTOS_CM -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DTARGET_NXP -DTARGET_LPC176X -DMBED_BUILD_TIMESTAMP=1476544608.02 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DDEVICE_ETHERNET=1 -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -D__MBED__=1 -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -DDEVICE_PORTIN=1 -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1 -include mbed_config.h -MMD -MP
ASM_FLAGS = -x assembler-with-cpp -D__CMSIS_RTOS -D__MBED_CMSIS_RTOS_CM -D__CORTEX_M3 -DARM_MATH_CM3 -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os
CC_SYMBOLS = -DDEVICE_ERROR_PATTERN=1 -D__MBED_CMSIS_RTOS_CM -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DTARGET_NXP -DTARGET_LPC176X -DMBED_BUILD_TIMESTAMP=1476544608.02 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DDEVICE_ETHERNET=1 -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -D__MBED__=1 -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -DDEVICE_PORTIN=1 -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1
LD_FLAGS =-Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_calloc_r -mcpu=cortex-m3 -mthumb
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
ifeq ($(DEBUG), 1)
CC_FLAGS += -DDEBUG -O0
else
CC_FLAGS += -DNDEBUG -Os
endif
.PHONY: all lst size
all: $(PROJECT).bin $(PROJECT).hex size
.asm.o:
+@$(call MAKEDIR,$(dir $@))
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
.s.o:
+@$(call MAKEDIR,$(dir $@))
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
.S.o:
+@$(call MAKEDIR,$(dir $@))
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
.c.o:
+@$(call MAKEDIR,$(dir $@))
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
.cpp.o:
+@$(call MAKEDIR,$(dir $@))
$(CPP) $(CPPC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT)
$(LD) $(LD_FLAGS) -T$(filter %.ld, $^) $(LIBRARY_PATHS) -o $@ $(filter %.o, $^) -Wl,--start-group $(LIBRARIES) $(LD_SYS_LIBS) -Wl,--end-group
@echo ""
@echo "*****"
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
@echo "*****"
@echo ""
$(PROJECT).bin: $(PROJECT).elf
$(OBJCOPY) -O binary $< $@
$(PROJECT).hex: $(PROJECT).elf
@$(OBJCOPY) -O ihex $< $@
$(PROJECT).lst: $(PROJECT).elf
@$(OBJDUMP) -Sdh $< > $@
lst: $(PROJECT).lst
size: $(PROJECT).elf
$(SIZE) $(PROJECT).elf
DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
-include $(DEPS)
endif
PK zOIøõ¤¢ PsiSwarm_V7_Blank/mbed_config.h// Automatically generated configuration file.
// DO NOT EDIT, content will be overwritten.
#ifndef __MBED_CONFIG_DATA__
#define __MBED_CONFIG_DATA__
#endif
PK nOI÷z´Þ
PsiSwarm_V7_Blank/main.h/***********************************************************************
** ██████╗ ███████╗██╗███████╗██╗ ██╗ █████╗ ██████╗ ███╗ ███╗ **
** ██╔â•â•â–ˆâ–ˆâ•—██╔â•â•â•â•â•â–ˆâ–ˆâ•‘██╔â•â•â•â•â•â–ˆâ–ˆâ•‘ ██║██╔â•â•â–ˆâ–ˆâ•—██╔â•â•â–ˆâ–ˆâ•—████╗ ████║ **
** ██████╔â•â–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•—██║███████╗██║ █╗ ██║███████║██████╔â•â–ˆâ–ˆâ•”████╔██║ **
** ██╔â•â•â•â• â•šâ•â•â•â•â–ˆâ–ˆâ•‘██║╚â•â•â•â•â–ˆâ–ˆâ•‘██║███╗██║██╔â•â•â–ˆâ–ˆâ•‘██╔â•â•â–ˆâ–ˆâ•—██║╚██╔â•â–ˆâ–ˆâ•‘ **
** ██║ ███████║██║███████║╚███╔███╔â•â–ˆâ–ˆâ•‘ ██║██║ ██║██║ â•šâ•â• ██║ **
** â•šâ•â• â•šâ•â•â•â•â•â•â•â•šâ•â•â•šâ•â•â•â•â•â•â• â•šâ•â•â•â•šâ•â•â• â•šâ•â• â•šâ•â•â•šâ•â• â•šâ•â•â•šâ•â• â•šâ•â• **
************************************************************************
** Copyright 2016 University of York **
** **
** Licensed under the Apache License, Version 2.0 (the "License") **
** You may not use this file except in compliance with the License. **
** You may obtain a copy of the License at **
** http://www.apache.org/licenses/LICENSE-2.0 Unless required by **
** applicable law or agreed to in writing, software distributed under **
** under the License is distributed on an "AS IS" BASIS WITHOUT **
** WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. **
** See the License for the specific language governing permissions **
** and limitations under the License. **
***********************************************************************/
/// PsiSwarm Blank Example Code
/// Version 0.7
/// James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
/// University of York
#ifndef MAIN_H
#define MAIN_H
#include "psiswarm.h"
int main(void);
void user_code_setup(void);
void user_code_loop(void);
void handle_switch_event(char switch_state);
void handle_user_serial_message(char * message, char length, char interface);
#endifPK
nOIÔ€ÌðÉ É ' PsiSwarm_V7_Blank/PsiSwarmV7/psiswarm.h/* University of York Robotics Laboratory PsiSwarm Library: PsiSwarm Core Header File
*
* Copyright 2016 University of York
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* File: psiswarm.h
*
* (C) Dept. Electronics & Computer Science, University of York
* James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
*
* PsiSwarm Library Version: 0.7
*
* October 2016
*
*
*/
#ifndef PSISWARM_H
#define PSISWARM_H
#define SOFTWARE_VERSION_CODE 0.70
#define PIC_ADDRESS 0x30
#define LCD_ADDRESS 0x7C
#define LED_IC_ADDRESS 0x42
#define GPIO_IC_ADDRESS 0x40
#define AUX_IC_ADDRESS 0x4E
#define ADC1_ADDRESS 0x46
#define ADC2_ADDRESS 0x48
#define EEPROM_ADDRESS 0XA0
#define TEMPERATURE_ADDRESS 0X30
#define BASE_COLOUR_ADDRESS 0X52
#define TOP_COLOUR_ADDRESS 0X72
#define ULTRASONIC_ADDRESS 0XE0
#define COMMAND_MESSAGE_BYTE 0X1D
#define ACKNOWLEDGE_MESSAGE_BYTE 0X1E
#define RESPONSE_MESSAGE_BYTE 0X1F
#define PSI_BYTE 0X1D
//Set temperature sensor warnings: 60C critical, 50C high, 0C low
#define TEMPERATURE_CRITICAL_HI 0X03
#define TEMPEARTURE_CRITICAL_LO 0XC0
#define TEMPERATURE_HIGH_HI 0X03
#define TEMPEARTURE_HIGH_LO 0X20
#define TEMPERATURE_LOW_HI 0X00
#define TEMPEARTURE_LOW_LO 0X00
#define DEFAULT_IR_PULSE_DELAY 400
#define DEFAULT_BASE_IR_PULSE_DELAY 50
#include
#include
#include
#include
#include "settings.h"
#include "serial.h"
#include "mbed.h"
#include "display.h"
#include "led.h"
#include "i2c.h"
#include "motors.h"
#include "sensors.h"
#include "eprom.h"
#include "colour.h"
#include "pic.h"
#include "demo.h"
#include "dances.h"
#include "basic.h"
//NB The user needs to have a main.cpp with a main() function and a handle_switch_event(char) function
#include "main.h"
void init(void);
float get_uptime(void);
void pause_user_code(float period);
void reset_encoders(void);
void debug(const char* format, ...) ;
void IF_end_pause_user_code(void);
void IF_handle_events(void);
void IF_update_encoders(void);
void IF_update_user_id(void);
void IF_update_switch(void);
void IF_update_minutes(void);
void IF_get_hardware_description(void);
extern char * program_name;
extern char * author_name;
extern char * version_name;
extern Serial pc;
extern Serial bt;
extern Display display;
extern I2C primary_i2c;
extern InterruptIn gpio_interrupt;
extern AnalogIn vin_current;
extern AnalogIn vin_battery;
extern AnalogIn vin_dc;
extern DigitalOut mbed_led1;
extern DigitalOut mbed_led2;
extern DigitalOut mbed_led3;
extern DigitalOut mbed_led4;
extern PwmOut center_led_red;
extern PwmOut center_led_green;
extern PwmOut motor_left_f;
extern PwmOut motor_left_r;
extern PwmOut motor_right_f;
extern PwmOut motor_right_r;
extern char time_based_motor_action;
extern int base_colour_sensor_raw_values [];
extern int top_colour_sensor_raw_values [];
extern char waiting_for_ultrasonic;
extern int ultrasonic_distance;
extern char ultrasonic_distance_updated;
extern Timeout ultrasonic_timeout;
extern Ticker ultrasonic_ticker;
extern unsigned short background_ir_values [];
extern unsigned short illuminated_ir_values [];
extern float reflected_ir_distances [];
extern char ir_values_stored;
extern char firmware_bytes[];
extern char testing_voltage_regulators_flag;
extern char power_good_motor_left;
extern char power_good_motor_right;
extern char power_good_infrared;
extern char status_dc_in;
extern char status_charging;
extern unsigned short background_base_ir_values [];
extern unsigned short illuminated_base_ir_values [];
extern char base_ir_values_stored;
extern float line_position;
extern char line_found;
extern float motor_left_speed;
extern float motor_right_speed;
extern char motor_left_brake;
extern char motor_right_brake;
extern float center_led_brightness;
extern float backlight_brightness;
extern char use_motor_calibration;
extern char motor_calibration_set;
extern float left_motor_calibration_value;
extern float right_motor_calibration_value;
extern float firmware_version;
extern float pcb_version;
extern float serial_number;
extern char has_compass;
extern char has_side_ir;
extern char has_base_ir;
extern char has_base_colour_sensor;
extern char has_top_colour_sensor;
extern char has_wheel_encoders;
extern char has_audio_pic;
extern char has_ultrasonic_sensor;
extern char has_temperature_sensor;
extern char has_recharging_circuit;
extern char has_433_radio;
extern int ir_pulse_delay;
extern int base_ir_pulse_delay;
extern char robot_id;
extern char previous_robot_id;
extern char wheel_encoder_byte;
extern char previous_wheel_encoder_byte;
extern signed int left_encoder;
extern signed int right_encoder;
extern char switch_byte;
extern char previous_switch_byte;
extern char user_code_running;
extern char user_code_restore_mode;
extern char demo_on;
extern char event;
extern char change_id_event;
extern char encoder_event;
extern char switch_event;
extern char system_warnings;
extern char debug_mode;
extern char debug_output;
extern vector basic_filenames;
extern char psi_basic_file_count;
extern char use_flash_basic;
extern char file_transfer_mode;
#endif
PK nOIóYG]A A $ PsiSwarm_V7_Blank/PsiSwarmV7/eprom.h/** University of York Robotics Laboratory PsiSwarm Library: Eprom Functions Header File
*
* Copyright 2016 University of York
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* File: eprom.h
*
* (C) Dept. Electronics & Computer Science, University of York
* James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
*
* PsiSwarm Library Version: 0.7
*
* October 2016
*
* Functions for accessing the 64Kb EPROM chip and reading the reserved firmware block
*
* Example:
* @code
* #include "psiswarm.h"
*
* int main() {
* init();
* write_eeprom_byte(0,0xDD); //Writes byte 0xDD in EPROM address 0
* char c = read_eeprom_byte(0); //c will hold 0xDD
* //Valid address range is from 0 to 65279
* }
* @endcode
*/
#ifndef EPROM_H
#define EPROM_H
/** Write a single byte to the EPROM
*
* @param address The address to store the data, range 0-65279
* @param data The character to store
*/
void write_eeprom_byte ( int address, char data );
/** Read a single byte from the EPROM
*
* @param address The address to read from, range 0-65279
* @return The character stored at address
*/
char read_eeprom_byte ( int address );
/** Read the next byte from the EPROM, to be called after read_eeprom_byte
*
* @return The character stored at address after the previous one read from
*/
char read_next_eeprom_byte ( void );
/** Read the data stored in the reserved firmware area of the EPROM
*
* @return 1 if a valid firmware is read, 0 otherwise
*/
char read_firmware ( void );
#endif PK nOIo¸Ôc c ' PsiSwarm_V7_Blank/PsiSwarmV7/settings.h/* University of York Robotics Laboratory PsiSwarm Library: PsiSwarm Settings File
*
* Copyright 2016 University of York
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* File: settings.h
*
* (C) Dept. Electronics & Computer Science, University of York
* James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
*
* PsiSwarm Library Version: 0.7
*
* October 2016
*
*
*/
/* USE_MOTOR_CALIBRATION [1=on, recommended 0=off]
* If enabled, the actual motor speeds will be adjusted from the requested values using the motor calibration values stored in
* firmware (and set using the motor calibration code in the demo mode)
*/
#define USE_MOTOR_CALIBRATION 1
/* OFFSET_MOTORS [1=on, recommended 0=off]
* The motors typically stall when the PWM output is below around 0.2
* Enabling the offset shifts the actual PWM range so that the motor speed 0.0 -> 1.0 actually sets a PWM output of 0.2 -> 1.0
*/
#define OFFSET_MOTORS 1
/* ENABLE_DEMO [1=on, 0=off]
* If enabled the demo mode will be launched when the center button is held as the MBED is switched on or reset
*/
#define ENABLE_DEMO 1
/* ENABLE_BASIC [1=on, 0=off]: Enable if the Psi-BASIC Interpretter is being used */
#define ENABLE_BASIC 1
/* SERIAL INTERFACES SETTINGS
* __________________________
*
* The Psi-Swarm can communicate using both the USB PC-Serial interface or via Bluetooth using a BlueSMIRF module
*
*
*/
/* ENABLE_BLUETOOTH [1=on, 0=off]: Enable if the BlueSmirf module is being used */
#define ENABLE_BLUETOOTH 1
/* ENABLE_PC_SERIAL [1=on, 0=off]: Enable if the PC USB serial module is being used */
#define ENABLE_PC_SERIAL 1
/* BLUETOOTH_BAUD [recommended=115200]: Baud rate for the BlueSMIRF module */
#define BLUETOOTH_BAUD 115200
/* PC_BAUD [recommended=460800 for optimal performance, 115200 for compatability]: Baud rate for the PC USB serial module */
//#define PC_BAUD 460800
#define PC_BAUD 115200
/* DEBUG_MODE [1=on, 0=off]: Enable to allow debug messages to be sent of one of the serial interfaces */
#define DEBUG_MODE 1
/* SHOW_VR_WARNINGS [1=on, 0=off]: Show voltage-regulator debug message warnings after initial boot-up */
#define SHOW_VR_WARNINGS 0
/* USE_LED3_FOR_INTERRUPTS [1=on, 0=off]: Switch interrupts will appear as the lighting of LED3 on MBED */
#define USE_LED3_FOR_INTERRUPTS 1
/* USE_LED4_FOR_VR_WARNINGS [1=on, 0=off]: Voltage-regulator warnings will appear as the lighting of LED4 on MBED */
#define USE_LED4_FOR_VR_WARNINGS 1
/* HALT_ON_GPIO_ERROR [1=on, 0=off]: Halts system if no GPIO response received during init() - typically this happens when MBED is powered but robot is switched off */
#define HALT_ON_GPIO_ERROR 1
/* HALT_ON_ALL_VREGS_LOW [1=on, 0=off]: Halts system when all 3.3V voltage regulators are low on boot-up - typically this happens when MBED is powered but robot is switched off */
#define HALT_ON_ALL_VREGS_LOW 0
/* DEBUG_OUTPUT_STREAM [1=PC\USB 2=BlueSmirf 4=Display]: Specify which output stream(s) should be used by default for debug messages, if enabled*/
#define DEBUG_OUTPUT_STREAM 1
PK nOI¤±® ® " PsiSwarm_V7_Blank/PsiSwarmV7/led.h/* University of York Robotics Laboratory PsiSwarm Library: LED Functions Header File
*
* Copyright 2016 University of York
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* File: led.h
*
* (C) Dept. Electronics & Computer Science, University of York
* James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
*
* PsiSwarm Library Version: 0.7
*
* October 2016
*
*
*/
#ifndef LED_H
#define LED_H
unsigned short get_led_states(void);
void set_leds(char green, char red);
void set_green_leds(char green);
void set_red_leds(char red);
void set_led(char led, char state);
void set_base_led(char state);
void blink_leds(float timeout);
void set_center_led(char state);
void set_center_led(char state, float brightness);
void set_center_led_brightness(float brightness);
void save_led_states(void);
void restore_led_states(void);
void IF_init_leds(void);
void IF_update_leds(void);
#endifPK
nOIÐÓ>43 3 &