-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sblib,examples] added some linkerscript examples and a new example w…
…hich shows the usage of the Selfbus library as a bus coupling unit (BCU) with mask version 0x0705. added some debugging configuration files to .gitignore
- Loading branch information
Showing
18 changed files
with
4,043 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,11 @@ | |
*.out | ||
*.app | ||
|
||
# debugging configuration files | ||
*.launch | ||
*.jlink | ||
|
||
|
||
# Build folders | ||
cmake-build* | ||
Debug* | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>example-heliovent-bim112_0x0705</name> | ||
<comment></comment> | ||
<projects> | ||
<project>CMSIS_CORE_LPC11xx</project> | ||
<project>sblib</project> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>org.eclipse.cdt.core.ccnature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
</projectDescription> |
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,7 @@ | ||
BCU BIM112 Maskversion 0x0705 Example | ||
===================================== | ||
|
||
A simple application which shows the usage of the Selfbus library sblib as a bus coupling unit (BCU).<br> | ||
The mask version of this example is 0x0705. | ||
|
||
- links against BIM112_75 version of the sblib library |
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,54 @@ | ||
/**************************************************************************//** | ||
* @addtogroup SBLIB_EXAMPLES Selfbus library usage examples | ||
* @defgroup SBLIB_EXAMPLE_BIM112_HELIOVENT_1 BCU BIM112 Maskversion 0x0705 Example | ||
* @ingroup SBLIB_EXAMPLES | ||
* @brief | ||
* @details | ||
* | ||
* @{ | ||
* | ||
* @file app_heliovent.h | ||
* @author Darthyson <[email protected]> Copyright (c) 2021 | ||
* @bug No known bugs. | ||
******************************************************************************/ | ||
|
||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef APP_RAINCENTER_H_ | ||
#define APP_RAINCENTER_H_ | ||
|
||
#include <sblib/types.h> | ||
|
||
/** | ||
* A communication object was updated from somebody via the EIB bus. | ||
* | ||
* @param objno - the ID of the communication object. | ||
*/ | ||
void objectUpdated(int objno); | ||
|
||
/** | ||
* The value of an input channel changed. | ||
* | ||
* @param channel - the input channel (0..) | ||
* @param value - the new value | ||
*/ | ||
void inputChanged(int channel, int value); | ||
|
||
/** | ||
* Handle the periodic functions. | ||
*/ | ||
void checkPeriodic(void); | ||
|
||
/** | ||
* Initialization of the application | ||
*/ | ||
void initApplication(void); | ||
|
||
|
||
|
||
#endif /* APP_RAINCENTER_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,29 @@ | ||
/**************************************************************************//** | ||
* @addtogroup SBLIB_EXAMPLES Selfbus library usage examples | ||
* @defgroup SBLIB_EXAMPLE_BIM112_HELIOVENT_1 BCU BIM112 Maskversion 0x0705 Example | ||
* @ingroup SBLIB_EXAMPLES | ||
* @brief | ||
* @details | ||
* | ||
* @{ | ||
* | ||
* @file config.h | ||
* @author Darthyson <[email protected]> Copyright (c) 2021 | ||
* @bug No known bugs. | ||
******************************************************************************/ | ||
|
||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef CONFIG_H_ | ||
#define CONFIG_H_ | ||
|
||
|
||
#define HELIOS | ||
// #define VALLOX | ||
|
||
#endif /* CONFIG_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,141 @@ | ||
/**************************************************************************//** | ||
* @addtogroup SBLIB_EXAMPLES Selfbus library usage examples | ||
* @defgroup SBLIB_EXAMPLE_BIM112_HELIOVENT_1 BCU BIM112 Maskversion 0x0705 Example | ||
* @ingroup SBLIB_EXAMPLES | ||
* @brief | ||
* @details | ||
* | ||
* @{ | ||
* | ||
* @file debug.h | ||
* @author Darthyson <[email protected]> Copyright (c) 2021 | ||
* @bug No known bugs. | ||
******************************************************************************/ | ||
|
||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef DEBUG_H_ | ||
#define DEBUG_H_ | ||
|
||
#ifdef DEBUG | ||
|
||
#include <sblib/timeout.h> | ||
|
||
Timeout TX_FlashTimeOut; | ||
Timeout RX_FlashTimeOut; | ||
|
||
|
||
/* | ||
* Handler for the timer_0 interrupt. | ||
*/ | ||
/* | ||
extern "C" void TIMER32_0_IRQHandler() | ||
{ | ||
// Toggle the Info LED | ||
digitalWrite(RX_LED, LED_OFF); | ||
// Clear the timer interrupt flags. Otherwise the interrupt handler is called | ||
// again immediately after returning. | ||
timer32_0.resetFlags(); | ||
timer32_0.end(); | ||
} | ||
*/ | ||
/* | ||
* Handler for the timer_1 interrupt. | ||
*/ | ||
/* | ||
extern "C" void TIMER32_1_IRQHandler() | ||
{ | ||
// Toggle the Info LED | ||
digitalWrite(TX_LED, !digitalRead(TX_LED)); | ||
// Clear the timer interrupt flags. Otherwise the interrupt handler is called | ||
// again immediately after returning. | ||
timer32_1.resetFlags(); | ||
timer32_1.end(); | ||
} | ||
*/ | ||
|
||
void FlashRX_LED(int FlashTime_ms = RX_FLASH_MS) | ||
{ | ||
pinMode(RX_LED, OUTPUT); | ||
digitalWrite(RX_LED, LED_ON); | ||
RX_FlashTimeOut.stop(); | ||
RX_FlashTimeOut.start(FlashTime_ms); | ||
|
||
/* | ||
// Enable the timer interrupt | ||
enableInterrupt(TIMER_32_0_IRQn); | ||
// Begin using the timer | ||
timer32_0.begin(); | ||
// Let the timer count milliseconds | ||
timer32_0.prescaler((SystemCoreClock / 1000) - 1); | ||
// On match of MAT1, generate an interrupt and reset the timer | ||
timer32_0.matchMode(MAT1, RESET | INTERRUPT); | ||
// Match MAT1 when the timer reaches this value (in milliseconds) | ||
timer32_0.match(MAT1, RX_FLASH_MS); | ||
timer32_0.start(); | ||
*/ | ||
} | ||
|
||
void FlashTX_LED(int FlashTime_ms = TX_FLASH_MS) | ||
{ | ||
pinMode(TX_LED, OUTPUT); | ||
digitalWrite(TX_LED, LED_ON); | ||
TX_FlashTimeOut.stop(); | ||
TX_FlashTimeOut.start(FlashTime_ms); | ||
/* | ||
// Enable the timer interrupt | ||
enableInterrupt(TIMER_32_1_IRQn); | ||
// Begin using the timer | ||
timer32_1.begin(); | ||
// Let the timer count milliseconds | ||
timer32_1.prescaler((SystemCoreClock / 1000) - 1); | ||
// On match of MAT1, generate an interrupt and reset the timer | ||
timer32_1.matchMode(MAT1, RESET | INTERRUPT); | ||
// Match MAT1 when the timer reaches this value (in milliseconds) | ||
timer32_1.match(MAT1, TX_FLASH_MS); | ||
timer32_1.start(); | ||
*/ | ||
} | ||
|
||
void debugCheckPeriodic() | ||
{ | ||
if (TX_FlashTimeOut.expired()) | ||
{ | ||
digitalWrite(TX_LED, LED_OFF); | ||
} | ||
|
||
if (RX_FlashTimeOut.expired()) | ||
{ | ||
digitalWrite(RX_LED, LED_OFF); | ||
} | ||
|
||
} | ||
|
||
#else /* DEBUG */ | ||
void FlashRX_LED(){}; | ||
void FlashRX_LED(int FlashTime_ms){}; | ||
void FlashTX_LED(){}; | ||
void FlashTX_LED(int FlashTime_ms){}; | ||
void debugCheckPeriodic(){}; | ||
#endif | ||
|
||
|
||
|
||
#endif /* DEBUG_H_ */ | ||
/** @}*/ |
Oops, something went wrong.