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

Fwxv 255 moved I2C to PCA #257

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

warren-xu
Copy link

No description provided.

@warren-xu warren-xu requested review from mitchellostler and removed request for mitchellostler January 23, 2024 00:13
@warren-xu
Copy link
Author

accidentally included gpio_leds folder in the pull request, can ignore

@warren-xu warren-xu self-assigned this Jan 23, 2024
return status_msg(STATUS_CODE_INVALID_ARGS, "Invalid PCA9555 port.");
}
uint8_t reg_arr[2] = {}; // store read value
uint8_t reg_to_read = INPUT0; // read the first register
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is INPUT0 and INPUT1? Can't seem to find them.
But basically you'll always only read and write 1 byte?

Copy link
Author

Choose a reason for hiding this comment

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

I was trying to find at what address the PCA9555 registers are at, but I couldn't find them so I assumed it was INPUT0 and INPUT1. Do you know where I should be reading from?
Yeah, essentially the function will read and write one byte for both registers and output them as a 16-bit int.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you look at the datasheet pg 19, it should be there

@@ -0,0 +1,16 @@
<!--
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should probably get rid of this folder

@warren-xu warren-xu removed their assignment Jan 29, 2024
return status_msg(STATUS_CODE_INVALID_ARGS, "Invalid PCA9555 port.");
}
uint8_t reg_arr[2] = {}; // store read value
uint8_t reg_to_read = 0x00; // read the first register
Copy link
Collaborator

Choose a reason for hiding this comment

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

The regs to read are 0x0 and 0x1? Could you make them into #defines so they're not magic numbers?

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.

3 participants