Wrong display

This commit is contained in:
StefansE
2026-03-29 13:03:24 +02:00
parent 21874c4455
commit b5000adf0e
8 changed files with 192 additions and 3 deletions

View File

@@ -42,6 +42,54 @@ static uint8_t ds1307_read_byte(uint8_t ds1307_reg_addres);
static uint8_t ds1307_bcd_decode(uint8_t data);
static uint8_t ds1307_bcd_encode(uint8_t data);
/*
*
Function designed to read embedded RAM data.
Address range 0x08 to 0x3F
56 bytes of data
addr: address of data to read 0x08 to 0x3F
data: pointer to data
len: number of bytes of data to read
*/
uint8_t ds1307_read_user_RAM(uint8_t addr, uint8_t * data, uint8_t len){
HAL_StatusTypeDef status = HAL_OK;
for(uint8_t i = 0; i < len; i++){
uint8_t resp = ds1307_read_byte(addr + i);
*(data + i) = resp;
}
return status;
}
/*
*
Function designed to write embedded RAM data.
Address range 0x08 to 0x3F
56 bytes of data
addr: address of data to read 0x08 to 0x3F
data: pointer to data
len: number of bytes of data to read
*/
uint8_t ds1307_write_user_RAM(uint8_t addr, uint8_t * data, uint8_t len){
HAL_StatusTypeDef status = HAL_OK;
for(uint8_t i = 0; i < len; i++){
ds1307_write_byte(addr + i, *(data + i));
}
return status;
}
/**
* @brief Write byte data from an specific address ds1307 RTC
*