no-OS
xilinx_timer.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef XILINX_TIMER_H_
35 #define XILINX_TIMER_H_
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include <xparameters.h>
42 #ifdef XPAR_XSCUTIMER_NUM_INSTANCES
43 #include <xscutimer.h>
44 #endif
45 #ifdef XPAR_XTMRCTR_NUM_INSTANCES
46 #include <xtmrctr.h>
47 #endif
48 
49 /******************************************************************************/
50 /*************************** Types Declarations *******************************/
51 /******************************************************************************/
52 
62 };
63 
70  void *instance;
72  void *config;
74  uint8_t active_tmr;
77 };
78 
85  uint8_t active_tmr;
88 };
89 
93 extern const struct no_os_timer_platform_ops xil_timer_ops;
94 
95 #endif /* XILINX_TIMER_H_ */
no_os_timer_platform_ops
Structure holding timer function pointers that point to the platform specific function.
Definition: no_os_timer.h:101
xilinx_timer_stop
int32_t xilinx_timer_stop(struct no_os_timer_desc *desc)
Stop a timer from counting.
Definition: xilinx_timer.c:94
xil_timer_ops
const struct no_os_timer_platform_ops xil_timer_ops
Xilinx platform specific timer platform ops structure.
Definition: xilinx_timer.c:439
no_os_alloc.h
xilinx_timer_count_clk_set
int32_t xilinx_timer_count_clk_set(struct no_os_timer_desc *desc, uint32_t freq_hz)
Set the timer clock frequency.
Definition: xilinx_timer.c:243
xil_timer_desc::config
void * config
Definition: xilinx_timer.h:72
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:196
xil_timer_desc
Xilinx specific timer descriptor.
Definition: xilinx_timer.h:68
NO_OS_SPI_CPOL
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:48
no_os_spi_init_param::bit_order
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:150
xil_timer_desc::instance
void * instance
Definition: xilinx_timer.h:70
no_os_spi.h
Header file of SPI Interface.
no_os_timer_init_param::id
uint16_t id
Definition: no_os_timer.h:85
xilinx_timer.h
Timer control module header.
no_os_spi_msg
Definition: no_os_spi.h:100
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:222
no_os_delay.h
Header file of Delay functions.
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
no_os_timer.h
Timer control module header.
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
_read
int _read(int file, char *ptr, int len)
Definition: maxim_uart_stdio.c:100
xilinx_timer_counter_set
int32_t xilinx_timer_counter_set(struct no_os_timer_desc *desc, uint32_t new_val)
Set the current counter value of the timer.
Definition: xilinx_timer.c:168
xil_spi_pl_ops
const struct no_os_spi_platform_ops xil_spi_pl_ops
Xilinx SPI PS register functions. No extra param needed.
no_os_timer_init_param::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:89
no_os_spi_msg::tx_buff
uint8_t * tx_buff
Definition: no_os_spi.h:102
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:142
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:146
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:200
no_os_min
#define no_os_min(x, y)
Definition: no_os_util.h:59
xilinx_timer_counter_get
int32_t xilinx_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Get the current counter value of the timer.
Definition: xilinx_timer.c:129
no_os_error.h
Error codes definition.
no_os_timer_init_param::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:87
no_os_timer_desc::ticks_count
uint32_t ticks_count
Definition: no_os_timer.h:65
no_os_spi_msg::rx_buff
uint8_t * rx_buff
Definition: no_os_spi.h:104
no_os_timer_desc::id
uint16_t id
Definition: no_os_timer.h:61
xilinx_timer_init
int32_t xilinx_timer_init(struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param)
Initialize hardware timer and the handler structure associated with it.
Definition: xilinx_timer.c:298
no_os_spi_msg::cs_change
uint8_t cs_change
Definition: no_os_spi.h:108
no_os_timer_platform_ops::init
int32_t(* init)(struct no_os_timer_desc **, const struct no_os_timer_init_param *)
Definition: no_os_timer.h:103
no_os_spi_desc::bit_order
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
_write
int _write(int file, char *ptr, int len)
Definition: maxim_uart_stdio.c:117
xilinx_timer_get_elapsed_time_nsec
int32_t xilinx_timer_get_elapsed_time_nsec(struct no_os_timer_desc *desc, uint64_t *elapsed_time)
Get the elapsed time in nsec for the timer.
Definition: xilinx_timer.c:284
no_os_spi_msg::bytes_number
uint32_t bytes_number
Definition: no_os_spi.h:106
xil_timer_init_param::type
enum xil_timer_type type
Definition: xilinx_timer.h:87
xil_timer_desc::type
enum xil_timer_type type
Definition: xilinx_timer.h:76
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
no_os_timer_init_param
Structure holding the parameters for timer initialization.
Definition: no_os_timer.h:83
xil_timer_init_param
Xilinx specific timer initialization structure.
Definition: xilinx_timer.h:83
no_os_timer_desc::freq_hz
uint32_t freq_hz
Definition: no_os_timer.h:63
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
NO_OS_SPI_BIT_ORDER_LSB_FIRST
@ NO_OS_SPI_BIT_ORDER_LSB_FIRST
Definition: no_os_spi.h:78
NULL
#define NULL
Definition: wrapper.h:64
no_os_timer_desc::extra
void * extra
Definition: no_os_timer.h:69
no_os_timer_init_param::extra
void * extra
Definition: no_os_timer.h:93
TIMER_PL
@ TIMER_PL
Definition: xilinx_timer.h:59
xil_timer_init_param::active_tmr
uint8_t active_tmr
Definition: xilinx_timer.h:85
xilinx_timer_start
int32_t xilinx_timer_start(struct no_os_timer_desc *desc)
Start a timer.
Definition: xilinx_timer.c:62
no_os_timer_desc
Structure holding timer descriptor.
Definition: no_os_timer.h:57
xilinx_timer_remove
int32_t xilinx_timer_remove(struct no_os_timer_desc *desc)
Free the memory allocated by timer_setup().
Definition: xilinx_timer.c:403
no_os_util.h
Header file of utility functions.
xil_timer_ops
const struct no_os_timer_platform_ops xil_timer_ops
Xilinx platform specific timer platform ops structure.
Definition: xilinx_timer.c:439
NO_OS_SPI_CPHA
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:47
no_os_spi_platform_ops::init
int32_t(* init)(struct no_os_spi_desc **, const struct no_os_spi_init_param *)
Definition: no_os_spi.h:224
TIMER_PS
@ TIMER_PS
Definition: xilinx_timer.h:61
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
xil_timer_type
xil_timer_type
Xilinx platform architecture sections.
Definition: xilinx_timer.h:57
xil_timer_desc::active_tmr
uint8_t active_tmr
Definition: xilinx_timer.h:74
xilinx_timer_count_clk_get
int32_t xilinx_timer_count_clk_get(struct no_os_timer_desc *desc, uint32_t *freq_hz)
Get the timer clock frequency.
Definition: xilinx_timer.c:205
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140