Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UIT2_MovingAverage UIT2_AllpassReverb UIT2_CombReverb UIT2_FIR_LPF_Symmetry ... more
Diff: DAC_MCP4922.cpp
- Revision:
- 18:0bfced9d5526
- Parent:
- 17:fd4f92ad4323
- Child:
- 19:900efc6796d4
--- a/DAC_MCP4922.cpp Thu Jan 29 05:52:57 2015 +0000
+++ b/DAC_MCP4922.cpp Thu Jan 29 07:55:04 2015 +0000
@@ -37,32 +37,6 @@
while (IsBusy()) {}
}
- void DAC_MCP4922::Write(float value)
- {
- if (value < -1.0f) value = -1.0f;
- if (value > 1.0f) value = 1.0f;
-
- WriteDac((uint16_t)((value + 1.0f)*2047));
- }
-
- void DAC_MCP4922::Write(uint16_t value)
- {
- WriteDac((value > 4095) ? 4095 : value);
- }
-
- void DAC_MCP4922::Ldac()
- {
- ld_.write(0);
- ld_.write(0); // ensure width of "L" pulse
- ld_.write(1);
- }
-
- void DAC_MCP4922::WriteDac(uint16_t value)
- {
- ss_->SlaveSelect();
- mySpi_->DR = value | wcr_;
- }
-
void DAC_MCP4922::ScfClockTim3(uint32_t clock, PinName pin)
{
if ( (pin != PA_6) && (pin != PB_4) && (pin != PB_5) &&
@@ -87,3 +61,4 @@
TIM3->CCR4 = (TIM3->ARR + 1)/2;
}
}
+