ccNOos
v0.0.0
Build Portable Microcontroller Applications!
HMC1119.h
Go to the documentation of this file.
1
/** \file HMC1119.h
2
* \brief <a href="https://www.inmechasol.org/" target="_blank">IMS</a>:
3
<a href="https://github.com/InMechaSol/ccNOos" target="_blank">ccNOos</a>,
4
Declarations for straight C and C++
5
6
Copyright 2021 <a href="https://www.inmechasol.org/" target="_blank">InMechaSol, Inc</a>
7
8
Licensed under the Apache License, Version 2.0(the "License");
9
you may not use this file except in compliance with the License.
10
You may obtain a copy of the License at
11
12
http://www.apache.org/licenses/LICENSE-2.0
13
14
Unless required by applicable law or agreed to in writing, software
15
distributed under the License is distributed on an "AS IS" BASIS,
16
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
See the License for the specific language governing permissions and
18
limitations under the License.
19
20
Notes:
21
(.c includes .h) - for straight C or
22
(.cpp includes .c which includes .h) - for C++ wrapped straight C
23
*Always compiled to a single compilation unit, either C or CPP, not both
24
25
*/
26
27
#ifndef HMC1119_H
28
#define HMC1119_H
29
30
#include "
version_config.h
"
31
32
#define MIN_ATTEN_VAL (0.0)
33
#define MAX_ATTEN_VAL (31.75)
34
35
struct
DATStruct
36
{
37
float
DATCMD
;
38
UI_8
attenSetting
;
39
};
40
struct
DATStruct
createDATStruct
();
41
void
limitDATcmd
(
struct
DATStruct
* DATptr);
42
// output factional part, write integral part to "intPartPtr"
43
float
ModuloFloat
(
float
floatValue,
float
* intPartPtr);
44
void
CalcAttenuationBits
(
struct
DATStruct
* DATptr);
45
#define datcmdbit16(DATA) ( (0b10000000 & DATA) >> 7 )
46
#define datcmdbit8(DATA) ( (0b01000000 & DATA) >> 6 )
47
#define datcmdbit4(DATA) ( (0b00100000 & DATA) >> 5 )
48
#define datcmdbit2(DATA) ( (0b00010000 & DATA) >> 4 )
49
#define datcmdbit1(DATA) ( (0b00001000 & DATA) >> 3 )
50
#define datcmdbit0_50(DATA) ( (0b00000100 & DATA) >> 2 )
51
#define datcmdbit0_25(DATA) ( (0b00000010 & DATA) >> 1 )
52
53
54
#endif // HMC1119_H
ModuloFloat
float ModuloFloat(float floatValue, float *intPartPtr)
createDATStruct
struct DATStruct createDATStruct()
Definition:
HMC1119.c:29
CalcAttenuationBits
void CalcAttenuationBits(struct DATStruct *DATptr)
Definition:
HMC1119.c:59
DATStruct::attenSetting
UI_8 attenSetting
Definition:
HMC1119.h:38
DATStruct::DATCMD
float DATCMD
Definition:
HMC1119.h:37
DATStruct
Definition:
HMC1119.h:36
limitDATcmd
void limitDATcmd(struct DATStruct *DATptr)
Definition:
HMC1119.c:37
version_config.h
IMS: ccNOos, Declarations for straight C and C++
ccLibs
devices
HMC1119
HMC1119.h
Generated by
1.8.20