|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
SENSE_LIMIT, the panel's half. See sense_limit_link.h. More...
Functions | |
| void | sense_limit_link_init (sense_limit_link_t *s) |
| Clears the service: no link, no limits asked. | |
| void | sense_limit_link_lost (sense_limit_link_t *s) |
| The link went: what was read is no longer the IOmcu's. | |
| void | sense_limit_link_came_up (sense_limit_link_t *s, uint16_t minor, uint32_t now_ms) |
| An IOmcu answered. | |
| void | sense_limit_link_want (sense_limit_link_t *s, const uint16_t *ma, uint32_t now_ms) |
| The limits SETUP > SENSORS asks. A change clears a refusal. | |
| static bool | any_limit (const uint16_t *ma) |
| Whether any channel has a limit. | |
| static bool | owed (const sense_limit_link_t *s) |
| Whether the limits wanted are owed to the page. | |
| bool | sense_limit_link_next (sense_limit_link_t *s, uint32_t now_ms, sense_limit_link_op_t *op) |
| The next exchange owed. | |
| static void | take_over (sense_limit_link_t *s, uint16_t over, uint16_t count) |
| Takes OVER and OVER_COUNT as a read returned them, each bit with the limit the page held, the one it was judged by. | |
| void | sense_limit_link_done (sense_limit_link_t *s, int result, const uint16_t *regs, uint32_t now_ms) |
| How the exchange sense_limit_link_next() named went. | |
| sense_limit_link_ev_t | sense_limit_link_event (sense_limit_link_t *s, uint32_t now_ms, unsigned *ch, uint16_t *ma) |
| The next band alert. | |
| uint16_t | sense_limit_link_held_ma (const sense_limit_link_t *s, unsigned ch) |
| A channel's limit the page holds. | |
| sense_limit_st_t | sense_limit_link_status (const sense_limit_link_t *s) |
| What SETUP > SENSORS shows of the limits. | |
| uint16_t | sense_limit_link_unheld (const sense_limit_link_t *s) |
| The channels whose LIMIT row SETUP marks. | |
SENSE_LIMIT, the panel's half. See sense_limit_link.h.
SPDX-License-Identifier: MIT
|
static |
Whether any channel has a limit.
| ma | LINK_SL_KEPT limits in mA |
|
static |
Whether the limits wanted are owed to the page.
| s | the service |
| void sense_limit_link_came_up | ( | sense_limit_link_t * | s, |
| uint16_t | minor, | ||
| uint32_t | now_ms ) |
An IOmcu answered.
| s | the service; NULL does nothing. |
| minor | its protocol minor; below LINK_MINOR_SENSE_LIMIT (27) the page is sent nothing. |
| now_ms | the time, ms; a limit asked before rests from it. |
| void sense_limit_link_done | ( | sense_limit_link_t * | s, |
| int | result, | ||
| const uint16_t * | regs, | ||
| uint32_t | now_ms ) |
How the exchange sense_limit_link_next() named went.
| s | the service; NULL does nothing. |
| result | SENSE_LIMIT_LINK_ACK, a NACK's reason (LINK_NACK_*), or SENSE_LIMIT_LINK_NO_ANSWER. |
| regs | for an answered read, the registers it asked for; else NULL. |
| now_ms | the time, ms. |
| sense_limit_link_ev_t sense_limit_link_event | ( | sense_limit_link_t * | s, |
| uint32_t | now_ms, | ||
| unsigned * | ch, | ||
| uint16_t * | ma ) |
The next band alert.
| s | the service. |
| now_ms | the time, ms. |
| ch | for EV_OVER the channel, 0 to 11; may be NULL. |
| ma | for EV_OVER the limit the window was judged by, mA; may be NULL. |
s and while the last is younger than SENSE_LIMIT_LINK_GAP_MS. | uint16_t sense_limit_link_held_ma | ( | const sense_limit_link_t * | s, |
| unsigned | ch ) |
A channel's limit the page holds.
| s | the service. |
| ch | the channel, 0 to 11. |
ch out of range. | void sense_limit_link_init | ( | sense_limit_link_t * | s | ) |
Clears the service: no link, no limits asked.
| s | the service; NULL does nothing. |
| void sense_limit_link_lost | ( | sense_limit_link_t * | s | ) |
The link went: what was read is no longer the IOmcu's.
The limits asked stay, and OVER_COUNT as last read, for the link-up read.
| s | the service; NULL does nothing. |
| bool sense_limit_link_next | ( | sense_limit_link_t * | s, |
| uint32_t | now_ms, | ||
| sense_limit_link_op_t * | op ) |
The next exchange owed.
| s | the service. |
| now_ms | the time, ms. |
| op | where the exchange goes; zeroed for none. |
s or op. | sense_limit_st_t sense_limit_link_status | ( | const sense_limit_link_t * | s | ) |
What SETUP > SENSORS shows of the limits.
| s | the service. |
s. | uint16_t sense_limit_link_unheld | ( | const sense_limit_link_t * | s | ) |
The channels whose LIMIT row SETUP marks.
| s | the service. |
| void sense_limit_link_want | ( | sense_limit_link_t * | s, |
| const uint16_t * | ma, | ||
| uint32_t | now_ms ) |
The limits SETUP > SENSORS asks. A change clears a refusal.
| s | the service; NULL does nothing. |
| ma | LIMIT_MA[0] to [11], mA, 0 for none; above 32767 taken as
|
| now_ms | the time, ms; a change rests SENSE_LIMIT_LINK_SETTLE_MS from it. |
|
static |
Takes OVER and OVER_COUNT as a read returned them, each bit with the limit the page held, the one it was judged by.
A count that moved with no bit is a reply lost, its bits with it; a count of 0 is an IOmcu that started again with no window over since.
| s | the service |
| over | OVER, one bit a channel |
| count | OVER_COUNT |