Psi Swarm robot library version 0.9
Fork of PsiSwarmV9 by
Diff: eprom.h
- Revision:
- 17:bf614e28668f
- Parent:
- 14:2f1ad77d281e
- Child:
- 18:9204f74069b4
diff -r 50686c07ad07 -r bf614e28668f eprom.h --- a/eprom.h Thu Jun 01 23:02:32 2017 +0000 +++ b/eprom.h Sun Jun 04 13:11:09 2017 +0000 @@ -23,6 +23,22 @@ #ifndef EPROM_H #define EPROM_H + +//FIRMWARE DEFAULTS +//Batch number (0-255), Serial number (1 - 255) +#define FD_BATCH_NUMBER 3 +#define FD_SERIAL_NUMBER 1 +#define FD_CREATE_DAY 01 +#define FD_CREATE_MONTH 06 +#define FD_CREATE_YEAR 17 +#define FD_PCB_VERSION_BIG 1 +#define FD_PCB_VERSION_LITTLE 6 + +//Firmware Version (eg 1.1) +#define FD_FIRMWARE_VERSION_BIG 1 +#define FD_FIRMWARE_VERSION_LITTLE 1 + + /** Eprom Class * Functions for accessing the 64Kb EPROM chip and reading the reserved firmware block * @@ -68,7 +84,24 @@ * @return 1 if a valid firmware is read, 0 otherwise */ char read_firmware ( void ); + + /** Update the firmware to include features from the current software version + * + */ + void update_firmware( void ); + + void write_firmware(char _flash_count, char _create_day, char _create_month, char _create_year, char _batch_number, char _serial_number, char _pcb_version_big, char _pcb_version_little, char _firmware_version_big, + char _firmware_version_little, char _has_compass, char _has_side_ir, char _has_base_ir, char _has_base_colour_sensor, char _has_top_colour_sensor, char _has_encoders, char _has_audio_pic, char _has_ultrasonic, + char _has_temperature, char _has_recharging, char _has_433_radio, char _motor_calibration_set, char _base_ir_calibration_set, char _base_colour_calibration_set); + + void write_string(char value); + + void write_firmware_byte ( int address, char data ); + char read_firmware_byte ( int address ); + + void IF_write_base_ir_calibration_values(short white_values[5], short black_values[5]); + void IF_write_base_colour_calibration_values(int white_values[4], int black_values[4]); }; #endif \ No newline at end of file