Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imu #519

Open
wants to merge 14 commits into
base: integration
Choose a base branch
from
Open

Imu #519

wants to merge 14 commits into from

Conversation

zer0page
Copy link
Contributor

@zer0page zer0page commented Oct 6, 2016

DO NOT MERGE
emits commands via SPI uart code
"tap"
and
"flipped [1|0]"

Copy link
Contributor

@plasticchris plasticchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What impact is there on pill?

imu_clear_tap_interrupt();
PRINTS("Tap\r\n");
MSG_Data_t * data = MSG_Base_AllocateStringAtomic("tap");
if(data){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reference a const string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to convert the string to MSG_Data_t * which is consumed by the sspi module

/*
*PRINTF("<imu>x:%d y:%d z:%d</imu>\r\n", xyz[0], xyz[1], xyz[2]);
*/
if(xyz[2] > 1000 && !flipped){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dependent on the selected scale

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change

Copy link
Contributor Author

@zer0page zer0page Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, i don't think the scale matters in this, because this is a simple hysteresis on the Z value. Due to the orientation of the imu chip, any positive Z value means Sense has flipped or rolled.

@zer0page
Copy link
Contributor Author

zer0page commented Oct 6, 2016

this change is morpheus only

_register_write(REG_CTRL_6, INT_ACTIVE_LOW );

_register_write(REG_CLICK_CFG, 0x3F);//all directions clickable
_register_write(REG_CLICK_SRC, CLICK_SRC_DCLICK | CLICK_SRC_STAP);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this register meant to be written to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like its read only, will remove

_register_write(REG_CLICK_THR, 0x06);
_register_write(REG_TIME_LIMIT, 0x04);
_register_write(REG_TIME_LATENCY, 0x24);
_register_write(REG_TIME_WINDOW, 0x7F);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the units for these documented anywhere?

Copy link
Contributor Author

@zer0page zer0page Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i just saw a youtube video of a demo and copied the numbers.
documentation also does not show what the units are

inline uint8_t imu_clear_interrupt_status()
{

// clear the interrupt by reading INT_SRC register
uint8_t int_source;
_register_read(REG_INT1_SRC, &int_source);
PRINTF("INT CLR %x\r\n", int_source);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why move this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

artifact from testing, will revert

@@ -17,6 +17,7 @@ enum imu_hz {
IMU_HZ_1 = 1,
IMU_HZ_10 = 2,
IMU_HZ_25 = 3,
IMU_HZ_400 = 7,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undocumented rates go all the way up to 1.6 kHz (the resonant freq of the sensing element) but you get reduced resolution...

@zer0page
Copy link
Contributor Author

causes instability to the middle board, do not merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants