/      日本語

Callback Functions

Various callback functions
These are callback functions where the application description is written. Callback means that it is called from the system (library). By defining several callback functions, the user describes the behavior of the system.

The following callback functions are mandatory definitions.

  • setup()
  • loop()

Functions other than these will be linked as empty functions that do nothing if not defined.

Normal callback invocation order

init_coldboot()
  ↓ (TWENET internal processing: Initialization 1)
setup()
  ↓ (TWENET internal processing: Initialization 2)
begin() --- only once
  ↓
loop() <--+
  ↓       | Event processing, behavior processing
CPU DOZE -+

Callback invocation order when waking up from sleep

the_twelite.sleep()
  ↓ sleeping...


init_warmboot()
  ↓ (TWENET internal processing: Initialization 3)
wakeup()
  ↓ (TWENET internal processing: Initialization 4)
loop() <--+
  ↓       | Event processing, behavior processing
CPU DOZE -+

setup()

Initialization process

begin()

Initialization process (after TWENET initialization)

loop()

Loop processing

wakeup()

Processing after waking from sleep

init_coldboot()

Initialization process (before peripheral initialization)

init_warmboot()

Process after waking from sleep (before peripheral initialization)

on_rx_packet()

Processing upon packet reception

on_tx_comp()

Processing upon packet transmission completion