uint8_t * const LCDMem = (uint8_t *) &LCDM3;
This code is used in msp430fg4618 trainer kit for lcd configuration.
Could any one please explain the meaning of the above mentioned code?
It allows use of array LCDMem[]? I don’t know how.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The operator
(type) valueis called a cast and implements conversion from one type to another.The code in your example casts one pointer, the address of
LCDM3, to a pointer of a different type. This enables access to the contents ofLCDM3through theLCDMempointer as if it were a contiguous array of bytes (8-bit unsigned integers).For example,
LDCM3could be a structure object, or the first element of an array of structures. The above cast would allow one to read and write the individual bytes of the underlying object(s).