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:
@@ -2,8 +2,19 @@
|
||||
|
||||
#define __SPISE2P_H__
|
||||
|
||||
/* Physical EEPROM layout shared with the linker and SETGUI. */
|
||||
#include "eeprom_config.h"
|
||||
#include "include/balsam167_eeprom_layout.h"
|
||||
|
||||
// ¨ìêîñòü ïàìàòè â áàéòàõ
|
||||
#define SEEPROM_LEN 0x10000
|
||||
/* Preserve compact 16-bit arithmetic for the original 32-KiB build.
|
||||
* Only the large part needs 32-bit word addresses and transfer lengths. */
|
||||
#if EEPROM_M95M02
|
||||
typedef unsigned long SE2P_SIZE;
|
||||
#else
|
||||
typedef unsigned int SE2P_SIZE;
|
||||
#endif
|
||||
#define SEEPROM_LEN BALSAM167_EEPROM_BYTES
|
||||
|
||||
#define NULL 0
|
||||
|
||||
@@ -58,8 +69,10 @@ typedef struct {
|
||||
|
||||
/* Object declaration */
|
||||
typedef struct {
|
||||
SE2P_DATA *msgPtr;
|
||||
unsigned int csr; /* control/status register */
|
||||
/* Main loop publishes the descriptor before setting csr; Timer2 consumes it.
|
||||
* Both accesses are volatile so optimization cannot publish the request first. */
|
||||
SE2P_DATA * volatile msgPtr;
|
||||
volatile unsigned int csr; /* control/status register */
|
||||
void (*init)(void *);
|
||||
void (*tick)(void *);
|
||||
void (*csset)(void);
|
||||
@@ -85,12 +98,12 @@ void spiSe2pWrite(SPISE2P_DRV *se2p, SE2P_DATA *data);
|
||||
void spiSe2pRead(SPISE2P_DRV *se2p, SE2P_DATA *data);
|
||||
|
||||
#if(SPISE2P_DATA_WIDTH==SIXTEEN_BIT)
|
||||
#define PROM_LEN 0x8000
|
||||
#define PAGE_LEN 0x20
|
||||
#define PROM_LEN BALSAM167_EEPROM_WORDS
|
||||
#define PAGE_LEN (BALSAM167_EEPROM_PAGE_BYTES / 2)
|
||||
#define WORD_LEN 2
|
||||
#else
|
||||
#define PROM_LEN 0x4000
|
||||
#define PAGE_LEN 0x40
|
||||
#define PROM_LEN BALSAM167_EEPROM_BYTES
|
||||
#define PAGE_LEN BALSAM167_EEPROM_PAGE_BYTES
|
||||
#define WORD_LEN 1
|
||||
#endif
|
||||
|
||||
@@ -105,7 +118,7 @@ void InitSeeprom(void);
|
||||
** adres = 0..0x4000, åñëè äëèíà ñëîâà 16 áèò **
|
||||
** buf - óêàçàòåëü íà ïàìàòü, îòêóäà ïèñàòü. **
|
||||
** size - äëèíà áëîêà â áàéòàõ. Ïî-ëþáîìó â áàéòàõ! */
|
||||
void Seeprom_write(unsigned int adres, unsigned int buf[], unsigned int size);
|
||||
void Seeprom_write(SE2P_SIZE adres, unsigned int buf[], SE2P_SIZE size);
|
||||
|
||||
/* ×òåíèå áëîêà èç SEEPROM. Ïàðàìåòðû òàêîâû: **
|
||||
** adres - àäðåñ â åïðîìêå, îòêóäà ÷èòàòü. **
|
||||
@@ -113,7 +126,7 @@ void Seeprom_write(unsigned int adres, unsigned int buf[], unsigned int size);
|
||||
** adres = 0..0x4000, åñëè äëèíà ñëîâà 16 áèò **
|
||||
** buf - óêàçàòåëü íà ïàìàòü, êóäà ÷èòàòü. **
|
||||
** size - äëèíà áëîêà â áàéòàõ. Ïî-ëþáîìó â áàéòàõ! */
|
||||
void Seeprom_read(unsigned int adres, unsigned int buf[], unsigned int size);
|
||||
void Seeprom_read(SE2P_SIZE adres, unsigned int buf[], SE2P_SIZE size);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user