Hello,
i'm new to DSPs and i want to use the adi-Libraries instead of editing registers. With all the given examples i tried to figure out, how i have to handle the library functions.
I want to use the internal ADC to sample a signal and then send the digital values via UART to the computer.
I used the example codes and ended up with two adi_dev_open() lines, each followed by a adi_dev_control() function. One adi_dev_open() is for the ADC module and one for the UART device. If i open only one of these devices, so there's only one adi_dev_open(), everything is fine. But if i have a second adi_dev_open(), this function returns not zero, but something like 0x03000040. What does this mean? Where is the problem? Has it something to do with the parameter: adi_dev_ManagerHandle?
Thank you! It's for my master thesis.
Here's the problematic code snippet:
/* open the UART driver */
nResult = adi_dev_Open( adi_dev_ManagerHandle, /* Dev manager Handle */
&ADIUARTEntryPoint, /* Entry point for Interrupt driven UART*/
UART_DEVICE_NUMBER, /* Device number */
NULL, /* No client handle */
&UARTDriverHandle, /* Location to store UART driver handle */
ADI_DEV_DIRECTION_BIDIRECTIONAL,/* Data Direction */
NULL, /* Handle to DMA Manager */
hDcbManager, /* Handle to callback manager */
UARTCallback); /* Callback Function */
/* pass UART configuration table to the driver */
nResult = adi_dev_Control(UARTDriverHandle, ADI_DEV_CMD_TABLE, (void*)UARTConfigTable);
/* Open BF506F ADC Device */
nResult = adi_dev_Open(adi_dev_ManagerHandle,
&ADI_BF506ADC1_EntryPoint,
0,
NULL,
&hAdcDevice,
ADI_DEV_DIRECTION_INBOUND,
adi_dma_ManagerHandle,
hDcbManager,
AdcCallback);
/* Configure ADC driver and ACM/SPORT Device registers */
nResult = (adi_dev_Control (hAdcDevice,
ADI_DEV_CMD_TABLE,
(void *) &aoAdcConfig[0]));