no-OS
Functions | Variables
maxim_timer.c File Reference

Source file for Maxim timer platform driver. More...

#include "tmr.h"
#include "maxim_timer.h"
#include "no_os_error.h"
#include "no_os_timer.h"
#include "no_os_util.h"
Include dependency graph for maxim_timer.c:

Functions

int max_timer_init (struct no_os_timer_desc **desc, struct no_os_timer_init_param *param)
 Timer driver init function. More...
 
int max_timer_remove (struct no_os_timer_desc *desc)
 Timer driver remove function. More...
 
int max_timer_start (struct no_os_timer_desc *desc)
 Timer count start function. More...
 
int max_timer_stop (struct no_os_timer_desc *desc)
 Timer count stop function. More...
 
int max_timer_counter_get (struct no_os_timer_desc *desc, uint32_t *counter)
 Function to get the current timer counter value. More...
 
int max_timer_counter_set (struct no_os_timer_desc *desc, uint32_t new_val)
 Function to set the timer counter value. More...
 
int max_timer_count_clk_get (struct no_os_timer_desc *desc, uint32_t *freq_hz)
 Function to get the timer frequency. More...
 
int max_timer_count_clk_set (struct no_os_timer_desc *desc, uint32_t freq_hz)
 Function to set the timer frequency. More...
 
int max_get_elapsed_nsec (struct no_os_timer_desc *desc, uint64_t *elapsed_time)
 Not implemented. More...
 

Variables

const struct no_os_timer_platform_ops max_timer_ops
 maxim platform specific timer platform ops structure More...
 

Detailed Description

Source file for Maxim timer platform driver.

Author
Ciprian Regus (cipri.nosp@m.an.r.nosp@m.egus@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ max_get_elapsed_nsec()

int max_get_elapsed_nsec ( struct no_os_timer_desc desc,
uint64_t *  elapsed_time 
)

Not implemented.

Parameters
desc- timer descriptor
elapsed_time- time in nanoseconds
Returns
-ENOSYS

◆ max_timer_count_clk_get()

int max_timer_count_clk_get ( struct no_os_timer_desc desc,
uint32_t *  freq_hz 
)

Function to get the timer frequency.

Parameters
desc- timer descriptor
freq_hz- the timer frequency value
Returns
0 in case of success, -EINVAL otherwise.

◆ max_timer_count_clk_set()

int max_timer_count_clk_set ( struct no_os_timer_desc desc,
uint32_t  freq_hz 
)

Function to set the timer frequency.

Parameters
desc- timer descriptor.
freq_hz- the timer frequency value to be set.
Returns
0 in case of success, negative errno error codes otherwise.

◆ max_timer_counter_get()

int max_timer_counter_get ( struct no_os_timer_desc desc,
uint32_t *  counter 
)

Function to get the current timer counter value.

Parameters
desc- timer descriptor
counter- the timer counter value
Returns
0 in case of success, -EINVAL otherwise.

◆ max_timer_counter_set()

int max_timer_counter_set ( struct no_os_timer_desc desc,
uint32_t  new_val 
)

Function to set the timer counter value.

Parameters
desc- timer descriptor
new_val- timer counter value to be set
Returns
0 in case of success, -EINVAL otherwise.

◆ max_timer_init()

int max_timer_init ( struct no_os_timer_desc **  desc,
struct no_os_timer_init_param param 
)

Timer driver init function.

Parameters
desc- timer descriptor to be initialized
param- initialization parameter for the desc
Returns
0 in case of success, negative errno error codes otherwise.

◆ max_timer_remove()

int max_timer_remove ( struct no_os_timer_desc desc)

Timer driver remove function.

Parameters
desc- timer descriptor
Returns
0 in case of success, -EINVAL otherwise.

◆ max_timer_start()

int max_timer_start ( struct no_os_timer_desc desc)

Timer count start function.

Parameters
desc- timer descriptor
Returns
0 in case of success, -EINVAL otherwise.

◆ max_timer_stop()

int max_timer_stop ( struct no_os_timer_desc desc)

Timer count stop function.

Parameters
desc- timer descriptor
Returns
0 in case of success, -EINVAL otherwise.

Variable Documentation

◆ max_timer_ops

const struct no_os_timer_platform_ops max_timer_ops
Initial value:
= {
.init = (int32_t (*)())max_timer_init,
.start = (int32_t (*)())max_timer_start,
.stop = (int32_t (*)())max_timer_stop,
.counter_get = (int32_t (*)())max_timer_counter_get,
.counter_set = (int32_t (*)())max_timer_counter_set,
.count_clk_get = (int32_t (*)())max_timer_count_clk_get,
.count_clk_set = (int32_t (*)())max_timer_count_clk_set,
.get_elapsed_time_nsec = (int32_t (*)())max_get_elapsed_nsec,
.remove = (int32_t (*)())max_timer_remove
}

maxim platform specific timer platform ops structure

Maxim specific timer platform ops.

max_timer_counter_get
int max_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Function to get the current timer counter value.
Definition: maxim_timer.c:212
max_get_elapsed_nsec
int max_get_elapsed_nsec(struct no_os_timer_desc *desc, uint64_t *elapsed_time)
Not implemented.
Definition: maxim_timer.c:303
max_timer_counter_set
int max_timer_counter_set(struct no_os_timer_desc *desc, uint32_t new_val)
Function to set the timer counter value.
Definition: maxim_timer.c:228
max_timer_start
int max_timer_start(struct no_os_timer_desc *desc)
Timer count start function.
Definition: maxim_timer.c:181
max_timer_count_clk_get
int max_timer_count_clk_get(struct no_os_timer_desc *desc, uint32_t *freq_hz)
Function to get the timer frequency.
Definition: maxim_timer.c:244
max_timer_stop
int max_timer_stop(struct no_os_timer_desc *desc)
Timer count stop function.
Definition: maxim_timer.c:196
max_timer_count_clk_set
int max_timer_count_clk_set(struct no_os_timer_desc *desc, uint32_t freq_hz)
Function to set the timer frequency.
Definition: maxim_timer.c:260
max_timer_remove
int max_timer_remove(struct no_os_timer_desc *desc)
Timer driver remove function.
Definition: maxim_timer.c:164
max_timer_init
int max_timer_init(struct no_os_timer_desc **desc, struct no_os_timer_init_param *param)
Timer driver init function.
Definition: maxim_timer.c:102