lots of stuff
This commit is contained in:
@@ -49,10 +49,10 @@ void dds_setFrequency(dds_t *dds, uint32_t frequency)
|
||||
data[3] = (uint8_t)(freq_hi & 0x00ff);
|
||||
|
||||
// send Control word to hold setup
|
||||
sendCommand(dds, FRQ_CTRL_WORD1, data, sizeof(data));
|
||||
sendCommand(dds, FRQ_CTRL_WORD1 | (dds->ddsMode == DDS_TRIANGLE ? 0x0002 : 0x0000), data, sizeof(data));
|
||||
|
||||
// send Control word to release setup
|
||||
sendCommand(dds, FRQ_CTRL_WORD2, NULL, 0);
|
||||
sendCommand(dds, FRQ_CTRL_WORD2 | (dds->ddsMode == DDS_TRIANGLE ? 0x0002 : 0x0000), NULL, 0);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -62,10 +62,11 @@ void dds_setFrequency(dds_t *dds, uint32_t frequency)
|
||||
|
||||
}
|
||||
|
||||
void dds_init(dds_t *dds, SPI_MODE_t mode, gpio_pin_t resetPin)
|
||||
void dds_init(dds_t *dds, SPI_MODE_t mode, gpio_pin_t resetPin, dds_mode_t ddsMode)
|
||||
{
|
||||
dds->mode = mode;
|
||||
dds->resetPin = resetPin;
|
||||
dds->ddsMode = ddsMode;
|
||||
|
||||
dds_reset(dds, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user