STIMA
3
|
Functions | |
void | setup () |
Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM. More... | |
void | loop () |
Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running. More... | |
void | logPrefix (Print *_logOutput) |
void | logSuffix (Print *_logOutput) |
void | init_logging () |
Init logging system. More... | |
void | init_power_down (uint32_t *time_ms, uint32_t debouncing_ms) |
Enter power down mode. More... | |
void | init_buffers () |
Init buffers. More... | |
void | init_tasks () |
Init tasks variable and state. More... | |
void | init_pins () |
Init hardware pins. More... | |
void | i2c_receive_interrupt_handler (int rx_data_length) |
I2C receive interrupt handler. More... | |
void | init_wire () |
Init wire (i2c) library and performs checks on the bus. More... | |
void | reset_wire () |
void | init_spi () |
Init SPI library. More... | |
void | init_system () |
Init system. More... | |
void | init_rpc () |
Register RPC. More... | |
void | init_wdt (uint8_t wdt_timer) |
Init watchdog. More... | |
void | init_timer1 () |
Init Timer1 module. More... | |
void | start_timer () |
Start Timer1 module. More... | |
void | stop_timer () |
Stop Timer1 module. More... | |
ISR (TIMER1_OVF_vect) | |
void | init_sensors () |
Create and setup sensors. More... | |
void | setNextTimeForSensorReading (time_t *next_time, uint16_t time_s) |
void | print_configuration () |
Print current configuration. More... | |
void | set_default_configuration () |
Set default configuration to global configuration variable. More... | |
void | save_configuration (bool is_default) |
Save configuration to EEPROM. More... | |
void | load_configuration () |
Load configuration from EEPROM. More... | |
time_t | getSystemTime () |
void | realreboot () |
void | interrupt_task_1s () |
1 seconds task. More... | |
void | supervisor_task () |
Supervisor task. Manage RTC and NTP sync and open/close gsm and ethernet connection. More... | |
void | rtc_task () |
Real Time Clock task. Read RTC time and sync system time with it. More... | |
void | time_task () |
Time task. Get time from NTP and sync RTC with it. More... | |
void | ethernet_task () |
Ethernet task. Manage Ethernet operation. More... | |
void | sensors_reading_task (bool do_prepare, bool do_get, char *driver, char *type, uint8_t address, uint8_t node, uint8_t *sensor_index, uint32_t *wait_time) |
Sensors reading Task. Read data from sensors. More... | |
void ethernet_task | ( | void | ) |
Ethernet task. Manage Ethernet operation.
void i2c_receive_interrupt_handler | ( | int | rx_data_length | ) |
I2C receive interrupt handler.
[in] | rx_data_length | received data length in bytes. |
check crc: ok
void init_buffers | ( | void | ) |
Init buffers.
copy readable_data_2 in readable_data_1
copy readable_data_2 in readable_data_1
copy readable_data_write in readable_data_read
copy readable_data_write in readable_data_read
copy readable_data_write in readable_data_read
copy readable_data_2 in readable_data_1
copy readable_data_write in readable_data_read
void init_logging | ( | void | ) |
Init logging system.
void init_pins | ( | void | ) |
Init hardware pins.
void init_power_down | ( | uint32_t * | time_ms, |
uint32_t | debouncing_ms | ||
) |
Enter power down mode.
time_ms | pointer to a variable to save the last instant you entered power down. |
debouncing_ms | delay to power down. |
void init_rpc | ( | void | ) |
Register RPC.
void init_sensors | ( | void | ) |
Create and setup sensors.
void init_spi | ( | void | ) |
Init SPI library.
void init_system | ( | void | ) |
Init system.
main loop state
main loop state
main loop state
main loop state
main loop state
void init_tasks | ( | void | ) |
Init tasks variable and state.
no tasks ready
no tasks ready
reset samples_count value
no tasks ready
no tasks ready
no tasks ready
void init_timer1 | ( | void | ) |
Init Timer1 module.
void init_wdt | ( | uint8_t | wdt_timer | ) |
Init watchdog.
wdt_timer | a time value for init watchdog (WDTO_xxxx). |
void init_wire | ( | void | ) |
Init wire (i2c) library and performs checks on the bus.
void interrupt_task_1s | ( | void | ) |
1 seconds task.
ISR | ( | TIMER1_OVF_vect | ) |
Pre-load timer counter register
void load_configuration | ( | void | ) |
Load configuration from EEPROM.
read configuration from eeprom
read configuration from eeprom
read configuration from eeprom
read configuration from eeprom
read configuration from eeprom
void loop | ( | void | ) |
Arduino loop function. First, initialize tasks and sensors, then execute the tasks and activates the power down if no task is running.
void print_configuration | ( | void | ) |
Print current configuration.
void rtc_task | ( | void | ) |
Real Time Clock task. Read RTC time and sync system time with it.
void save_configuration | ( | bool | is_default | ) |
Save configuration to EEPROM.
is_default | if true save default configuration; if false save current configuration. |
write configuration to eeprom
write configuration to eeprom
write configuration to eeprom
write configuration to eeprom
write configuration to eeprom
void sensors_reading_task | ( | bool | do_prepare, |
bool | do_get, | ||
char * | driver, | ||
char * | type, | ||
uint8_t | address, | ||
uint8_t | node, | ||
uint8_t * | sensor_index, | ||
uint32_t * | wait_time | ||
) |
Sensors reading Task. Read data from sensors.
do_prepare | if true, execute the prepare sensor's procedure |
do_get | if true, execute the get sensor's procedure |
*driver | sensor's driver |
*type | sensor's type |
*address | sensor's address |
*node | sensor's node |
*sensor_index | sensor's index |
*wait_time | sensor's wait time |
void set_default_configuration | ( | void | ) |
Set default configuration to global configuration variable.
void setup | ( | ) |
Arduino setup function. Init watchdog, hardware, debug, buffer and load configuration stored in EEPROM.
Arduino setup function. Init watchdog, hardware, debug and load configuration stored in EEPROM.
void start_timer | ( | void | ) |
Start Timer1 module.
< Normal timer operation
< 1:1024 prescaler
< Pre-load timer counter register
< Clear interrupt overflow flag register
< Enable overflow interrupt
void stop_timer | ( | void | ) |
Stop Timer1 module.
< Stop
< Disable overflow interrupt
< Clear interrupt overflow flag register
< Pre-load timer counter register
void supervisor_task | ( | void | ) |
Supervisor task. Manage RTC and NTP sync and open/close gsm and ethernet connection.
void time_task | ( | void | ) |
Time task. Get time from NTP and sync RTC with it.