IJFW - IchigoJamのBASICプログラムをメモリカード(MMCまたは互換カード)に保存したり読み出したりできるプログラム。メモリカードにファームウェアのファイルを置くだけで、電源ON時に自動的に書き換える機能も搭載(一応こちらがメイン)。LPC1114FN28専用。
FatfsIjfwConfigurable.h
00001 #ifndef FATFS_IJFW_CONFIGURABLE_H 00002 #define FATFS_IJFW_CONFIGURABLE_H 00003 00004 #include "mbed.h" 00005 #include "FatfsIJFW.h" 00006 00007 const int CONFIG_ITEM_NUM = 3; 00008 const int ITEM_NAME_LENGTH = 32; 00009 const int ITEM_VAL_LENGTH = 8; 00010 00011 typedef struct { 00012 char itemName[ITEM_NAME_LENGTH+1]; 00013 char itemValue[ITEM_VAL_LENGTH+1]; 00014 } ConfigItem; 00015 00016 class FatfsIjfwConfigurable : public FatfsIJFW { 00017 public: 00018 FatfsIjfwConfigurable(SPI* _spi, DigitalOut* _cs); 00019 00020 int setConfigValue(const char* itemName, const char* value); 00021 int getConfigValue(const char* itemName, char* buf); 00022 int readConfigFile(const char* configFiie); 00023 00024 int chdir(const char* dir); 00025 int openBas(const char* name, const FileMode mode); 00026 int checkFirmFile(const char* binfile); 00027 int deleteFirmFile(const char* binfile); 00028 00029 protected: 00030 void initConfigItem(); 00031 int readLine(char* buf, int length); 00032 00033 ConfigItem configitem[CONFIG_ITEM_NUM]; 00034 00035 }; 00036 00037 #endif
Generated on Sat Jul 16 2022 19:47:26 by 1.7.2