13.2.2.5 dac_os_write
The DAC convert digital data to analog output.
int32_t dac_os_write(
struct dac_os_descriptor *const descr,
const uint8_t ch,
uint16_t * buffer,
uint32_t length
)
It blocks the task/thread until the conversation is done. The buffer sample should be 16-bit wide. 8-bit data will not be supported. You must convert to 16-bit if there are 8-bit samples.
Parameters
- descr
-
Type: struct dac_os_descriptor Struct *const
Pointer to the HAL DAC descriptor
- ch
-
Type: const uint8_t
The channel selected to output
- buffer
-
Type: uint16_t *
Pointer to digital data or buffer
- length
-
Type: uint32_t
The number of elements in buffer
Returns
Type: int32_t
Operation status.
- <0
-
Error code
- length
-
Convert success