PHiLIP
tmr.c File Reference

Controls the timer peripheral. More...

#include <errno.h>
#include "stm32f1xx_hal.h"
#include "PHiLIP_typedef.h"
#include "PHiLIP_defaults.h"
#include "port.h"
#include "gpio.h"
#include "trace.h"
#include "tmr.h"

Data Structures

struct  tmr_dev_t
 The parameters for tmr control. More...
 

Functions

void init_dut_ic (map_t *map)
 Initializes timer registers and peripheral. More...
 
void init_dut_ic_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
void deinit_dut_ic_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
error_t commit_dut_ic ()
 Commits the adc registers and executes operations. More...
 
void poll_dut_ic ()
 Polls for high speed input capture values. More...
 
void update_dut_ic_inputs ()
 Updates the dut_ic input level.
 
void DUT_IC_DMA_INT ()
 This function handles dut_ic dma event interrupt.
 
void DUT_IC_GPIO_INT ()
 Trigger on edge, must be quick and save counter value in buffer.
 

Detailed Description

Controls the timer peripheral.

Author
Kevin Weiss
Date
03.03.2020
Author
Kevin Weiss
Date
03.03.2020 This module requires very low jitter since the precision is 14ns. In interrupt mode events can occur as fast as 1us apart, however, time must be allowed for the buffer to be processed. With the DMA it appears that events can still be caught up to 200ns. However the buffer still must not overflow too quickly
Note
Testing shows the a 150us wait must happen for every 255 events to prevent any data corruption.