From 58fe08e64dcb3a7986f0755e806266f4062c9651 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:01:07 +0200 Subject: [PATCH] included pygate reference api --- content/datasheets/expansionboards/pygate.md | 2 + content/firmwareapi/pycom/machine/pygate.md | 39 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 content/firmwareapi/pycom/machine/pygate.md diff --git a/content/datasheets/expansionboards/pygate.md b/content/datasheets/expansionboards/pygate.md index 2917b76..8b913f2 100644 --- a/content/datasheets/expansionboards/pygate.md +++ b/content/datasheets/expansionboards/pygate.md @@ -45,3 +45,5 @@ The Pygate features a single cell Li-Ion/Li-Po charger. When the board is being * If PIC stays in bootloader mode, the [`dfu-util` update](/pytrackpysense/installation/firmware) should be performed +* If `machine.callback()` gives an error, update your -py device with the `pygate` firmware. + diff --git a/content/firmwareapi/pycom/machine/pygate.md b/content/firmwareapi/pycom/machine/pygate.md new file mode 100644 index 0000000..c961b11 --- /dev/null +++ b/content/firmwareapi/pycom/machine/pygate.md @@ -0,0 +1,39 @@ +--- +title: "Pygate" +aliases: + - firmwareapi/pycom/machine/pygate.html + - firmwareapi/pycom/machine/pygate.md + - chapter/firmwareapi/pycom/machine/pygate +--- + +The Pygate is an 8-channel LoRaWAN gateway. Connect a WiPy, Gpy or LoPy4 board to the Pygate and flash the Pygate firmware. See the [Pygate tutorial](/tutorials/all/pygate) to get started. + +## Methods + +#### machine.pygate\_init(buff) + +This function is used to initialize the Pygate + +- `buff`: the data contents of the gateway global config json file + +#### machine.pygate\_deinit() + +This shuts down the concentrator. + +#### machine.callback(trigger, handler=None, arg=None) + +- `trigger`: A trigger event(s) for invoking the callback function `handler`, the triggers/events are: + + `machine.PYGATE_START_EVT` + + `machine.PYGATE_STOP_EVT` + + `machine.MP_QSTR_PYGATE_ERROR_EVT` + +- `handler`: The callback function to be called. When not passed to function, any pre-registered callback will be disabled/removed. + +- `arg`: Optional argument to be passed to the callback function. + +#### machine.events() + +Get the Pygate events \ No newline at end of file