mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-28 05:09:32 +00:00
firstTest
This commit is contained in:
52
Core/Inc/EEPROM.h
Normal file
52
Core/Inc/EEPROM.h
Normal file
@ -0,0 +1,52 @@
|
||||
#include "stm32f1xx_hal.h"
|
||||
|
||||
#define AT24C_ADRESS 0x50 // i2c slave adress EEPROM
|
||||
|
||||
#define FLASH_BLOCKSIZE 64
|
||||
#define START_ADR_SHOT 0x0000 //00000
|
||||
#define START_ADR_PROGRAM 0x3000 //12288
|
||||
#define START_ADR_MACRO 0x6000 //24576
|
||||
|
||||
#define MAX_NUMBER_MACRO 100
|
||||
#define MAX_NUMBER_SHOTS 160
|
||||
#define MAX_NUMBER_PROGRAMS 100
|
||||
#define MAX_NUMBER_SHOTS_IN_PROGRAMS 31
|
||||
#define MAX_NUMBER_PROGRAMS_IN_MACRO 16
|
||||
|
||||
struct StructNumberScrewCount{
|
||||
unsigned char number;
|
||||
unsigned char speedScrew;
|
||||
unsigned char countRepeat;
|
||||
unsigned char options;
|
||||
};
|
||||
|
||||
struct StructNumberScrew{
|
||||
unsigned char number;
|
||||
unsigned char speedScrew;
|
||||
};
|
||||
|
||||
struct StructShot {
|
||||
unsigned char countRepeatShot;
|
||||
unsigned char speedRollerTop;
|
||||
unsigned char speedRollerBottom;
|
||||
unsigned char speedScrew;
|
||||
unsigned char rotationAxial;
|
||||
unsigned char rotationHorizontal;
|
||||
unsigned char rotationVertical;
|
||||
};
|
||||
|
||||
struct StructProgram {
|
||||
unsigned char countRepeat;
|
||||
unsigned char options;
|
||||
struct StructNumberScrew numberScrew[MAX_NUMBER_SHOTS_IN_PROGRAMS];
|
||||
};
|
||||
|
||||
struct StructMacro {
|
||||
struct StructNumberScrewCount numberScrewCount[MAX_NUMBER_PROGRAMS_IN_MACRO];
|
||||
};
|
||||
|
||||
void SaveShot(unsigned char number, struct StructShot* shot);
|
||||
void FLASH_WriteBlock(uint8_t *writeAddr, unsigned char *flashWrBufPtr);
|
||||
|
||||
struct StructShot GetShot( unsigned char number );
|
||||
|
Reference in New Issue
Block a user