code wiki / (root) / nx_haptic_render.nx

nx_haptic_render.nx

buildroot/runtime/nx_haptic_render.nx

10242 B195 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_perceptual_profile.nx nx_signal_compensator.nx nx_transducer_characterizer.nx nx_haptic_render.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_signal_compensator.nxnx_transducer_characterizer.nx

imported by: nobody (leaf or entry point)

structs

139struct NxHapticRenderParams

consts

60const NX_HAPTIC_ACTUATOR_ERM: i64 = 1 // eccentric rotating mass
61const NX_HAPTIC_ACTUATOR_LRA: i64 = 2 // linear resonant actuator
62const NX_HAPTIC_ACTUATOR_VOICE_COIL: i64 = 3 // small voice-coil motor
63const NX_HAPTIC_ACTUATOR_PIEZO_BENDER: i64 = 4 // piezoelectric bending element
64const NX_HAPTIC_ACTUATOR_SOLENOID_PULSE: i64 = 5 // electromagnetic solenoid
65const NX_HAPTIC_ACTUATOR_BONE_CONDUCTION: i64 = 6 // bone-conduction transducer
66const NX_HAPTIC_ACTUATOR_PLATFORM_SHAKER: i64 = 7 // larger platform, livestock scale
85const NX_HAPTIC_PATTERN_PAW_THUMP: i64 = 1 // dog toy: rabbit-thump, single
86const NX_HAPTIC_PATTERN_PAW_THUMP_DOUBLE: i64 = 2 // rabbit-alarm-thump pair
87const NX_HAPTIC_PATTERN_SCRATCH: i64 = 3 // small mammal scratching
88const NX_HAPTIC_PATTERN_PREY_STEP: i64 = 4 // light footfall sequence
89const NX_HAPTIC_PATTERN_PREY_FLIGHT: i64 = 5 // accelerating away-pattern
91const NX_HAPTIC_PATTERN_BIRD_LANDING: i64 = 6 // wing-flutter + landing impact
92const NX_HAPTIC_PATTERN_QUEEN_BEE_BUZZ: i64 = 7 // beekeeping
93const NX_HAPTIC_PATTERN_CALMING_PULSE: i64 = 8 // anxiety-reduction rhythm
94const NX_HAPTIC_PATTERN_TRAINING_CUE: i64 = 9 // working-dog training collar
95const NX_HAPTIC_PATTERN_NOTIFICATION: i64 = 10 // human accessibility
96const NX_HAPTIC_PATTERN_USER_DEFINED: i64 = 11 // caller provides waveform
115const NX_HAPTIC_RENDER_OK: i64 = 0
116const NX_HAPTIC_RENDER_FAIL_BAD_ACTUATOR: i64 = 1
117const NX_HAPTIC_RENDER_FAIL_BAD_PATTERN: i64 = 2
118const NX_HAPTIC_RENDER_FAIL_NOT_CALIBRATED: i64 = 3 // no curve in
120const NX_HAPTIC_RENDER_FAIL_SAFETY_LIMITED: i64 = 4 // would exceed motor limits
121const NX_HAPTIC_RENDER_FAIL_BUSY: i64 = 5 // previous pattern still playing
122const NX_HAPTIC_RENDER_FAIL_DEPENDENCY_MISSING: i64 = 6 // PARTIAL_WIRED default

functions

68func nx_haptic_actuator_name(a: i64) -> *u8
98func nx_haptic_pattern_name(p: i64) -> *u8
124func nx_haptic_render_verdict_name(v: i64) -> *u8
161func nx_haptic_render_play(params_ptr: *NxHapticRenderParams) -> i64
170func nx_haptic_render_stop(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64
178func nx_haptic_render_is_busy(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64
186func nx_haptic_render_get_safety_max_intensity(actuator_serial_ptr: *u8, actuator_serial_len: i64) -> i64
193func nx_haptic_render_get_last_verdict() -> i64