summaryrefslogtreecommitdiff
path: root/frontends/calculator/CEdev/include/usb.h
blob: 3bbf465e27f664bfaba13cfa1f4389bc149f89ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
 * @file
 * @authors Matt "MateoConLechuga" Waltz
 * @authors Jacob "jacobly" Young
 * @brief USB communication routines
 */

#ifndef H_USB
#define H_USB

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @returns True if the usb bus line is powered, i.e. connected to a another calc
 */
bool usb_BusPowered(void);

/**
 * @returns True if the usb is self powered
 */
bool usb_SelfPowered(void);

/**
 * Resets the usb controller chip
 */
void usb_ResetChip(void);

/**
 * Disables the usb timer interrupt (timer 3)
 */
void usb_DisableTimers(void);

/**
 * Enables the usb timer interrupt (timer 3)
 */
void usb_EnableTimers(void);

/**
 * Resets the usb timer interrupt (timer 3)
 */
void usb_ResetTimers(void);

#ifdef __cplusplus
}
#endif

#endif