|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The GT911 register file as an I2C target sees it (gt911_emu.h). More...
Functions | |
| void | gt911_emu_init (gt911_emu_t *e, uint16_t res_x, uint16_t res_y) |
| Clear the register file and set the resolution it reports. | |
| static uint8_t | lo (uint16_t v) |
The low byte of v. | |
| static uint8_t | hi (uint16_t v) |
The high byte of v. | |
| uint8_t | gt911_emu_peek (const gt911_emu_t *e, uint16_t reg) |
The byte at reg, as a read would return it, without side effects. | |
| void | gt911_emu_rx (gt911_emu_t *e, uint8_t b) |
The master wrote b. | |
| uint8_t | gt911_emu_tx (gt911_emu_t *e) |
| The master reads a byte: the one at the pointer, which then moves on. | |
| void | gt911_emu_finish (gt911_emu_t *e) |
| A STOP, a repeated START or an abort ended the transfer. | |
| bool | gt911_emu_publish (gt911_emu_t *e, const gt911_emu_frame_t *f) |
Make f the frame the master reads next. | |
| bool | gt911_emu_withdraw (gt911_emu_t *e) |
| Withdraw an unacknowledged frame: the status reads 0x00. | |
The GT911 register file as an I2C target sees it (gt911_emu.h).
SPDX-License-Identifier: MIT
| void gt911_emu_finish | ( | gt911_emu_t * | e | ) |
A STOP, a repeated START or an abort ended the transfer.
| e | The emulator. |
| void gt911_emu_init | ( | gt911_emu_t * | e, |
| uint16_t | res_x, | ||
| uint16_t | res_y ) |
Clear the register file and set the resolution it reports.
| e | The emulator. |
| res_x | Columns. |
| res_y | Rows. |
| uint8_t gt911_emu_peek | ( | const gt911_emu_t * | e, |
| uint16_t | reg ) |
The byte at reg, as a read would return it, without side effects.
| e | The emulator. |
| reg | The register. |
| bool gt911_emu_publish | ( | gt911_emu_t * | e, |
| const gt911_emu_frame_t * | f ) |
Make f the frame the master reads next.
Refused while a transfer is under way or the previous frame is not yet acknowledged, so a master never reads the status of one frame and the points of another. Refused too for more than GT911_EMU_POINTS points. Point slots past f->n read 0x00.
| e | The emulator. |
| f | The frame. |
| void gt911_emu_rx | ( | gt911_emu_t * | e, |
| uint8_t | b ) |
The master wrote b.
| e | The emulator. |
| b | The byte. |
| uint8_t gt911_emu_tx | ( | gt911_emu_t * | e | ) |
The master reads a byte: the one at the pointer, which then moves on.
| e | The emulator. |
| bool gt911_emu_withdraw | ( | gt911_emu_t * | e | ) |
Withdraw an unacknowledged frame: the status reads 0x00.
| e | The emulator. |