Fix ctb slow adc fw (#713)

Firmware updated. spi moved to firmware. In Software, configuring, then a pulse to start, wait for done bit and convert the values read from a regiter.
This commit is contained in:
Dhanya Thattil
2023-04-12 11:25:41 +02:00
committed by GitHub
parent b442b17415
commit cab2b335dc
10 changed files with 210 additions and 327 deletions

View File

@ -1,52 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include <inttypes.h>
/**
* Set Defines
* @param reg spi register
* @param roreg spi readout register
* @param cmsk conversion mask
* @param clkmsk clock output mask
* @param dmsk digital output mask
* @param dofst digital output offset
*/
void AD7689_SetDefines(uint32_t reg, uint32_t roreg, uint32_t cmsk,
uint32_t clkmsk, uint32_t dmsk, int dofst);
/**
* Disable SPI
*/
void AD7689_Disable();
/**
* Set SPI reg value
* @param codata value to be set
*/
void AD7689_Set(uint32_t codata);
/**
* Get SPI reg value
* @returns SPI reg value
*/
uint16_t AD7689_Get();
/**
* Get temperature
* @returns temperature in °C
*/
int AD7689_GetTemperature();
/**
* Reads channels voltage
* @param ichan channel number from 0 to 7
* @returns channel voltage in mV
*/
int AD7689_GetChannel(int ichan);
/**
* Configure
*/
void AD7689_Configure();

View File

@ -389,6 +389,10 @@ int getADC(enum ADCINDEX ind, int *value);
#else
int getADC(enum ADCINDEX ind);
#endif
#ifdef CHIPTESTBOARDD
int getSlowADC(int ichan);
int getSlowADCTemperature();
#endif
int setHighVoltage(int val);