The TONE page and the phase tap's capture behind it; see iomcu.h for the other files.
More...
#include <string.h>
#include "iomcu.h"
#include "pd_uart.h"
#include "tone_cap.h"
#include "tone_core1.h"
|
| uint64_t | tone_taken (void) |
| | Returns the pins the phase tap may not take now.
|
|
static void | tone_order (void) |
| | Core 1's order from the page, running when the capture does.
|
| static bool | tone_rewire_as (bool keep_ring) |
| | Makes the capture agree with the TONE page: stopped, then started on the page's pin.
|
| bool | tone_rewire (void) |
| | Makes the phase tap's capture agree with the TONE page's pin.
|
| void | tone_read (void *ctx, uint8_t off, uint8_t n, uint16_t *out) |
| | Reads the TONE page.
|
| uint8_t | tone_write (void *ctx, uint8_t off, uint8_t n, const uint16_t *in) |
| | Writes the TONE page.
|
|
|
static bool | s_tone_busy |
|
static uint64_t | s_tone_was_us |
The TONE page and the phase tap's capture behind it; see iomcu.h for the other files.
SPDX-License-Identifier: MIT
◆ tone_read()
| void tone_read |
( |
void * | ctx, |
|
|
uint8_t | off, |
|
|
uint8_t | n, |
|
|
uint16_t * | out ) |
Reads the TONE page.
- Parameters
-
| ctx | Unused. |
| off | First register to read. |
| n | Number of registers to read. |
| out | Receives the n register values. |
◆ tone_rewire()
| bool tone_rewire |
( |
void | | ) |
|
Makes the phase tap's capture agree with the TONE page's pin.
- Returns
- True when the capture agrees with the page. False when the wiring could not take the pin, or core 1 was still in a pass.
◆ tone_rewire_as()
| bool tone_rewire_as |
( |
bool | keep_ring | ) |
|
|
static |
Makes the capture agree with the TONE page: stopped, then started on the page's pin.
- Parameters
-
- Returns
- False when the tap is enabled and the wiring could not take its pin (no PIO state machine, no DMA channel), or core 1 was still in a pass and the old capture runs on. True otherwise.
◆ tone_taken()
| uint64_t tone_taken |
( |
void | | ) |
|
Returns the pins the phase tap may not take now.
- Returns
- One bit per GPIO: the supply's pins, the programming ports' pins and the sensor bus's pins, including those core 1 has not let go of yet.
◆ tone_write()
| uint8_t tone_write |
( |
void * | ctx, |
|
|
uint8_t | off, |
|
|
uint8_t | n, |
|
|
const uint16_t * | in ) |
Writes the TONE page.
- Parameters
-
| ctx | Unused. |
| off | First register to write. |
| n | Number of registers to write. |
| in | The n register values to write. |
- Returns
- 0 to accept, or a link_nack_t to refuse.