Deluge Firmware
Loading...
Searching...
No Matches
cfunctions.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16*/
17
18
19#ifndef CFUNCTIONS_H_
20#define CFUNCTIONS_H_
21
22
23#include "r_typedefs.h"
24
25#define getMin(a, b) (((a)<(b))?(a):(b))
26#define getMax(a, b) (((a)>(b))?(a):(b))
27
28int getNumDecimalDigits(uint32_t number);
29void intToString(int32_t number, char* buffer, int minNumDigits);
30void floatToString(float number, char* __restrict__ buffer, int minNumDecimalPlaces, int maxNumDecimalPlaces);
31void slotToString(int slot, int subSlot, char* __restrict__ buffer, int minNumDigits);
32
33uint32_t fastTimerCountToUS(uint32_t timerCount);
34uint32_t usToFastTimerCount(uint32_t us);
35uint32_t msToSlowTimerCount(uint32_t ms);
36uint32_t superfastTimerCountToUS(uint32_t timerCount);
37uint32_t superfastTimerCountToNS(uint32_t timerCount);
38
39void delayMS(uint32_t ms);
40void delayUS(uint32_t us);
41
42#endif /* CFUNCTIONS_H_ */
uint32_t fastTimerCountToUS(uint32_t timerCount)
Definition: cfunctions.c:213
void delayUS(uint32_t us)
Definition: cfunctions.c:231
void intToString(int32_t number, char *buffer, int minNumDigits)
int getNumDecimalDigits(uint32_t number)
Definition: cfunctions.c:22
uint32_t msToSlowTimerCount(uint32_t ms)
Definition: cfunctions.c:221
void slotToString(int slot, int subSlot, char *__restrict__ buffer, int minNumDigits)
Definition: cfunctions.c:195
void delayMS(uint32_t ms)
Definition: cfunctions.c:225
void floatToString(float number, char *__restrict__ buffer, int minNumDecimalPlaces, int maxNumDecimalPlaces)
Definition: cfunctions.c:61
uint32_t superfastTimerCountToNS(uint32_t timerCount)
Definition: cfunctions.c:205
uint32_t usToFastTimerCount(uint32_t us)
Definition: cfunctions.c:217
uint32_t superfastTimerCountToUS(uint32_t timerCount)
Definition: cfunctions.c:209