This commit is contained in:
2018-02-03 11:54:22 +01:00
parent 96a7b58091
commit 611b38c5e6
39 changed files with 260 additions and 487 deletions
-21
View File
@@ -1,21 +0,0 @@
//
// Created by MightyPork on 2018/02/03.
//
#ifndef GEX_F072_DIN_EXTI_H
#define GEX_F072_DIN_EXTI_H
#ifndef DIN_INTERNAL
#error bad include!
#endif
#include "unit_base.h"
/**
* EXTI callback for pin change interrupts
*
* @param arg - the unit is passed here
*/
void DIn_handleExti(void *arg);
#endif //GEX_F072_DIN_EXTI_H
-20
View File
@@ -1,20 +0,0 @@
//
// Created by MightyPork on 2018/02/03.
//
#ifndef GEX_F072_DIN_INIT_H
#define GEX_F072_DIN_INIT_H
#ifndef DIN_INTERNAL
#error bad include!
#endif
#include "unit_base.h"
/** Finalize unit set-up */
error_t DIn_init(Unit *unit);
/** Tear down the unit */
void DIn_deInit(Unit *unit);
#endif //GEX_F072_DIN_INIT_H
+34
View File
@@ -28,4 +28,38 @@ struct priv {
GPIO_TypeDef *port;
};
/** Allocate data structure and set defaults */
error_t DIn_preInit(Unit *unit);
/** Load from a binary buffer stored in Flash */
void DIn_loadBinary(Unit *unit, PayloadParser *pp);
/** Write to a binary buffer for storing in Flash */
void DIn_writeBinary(Unit *unit, PayloadBuilder *pb);
// ------------------------------------------------------------------------
/** Parse a key-value pair from the INI file */
error_t DIn_loadIni(Unit *unit, const char *key, const char *value);
/** Generate INI file section for the unit */
void DIn_writeIni(Unit *unit, IniWriter *iw);
// ------------------------------------------------------------------------
/** Finalize unit set-up */
error_t DIn_init(Unit *unit);
/** Tear down the unit */
void DIn_deInit(Unit *unit);
// ------------------------------------------------------------------------
/**
* EXTI callback for pin change interrupts
*
* @param arg - the unit is passed here
*/
void DIn_handleExti(void *arg);
#endif //GEX_F072_DIN_INTERNAL_H
-31
View File
@@ -1,31 +0,0 @@
//
// Created by MightyPork on 2018/02/03.
//
#ifndef GEX_F072_DIN_SETTINGS_H
#define GEX_F072_DIN_SETTINGS_H
#ifndef DIN_INTERNAL
#error bad include!
#endif
#include "unit_base.h"
/** Allocate data structure and set defaults */
error_t DIn_preInit(Unit *unit);
/** Load from a binary buffer stored in Flash */
void DIn_loadBinary(Unit *unit, PayloadParser *pp);
/** Write to a binary buffer for storing in Flash */
void DIn_writeBinary(Unit *unit, PayloadBuilder *pb);
// ------------------------------------------------------------------------
/** Parse a key-value pair from the INI file */
error_t DIn_loadIni(Unit *unit, const char *key, const char *value);
/** Generate INI file section for the unit */
void DIn_writeIni(Unit *unit, IniWriter *iw);
#endif //GEX_F072_DIN_SETTINGS_H