31 lines
648 B
C
31 lines
648 B
C
/*
|
|
* AT24CSW.h
|
|
*
|
|
* Created on: Nov 12, 2021
|
|
* Author: angoosh
|
|
*/
|
|
|
|
|
|
/*
|
|
* Page wite writes 8 bytes to whole page or memory row => bytes A7-A3 are the same
|
|
* Word address 11111111 is reserved
|
|
*/
|
|
#ifndef INC_AT24CSW_H_
|
|
#define INC_AT24CSW_H_
|
|
|
|
#include "stm32l0xx_hal.h"
|
|
|
|
#define PRODUCT_LAST_NUMBER 0
|
|
|
|
#define AT24CSW_ADDRESS 0b1010000 + PRODUCT_LAST_NUMBER
|
|
#define AT24CSW_SEC_ADDRESS 0b1011000 + PRODUCT_LAST_NUMBER
|
|
|
|
|
|
|
|
|
|
int AT24CSW_Read_Memory(uint8_t address, uint8_t size, uint8_t *data);
|
|
int AT24CSW_Page_Write(uint8_t address, uint8_t *bytes);
|
|
int AT24CSW_Byte_Write(uint8_t address, uint8_t byte);
|
|
|
|
#endif /* INC_AT24CSW_H_ */
|