Skip to content

Commit

Permalink
[sblib,examples] added some linkerscript examples and a new example w…
Browse files Browse the repository at this point in the history
…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
Darthyson committed Oct 19, 2021
1 parent f6eda72 commit 0fd7c8f
Show file tree
Hide file tree
Showing 18 changed files with 4,043 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
*.out
*.app

# debugging configuration files
*.launch
*.jlink


# Build folders
cmake-build*
Debug*
Expand Down
1,215 changes: 1,215 additions & 0 deletions examples/example-heliovent-bim112/.cproject

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions examples/example-heliovent-bim112/.project
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>
7 changes: 7 additions & 0 deletions examples/example-heliovent-bim112/README.md
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
54 changes: 54 additions & 0 deletions examples/example-heliovent-bim112/inc/app_heliovent.h
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_ */
/** @}*/
29 changes: 29 additions & 0 deletions examples/example-heliovent-bim112/inc/config.h
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_ */
/** @}*/
141 changes: 141 additions & 0 deletions examples/example-heliovent-bim112/inc/debug.h
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_ */
/** @}*/
Loading

0 comments on commit 0fd7c8f

Please sign in to comment.