Skip to content

File syn_comp.c

FileList > drivers > syn_comp.c

Go to the source code of this file

High-Speed Rail-to-Rail Analog Comparator Driver implementation.

  • #include "../util/syn_assert.h"
  • #include "syn_comp.h"

Public Functions

Type Name
SYN_Status syn_comp_enable (SYN_COMP * comp, bool enable)
Enable or disable the analog comparator.
SYN_Status syn_comp_init (SYN_COMP * comp, uint8_t comp_id, SYN_COMP_InvertingInput inv_in)
Initialize an Analog Comparator instance.
bool syn_comp_read (const SYN_COMP * comp)
Read real-time logical output state of the comparator.

Public Functions Documentation

function syn_comp_enable

Enable or disable the analog comparator.

SYN_Status syn_comp_enable (
    SYN_COMP * comp,
    bool enable
) 

Parameters:

  • comp Initialized comparator handle.
  • enable true to enable, false to disable.

Returns:

SYN_OK on success.


function syn_comp_init

Initialize an Analog Comparator instance.

SYN_Status syn_comp_init (
    SYN_COMP * comp,
    uint8_t comp_id,
    SYN_COMP_InvertingInput inv_in
) 

Parameters:

  • comp Handle to initialize. Must not be NULL.
  • comp_id Comparator hardware index (0 = COMP1, 1 = COMP2).
  • inv_in Reference threshold input source.

Returns:

SYN_OK on success, SYN_INVALID_PARAM on invalid argument.


function syn_comp_read

Read real-time logical output state of the comparator.

bool syn_comp_read (
    const SYN_COMP * comp
) 

Parameters:

  • comp Initialized comparator handle.

Returns:

true if non-inverting input voltage > inverting reference voltage.



The documentation for this class was generated from the following file src/syntropic/drivers/syn_comp.c