feat: add M95M02-only GAS and EEPROM profiles
Expose the existing registers through Modbus and service CAN using one GAS provider only in M95M02 builds. Include the EEPROM layout/driver, LOAD protection and calibration, firmware identity and shared CCS build workflow. Add transport/profile and SCI8 validation tests, documentation and the checked M95M02 firmware image.
This commit is contained in:
@@ -19,12 +19,18 @@ int ccc=0;
|
||||
/******* SPI bus Serial EEPROM driver Initialization routine ********/
|
||||
/********************************************************************/
|
||||
|
||||
void Seeprom_write( unsigned int adres,
|
||||
void Seeprom_write( SE2P_SIZE adres,
|
||||
unsigned int buf[],
|
||||
unsigned int size)
|
||||
SE2P_SIZE size)
|
||||
{
|
||||
unsigned int len;
|
||||
|
||||
#if EEPROM_M95M02
|
||||
/* Bound physical accesses before byte-to-word rounding. Legacy 32-KiB
|
||||
* callers retain their compact driver; EXTEND is checked independently. */
|
||||
if (adres >= PROM_LEN || !size || size > (PROM_LEN-adres)*2) return;
|
||||
#endif
|
||||
|
||||
CpuTimer2.InterruptCount=0;
|
||||
CpuTimer2Regs.TCR.all = 0x4020; // Use write-only instruction to set TSS bit = 0
|
||||
|
||||
@@ -50,12 +56,18 @@ void Seeprom_write( unsigned int adres,
|
||||
CpuTimer2Regs.TCR.all = 0x4010; // Use write-only instruction to set TSS bit = 1
|
||||
}
|
||||
|
||||
void Seeprom_read( unsigned int adres,
|
||||
void Seeprom_read( SE2P_SIZE adres,
|
||||
unsigned int buf[],
|
||||
unsigned int size)
|
||||
SE2P_SIZE size)
|
||||
{
|
||||
unsigned int len;
|
||||
|
||||
#if EEPROM_M95M02
|
||||
/* Bound physical accesses before byte-to-word rounding. Legacy 32-KiB
|
||||
* callers retain their compact driver; EXTEND is checked independently. */
|
||||
if (adres >= PROM_LEN || !size || size > (PROM_LEN-adres)*2) return;
|
||||
#endif
|
||||
|
||||
CpuTimer2.InterruptCount=0;
|
||||
CpuTimer2Regs.TCR.all = 0x4020; // Use write-only instruction to set TSS bit = 0
|
||||
|
||||
@@ -244,6 +256,15 @@ void SPISE2P_DRV_tick(SPISE2P_DRV *eeprom)
|
||||
case 5:
|
||||
/* Send Address */
|
||||
|
||||
#if EEPROM_M95M02
|
||||
SpiaRegs.SPICCR.all=SPISE2P_TFR8BIT;
|
||||
SpiaRegs.SPITXBUF=(unsigned int)(eeprom->msgPtr->se2pAddr >> 16) << 8;
|
||||
step=20;
|
||||
break;
|
||||
case 20:
|
||||
if (!SpiaRegs.SPISTS.bit.INT_FLAG) break;
|
||||
dummy=SpiaRegs.SPIRXBUF;
|
||||
#endif
|
||||
#if(SPISE2P_ADDR_WIDTH==SIXTEEN_BIT)
|
||||
SpiaRegs.SPICCR.all= SPISE2P_TFR16BIT;
|
||||
SpiaRegs.SPITXBUF=eeprom->msgPtr->se2pAddr;
|
||||
@@ -374,7 +395,16 @@ void SPISE2P_DRV_tick(SPISE2P_DRV *eeprom)
|
||||
case 15:
|
||||
/* Send Address */
|
||||
|
||||
#if(SPISE2P_ADDR_WIDTH==SIXTEEN_BIT)
|
||||
#if EEPROM_M95M02
|
||||
SpiaRegs.SPICCR.all=SPISE2P_TFR8BIT;
|
||||
SpiaRegs.SPITXBUF=(unsigned int)(eeprom->msgPtr->se2pAddr >> 16) << 8;
|
||||
step=21;
|
||||
break;
|
||||
case 21:
|
||||
if (!SpiaRegs.SPISTS.bit.INT_FLAG) break;
|
||||
dummy=SpiaRegs.SPIRXBUF;
|
||||
#endif
|
||||
#if(SPISE2P_ADDR_WIDTH==SIXTEEN_BIT)
|
||||
SpiaRegs.SPICCR.all= SPISE2P_TFR16BIT;
|
||||
SpiaRegs.SPITXBUF=eeprom->msgPtr->se2pAddr;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user