C Test Function Reference

These functions are included for manufacturing test and not targeted for the end user.

MCC 118 test functions

Function

Description

mcc118_test_clock()

Test the CLK pin.

mcc118_test_trigger()

Test the TRIG pin.

int mcc118_test_clock(uint8_t address, uint8_t mode, uint8_t *value)

Test the CLK pin.

This function will return RESULT_BUSY if called while a scan is running.

Parameters:
  • address – The board address (0 - 7). Board must already be opened.

  • mode – The CLK pin mode

    • 0 = input

    • 1 = output low

    • 2 = output high

    • 3 = output 1 kHz square wave

  • value – Receives the value at the CLK pin after setting the mode.

Returns:

Result code, RESULT_SUCCESS if successful.

int mcc118_test_trigger(uint8_t address, uint8_t *state)

Test the TRIG pin by returning the current state.

Parameters:
  • address – The board address (0 - 7). Board must already be opened.

  • state – Receives the TRIG pin state (0 or 1.)

Returns:

Result code, RESULT_SUCCESS if successful.

MCC 172 test functions

Function

Description

mcc172_test_signals_read()

Read the state of the clock, sync, and trigger signals.

mcc172_test_signals_write()

Write values to the clock and sync signals.

int mcc172_test_signals_read(uint8_t address, uint8_t *clock, uint8_t *sync, uint8_t *trigger)

Read the state of shared signals for testing.

This function reads the state of the ADC clock, sync, and trigger signals. Use it in conjunction with mcc172_a_in_clock_config_write() and mcc172_trigger_config() to put the signals into slave mode then set values on the signals using the Pi GPIO pins.

Parameters:
  • address – The board address (0 - 7). Board must already be opened.

  • clock – Receives the current logic level of the ADC clock.

  • sync – Receives the current logic level of sync.

  • trigger – Receives the current logic level of trigger.

Returns:

Result code, RESULT_SUCCESS if successful.

int mcc172_test_signals_write(uint8_t address, uint8_t mode, uint8_t clock, uint8_t sync)

Write values to shared signals for testing.

This function puts the shared signals into test mode and sets them to the specified state. The signal levels can then be read on the Pi GPIO pins to confirm.

Parameters:
  • address – The board address (0 - 7). Board must already be opened.

  • mode – Set to 1 for test mode, 0 to return to normal operation.

  • clock – The value to write to the ADC clock when in test mode.

  • sync – The value to write to sync when in test mode.

Returns:

Result code, RESULT_SUCCESS if successful.