APCI-3660 API  1719
Board Clock management functions

Functions

int i_APCI3660_InitBoard (uint8_t boardId, uint8_t masterSlaveMode, uint8_t clockGen1_Divisor, uint8_t clockGen2_Divisor, uint8_t samplingClock1_Selection, uint8_t samplingClock2_Selection, uint8_t slaveSamplingClock1_Selection, uint8_t slaveSamplingClock2_Selection, uint8_t chronometer_MasterClock_Divisor)
 
int i_APCI3660_GetBoardInitialisation (uint8_t boardId, uint8_t *masterSlaveMode, uint8_t *clockGen1_Divisor, uint8_t *clockGen2_Divisor, uint8_t *samplingClock1_Selection, uint8_t *samplingClock2_Selection, uint8_t *slaveSamplingClock1_Selection, uint8_t *slaveSamplingClock2_Selection, uint8_t *chronometer_MasterClock_Divisor)
 
int i_APCI3660_ReleaseBoardHardware (uint8_t boardId)
 

Detailed Description

Function Documentation

◆ i_APCI3660_InitBoard()

int i_APCI3660_InitBoard ( uint8_t  boardId,
uint8_t  masterSlaveMode,
uint8_t  clockGen1_Divisor,
uint8_t  clockGen2_Divisor,
uint8_t  samplingClock1_Selection,
uint8_t  samplingClock2_Selection,
uint8_t  slaveSamplingClock1_Selection,
uint8_t  slaveSamplingClock2_Selection,
uint8_t  chronometer_MasterClock_Divisor 
)

Init the board

This function initializes the board and release all analog inputs and outputs to initial state.

Parameters
[in]boardIdTarget board index
[in]masterSlaveModeBoard mode (0: master mode, 1: slave mode (not used))
[in]clockGen1_DivisorSelection of the divisor for the clock generator 1
  • 4 : DIVISOR4 -> 25.600MHz
  • 5 : DIVISOR5 -> 20.480MHz
  • 6 : DIVISOR6 -> 17.060MHz
  • 8 : DIVISOR8 -> 12.800MHz
  • 10 : DIVISOR10 -> 10.240MHz
  • 12 : DIVISOR12 -> 8.530MHz
  • 16 : DIVISOR16 -> 6.400MHz
  • 20 : DIVISOR20 -> 5.120MHz
  • 25 : DIVISOR25 -> 4.096MHz
  • 40 : DIVISOR40 -> 2.560MHz
  • 50 : DIVISOR50 -> 2.048MHz
  • 60 : DIVISOR60 -> 1.706MHz
  • 80 : DIVISOR80 -> 1.280MHz
  • 100 : DIVISOR100 -> 1.024MHz
[in]clockGen2_DivisorSelection of the divisor for the clock generator 2 if (boardId > sizeof(_thread_info) / sizeof(*_thread_info))return -1;
  • 4 : DIVISOR4 -> 25.600MHz
  • 5 : DIVISOR5 -> 20.480MHz
  • 6 : DIVISOR6 -> 17.060MHz
  • 8 : DIVISOR8 -> 12.800MHz
  • 10 : DIVISOR10 -> 10.240MHz
  • 12 : DIVISOR12 -> 8.530MHz
  • 16 : DIVISOR16 -> 6.400MHz
  • 20 : DIVISOR20 -> 5.120MHz
  • 25 : DIVISOR25 -> 4.096MHz
  • 40 : DIVISOR40 -> 2.560MHz
  • 50 : DIVISOR50 -> 2.048MHz
  • 60 : DIVISOR60 -> 1.706MHz
  • 80 : DIVISOR80 -> 1.280MHz
  • 100 : DIVISOR100 -> 1.024MHz
[in]samplingClock1_SelectionSelection of the clock for the sampling clock 1
  • 0 : External clock 1
  • 1 : External clock 2
[in]samplingClock2_SelectionSelection of the clock for the sampling clock 2
  • 0 : External clock 1
  • 1 : External clock 2
[in]slaveSamplingClock1_SelectionSelection of the clock for the sampling clock 1 for the slave board (0: PCI3660_EXT_CLOCK_1, 1:PCI3660_EXT_CLOCK_2)
  • 0 : External clock 1
  • 1 : External clock 2
[in]slaveSamplingClock2_SelectionSelection of the clock for the sampling clock 2 for the slave board (0: PCI3660_EXT_CLOCK_1, 1:PCI3660_EXT_CLOCK_2)
  • 0 : External clock 1
  • 1 : External clock 2
[in]chronometer_MasterClock_DivisorSelection of the divisor for the master clock for the chronometer
  • 0: PCI3660_CHRONOMETER_DIVISOR_1
  • 1: PCI3660_CHRONOMETER_DIVISOR_10
  • 2: PCI3660_CHRONOMETER_DIVISOR_100)
Return values
0No error
-1The boardId is wrong
-2The masterSlaveMode is wrong
-3One or both of the selected bus clock divisor parameter is wrong
-4One or both of the clock selection is wrong
-5The masterSlaveMode and slaveSamplingClock1_Selection combination is wrong
-6The chronometer_MasterClock_Divisor is wrong
Sampling frequency(in kHz)
clockgen Divisor Speed mod (see InitAnalogInputModule)
Single Double Quad
4 50 100 200
5 40 80 120
6 33.33 66.66 133,33
8 25 50 100
10 20
12 16.67
16 12.5
20 10
25 8
40 5
50 4
60 3.33
80 2.5
100 2

◆ i_APCI3660_GetBoardInitialisation()

int i_APCI3660_GetBoardInitialisation ( uint8_t  boardId,
uint8_t *  masterSlaveMode,
uint8_t *  clockGen1_Divisor,
uint8_t *  clockGen2_Divisor,
uint8_t *  samplingClock1_Selection,
uint8_t *  samplingClock2_Selection,
uint8_t *  slaveSamplingClock1_Selection,
uint8_t *  slaveSamplingClock2_Selection,
uint8_t *  chronometer_MasterClock_Divisor 
)

Get board initialization state

Parameters
[in]boardIdTarget board index
[out]masterSlaveModeBoard mode (0: master mode, 1: slave mode)
[out]clockGen1_DivisorSelection of the divisor for the clock generator 1
[out]clockGen2_DivisorSelection of the divisor for the clock generator 2
[out]samplingClock1_SelectionSelection of the clock for the sampling clock 1
[out]samplingClock2_SelectionSelection of the clock for the sampling clock 2
[out]slaveSamplingClock1_SelectionSelection of the clock for the sampling clock 1 for the slave board (0: PCI3660_EXT_CLOCK_1, 1:PCI3660_EXT_CLOCK_2)
[out]slaveSamplingClock2_SelectionSelection of the clock for the sampling clock 2 for the slave board (0: PCI3660_EXT_CLOCK_1, 1:PCI3660_EXT_CLOCK_2)
[out]chronometer_MasterClock_DivisorSelection of the divisor for the master clock for the chronometer (PCI3660_CHRONOMETER_DIVISOR_1, PCI3660_CHRONOMETER_DIVISOR_10 or PCI3660_CHRONOMETER_DIVISOR_100)
Return values
0No error
-1The boardId is wrong
-2The board has not been initialized
-14An error occurred while calling the IOCTL function

◆ i_APCI3660_ReleaseBoardHardware()

int i_APCI3660_ReleaseBoardHardware ( uint8_t  boardId)

Release the Hardware of the board

Parameters
[in]boardIdTarget board index
Return values
0No error
-1The boardId is wrong