ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
communication.c File Reference
#include "communication.h"
#include <libtock/peripherals/i2c_master.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

void ControllerWakeupEsp32 (void)
 Wakeup esp32 from deep sleep.
 
ControllerStatus ControllerTransmit (void)
 Send bytes to esp32.
 
ControllerStatus ControllerReceive (void)
 Receive bytes from esp32.
 
ControllerStatus ControllerTransaction (void)
 Send message and receive response from esp32.
 
Buffer * ControllerTx (void)
 Get reference to transmit buffer.
 
Buffer * ControllerRx (void)
 Get reference to receive buffer.
 

Function Documentation

◆ ControllerReceive()

ControllerStatus ControllerReceive ( void  )

Receive bytes from esp32.

Definition at line 101 of file communication.c.

References CONTROLLER_ERROR, CONTROLLER_SUCCESS, Buffer::data, Buffer::len, and Buffer::size.

Referenced by ControllerTransaction().

◆ ControllerRx()

Buffer * ControllerRx ( void  )

◆ ControllerTransaction()

◆ ControllerTransmit()

ControllerStatus ControllerTransmit ( void  )

Send bytes to esp32.

Definition at line 42 of file communication.c.

References CONTROLLER_ERROR, CONTROLLER_SUCCESS, ControllerWakeupEsp32(), Buffer::data, Buffer::len, and Buffer::size.

Referenced by ControllerTransaction().

◆ ControllerTx()

Buffer * ControllerTx ( void  )

◆ ControllerWakeupEsp32()

void ControllerWakeupEsp32 ( void  )

Wakeup esp32 from deep sleep.

Starting with hardware version 2.2.2 there is an stm32 GPIO line connected the esp32 ext1 to wakeup the device from a deep sleep state.

Definition at line 191 of file communication.c.

Referenced by ControllerTransmit().