Just4Trionic - CAN and BDM FLASH programmer for Saab cars

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bdmdriver.h Source File

bdmdriver.h

00001 /*******************************************************************************
00002 
00003 bdmdriver.cpp
00004 (c) 2014 by Sophie Dexter
00005 
00006 ********************************************************************************
00007 
00008 WARNING: Use at your own risk, sadly this software comes with no guarantees.
00009 This software is provided 'free' and in good faith, but the author does not
00010 accept liability for any damage arising from its use.
00011 
00012 *******************************************************************************/
00013 
00014 #ifndef __BDMDRIVER_H__
00015 #define __BDMDRIVER_H__
00016 
00017 #include "mbed.h"
00018 
00019 #include "common.h"
00020 #include "bdmcpu32.h"
00021 
00022 // public functions
00023 bool bdmLoadMemory(uint8_t dataArray[], uint32_t loadAddress, uint32_t dataArraySize);
00024 bool bdmRunDriver(uint32_t addr, uint32_t maxtime);
00025 uint8_t bdmProcessSyscall(void);
00026 
00027 enum bdmSyscall {
00028     QUIT = 0,
00029     PUTS = 1,
00030     PUTCHAR = 2,
00031     GETS = 3,
00032     GETCHAR = 4,
00033     GETSTAT = 5,
00034     FOPEN = 6,
00035     FCLOSE = 7,
00036     FREAD = 8,
00037     FWRITE = 9,
00038     FTELL = 10,
00039     FSEEK = 11,
00040     FGETS = 12,
00041     FPUTS = 13,
00042     EVAL = 14,
00043     FREADSREC = 15
00044 };
00045 
00046 enum bdmSyscallResult {
00047     DONE,
00048     CONTINUE,
00049     ERROR    
00050     };
00051 
00052 #endif    // __BDMDRIVER_H__
00053 //-----------------------------------------------------------------------------
00054 //    EOF
00055 //-----------------------------------------------------------------------------