SPIKE-RT C++ API Reference
Loading...
Searching...
No Matches
Battery.h
1
//
2
// Battery.h
3
//
4
// Copyright (c) 2025 Embedded Technology Software Design Robot Contest
5
//
6
7
#ifndef SPIKE_CPP_API_BATTERY_H_
8
#define SPIKE_CPP_API_BATTERY_H_
9
10
#include <stdint.h>
11
12
extern
"C"
{
13
#include <spike/hub/battery.h>
14
}
15
16
namespace
spikeapi {
20
class
Battery
21
{
22
public
:
28
Battery
(
void
) =
default
;
29
36
uint16_t
getCurrent
(
void
)
const
{
37
return
hub_battery_get_current();
38
}
39
46
uint16_t
getVoltage
(
void
)
const
{
47
return
hub_battery_get_voltage();
48
}
49
54
bool
hasError
() {
return
false
; }
55
56
57
};
// class Battery
58
}
// namespace spikeapi
59
60
#endif
// !SPIKE_CPP_API_BATTERY_H_
spikeapi::Battery::Battery
Battery(void)=default
spikeapi::Battery::getVoltage
uint16_t getVoltage(void) const
Definition
Battery.h:46
spikeapi::Battery::hasError
bool hasError()
Definition
Battery.h:54
spikeapi::Battery::getCurrent
uint16_t getCurrent(void) const
Definition
Battery.h:36
libcpp-spike
include
Battery.h
Generated by
1.14.0