XTOS / OPEN SOURCE REAL-TIME SYSTEMOPEN SOURCE · VERSION 0.9.0 · BUILD FROM SOURCE
libxtos-bcixtos_bci_set_channel

xtos_bci_set_channel

Requests enabling or disabling one channel and supplies a gain field through ioctl.

On this page

Declaration

c
#include <xtos/bci.h>

int xtos_bci_set_channel(xtos_bci_session_t *session,
                        uint32_t channel,
                        bool enabled,
                        uint32_t gain);

Parameters

ParameterTypeDescription
sessionxtos_bci_session_t *Non-NULL session handle.
channeluint32_tChannel index; valid range is driver-defined.
enabledboolWhether to enable the channel.
gainuint32_tGain field constructed by user space and passed to ioctl.

Return value

Returns the underlying ioctl’s 0 or -1; the SDK does not update the device-info cache.

Errors

errnoCondition
EINVALsession is NULL or the driver considers the channel configuration invalid.
ENOTTY/EOPNOTSUPPThe device does not support channel configuration.
system errnoPreserves driver or system errno from ioctl failure.

Notes

  • The implementation builds cfg with gain, but the public Cyton/core path does not pass gain to device configuration; this API cannot claim to change hardware gain.
  • The parameter structure is stack-local and no pointer is retained; channel range and concurrency rules are driver-defined.

Example

Source

This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.