Skip to main content
Associate II
January 8, 2024
Solved

EEPROM-24c16A

  • January 8, 2024
  • 2 replies
  • 1688 views

Hi @everyone

In the below IIC API 
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)

uint16_t MemAddress will accept only hexadecimal value or it will accept decimal value also.

 

 

 

 

Best answer by Peter BENSCH

The numbers are translated by the compiler anyway, which doesn't care whether you feed it decimal, hexadecimal, octal or binary numbers. However, hexadecimal numbers are often justified because they are easier to read.

Regards
/Peter

2 replies

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
January 8, 2024

The numbers are translated by the compiler anyway, which doesn't care whether you feed it decimal, hexadecimal, octal or binary numbers. However, hexadecimal numbers are often justified because they are easier to read.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
January 9, 2024

Hi @Peter BENSCH 

Thank you for valuable reply.

Tesla DeLorean
Guru
January 8, 2024

An integer between 0-2047 decimal, or 0-0x7FF hex. It can be a variable, you can do math on the parameter.

#LearnC

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Associate II
January 9, 2024

Hi @Tesla DeLorean 

Thank you for your valuable reply