din renames, dout split
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#include "platform.h"
|
||||
#include "unit_base.h"
|
||||
#include "unit_dout.h"
|
||||
|
||||
#define DOUT_INTERNAL
|
||||
#include "_dout_internal.h"
|
||||
|
||||
error_t UU_DOut_Write(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
uint16_t set = spread;
|
||||
uint16_t reset = ((~spread) & mask);
|
||||
priv->port->BSRR = set | (reset << 16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DOut_Set(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
priv->port->BSRR = spread;
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DOut_Clear(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
priv->port->BSRR = (spread<<16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DOut_Toggle(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
uint16_t flipped = (uint16_t) (~priv->port->ODR) & mask;
|
||||
uint16_t set = flipped & spread;
|
||||
uint16_t reset = ((~flipped) & mask) & spread;
|
||||
priv->port->BSRR = set | (reset<<16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DOut_GetPinCount(Unit *unit, uint8_t *count)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
uint32_t packed = pinmask_pack(0xFFFF, priv->pins);
|
||||
*count = (uint8_t)(32 - __CLZ(packed));
|
||||
return E_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#include "platform.h"
|
||||
#include "unit_base.h"
|
||||
|
||||
#define DOUT_INTERNAL
|
||||
#include "_dout_internal.h"
|
||||
#include "_dout_init.h"
|
||||
|
||||
/** Allocate data structure and set defaults */
|
||||
error_t DOut_preInit(Unit *unit)
|
||||
{
|
||||
struct priv *priv = unit->data = calloc_ck(1, sizeof(struct priv));
|
||||
if (priv == NULL) return E_OUT_OF_MEM;
|
||||
|
||||
// some defaults
|
||||
priv->port_name = 'A';
|
||||
priv->pins = 0x0001;
|
||||
priv->open_drain = 0x0000;
|
||||
priv->initial = 0x0000;
|
||||
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Finalize unit set-up */
|
||||
error_t DOut_init(Unit *unit)
|
||||
{
|
||||
bool suc = true;
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
priv->initial &= priv->pins;
|
||||
priv->open_drain &= priv->pins;
|
||||
|
||||
// --- Parse config ---
|
||||
priv->port = hw_port2periph(priv->port_name, &suc);
|
||||
if (!suc) return E_BAD_CONFIG;
|
||||
|
||||
// Claim all needed pins
|
||||
TRY(rsc_claim_gpios(unit, priv->port_name, priv->pins));
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (priv->pins & (1 << i)) {
|
||||
uint32_t ll_pin = hw_pin2ll((uint8_t) i, &suc);
|
||||
|
||||
// --- Init hardware ---
|
||||
LL_GPIO_SetPinMode(priv->port, ll_pin, LL_GPIO_MODE_OUTPUT);
|
||||
LL_GPIO_SetPinOutputType(priv->port, ll_pin,
|
||||
(priv->open_drain & (1 << i)) ? LL_GPIO_OUTPUT_OPENDRAIN : LL_GPIO_OUTPUT_PUSHPULL);
|
||||
LL_GPIO_SetPinSpeed(priv->port, ll_pin, LL_GPIO_SPEED_FREQ_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the initial state
|
||||
priv->port->ODR &= ~priv->pins;
|
||||
priv->port->ODR |= priv->initial;
|
||||
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Tear down the unit */
|
||||
void DOut_deInit(Unit *unit)
|
||||
{
|
||||
// pins are de-inited during teardown
|
||||
|
||||
// Release all resources
|
||||
rsc_teardown(unit);
|
||||
|
||||
// Free memory
|
||||
free_ck(unit->data);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#ifndef GEX_F072_DOUT_INIT_H
|
||||
#define GEX_F072_DOUT_INIT_H
|
||||
|
||||
#ifndef DOUT_INTERNAL
|
||||
#error bad include!
|
||||
#endif
|
||||
|
||||
#include "unit_base.h"
|
||||
|
||||
/** Finalize unit set-up */
|
||||
error_t DOut_init(Unit *unit);
|
||||
|
||||
/** Tear down the unit */
|
||||
void DOut_deInit(Unit *unit);
|
||||
|
||||
#endif //GEX_F072_DOUT_INIT_H
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#ifndef GEX_F072_DOUT_INTERNAL_H
|
||||
#define GEX_F072_DOUT_INTERNAL_H
|
||||
|
||||
#ifndef DOUT_INTERNAL
|
||||
#error bad include!
|
||||
#endif
|
||||
|
||||
#include "unit_base.h"
|
||||
|
||||
/** Private data structure */
|
||||
struct priv {
|
||||
char port_name;
|
||||
uint16_t pins; // pin mask
|
||||
uint16_t initial; // initial pin states
|
||||
uint16_t open_drain; // open drain pins
|
||||
|
||||
GPIO_TypeDef *port;
|
||||
};
|
||||
|
||||
#endif //GEX_F072_DOUT_INTERNAL_H
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#include "platform.h"
|
||||
#include "unit_base.h"
|
||||
|
||||
#define DOUT_INTERNAL
|
||||
#include "_dout_internal.h"
|
||||
#include "_dout_settings.h"
|
||||
|
||||
/** Load from a binary buffer stored in Flash */
|
||||
void DOut_loadBinary(Unit *unit, PayloadParser *pp)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
uint8_t version = pp_u8(pp);
|
||||
(void)version;
|
||||
|
||||
priv->port_name = pp_char(pp);
|
||||
priv->pins = pp_u16(pp);
|
||||
priv->initial = pp_u16(pp);
|
||||
priv->open_drain = pp_u16(pp);
|
||||
}
|
||||
|
||||
/** Write to a binary buffer for storing in Flash */
|
||||
void DOut_writeBinary(Unit *unit, PayloadBuilder *pb)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
pb_u8(pb, 0); // version
|
||||
|
||||
pb_char(pb, priv->port_name);
|
||||
pb_u16(pb, priv->pins);
|
||||
pb_u16(pb, priv->initial);
|
||||
pb_u16(pb, priv->open_drain);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/** Parse a key-value pair from the INI file */
|
||||
error_t DOut_loadIni(Unit *unit, const char *key, const char *value)
|
||||
{
|
||||
bool suc = true;
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
if (streq(key, "port")) {
|
||||
suc = parse_port_name(value, &priv->port_name);
|
||||
}
|
||||
else if (streq(key, "pins")) {
|
||||
priv->pins = parse_pinmask(value, &suc);
|
||||
}
|
||||
else if (streq(key, "initial")) {
|
||||
priv->initial = parse_pinmask(value, &suc);
|
||||
}
|
||||
else if (streq(key, "open-drain")) {
|
||||
priv->open_drain = parse_pinmask(value, &suc);
|
||||
}
|
||||
else {
|
||||
return E_BAD_KEY;
|
||||
}
|
||||
|
||||
if (!suc) return E_BAD_VALUE;
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Generate INI file section for the unit */
|
||||
void DOut_writeIni(Unit *unit, IniWriter *iw)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
iw_comment(iw, "Port name");
|
||||
iw_entry(iw, "port", "%c", priv->port_name);
|
||||
|
||||
iw_comment(iw, "Pins (comma separated, supports ranges)");
|
||||
iw_entry(iw, "pins", "%s", pinmask2str(priv->pins, unit_tmp512));
|
||||
|
||||
iw_comment(iw, "Initially high pins");
|
||||
iw_entry(iw, "initial", "%s", pinmask2str(priv->initial, unit_tmp512));
|
||||
|
||||
iw_comment(iw, "Open-drain pins");
|
||||
iw_entry(iw, "open-drain", "%s", pinmask2str(priv->open_drain, unit_tmp512));
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Created by MightyPork on 2018/02/03.
|
||||
//
|
||||
|
||||
#ifndef GEX_F072_DOUT_SETTINGS_H
|
||||
#define GEX_F072_DOUT_SETTINGS_H
|
||||
|
||||
#ifndef DOUT_INTERNAL
|
||||
#error bad include!
|
||||
#endif
|
||||
|
||||
#include "unit_base.h"
|
||||
|
||||
/** Allocate data structure and set defaults */
|
||||
error_t DOut_preInit(Unit *unit);
|
||||
|
||||
/** Load from a binary buffer stored in Flash */
|
||||
void DOut_loadBinary(Unit *unit, PayloadParser *pp);
|
||||
|
||||
/** Write to a binary buffer for storing in Flash */
|
||||
void DOut_writeBinary(Unit *unit, PayloadBuilder *pb);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/** Parse a key-value pair from the INI file */
|
||||
error_t DOut_loadIni(Unit *unit, const char *key, const char *value);
|
||||
|
||||
/** Generate INI file section for the unit */
|
||||
void DOut_writeIni(Unit *unit, IniWriter *iw);
|
||||
|
||||
#endif //GEX_F072_DOUT_SETTINGS_H
|
||||
+17
-227
@@ -2,223 +2,12 @@
|
||||
// Created by MightyPork on 2017/11/25.
|
||||
//
|
||||
|
||||
#include "comm/messages.h"
|
||||
#include "unit_base.h"
|
||||
#include "unit_dout.h"
|
||||
|
||||
/** Private data structure */
|
||||
struct priv {
|
||||
char port_name;
|
||||
uint16_t pins; // pin mask
|
||||
uint16_t initial; // initial pin states
|
||||
uint16_t open_drain; // open drain pins
|
||||
|
||||
GPIO_TypeDef *port;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/** Load from a binary buffer stored in Flash */
|
||||
static void DO_loadBinary(Unit *unit, PayloadParser *pp)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
uint8_t version = pp_u8(pp);
|
||||
(void)version;
|
||||
|
||||
priv->port_name = pp_char(pp);
|
||||
priv->pins = pp_u16(pp);
|
||||
priv->initial = pp_u16(pp);
|
||||
priv->open_drain = pp_u16(pp);
|
||||
}
|
||||
|
||||
/** Write to a binary buffer for storing in Flash */
|
||||
static void DO_writeBinary(Unit *unit, PayloadBuilder *pb)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
pb_u8(pb, 0); // version
|
||||
|
||||
pb_char(pb, priv->port_name);
|
||||
pb_u16(pb, priv->pins);
|
||||
pb_u16(pb, priv->initial);
|
||||
pb_u16(pb, priv->open_drain);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/** Parse a key-value pair from the INI file */
|
||||
static error_t DO_loadIni(Unit *unit, const char *key, const char *value)
|
||||
{
|
||||
bool suc = true;
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
if (streq(key, "port")) {
|
||||
suc = parse_port_name(value, &priv->port_name);
|
||||
}
|
||||
else if (streq(key, "pins")) {
|
||||
priv->pins = parse_pinmask(value, &suc);
|
||||
}
|
||||
else if (streq(key, "initial")) {
|
||||
priv->initial = parse_pinmask(value, &suc);
|
||||
}
|
||||
else if (streq(key, "open-drain")) {
|
||||
priv->open_drain = parse_pinmask(value, &suc);
|
||||
}
|
||||
else {
|
||||
return E_BAD_KEY;
|
||||
}
|
||||
|
||||
if (!suc) return E_BAD_VALUE;
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Generate INI file section for the unit */
|
||||
static void DO_writeIni(Unit *unit, IniWriter *iw)
|
||||
{
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
iw_comment(iw, "Port name");
|
||||
iw_entry(iw, "port", "%c", priv->port_name);
|
||||
|
||||
iw_comment(iw, "Pins (comma separated, supports ranges)");
|
||||
iw_entry(iw, "pins", "%s", pinmask2str(priv->pins, unit_tmp512));
|
||||
|
||||
iw_comment(iw, "Initially high pins");
|
||||
iw_entry(iw, "initial", "%s", pinmask2str(priv->initial, unit_tmp512));
|
||||
|
||||
iw_comment(iw, "Open-drain pins");
|
||||
iw_entry(iw, "open-drain", "%s", pinmask2str(priv->open_drain, unit_tmp512));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/** Allocate data structure and set defaults */
|
||||
static error_t DO_preInit(Unit *unit)
|
||||
{
|
||||
struct priv *priv = unit->data = calloc_ck(1, sizeof(struct priv));
|
||||
if (priv == NULL) return E_OUT_OF_MEM;
|
||||
|
||||
// some defaults
|
||||
priv->port_name = 'A';
|
||||
priv->pins = 0x0001;
|
||||
priv->open_drain = 0x0000;
|
||||
priv->initial = 0x0000;
|
||||
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Finalize unit set-up */
|
||||
static error_t DO_init(Unit *unit)
|
||||
{
|
||||
bool suc = true;
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
priv->initial &= priv->pins;
|
||||
priv->open_drain &= priv->pins;
|
||||
|
||||
// --- Parse config ---
|
||||
priv->port = hw_port2periph(priv->port_name, &suc);
|
||||
if (!suc) return E_BAD_CONFIG;
|
||||
|
||||
// Claim all needed pins
|
||||
TRY(rsc_claim_gpios(unit, priv->port_name, priv->pins));
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (priv->pins & (1 << i)) {
|
||||
uint32_t ll_pin = hw_pin2ll((uint8_t) i, &suc);
|
||||
|
||||
// --- Init hardware ---
|
||||
LL_GPIO_SetPinMode(priv->port, ll_pin, LL_GPIO_MODE_OUTPUT);
|
||||
LL_GPIO_SetPinOutputType(priv->port, ll_pin,
|
||||
(priv->open_drain & (1 << i)) ? LL_GPIO_OUTPUT_OPENDRAIN : LL_GPIO_OUTPUT_PUSHPULL);
|
||||
LL_GPIO_SetPinSpeed(priv->port, ll_pin, LL_GPIO_SPEED_FREQ_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the initial state
|
||||
priv->port->ODR &= ~priv->pins;
|
||||
priv->port->ODR |= priv->initial;
|
||||
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
/** Tear down the unit */
|
||||
static void DO_deInit(Unit *unit)
|
||||
{
|
||||
// pins are de-inited during teardown
|
||||
|
||||
// Release all resources
|
||||
rsc_teardown(unit);
|
||||
|
||||
// Free memory
|
||||
free_ck(unit->data);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
error_t UU_DO_Write(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
uint16_t set = spread;
|
||||
uint16_t reset = ((~spread) & mask);
|
||||
priv->port->BSRR = set | (reset << 16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DO_Set(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
priv->port->BSRR = spread;
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DO_Clear(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
priv->port->BSRR = (spread<<16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DO_Toggle(Unit *unit, uint16_t packed)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
|
||||
struct priv *priv = unit->data;
|
||||
uint16_t mask = priv->pins;
|
||||
uint16_t spread = pinmask_spread(packed, mask);
|
||||
|
||||
uint16_t flipped = (uint16_t) (~priv->port->ODR) & mask;
|
||||
uint16_t set = flipped & spread;
|
||||
uint16_t reset = ((~flipped) & mask) & spread;
|
||||
priv->port->BSRR = set | (reset<<16);
|
||||
return E_SUCCESS;
|
||||
}
|
||||
|
||||
error_t UU_DO_GetPinCount(Unit *unit, uint8_t *count)
|
||||
{
|
||||
CHECK_TYPE(unit, &UNIT_DOUT);
|
||||
struct priv *priv = unit->data;
|
||||
|
||||
uint32_t packed = pinmask_pack(0xFFFF, priv->pins);
|
||||
*count = (uint8_t)(32 - __CLZ(packed));
|
||||
return E_SUCCESS;
|
||||
}
|
||||
#define DOUT_INTERNAL
|
||||
#include "_dout_settings.h"
|
||||
#include "_dout_init.h"
|
||||
|
||||
enum PinCmd_ {
|
||||
CMD_TEST = 0,
|
||||
@@ -228,22 +17,23 @@ enum PinCmd_ {
|
||||
};
|
||||
|
||||
/** Handle a request message */
|
||||
static error_t DO_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command, PayloadParser *pp)
|
||||
static error_t DOut_handleRequest(Unit *unit, TF_ID frame_id, uint8_t command,
|
||||
PayloadParser *pp)
|
||||
{
|
||||
uint16_t packed = pp_u16(pp);
|
||||
|
||||
switch (command) {
|
||||
case CMD_TEST:
|
||||
return UU_DO_Write(unit, packed);
|
||||
return UU_DOut_Write(unit, packed);
|
||||
|
||||
case CMD_SET:
|
||||
return UU_DO_Set(unit, packed);
|
||||
return UU_DOut_Set(unit, packed);
|
||||
|
||||
case CMD_CLEAR:
|
||||
return UU_DO_Clear(unit, packed);
|
||||
return UU_DOut_Clear(unit, packed);
|
||||
|
||||
case CMD_TOGGLE:
|
||||
return UU_DO_Toggle(unit, packed);
|
||||
return UU_DOut_Toggle(unit, packed);
|
||||
|
||||
default:
|
||||
return E_UNKNOWN_COMMAND;
|
||||
@@ -257,14 +47,14 @@ const UnitDriver UNIT_DOUT = {
|
||||
.name = "DO",
|
||||
.description = "Digital output",
|
||||
// Settings
|
||||
.preInit = DO_preInit,
|
||||
.cfgLoadBinary = DO_loadBinary,
|
||||
.cfgWriteBinary = DO_writeBinary,
|
||||
.cfgLoadIni = DO_loadIni,
|
||||
.cfgWriteIni = DO_writeIni,
|
||||
.preInit = DOut_preInit,
|
||||
.cfgLoadBinary = DOut_loadBinary,
|
||||
.cfgWriteBinary = DOut_writeBinary,
|
||||
.cfgLoadIni = DOut_loadIni,
|
||||
.cfgWriteIni = DOut_writeIni,
|
||||
// Init
|
||||
.init = DO_init,
|
||||
.deInit = DO_deInit,
|
||||
.init = DOut_init,
|
||||
.deInit = DOut_deInit,
|
||||
// Function
|
||||
.handleRequest = DO_handleRequest,
|
||||
.handleRequest = DOut_handleRequest,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ extern const UnitDriver UNIT_DOUT;
|
||||
* @param packed - packed pin states (aligned to right)
|
||||
* @return success
|
||||
*/
|
||||
error_t UU_DO_Write(Unit *unit, uint16_t packed);
|
||||
error_t UU_DOut_Write(Unit *unit, uint16_t packed);
|
||||
|
||||
/**
|
||||
* Set pins (clear none)
|
||||
@@ -27,7 +27,7 @@ error_t UU_DO_Write(Unit *unit, uint16_t packed);
|
||||
* @param packed - packed pins, 1 if pin should be set
|
||||
* @return success
|
||||
*/
|
||||
error_t UU_DO_Set(Unit *unit, uint16_t packed);
|
||||
error_t UU_DOut_Set(Unit *unit, uint16_t packed);
|
||||
|
||||
/**
|
||||
* Clear multiple pins
|
||||
@@ -36,7 +36,7 @@ error_t UU_DO_Set(Unit *unit, uint16_t packed);
|
||||
* @param packed - packed pins, 1 if pin should be cleared
|
||||
* @return
|
||||
*/
|
||||
error_t UU_DO_Clear(Unit *unit, uint16_t packed);
|
||||
error_t UU_DOut_Clear(Unit *unit, uint16_t packed);
|
||||
|
||||
/**
|
||||
* Toggle pins
|
||||
@@ -45,7 +45,7 @@ error_t UU_DO_Clear(Unit *unit, uint16_t packed);
|
||||
* @param packed - packed pins, 1 if pin should be toggled
|
||||
* @return
|
||||
*/
|
||||
error_t UU_DO_Toggle(Unit *unit, uint16_t packed);
|
||||
error_t UU_DOut_Toggle(Unit *unit, uint16_t packed);
|
||||
|
||||
/**
|
||||
* Get number of configured pins
|
||||
@@ -54,6 +54,6 @@ error_t UU_DO_Toggle(Unit *unit, uint16_t packed);
|
||||
* @param count output, written with 0-16
|
||||
* @return success
|
||||
*/
|
||||
error_t UU_DO_GetPinCount(Unit *unit, uint8_t *count);
|
||||
error_t UU_DOut_GetPinCount(Unit *unit, uint8_t *count);
|
||||
|
||||
#endif //U_DOUT_H
|
||||
|
||||
Reference in New Issue
Block a user