Major updates:
- added DAConverter(s) - added ADConverter(s) - Fixed some display issues - Made repair process and signalProfileGenerator calculate with voltages (signed) instead of DAC/ADC values - Fixed several bugs in task handlings - Put display data mirror into dedicated file displaycontent git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@261 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
static ErrorStatus channelWrite(const struct DACDevice* self, uint32_t voltage);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
@@ -163,6 +163,11 @@ ErrorStatus MAX5715Channel_construct(struct MAX5715_DAC* self, struct MAX5715* p
|
||||
self->parent = parent;
|
||||
self->value = 0;
|
||||
self->initialized = true;
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
returnValue = DACDevice_construct(&self->dacDevice, channelWrite, MAX5715_RESOLUTION_IN_BITS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -208,3 +213,11 @@ ErrorStatus MAX5715Channel_setValue(const struct MAX5715_DAC* self, uint16_t val
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static ErrorStatus channelWrite(const struct DACDevice* self, uint32_t voltage)
|
||||
{
|
||||
// MASK the uint32_t DAC value (voltage) with the resolution of the MAX5715 DAC
|
||||
return MAX5715Channel_setValue((struct MAX5715_DAC*)self, (((1 << MAX5715_RESOLUTION_IN_BITS) - 1) & voltage));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user