why should //uint8_t, //uint16_t macro actually to be used !!

saj's picture
saj

Offline

Joined: Sep 28, 2018

Replies: 12
why should //uint8_t, //uint16_t macro actually to be used !!
November 17, 2018 - 2:01am

Hi all,

Can you please explain details of fundamental for UNSUGNED INT MACRO "//uint8_t" or "//uint16_t" and why should we used in liew of //__delay() macro and simple simple delay routine??

Also please share a link where it can be distinguish all among above three if available.

tnx for ur valuable time.

Tnx

 

 

Violet's picture

Offline

Joined: Aug 16, 2018

Replies: 19
typedef and macros in C
November 19, 2018 - 4:26pm

I think you are confused with something. The unit8_t, unit16_t, unit32_t and unit64_t are not called as macros, these are called as type defanitions or typedef in short.

And you do not have to confuse a lot with them, they are similar to other variable typedef like char, int or flat. 

unit8_t means that it allocated 8 bit and unit16_t means it allocated 16 bits and so on. If they are more confusing you can also use their equivalents unsigned char for unit8_t, unsigned short for unit16_t etc... I mentioned the common name for all below

 

unit8_t  => unsigned char

unit16_t  =>unsigned short

unit32_t   =>unsigned int

unit64_t  => unsigned long long 

 

Hope this has made you clear 

saj's picture
saj

Offline

Joined: Sep 28, 2018

Replies: 12
tnx
December 1, 2018 - 5:19pm

tnx mr violet for your reply...