From cd621408033f82e65d38e258b684e1acf4a20a98 Mon Sep 17 00:00:00 2001 From: WesleyAC Date: Fri, 12 Jan 2024 00:54:09 +0000 Subject: [PATCH] deploy: 07e45acba7c47748a382ef63ab35b04dd22bdc9b --- dir_280ec1f3fe74f12cdd5c78898ed1ca3c.html | 2 + files.html | 15 +-- group__buzzer.html | 3 + search/all_7.js | 2 +- search/variables_0.js | 2 +- watch__buzzer_8h_source.html | 18 ++-- watch__private__buzzer_8h_source.html | 120 ++++++++++++++++++++++ 7 files changed, 145 insertions(+), 17 deletions(-) create mode 100644 watch__private__buzzer_8h_source.html diff --git a/dir_280ec1f3fe74f12cdd5c78898ed1ca3c.html b/dir_280ec1f3fe74f12cdd5c78898ed1ca3c.html index a9e6e3e6..33e3d664 100644 --- a/dir_280ec1f3fe74f12cdd5c78898ed1ca3c.html +++ b/dir_280ec1f3fe74f12cdd5c78898ed1ca3c.html @@ -100,6 +100,8 @@ Files   file  watch_private.h [code]   +file  watch_private_buzzer.h [code] +  file  watch_private_display.h [code]   file  watch_rtc.h [code] diff --git a/files.html b/files.html index 3b404e6e..9e024179 100644 --- a/files.html +++ b/files.html @@ -88,13 +88,14 @@ $(function() {  watch_i2c.h  watch_led.h  watch_private.h - watch_private_display.h - watch_rtc.h - watch_slcd.h - watch_spi.h - watch_storage.h - watch_uart.h - watch_utility.h + watch_private_buzzer.h + watch_private_display.h + watch_rtc.h + watch_slcd.h + watch_spi.h + watch_storage.h + watch_uart.h + watch_utility.h diff --git a/group__buzzer.html b/group__buzzer.html index 6bd9bf32..b307e566 100644 --- a/group__buzzer.html +++ b/group__buzzer.html @@ -231,6 +231,9 @@ void watch_set_buzzer_off< void watch_buzzer_play_sequence (int8_t *note_sequence, void(*callback_on_end)(void))  Plays the given sequence of notes in a non-blocking way. More...
  + +uint16_t sequence_length (int8_t *sequence) +  void watch_buzzer_abort_sequence (void)  Aborts a playing sequence.
diff --git a/search/all_7.js b/search/all_7.js index c27770eb..6630e52e 100644 --- a/search/all_7.js +++ b/search/all_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['noteperiods_0',['NotePeriods',['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.c'],['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.c']]] + ['noteperiods_0',['NotePeriods',['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.h'],['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.h']]] ]; diff --git a/search/variables_0.js b/search/variables_0.js index c27770eb..6630e52e 100644 --- a/search/variables_0.js +++ b/search/variables_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['noteperiods_0',['NotePeriods',['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.c'],['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.c']]] + ['noteperiods_0',['NotePeriods',['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.h'],['../group__buzzer.html#ga747b4014093d6a71b6d8fba2db41696b',1,'NotePeriods(): watch_private_buzzer.h']]] ]; diff --git a/watch__buzzer_8h_source.html b/watch__buzzer_8h_source.html index 4c42966a..28a4d03f 100644 --- a/watch__buzzer_8h_source.html +++ b/watch__buzzer_8h_source.html @@ -213,20 +213,22 @@ $(function() {
162
176void watch_buzzer_play_sequence(int8_t *note_sequence, void (*callback_on_end)(void));
177
- -
181
-
182#ifndef __EMSCRIPTEN__
-
183void TC3_Handler(void);
-
184#endif
-
185
-
187#endif
+
178uint16_t sequence_length(int8_t *sequence);
+
179
+ +
183
+
184#ifndef __EMSCRIPTEN__
+
185void TC3_Handler(void);
+
186#endif
+
187
+
189#endif
void watch_buzzer_play_note(BuzzerNote note, uint16_t duration_ms)
Plays the given note for a set duration.
BuzzerNote
87 notes for use with watch_buzzer_play_note
Definition: watch_buzzer.h:61
void watch_disable_buzzer(void)
Disables the TCC peripheral that drives the buzzer.
void watch_set_buzzer_on(void)
Turns the buzzer output on. It will emit a continuous sound at the given frequency.
void watch_buzzer_play_sequence(int8_t *note_sequence, void(*callback_on_end)(void))
Plays the given sequence of notes in a non-blocking way.
void watch_buzzer_abort_sequence(void)
Aborts a playing sequence.
-
const uint16_t NotePeriods[108]
An array of periods for all the notes on a piano, corresponding to the names in BuzzerNote.
Definition: watch_private_buzzer.c:28
+
const uint16_t NotePeriods[108]
An array of periods for all the notes on a piano, corresponding to the names in BuzzerNote.
Definition: watch_private_buzzer.h:29
void watch_set_buzzer_period(uint32_t period)
Sets the period of the buzzer.
void watch_set_buzzer_off(void)
Turns the buzzer output off.
void watch_enable_buzzer(void)
Enables the TCC peripheral, which drives the buzzer.
diff --git a/watch__private__buzzer_8h_source.html b/watch__private__buzzer_8h_source.html new file mode 100644 index 00000000..fde4b853 --- /dev/null +++ b/watch__private__buzzer_8h_source.html @@ -0,0 +1,120 @@ + + + + + + + +Sensor Watch: watch-library/shared/watch/watch_private_buzzer.h Source File + + + + + + + + + +
+
+ + + + + + +
+
Sensor Watch 0.0.2 +
+
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
watch_private_buzzer.h
+
+
+
1/*
+
2 * MIT License
+
3 *
+
4 * Copyright (c) 2023 Wesley Aptekar-Cassels
+
5 *
+
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
+
7 * of this software and associated documentation files (the "Software"), to deal
+
8 * in the Software without restriction, including without limitation the rights
+
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+
10 * copies of the Software, and to permit persons to whom the Software is
+
11 * furnished to do so, subject to the following conditions:
+
12 *
+
13 * The above copyright notice and this permission notice shall be included in all
+
14 * copies or substantial portions of the Software.
+
15 *
+
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
22 * SOFTWARE.
+
23 */
+
24#ifndef _WATCH_PRIVATE_BUZZER_H_INCLUDED
+
25#define _WATCH_PRIVATE_BUZZER_H_INCLUDED
+
26
+
27// note: the buzzer uses a 1 MHz clock. these values were determined by dividing 1,000,000 by the target frequency.
+
28// i.e. for a 440 Hz tone (A4 on the piano), 1MHz/440Hz = 2273
+
29const uint16_t NotePeriods[108] = {18182,17161,16197,15288,14430,13620,12857,12134,11453,10811,10204,9631,9091,8581,8099,7645,7216,6811,6428,6068,5727,5405,5102,4816,4545,4290,4050,3822,3608,3405,3214,3034,2863,2703,2551,2408,2273,2145,2025,1911,1804,1703,1607,1517,1432,1351,1276,1204,1136,1073,1012,956,902,851,804,758,716,676,638,602,568,536,506,478,451,426,402,379,358,338,319,301,284,268,253,239,225,213,201,190,179,169,159,150,142,134,127};
+
30
+
31uint16_t sequence_length(int8_t *sequence);
+
32
+
33#endif
+
const uint16_t NotePeriods[108]
An array of periods for all the notes on a piano, corresponding to the names in BuzzerNote.
Definition: watch_private_buzzer.h:29
+
+ + + +