-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Request] new isFifo()
function
#812
Labels
Comments
This might be good but I think we should organize the class docs better somehow because there are so many functions. I’ll have to think about how to categorize them…
… On Dec 2, 2021, at 1:16 AM, Brendan ***@***.***> wrote:
Currently, the library does not provide users with a way to examine the FIFO buffers statuses, with the exception of rxFifoFull(). In developing the CirPy lib, I have found the ability to examine the FIFO statuses extremely helpful when debugging a problem.
Proposal
Using 2 overloaded functions, we can expose info from the FIFO_STATUS register.
/**
* @param about_tx `true` focuses on the TX FIFO, `false` focuses on the RX FIFO
* @return
* - `0` if the specified FIFO is neither full nor empty.
* - `1` if the specified FIFO is empty.
* - `2` if the specified FIFO is full.
*/
uint8_t is_fifo(const bool about_tx)
{
return static_cast<uint8_t>((read_register(FIFO_STATUS) >> (4 * about_tx)) & 3);
}
/**
* @param about_tx `true` focuses on the TX FIFO, `false` focuses on the RX FIFO
* @param check_empty
* - `true` checks if the specified FIFO is empty
* - `false` checks is the specified FIFO is full.
* @return A boolean answer to the question "is the [TX/RX] FIFO [empty/full]?"
*/
bool is_fifo(const bool about_tx, const bool check_empty)
{
return static_cast<bool>(is_fifo(about_tx) & _BV(!check_empty));
}
Additional context
It is not my intention to make rxFifoFull() internally call isFifo(0, 0) as that would add to the code-size. Initially, I had planned to add these functions to the newer python wrapper in pyRF24, but I think it could be useful to those trying to debug the FIFO buffers' state in C++.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Yeah, I started organizing them by radio's feature in the CirPy lib's docs |
I could do some experimenting with the docs on my "improve-sphinx-docs" branch... |
Sure, I haven’t given it a good look yet but if u want to try some things out, that sounds great.
… On Dec 3, 2021, at 2:12 PM, Brendan ***@***.***> wrote:
I could do some experimenting with the docs on my "improve-sphinx-docs" branch...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I want to fit this in before the next release. I'll also be adding the model variant info to |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the library does not provide users with a way to examine the FIFO buffers statuses, with the exception of
rxFifoFull()
. In developing the CirPy lib, I have found the ability to examine the FIFO statuses extremely helpful when debugging a problem.Proposal
Using 2 overloaded functions, we can expose info from the FIFO_STATUS register.
Additional context
It is not my intention to make
rxFifoFull()
internally callisFifo(0, 0)
as that would add to the code-size. Initially, I had planned to add these functions to the newer python wrapper in pyRF24, but I think it could be useful to those trying to debug the FIFO buffers' state in C++.The text was updated successfully, but these errors were encountered: