Sygaldry
Loading...
Searching...
No Matches
sygsr-adc.hpp
1#pragma once
2/*
3Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music
4Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music
5Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ.
6Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
7
8SPDX-License-Identifier: MIT
9*/
10
11#include "sygah-metadata.hpp"
12#include "sygah-endpoints.hpp"
13
14namespace sygaldry { namespace sygsr {
15
18
22
29static constexpr unsigned int ADC_CHANNEL_0 = 0;
30static constexpr unsigned int ADC_CHANNEL_1 = 1;
31static constexpr unsigned int ADC_CHANNEL_2 = 2;
32static constexpr unsigned int ADC_CHANNEL_3 = 3;
33static constexpr unsigned int ADC_GPIO[] = {26,27,28,29};
35
38template<unsigned int input_number>
40: name_<"ADC">
41, description_<"Oneshot analog-digital converter">
42, author_<"Travis J. West">
43, copyright_<"Copyright 2023 Sygaldry Contributors">
44, license_<"SPDX-License-Identifier: MIT">
45, version_<"0.0.0">
46{
47 static_assert(ADC_CHANNEL_0 <= input_number && input_number <= ADC_CHANNEL_3);
48
49 struct outputs_t {
50 slider<"raw", "raw binary representation of the analog voltage measured by the ADC"
51 , int, 0, 4096, 0
52 > raw;
53 } outputs;
54
55 void init();
56
57 void main();
58};
59
60extern template struct OneshotAdc<ADC_CHANNEL_0>;
61extern template struct OneshotAdc<ADC_CHANNEL_1>;
62extern template struct OneshotAdc<ADC_CHANNEL_2>;
63extern template struct OneshotAdc<ADC_CHANNEL_3>;
64
67
68} }
Document the author of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:39
Document the copyright statement of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:47
Document a textual description of an entity, e.g. an endpoint, component or binding.
Definition sygah-metadata.hpp:35
Document the copyright license of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:45
Document the name of an entity, e.g. an endpoint, component, or binding.
Definition sygah-metadata.hpp:33
A numeric endpoint with user customizeable range and persistent value semantics.
Definition sygah-endpoints.hpp:348
Definition sygsr-adc.hpp:49
Oneshot analog-digital converter.
Definition sygsr-adc.hpp:46
Document a textual description of the version number of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:51