motorcontroldemo_035/Vinclude/V_i2cMem.h

43 lines
1.1 KiB
C
Raw Normal View History

/*
* V_i2cMem.h
*
* Created on: 15 <EFBFBD><EFBFBD><EFBFBD>. 2019 <EFBFBD>.
* Author: Dmitry
*/
#ifndef INCLUDE_V_I2CMEM_H_
#define INCLUDE_V_I2CMEM_H_
#define EEPROM_MEM_LENGTH 32768 //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (256 <20><><EFBFBD><EFBFBD>)
struct SI2cMem;
typedef volatile struct SI2cMem TI2cMem;
struct SI2cMem {
Uint16 MEMstartaddr; //! <20><><EFBFBD><EFBFBD><EFBFBD> <20><> flash
Uint16 data_length; //! <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Uint16 *DSPstartaddr; //! <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Uint16 LastErr; //! <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
void (*init)(TI2cMem*);
void (*write)(TI2cMem*);
void (*read)(TI2cMem*);
void (*clearMem)(TI2cMem*);
};
void I2CMEM_Init(TI2cMem*);
void I2CMEM_Write(TI2cMem*);
void I2CMEM_Read(TI2cMem*);
void I2CMEM_Clear(TI2cMem*);
//!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define I2CMEM_DEFAULTS { .init = I2CMEM_Init, \
.write = I2CMEM_Write,\
.read = I2CMEM_Read,\
.clearMem = I2CMEM_Clear,\
}
extern TI2cMem i2cMem;
#endif /* INCLUDE_V_I2CMEM_H_ */