Issue #1:
MEMS_GetRotation() is defined in the documentation and the source code as taking a single parameter, a pointer to the enum 'Rotate_H12_V_Match_TypeDef', returning nothing. The circle_api.h header file declares it s taking two parameters.
Rotate_H12_V_Match_TypeDef rotation;
MEMS_GetRotation ( &rotation );
...gives a compile error. Adding a (fake) extra parameter makes the compiler happy:
MEMS_GetRotation (&rotation, 0 );
I think this is just a problem in the circle_api.h header file.
Issue #2:
The orientation value reported by the MEMS_GetRotation() function does not correspond with the current rotation of the screen. It reports the current orientation of the STM32 Primer, which may not be the same thing.
This is a problem when an application needs to know the screen orientation to account for rotation of the MEMS data. For example, a newly loaded application might be first in the list on the CicleOS menu. Selecting this item requires the STM32 Primer to be tilted almost to the horizontal plane to be selected. Once the application starts, MEMS_GetRotation() reports the current orientation (almost always V12) instead of the current rotation of the screen.
Perhaps I'm misunderstanding how this function is supposed to be used. I'm trying to write a simple application that lets the user tilt the unit around to select one of several different options. To interpret the MEMS data correctly, I need to know the current screen rotation to know which axes to monitor and for what polarity of values.
Any enlightenment would be appreciated.
Thanks,
Dale Wheat