ds1302-dev

cesars/ds1302/ds1302-dev

No description
ds1302-dev
@/ds1302-dev
RSTport
Pin CE/RST
IOport
Pin IO
SCLKport
Pin SCLK
ds1302-dev
RST
IO
SCLK
1302'
1302'@/ds1302-dev
To use the node in your project you should have the cesars/ds1302 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD require "https://github.com/Cesar-S/DS1302"
#pragma XOD error_raise enable
#pragma XOD error_catch enable

{{#global}}
#include <DS1302.h>
{{/global}}

struct State {
    uint8_t mem[sizeof(DS1302)];
};

using Type = DS1302*;

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isSettingUp())
        return;

    auto state = getState(ctx);
    Type rtc = new (state->mem) DS1302((uint8_t)getValue<input_RST>(ctx),(uint8_t)getValue<input_SCLK>(ctx),
                                       (uint8_t)getValue<input_IO>(ctx));
    rtc->init();
    emitValue<output_1302U0027>(ctx, rtc);
}