|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|

Go to the source code of this file.
Functions | |
| static void | InitSound () |
| Initializes sound hardware and state. More... | |
| void | PlayNote (uint8_t note, uint8_t duration) |
| Plays a single note. More... | |
| void | PlaySequence (uint8_t *seq) |
| Plays a sequence of notes. More... | |
| void | PlayTone (uint16_t tone, uint8_t duration) |
| Plays a single tone. More... | |
| static void | SndTimerCallback () |
| Must be called by system timer (10ms) More... | |
| void | SndToneOff (void) |
| Stops playing a tone. More... | |
| void | SndToneOn (uint16_t tone) |
| Starts playing a tone. More... | |
Variables | |
| uint8_t * | musicPtr |
| Is used in the timer callback to play sequences. More... | |
| uint8_t | sndBigBenSeq [] |
| Big Ben Tone sequence. More... | |
| uint8_t | sndErrorSeq [] |
| Tone sequence for error messages. More... | |
| uint8_t | sndSeqPlaying |
| Is !=0 while a sequence is playing. More... | |
| uint8_t | sndSig1 [] |
| Sequence for alert output 1. More... | |
| uint8_t | sndSig2 [] |
| Sequence for alert output 2. More... | |
| uint8_t | sndSuccessSeq [] |
| Tone sequence for success. More... | |
| uint8_t | sndToneCnt |
| Down-counter for tone duration. Can be tested to 0 to wait for end of tone. More... | |
|
inlinestatic |
Initializes sound hardware and state.
References musicPtr, sndSeqPlaying, and sndToneCnt.
Referenced by Init().

| void PlayNote | ( | uint8_t | note, |
| uint8_t | duration | ||
| ) |
Plays a single note.
| note | The note as a midi value (e.g. A4 (440Hz) = 69) |
| duration | Length in multiple of 10ms |
The note value "0" can be used to play silence. Notes from 57 to 117 can be used. Other values produce undefined tones.
References midiOffset, and PlayTone().
Referenced by PlaySequence(), and SndTimerCallback().


| void PlaySequence | ( | uint8_t * | seq | ) |
Plays a sequence of notes.
| seq | a pointer to the note data |
The data format is one byte note and one byte duration. The data has to be terminated with 0x00 0x00
References musicPtr, and PlayNote().
Referenced by DoTflags(), and main().


| void PlayTone | ( | uint16_t | tone, |
| uint8_t | duration | ||
| ) |
Plays a single tone.
| tone | The value of the timer period register (OCR3A) |
| duration | Length in multiple of 10ms |
The frequency of the tone is 3.6864MHz/(tone+1) A tone value 0 plays silence for the given duration
References sndToneCnt, SndToneOff(), and SndToneOn().
Referenced by PlayNote().


|
inlinestatic |
Must be called by system timer (10ms)
References musicPtr, PlayNote(), sndToneCnt, and SndToneOff().
Referenced by ISR().


|
inline |
Stops playing a tone.
Referenced by PlayTone(), and SndTimerCallback().

|
inline |
Starts playing a tone.
| tone | The value of the timer period register (OCR3A) |
The frequency of the tone is 3.6864MHz/(tone+1)
Referenced by PlayTone().

| uint8_t* musicPtr |
Is used in the timer callback to play sequences.
Referenced by InitSound(), PlaySequence(), and SndTimerCallback().
| uint8_t sndBigBenSeq[] |
Big Ben Tone sequence.
Referenced by DoTflags().
| uint8_t sndErrorSeq[] |
Tone sequence for error messages.
| uint8_t sndSeqPlaying |
Is !=0 while a sequence is playing.
Referenced by InitSound().
| uint8_t sndSig1[] |
Sequence for alert output 1.
Referenced by DoTflags().
| uint8_t sndSig2[] |
Sequence for alert output 2.
Referenced by DoTflags().
| uint8_t sndSuccessSeq[] |
Tone sequence for success.
Referenced by main().
| uint8_t sndToneCnt |
Down-counter for tone duration. Can be tested to 0 to wait for end of tone.
Referenced by InitSound(), PlayTone(), and SndTimerCallback().
1.8.15