nx_haptic_render.nx
buildroot/runtime/nx_haptic_render.nx
about
nx_haptic_render.nx -- temporal-vibration output rendering.
module: nishi-core.perception.haptic_render
depends: nishi-core.perception.profile + nishi-core.perception.signal_compensator +
nishi-core.perception.transducer_characterizer + nishi-core.io.syscalls
disk_kb: 5
capability: PERCEPTION
wired_status: PARTIAL_WIRED
MISSING_CAPABILITIES:
- PWM_GENERATOR_DISPATCH (drive haptic motor via MCU PWM peripheral;
depends on nx_mcu_pwm primitive from embedded substrate arc)
- DAC_VOLTAGE_DISPATCH (for voice-coil / linear-resonant-actuator
haptics that take analog drive)
- SIGNAL_COMPENSATOR_CALL (route output through nx_signal_compensator
with TEMPORAL_VIBRATION domain + per-motor calibration curve)
- WAVEFORM_LIBRARY_LOAD (pre-defined haptic patterns: paw-thump,
scratch, click, double-tap, prey-step, etc.)
- CONCURRENT_VOICE_MIXING (multiple haptic events overlapping in time
without phase issues)
- SAFETY_LIMITER (prevent motor stall + over-current per
[[feedback-cooperative-resource-arbitration-vs-bloatware]])
license_tier: PUBLIC_NISHI_SUBSTRATE
genealogy_id: feedback-substrate-primitives-meta-not-one-off_2026 +
feedback-multi-species-perceptual-substrate-not-anthropocentric_2026 +
feedback-substrate-does-heavy-lifting-user-is-partner-not-gate +
immersion_2014_TouchSense_haptic_patterns +
feedback-build-intelligence-never-strip-features
Per cardinals [[feedback-substrate-primitives-meta-not-one-off]] and
[[feedback-multi-species-perceptual-substrate-not-anthropocentric]]:
THIS primitive renders temporal-vibration output for ANY haptic
transducer (ERM = eccentric rotating mass, LRA = linear resonant actuator,
voice-coil, piezo bender, solenoid pulse). Per-motor calibration via
nx_transducer_characterize(NX_TXR_KIND_VIBRATION_OUTPUT); per-render
pre-correction via nx_signal_compensator(NX_SIG_DOMAIN_TEMPORAL_VIBRATION).
Reuse set served by this single primitive:
- Dog toy paw-thump simulation (prey-spec dog toy)
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_perceptual_profile.nxnx_signal_compensator.nxnx_transducer_characterizer.nx
imported by: nobody (leaf or entry point)
structs
| 139 | struct NxHapticRenderParams |
consts
| 60 | const NX_HAPTIC_ACTUATOR_ERM: i64 = 1 // eccentric rotating mass |
| 61 | const NX_HAPTIC_ACTUATOR_LRA: i64 = 2 // linear resonant actuator |
| 62 | const NX_HAPTIC_ACTUATOR_VOICE_COIL: i64 = 3 // small voice-coil motor |
| 63 | const NX_HAPTIC_ACTUATOR_PIEZO_BENDER: i64 = 4 // piezoelectric bending element |
| 64 | const NX_HAPTIC_ACTUATOR_SOLENOID_PULSE: i64 = 5 // electromagnetic solenoid |
| 65 | const NX_HAPTIC_ACTUATOR_BONE_CONDUCTION: i64 = 6 // bone-conduction transducer |
| 66 | const NX_HAPTIC_ACTUATOR_PLATFORM_SHAKER: i64 = 7 // larger platform, livestock scale |
| 85 | const NX_HAPTIC_PATTERN_PAW_THUMP: i64 = 1 // dog toy: rabbit-thump, single |
| 86 | const NX_HAPTIC_PATTERN_PAW_THUMP_DOUBLE: i64 = 2 // rabbit-alarm-thump pair |
| 87 | const NX_HAPTIC_PATTERN_SCRATCH: i64 = 3 // small mammal scratching |
| 88 | const NX_HAPTIC_PATTERN_PREY_STEP: i64 = 4 // light footfall sequence |
| 89 | const NX_HAPTIC_PATTERN_PREY_FLIGHT: i64 = 5 // accelerating away-pattern |
| 91 | const NX_HAPTIC_PATTERN_BIRD_LANDING: i64 = 6 // wing-flutter + landing impact |
| 92 | const NX_HAPTIC_PATTERN_QUEEN_BEE_BUZZ: i64 = 7 // beekeeping |
| 93 | const NX_HAPTIC_PATTERN_CALMING_PULSE: i64 = 8 // anxiety-reduction rhythm |
| 94 | const NX_HAPTIC_PATTERN_TRAINING_CUE: i64 = 9 // working-dog training collar |
| 95 | const NX_HAPTIC_PATTERN_NOTIFICATION: i64 = 10 // human accessibility |
| 96 | const NX_HAPTIC_PATTERN_USER_DEFINED: i64 = 11 // caller provides waveform |
| 115 | const NX_HAPTIC_RENDER_OK: i64 = 0 |
| 116 | const NX_HAPTIC_RENDER_FAIL_BAD_ACTUATOR: i64 = 1 |
| 117 | const NX_HAPTIC_RENDER_FAIL_BAD_PATTERN: i64 = 2 |
| 118 | const NX_HAPTIC_RENDER_FAIL_NOT_CALIBRATED: i64 = 3 // no curve in |
| 120 | const NX_HAPTIC_RENDER_FAIL_SAFETY_LIMITED: i64 = 4 // would exceed motor limits |
| 121 | const NX_HAPTIC_RENDER_FAIL_BUSY: i64 = 5 // previous pattern still playing |
| 122 | const NX_HAPTIC_RENDER_FAIL_DEPENDENCY_MISSING: i64 = 6 // PARTIAL_WIRED default |
functions
| 68 | func nx_haptic_actuator_name(a: i64) -> *u8 |
| 98 | func nx_haptic_pattern_name(p: i64) -> *u8 |
| 124 | func nx_haptic_render_verdict_name(v: i64) -> *u8 |
| 161 | func nx_haptic_render_play(params_ptr: *NxHapticRenderParams) -> i64 |
| 170 | func nx_haptic_render_stop(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64 |
| 178 | func nx_haptic_render_is_busy(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64 |
| 186 | func nx_haptic_render_get_safety_max_intensity(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64 |
| 193 | func nx_haptic_render_get_last_verdict() -> i64 |