-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working TimerOc for Raman pulses. Initial MiniG experimental Setup wi…
…th MOT and PCG and Imagining
- Loading branch information
Bola Malek
committed
Jul 20, 2018
1 parent
d2b7667
commit 41dc879
Showing
12 changed files
with
963 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef TIMER_OC_H | ||
#define TIMER_OC_H | ||
|
||
#include "platform/platform.h" | ||
|
||
#include "platform/mbed_critical.h" | ||
#include "platform/mbed_power_mgmt.h" | ||
#include "timer_oc_api.h" | ||
|
||
class TimerOc { | ||
|
||
public: | ||
/** Create a TimerOc connected to the specified pin | ||
* | ||
* @param pin TimerOc pin to connect to | ||
*/ | ||
TimerOc(PinName pin) : _deep_sleep_locked(false) { | ||
core_util_critical_section_enter(); | ||
timer_oc_init(&_timer_oc, pin); | ||
core_util_critical_section_exit(); | ||
} | ||
|
||
~TimerOc() { | ||
core_util_critical_section_enter(); | ||
unlock_deep_sleep(); | ||
core_util_critical_section_exit(); | ||
} | ||
|
||
/** Set the ouput duty-cycle, specified as a percentage (float) | ||
* | ||
* @param value A floating-point value representing the output duty-cycle, | ||
* specified as a percentage. The value should lie between | ||
* 0.0f (representing on 0%) and 1.0f (representing on 100%). | ||
* Values outside this range will be saturated to 0.0f or 1.0f. | ||
*/ | ||
void start(int period_us, int num_repetitions, uint32_t *ticks) { | ||
core_util_critical_section_enter(); | ||
lock_deep_sleep(); | ||
timer_oc_start(&_timer_oc, period_us, num_repetitions, ticks); | ||
core_util_critical_section_exit(); | ||
} | ||
|
||
void stop() { | ||
printf("before cs\n"); | ||
core_util_critical_section_enter(); | ||
lock_deep_sleep(); | ||
timer_oc_stop(&_timer_oc); | ||
core_util_critical_section_exit(); | ||
} | ||
|
||
protected: | ||
/** Lock deep sleep only if it is not yet locked */ | ||
void lock_deep_sleep() { | ||
if (_deep_sleep_locked == false) { | ||
sleep_manager_lock_deep_sleep(); | ||
_deep_sleep_locked = true; | ||
} | ||
} | ||
|
||
/** Unlock deep sleep in case it is locked */ | ||
void unlock_deep_sleep() { | ||
if (_deep_sleep_locked == true) { | ||
sleep_manager_unlock_deep_sleep(); | ||
_deep_sleep_locked = false; | ||
} | ||
} | ||
|
||
timer_oc_t _timer_oc; | ||
bool _deep_sleep_locked; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
coils_ D43 | ||
liquid_crystal_1_ D44 | ||
under_vac_shutter_ D46 | ||
ao_2_ D47 | ||
ao_3_ D48 | ||
cooling_shutter_ D49 | ||
mot_eo_ D50 | ||
raman_eo_ D51 | ||
m_horn_switch_ D52 | ||
m_lock_ D53 | ||
analog_trigger_ D54 | ||
dds_switch_ D56 | ||
dds_trigger_1_ D57 | ||
dds_trigger_2_ D58 | ||
oscillscope_trigger_ D59 | ||
camera_ttl_ D60 | ||
ao1_freq_ OUT0} | ||
ao2_atten_ OUT1} | ||
ao3_atten_ OUT2} | ||
z_field_ OUT3} | ||
ns_field_ OUT4} | ||
we_field_ OUT5} | ||
eo_freq_ OUT6} | ||
bias_field_ OUT7} | ||
laser_jump_ OUT8} | ||
photodiode_ IN0} | ||
|
Oops, something went wrong.