/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Function Pointer in CircleOS

Username:     
Password:     
             

Forum

# 1   2013-01-22 08:05:08 Function Pointer in CircleOS

softy
Member
Registered: 2012-12-03
Posts: 68

Function Pointer in CircleOS

HI,
Can any one tell me whats the meaning and usage /purpose of doing this :

$1



I interpreted it as Circle_API  being an array of functionpointer and they being called by an index , here --> MEMS_GET_INFO_ID , whre return value gets type casted to tCircleFunc0 (which is the pointers to function returning u32 data ( so for Mems we will be getting the u32 data - makes sense) which is then type casted to its structure's pointer tMEMS_Info which has all the members required to define a MEMS structure.

Why the functioncallss have been made to depend on the index? or Any other Line of thinking can some one tell me where I can find the  $1 array?
$1
Rgds,
Softy

Last edited by softy (2013-01-22 08:07:00)


" Pain is temporary, Quitting Lasts for ever"

Offline

 

# 2   2013-01-25 10:00:50 Function Pointer in CircleOS

Etienne.C
Administrator
Registered: 2012-12-04
Posts: 71

Re: Function Pointer in CircleOS

exactly, it depends of the Circle api.h.

It is good to understand all the function from the api.h but we did this library to facilitate our users in programming. all you interpreted is right but the users just need to Know that there is a function called MEMS_GetInfo which ask for a pointer and will give informations.

below you will find an example how to use it:

We want to know the x position of the MEMS:

tMEMS_Info* ptInfo; 
ptInfo = MEMS_GetInfo();
s16 x = ptInfo.OutX;

Regards,

Etienne

Offline

 

# 3   2013-01-25 10:27:35 Function Pointer in CircleOS

softy
Member
Registered: 2012-12-03
Posts: 68

Re: Function Pointer in CircleOS

Thanks fro this info.Is it possible to change the OS and generate a new .elf.
(1) My Understanding
$1 correct.

$1 by including its source code in the Ride 7.


Another Question :
You said :
tMEMS_Info* ptInfo; 
ptInfo = MEMS_GetInfo();
s16 x = ptInfo.OutX;

I went inside the Circle OS function and found the  I2C_BufferRead in the MEMS_ReadOutXY which seems to be reading the 0x3b.What is this sensor? Is this --> LIS3LV02DL ? Can you please point to the spec or the schematic as well.
Is it possible to debug the OS in the Ride 7 by using the source code instead of the .elf file if my understanding (1) is correct.

If I can change the OS and generate a new .elf file I would be interested in replacing the LIS3LV02DL with some other sensors.

Kindly respond.
Rgds,
Softy

Last edited by softy (2013-01-25 10:30:41)


" Pain is temporary, Quitting Lasts for ever"

Offline

 

# 4   2013-03-18 10:30:07 Function Pointer in CircleOS

softy
Member
Registered: 2012-12-03
Posts: 68

Re: Function Pointer in CircleOS

Any comments on this ! Especially the compiling the elf part.


" Pain is temporary, Quitting Lasts for ever"

Offline

 

Board footer