xtos_ bci_ set_ channel
Requests enabling or disabling one channel and supplies a gain field through ioctl.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_set_channel(xtos_bci_session_t *session,
uint32_t channel,
bool enabled,
uint32_t gain);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle. |
| channel | uint32_t | Channel index; valid range is driver-defined. |
| enabled | bool | Whether to enable the channel. |
| gain | uint32_t | Gain 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
| errno | Condition |
|---|---|
| EINVAL | session is NULL or the driver considers the channel configuration invalid. |
| ENOTTY/EOPNOTSUPP | The device does not support channel configuration. |
| system errno | Preserves 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.