Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Hi doubt in C programming

Status
Not open for further replies.

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
When a pointer is used to reference a structure, the structure pointer operator (->) is used:

message->frame_type=CAN_FRAME_STD;
is the same as
(*message).frame_type=CAN_FRAME_STD;

check
Pointers and Structures

Alex
 

Joyhtidas

Member level 4
Joined
Nov 30, 2009
Messages
72
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,288
Location
Bangalore, India
Activity points
1,709
Hi,
My doubt got cleared, i was having doubt on that reference place

struct date {
int month, day, year;
};

struct date todays_date, *date_pointer; //
date_pointer = &todays_date; //

The link you given was nice, thanks
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,094
this is a simple case of configuring the ECAN bus in the code...

both lines a & b are used to Define ECAN Message Buffers.

statement a : it is about Configuring DMA Channel 0 for ECAN2 Transmit (Remote Transmit Request)
ecan2msgBuf __attribute__ is the syntax that has to be used to define or use any statement here...
ECAN2MSGBUF ecan2msgBuf __attribute__((space(dma),aligned(ECAN2_MSG_BUF_LE NGTH*16)));
means you are trying to configure the size of the CAN BUFFER MESSAGE LENGTH...... space dma refers to initializing the DMA space , and the length alloted if 4 bytes *16) you have to align the memory read and write when you use DMA....

typedef unsigned int ECAN1MSGBUF [ECAN1_MSG_BUF_LENGTH][8];

is declaration of ECAN1 message buffer length 4* 8 = 32 bytes you are allocating the memory and allocating DMA to read 32 locations....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top