|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The SENSE_LIMIT link page at the IOmcu (protocol 4.27): a current limit for each of SENSE_MAP's 12 channels, and the channels whose window passed its limit. More...
Go to the source code of this file.
Functions | |
| void | sense_limit_read (sense_page_t *p, uint8_t off, uint8_t n, uint16_t *out) |
| A SENSE_LIMIT read from the link. | |
| void | sense_limit_peek (const sense_page_t *p, uint8_t off, uint8_t n, uint16_t *out) |
| The registers as they stand, OVER kept: for a report, not the link. | |
| uint8_t | sense_limit_write (sense_page_t *p, uint8_t off, uint8_t n, const uint16_t *in) |
| A SENSE_LIMIT write, judged whole. | |
| void | sense_limit_kept (const sense_page_t *p, uint16_t *kept) |
What is kept: the 12 limits into kept. | |
| uint8_t | sense_limit_restore (sense_page_t *p, const uint16_t *kept) |
| Kept limits back at boot, through sense_limit_write()'s checks: 0, or the refusal, which leaves every limit 0. | |
The SENSE_LIMIT link page at the IOmcu (protocol 4.27): a current limit for each of SENSE_MAP's 12 channels, and the channels whose window passed its limit.
The registers and the rule are in link_pages.h (LINK_SL_*); the state is the SENSE page's (sense_page_t). An alert only: nothing here stops or drives an output.
Host-tested in test_sense_limit.
SPDX-License-Identifier: MIT
| void sense_limit_kept | ( | const sense_page_t * | p, |
| uint16_t * | kept ) |
What is kept: the 12 limits into kept.
| p | Page state, not changed. |
| kept | Receives LINK_SL_KEPT (12) limit values. Not checked for NULL. |
| void sense_limit_peek | ( | const sense_page_t * | p, |
| uint8_t | off, | ||
| uint8_t | n, | ||
| uint16_t * | out ) |
The registers as they stand, OVER kept: for a report, not the link.
Nothing is done when p or out is NULL, or when off and n reach past the page.
| p | Page state, not changed. |
| off | First register, 0 to LINK_SL_COUNT - 1. |
| n | Number of registers to copy. |
| out | Receives the n register values. |
| void sense_limit_read | ( | sense_page_t * | p, |
| uint8_t | off, | ||
| uint8_t | n, | ||
| uint16_t * | out ) |
A SENSE_LIMIT read from the link.
A read that covers OVER clears it once out holds it.
Nothing is done when p or out is NULL, or when off and n reach past the page.
| p | Page state, read and cleared in place. |
| off | First register, 0 to LINK_SL_COUNT - 1. |
| n | Number of registers to read. |
| out | Receives the n register values. |
| uint8_t sense_limit_restore | ( | sense_page_t * | p, |
| const uint16_t * | kept ) |
Kept limits back at boot, through sense_limit_write()'s checks: 0, or the refusal, which leaves every limit 0.
| p | Page state, written through sense_limit_write(). |
| kept | The LINK_SL_KEPT (12) kept limit values. |
| uint8_t sense_limit_write | ( | sense_page_t * | p, |
| uint8_t | off, | ||
| uint8_t | n, | ||
| const uint16_t * | in ) |
A SENSE_LIMIT write, judged whole.
Refused: off the page (BAD_RANGE), reaching register 12 (READ_ONLY), a limit above 32767 (BAD_VALUE).
Taken in any bank state.
| p | Page state, written only when the whole write is taken. |
| off | First register, 0 to LINK_SL_COUNT - 1. |
| n | Number of registers to write. |
| in | The n new limit values, each at most LINK_SL_MA_MAX (32767). |