|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Core 1: the sensor bus and the hand-over. More...
#include "sense_core1.h"#include <string.h>#include "hardware/sync.h"#include "pico/flash.h"#include "pico/multicore.h"#include "pico/stdlib.h"#include "sense_i2c.h"#include "tone_core1.h"#include "sense_trace_hw.h"Functions | |
| static uint64_t | clock_us (void *ctx) |
| Reads the 64-bit microsecond timer for the sensor schedule. | |
| static void | recover (void *ctx) |
| Clears the sensor bus with sense_i2c_recover(). | |
| static bool | bus_open (void *ctx, uint8_t sda, uint8_t scl) |
| Opens the sensor bus on the given pins. | |
| static void | bus_close (void *ctx) |
| Closes the sensor bus. | |
| static sense_err_t | bus_ask (void *ctx, uint8_t addr) |
| Asks whether a device acknowledges on the sensor bus. | |
| static void | core1_main (void) |
| Core 1's entry point: runs the sensor loop, one step per tick, forever. | |
| bool | sense_core1_start (const sense_cmd_t *first) |
Launch core 1 with first as its first order. | |
| void | sense_core1_order (const sense_cmd_t *cmd) |
| A new order for core 1, taken at its next tick. | |
| bool | sense_core1_snapshot (sense_snap_t *out) |
The newest snapshot into out when one has arrived since the last call; false, and out untouched, when none has. | |
Variables | |
| static spin_lock_t * | s_lock |
| static sense_cmd_t | s_order |
| static sense_snap_t | s_shared |
| static volatile uint32_t | s_shared_seq |
| static sense_svc_t | s_svc |
| static sense_cmd_t | s_cmd |
| static sense_snap_t | s_snap |
| static uint32_t | s_stack [1024] |
| static uint32_t | s_taken_seq |
|
static |
Asks whether a device acknowledges on the sensor bus.
| ctx | Unused. |
| addr | I2C address of the device. |
|
static |
Closes the sensor bus.
| ctx | Unused. |
|
static |
Opens the sensor bus on the given pins.
| ctx | Unused. |
| sda | GPIO number of SDA. |
| scl | GPIO number of SCL. |
|
static |
Reads the 64-bit microsecond timer for the sensor schedule.
| ctx | Unused. |
|
static |
Clears the sensor bus with sense_i2c_recover().
| ctx | Unused. |
| void sense_core1_order | ( | const sense_cmd_t * | cmd | ) |
A new order for core 1, taken at its next tick.
| cmd | The order to copy into the shared slot. |
| bool sense_core1_snapshot | ( | sense_snap_t * | out | ) |
The newest snapshot into out when one has arrived since the last call; false, and out untouched, when none has.
| out | Receives the snapshot when one has arrived. |
| bool sense_core1_start | ( | const sense_cmd_t * | first | ) |
Launch core 1 with first as its first order.
Returns whether core 1 registered for the flash lock-out within SENSE_CORE1_START_MS. False means no flash window may open this boot: flash_safe_execute() would refuse it, or assert where asserts are on.
| first | The first order for core 1. |