Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
lampda::platform Namespace Reference

Handle the platform specific interactions. More...

Namespaces

namespace  bluetooth
 Handle the platform specific bluetooth operations.
 
namespace  gpio
 handler for the GeneralPurposeInputOutputs
 
namespace  microphone
 Handle the platform specific microphone operations.
 
namespace  registers
 Define the interaction layer with the system specific registers.
 
namespace  threads
 Define tasks and threads specifics.
 

Classes

struct  Inputs
 read external inputs (may take some time) More...
 

Functions

bool is_ignore_char (char c)
 
void _lockPrintMutex (void)
 
void _unlockPrintMutex (void)
 
void init_prints ()
 Print and debug function to serial port.
 
void lampda_print_raw (const char *format,...)
 raw print, no system additional logs
 
void lampda_print (const char *format,...)
 
Inputs read_inputs ()
 read external inputs (may take some time)
 
uint32_t time_ms (void)
 Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
 
uint64_t time_us (void)
 Returns the number of microseconds since the Arduino board began running the current program.
 
void delay_ms (uint32_t dwMs)
 Pauses the program for the amount of time (in miliseconds) specified as parameter. (There are 1000 milliseconds in a second.)
 
void delay_us (uint64_t dwUs)
 Pauses the program for the amount of time (in microseconds) specified as parameter.
 
uint32_t time_s ()
 Get the current time, in seconds.
 
uint32_t time_min ()
 Get the current time, in minutes.
 
void delay_s (uint32_t s)
 pause the current task for the given number of seconds
 

Variables

StaticSemaphore_t _PrintMutex
 
SemaphoreHandle_t printMutex = xSemaphoreCreateMutexStatic(&_PrintMutex)
 
constexpr uint8_t maxReadLinePerLoop = 5
 
constexpr uint8_t maxLineLenght = 200
 
std::mutex mut
 Print a screen to the external world.
 

Detailed Description

Handle the platform specific interactions.

Function Documentation

◆ delay_ms()

void lampda::platform::delay_ms ( uint32_t  dwMs)

Pauses the program for the amount of time (in miliseconds) specified as parameter. (There are 1000 milliseconds in a second.)

Parameters
dwMsthe number of milliseconds to pause (uint32_t)

◆ delay_us()

void lampda::platform::delay_us ( uint64_t  dwUs)

Pauses the program for the amount of time (in microseconds) specified as parameter.

Parameters
dwUsthe number of microseconds to pause (uint32_t)

◆ init_prints()

void lampda::platform::init_prints ( )

Print and debug function to serial port.

call once at program start

◆ lampda_print()

void lampda::platform::lampda_print ( const char *  format,
  ... 
)

This file should be used by .c files to access print functions

◆ time_ms()

uint32_t lampda::platform::time_ms ( void  )

Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.

Returns
Number of milliseconds since the program started (uint32_t)

◆ time_us()

uint64_t lampda::platform::time_us ( void  )

Returns the number of microseconds since the Arduino board began running the current program.

This number will overflow (go back to zero), after approximately 70 minutes. On 16 MHz Arduino boards (e.g. Duemilanove and Nano), this function has a resolution of four microseconds (i.e. the value returned is always a multiple of four). On 8 MHz Arduino boards (e.g. the LilyPad), this function has a resolution of eight microseconds.

Note
There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second.