-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new epaper driver add support for Buzz 2 Click & LED 3 Driver Click always overflow embedded system time 5 minutes after boot, for reliability testing fix for posix system time breaking upon SNTP updates
- Loading branch information
Showing
64 changed files
with
2,670 additions
and
118 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
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 @@ | ||
# Global config --------------------------------------------------------------- | ||
cmake_minimum_required (VERSION 3.11) | ||
project (cascoda-buzz2-click) | ||
|
||
# Main library config --------------------------------------------------------- | ||
add_library(buzz2 | ||
${PROJECT_SOURCE_DIR}/source/buzz2_click_test.c | ||
${PROJECT_SOURCE_DIR}/source/buzz2_click_main.c | ||
) | ||
|
||
target_include_directories(buzz2 | ||
PUBLIC | ||
${PROJECT_SOURCE_DIR}/include | ||
) | ||
|
||
target_link_libraries(buzz2 | ||
PUBLIC | ||
cascoda-bm | ||
mikrosdk-click | ||
) | ||
|
||
# Test app config ------------------------------------------------------------- | ||
add_executable(buzz2-click ${PROJECT_SOURCE_DIR}/source/buzz2_click_main.c) | ||
target_link_libraries(buzz2-click buzz2 cascoda-bm) | ||
|
||
# convert to bin file format | ||
cascoda_make_binary(buzz2-click CASCODA_BUILD_BINARIES) |
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,47 @@ | ||
/* | ||
* Copyright (c) 2023, Cascoda Ltd. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of the copyright holder nor the | ||
* names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
/** | ||
* @file | ||
* | ||
* @brief Test for buzz2 click | ||
*/ | ||
|
||
#ifndef BUZZ2_CLICK_TEST_H | ||
#define BUZZ2_CLICK_TEST_H | ||
|
||
#include "ca821x_error.h" | ||
|
||
#include <stdint.h> | ||
|
||
/* | ||
Function which kicks off the demo. | ||
*/ | ||
ca_error buzz2_play_one_note(void); | ||
ca_error buzz2_ascending_scale(void); | ||
|
||
#endif // BUZZ2_CLICK_TEST_H |
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,77 @@ | ||
|
||
/* | ||
* Copyright (c) 2023, Cascoda Ltd. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of the copyright holder nor the | ||
* names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
/** | ||
* @file | ||
* | ||
* @brief Demo application which uses PWM to dim an LED to various brightness levels | ||
*/ | ||
|
||
#include "buzz2_click.h" | ||
#include "buzz2_click_test.h" | ||
|
||
#include "cascoda-bm/cascoda_evbme.h" | ||
#include "cascoda-bm/cascoda_ota_upgrade.h" | ||
#include "cascoda-bm/cascoda_serial.h" | ||
#include "cascoda-bm/test15_4_evbme.h" | ||
#include "ca821x_api.h" | ||
|
||
#include <stdlib.h> | ||
|
||
/******************************************************************************/ | ||
/***************************************************************************/ /** | ||
* \brief Main Program Endless Loop | ||
******************************************************************************* | ||
* \return Does not return | ||
******************************************************************************* | ||
******************************************************************************/ | ||
int main(void) | ||
{ | ||
struct ca821x_dev dev; | ||
ca821x_api_init(&dev); | ||
|
||
/* Initialisation of Chip and EVBME */ | ||
/* Returns a Status of CA_ERROR_SUCCESS/CA_ERROR_FAIL for further Action */ | ||
/* in case there is no UpStream Communications Channel available */ | ||
EVBMEInitialise(CA_TARGET_NAME, &dev); | ||
|
||
/* Insert Application-Specific Initialisation Routines here */ | ||
MIKROSDK_BUZZ2_Initialise(); | ||
|
||
#if CASCODA_OTA_UPGRADE_ENABLED | ||
/* Initialises handling of OTA Firmware Upgrade */ | ||
ota_upgrade_init(); | ||
#endif | ||
|
||
/* Endless Polling Loop */ | ||
while (1) | ||
{ | ||
cascoda_io_handler(&dev); | ||
buzz2_ascending_scale(); | ||
} /* while(1) */ | ||
} |
140 changes: 140 additions & 0 deletions
140
baremetal/app/buzz2-click-test/source/buzz2_click_test.c
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,140 @@ | ||
/* | ||
* Copyright (c) 2023, Cascoda Ltd. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of the copyright holder nor the | ||
* names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
/** | ||
* @file | ||
* | ||
* @brief Test for buzz2 click | ||
*/ | ||
|
||
#include "buzz2_click_test.h" | ||
#include "buzz2_click.h" | ||
|
||
#include "cascoda-bm/cascoda_sensorif.h" | ||
#include "cascoda-util/cascoda_tasklet.h" | ||
|
||
static bool g_play_one_note_done = false; | ||
static bool g_ascending_scale_done = false; | ||
|
||
ca_error buzz2_play_one_note(void) | ||
{ | ||
if (!g_play_one_note_done) | ||
{ | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E5, 1, 250, NON_BLOCKING); | ||
g_play_one_note_done = true; | ||
} | ||
} | ||
|
||
ca_error buzz2_ascending_scale(void) | ||
{ | ||
if (!g_ascending_scale_done) | ||
{ | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B2, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B3, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B4, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B5, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B6, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_D7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_F7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_G7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B7, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_C8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Db8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Eb8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_E8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Gb8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Ab8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_A8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_Bb8, 1, 50, BLOCKING); | ||
MIKROSDK_BUZZ2_play_note(BUZZ2_NOTE_B8, 1, 50, BLOCKING); | ||
g_ascending_scale_done = true; | ||
} | ||
} |
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
Oops, something went wrong.