Speeduino
Loading...
Searching...
No Matches
Public Attributes | List of all members
decoder_t Struct Reference

This structure represents a decoder configuration. More...

#include <decoder_t.h>

Public Member Functions

int16_t getCrankAngle (void) const
 The function to get the crank angle.
 

Public Attributes

interrupt_t primary
 The primary interrupt configuration - usually the crank trigger.
 
interrupt_t secondary
 The secondary interrupt configuration - usually the cam trigger.
 
interrupt_t tertiary
 The tertiary interrupt configuration - for decoders that use a 3rd input. E.g. VVT.
 
using getRevolutionTime_t = uint32_t(*)(void)
 The function to get the current crank revolution time.
 
getRevolutionTime_t getRevolutionTime
 The function to get the current crank revolution time.
 
using getCrankAngle_t = int16_t(*)(uint32_t)
 The function to get the crank angle.
 
getCrankAngle_t pGetCrankAngle
 The function to get the crank angle.
 
using setEndTeeth_t = void(*)(void)
 The function to set the end teeth for ignition calculations.
 
setEndTeeth_t setEndTeeth
 The function to set the end teeth for ignition calculations.
 
using reset_t = void(*)(void)
 The function to reset the decoder. Called when the engine is stopped, or when the engine is started.
 
reset_t reset
 The function to reset the decoder. Called when the engine is stopped, or when the engine is started.
 
using engine_running_t = bool(*)(uint32_t)
 The function to test if the engine is running.
 
engine_running_t isEngineRunning
 The function to test if the engine is running.
 
using status_fun_t = decoder_status_t(*)(void) noexcept
 The function to get the current decoder status.
 
status_fun_t getStatus
 The function to get the current decoder status.
 
using feature_fun_t = decoder_features_t(*)(void)
 The function to get the current decoder feature set.
 
feature_fun_t getFeatures
 The function to get the current decoder feature set.
 

Detailed Description

This structure represents a decoder configuration.

Create using decoder_builder_t

Member Typedef Documentation

◆ engine_running_t

using decoder_t::engine_running_t = bool(*)(uint32_t)

The function to test if the engine is running.

This is based on whether or not the decoder has detected a tooth recently

Parameters
curTimeThe time in µS to use for the liveness check. Typically the result of a recent call to micros()
Returns
true If the engine is turning
false If the engine is not turning

◆ feature_fun_t

The function to get the current decoder feature set.

◆ getCrankAngle_t

using decoder_t::getCrankAngle_t = int16_t(*)(uint32_t)

The function to get the crank angle.

◆ getRevolutionTime_t

using decoder_t::getRevolutionTime_t = uint32_t(*)(void)

The function to get the current crank revolution time.

This is the time in µS that one crank revolution would take at the current speed, as measured by the decoder. RPM is derived from this (see statuses::setRevolutionTime()).

Returns
The revolution time in µS, or 0 if the engine speed is unknown (E.g. no sync). If the decoder can't take a new measurement (E.g. no tooth history yet), it can return the current statuses::revolutionTime to keep the last known speed.

◆ reset_t

using decoder_t::reset_t = void(*)(void)

The function to reset the decoder. Called when the engine is stopped, or when the engine is started.

◆ setEndTeeth_t

using decoder_t::setEndTeeth_t = void(*)(void)

The function to set the end teeth for ignition calculations.

◆ status_fun_t

The function to get the current decoder status.

Member Function Documentation

◆ getCrankAngle()

int16_t decoder_t::getCrankAngle ( void  ) const
inline

The function to get the crank angle.

Member Data Documentation

◆ getFeatures

feature_fun_t decoder_t::getFeatures

The function to get the current decoder feature set.

◆ getRevolutionTime

getRevolutionTime_t decoder_t::getRevolutionTime

The function to get the current crank revolution time.

This is the time in µS that one crank revolution would take at the current speed, as measured by the decoder. RPM is derived from this (see statuses::setRevolutionTime()).

Returns
The revolution time in µS, or 0 if the engine speed is unknown (E.g. no sync). If the decoder can't take a new measurement (E.g. no tooth history yet), it can return the current statuses::revolutionTime to keep the last known speed.

◆ getStatus

status_fun_t decoder_t::getStatus

The function to get the current decoder status.

◆ isEngineRunning

engine_running_t decoder_t::isEngineRunning

The function to test if the engine is running.

This is based on whether or not the decoder has detected a tooth recently

Parameters
curTimeThe time in µS to use for the liveness check. Typically the result of a recent call to micros()
Returns
true If the engine is turning
false If the engine is not turning

◆ pGetCrankAngle

getCrankAngle_t decoder_t::pGetCrankAngle

The function to get the crank angle.

◆ primary

interrupt_t decoder_t::primary

The primary interrupt configuration - usually the crank trigger.

◆ reset

reset_t decoder_t::reset

The function to reset the decoder. Called when the engine is stopped, or when the engine is started.

◆ secondary

interrupt_t decoder_t::secondary

The secondary interrupt configuration - usually the cam trigger.

◆ setEndTeeth

setEndTeeth_t decoder_t::setEndTeeth

The function to set the end teeth for ignition calculations.

◆ tertiary

interrupt_t decoder_t::tertiary

The tertiary interrupt configuration - for decoders that use a 3rd input. E.g. VVT.


The documentation for this struct was generated from the following file: