ds1302-dev

cs/test-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 cs/test-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/virtuabotixRTC"
#pragma XOD error_raise enable
#pragma XOD error_catch enable

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

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

using Type = virtuabotixRTC*;

{{ GENERATED_CODE }}

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

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