-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathusb_host.hpp
61 lines (49 loc) · 1.52 KB
/
usb_host.hpp
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
53
54
55
56
57
58
59
60
61
#pragma once
//=====================================================================//
/*! @file
@brief USB Host クラス
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 2020 Kunihito Hiramatsu @n
Released under the MIT license @n
https://github.com/hirakuni45/RX/blob/master/LICENSE
*/
//=====================================================================//
#include "common/renesas.hpp"
namespace device {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/*!
@brief USB Host クラス
@param[in] USBIO USB_IO クラス
@param[in] PMAP 電源管理、ポート・マップ
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
template <class USBIO, port_map::option PMAP = port_map::option::FIRST>
class usb_host {
USBIO& usbio_;
uint8_t ilvl_;
static INTERRUPT_FUNC void i_task_()
{
}
public:
//-----------------------------------------------------------------//
/*!
@brief コンストラクター
@param[in] usbio USB_IO クラス(参照)
*/
//-----------------------------------------------------------------//
usb_host(USBIO& usbio) noexcept : usbio_(usbio), ilvl_(0)
{ }
//-----------------------------------------------------------------//
/*!
@brief 開始
@param[in] ilvl 割り込みレベル
@return 正常なら「true」
*/
//-----------------------------------------------------------------//
bool start(uint8_t ilvl) noexcept
{
ilvl_ = ilvl;
return true;
}
};
}