Hello, and welcome to the forum.
You have not indicated which EEPROM type you are using. The code that is written must have a specific EEPROM in mind. For the higher level functions, you would need to decide whether the function is required to handle a single EEPROM byte, or multiple EEPROM bytes. The EEPROM will usually contain an internal page buffer, to give the option to write or read multiple bytes.
It would seem that the parameters shown for your read and write functions may be inappropriate (assuming these are intermediate level functions). The storage of floating point data within EEPROM would usually be a higher level function.
I would normally expect to see parameters for a single data byte value, or a pointer to a data buffer, plus an address at which the data is to be written or read. If handling multiple bytes, the number of bytes would also need to be a parameter.
The read function will need to return a data byte, or alternatively use a pointer to a data buffer . It is also less likely that you would need an erase function, since each byte will be automatically erased before it is written.
In addition to SPI_setup() function, you will need a low level SPI function for the bi-directional transfer of a single byte (for every byte sent a byte is received). This would be used for both read and write processes, and might have the following prototype:
byte SPI_transfer( byte val);
I would tend to handle the CS pin control as macros, perhaps CS_ON and CS_OFF. The multiple byte read and write
functions might possibly have the following prototypes:
void EE_nwrite( word address, byte *buf, byte n);
void EE_nread( word address, byte *buf, byte n);
These would be typical for binary data. For the storage of string data the form might be a little different. The detail of these functions will depend, to some extent, on the EEPROM type.
Regards,
Mac