libpynq (release 5EWC0-2023 version 0.2.6 of 2025-11-10 09:56)
Loading...
Searching...
No Matches
pulsecounter.h
Go to the documentation of this file.
1/*
2Copyright (c) 2023 Eindhoven University of Technology
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22#ifndef PULSECOUNTER_H
23#define PULSECOUNTER_H
24#include <gpio.h>
25#include <stdbool.h>
26#include <stdint.h>
27
50
56extern void pulsecounter_init(const pulsecounter_index_t pci);
57
64extern void pulsecounter_destroy(const pulsecounter_index_t pci);
65
74extern uint32_t pulsecounter_get_count(const pulsecounter_index_t pci,
75 uint32_t *timestamp);
76
83
94 const int edge);
95
101extern int pulsecounter_get_edge(const pulsecounter_index_t pci);
102
111 uint8_t const count);
112
119
129extern uint32_t pulsecounter_get_pulsetrain(const pulsecounter_index_t pci,
130 uint32_t *const inv,
131 const uint32_t inv_length);
132
140extern uint32_t
145#endif
void pulsecounter_reset_count(const pulsecounter_index_t pci)
pulsecounter_index_t
Enum of PULSECOUNTERs. Functions use a switch numbered from 0..NUM_PULSECOUNTERS-1.
void pulsecounter_set_edge(const pulsecounter_index_t pci, const int edge)
uint32_t pulsecounter_get_pulsetrain_count(const pulsecounter_index_t pci)
uint32_t pulsecounter_get_pulsetrain(const pulsecounter_index_t pci, uint32_t *const inv, const uint32_t inv_length)
void pulsecounter_set_filter_length(const pulsecounter_index_t pci, uint8_t const count)
void pulsecounter_destroy(const pulsecounter_index_t pci)
Close the shared memory handle for the specified PULSECOUNTER index.
uint32_t pulsecounter_get_count(const pulsecounter_index_t pci, uint32_t *timestamp)
void pulsecounter_init(const pulsecounter_index_t pci)
initialize the pulsecounter specified by the index with a shared memory pointer
uint8_t pulsecounter_get_filter_length(const pulsecounter_index_t pci)
int pulsecounter_get_edge(const pulsecounter_index_t pci)
@ PULSECOUNTER0
@ NUM_PULSECOUNTERS
@ PULSECOUNTER1