Main Page
Namespaces
Classes
Files
File List
File Members
src
loader.h
Go to the documentation of this file.
1
/*
2
* This file is part of the OpenKinect Project. http://www.openkinect.org
3
*
4
* Copyright (c) 2011 individual OpenKinect contributors. See the CONTRIB file
5
* for details.
6
*
7
* This code is licensed to you under the terms of the Apache License, version
8
* 2.0, or, at your option, the terms of the GNU General Public License,
9
* version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10
* or the following URLs:
11
* http://www.apache.org/licenses/LICENSE-2.0
12
* http://www.gnu.org/licenses/gpl-2.0.txt
13
*
14
* If you redistribute this file in source form, modified or unmodified, you
15
* may:
16
* 1) Leave this header intact and distribute it under the same terms,
17
* accompanying it with the APACHE20 and GPL20 files, or
18
* 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19
* 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20
* In all cases you must keep the copyright notice intact and include a copy
21
* of the CONTRIB file.
22
*
23
* Binary distributions must follow the binary distribution requirements of
24
* either License.
25
*/
26
27
#pragma once
28
29
#include <stdint.h>
30
#include "
usb_libusb10.h
"
31
32
33
typedef
struct
{
34
uint32_t
magic
;
35
uint32_t
tag
;
36
uint32_t
bytes
;
37
uint32_t
cmd
;
38
uint32_t
addr
;
39
uint32_t
unk
;
40
}
bootloader_command
;
41
42
typedef
struct
{
43
uint32_t
magic
;
// Magic bytes. 2BL uses 0xF00BACCA, audios uses 0xCA77F00D
44
uint16_t
ver_minor
;
// The version string has four parts, each a 16-bit little-endian int.
45
uint16_t
ver_major
;
// Yes, minor comes before major.
46
uint16_t
ver_release
;
//
47
uint16_t
ver_patch
;
//
48
uint32_t
base_addr
;
// Base address of firmware image. 2BL starts at 0x10000, audios starts at 0x80000.
49
uint32_t
size
;
// Size of firmware image, in bytes
50
uint32_t
entry_addr
;
// Code entry point (absolute address)
51
}
firmware_header
;
52
53
typedef
struct
{
54
uint32_t
magic
;
55
uint32_t
tag
;
56
uint32_t
arg1
;
// initial command: 0. Firmware blocks: byte count.
57
uint32_t
cmd
;
58
uint32_t
arg2
;
// initial command: byte count. Firmware blocks: target address.
59
uint32_t
zeros[8];
60
}
cemdloader_command
;
61
62
typedef
struct
{
63
uint32_t
magic
;
64
uint32_t
tag
;
65
uint32_t
status
;
66
}
bootloader_status_code
;
67
68
int
upload_firmware
(
fnusb_dev
* dev,
char
* fw_filename);
69
int
upload_firmware_from_memory
(
fnusb_dev
* dev,
unsigned
char
* fw_from_mem,
unsigned
int
fw_size_in_bytes);
70
71
int
upload_cemd_data
(
fnusb_dev
* dev);
upload_firmware
int upload_firmware(fnusb_dev *dev, char *fw_filename)
Definition:
loader.c:125
cemdloader_command::arg2
uint32_t arg2
Definition:
loader.h:58
firmware_header::base_addr
uint32_t base_addr
Definition:
loader.h:48
firmware_header
Definition:
loader.h:42
fnusb_dev
Definition:
usb_libusb10.h:68
bootloader_command::magic
uint32_t magic
Definition:
loader.h:34
bootloader_command::tag
uint32_t tag
Definition:
loader.h:35
firmware_header::magic
uint32_t magic
Definition:
loader.h:43
uint16_t
unsigned short uint16_t
Definition:
OniPlatformWin32.h:66
bootloader_command::unk
uint32_t unk
Definition:
loader.h:39
cemdloader_command::tag
uint32_t tag
Definition:
loader.h:55
cemdloader_command::cmd
uint32_t cmd
Definition:
loader.h:57
bootloader_command::addr
uint32_t addr
Definition:
loader.h:38
cemdloader_command::arg1
uint32_t arg1
Definition:
loader.h:56
firmware_header::ver_release
uint16_t ver_release
Definition:
loader.h:46
upload_cemd_data
int upload_cemd_data(fnusb_dev *dev)
Definition:
loader.c:340
firmware_header::ver_major
uint16_t ver_major
Definition:
loader.h:45
bootloader_status_code
Definition:
loader.h:62
usb_libusb10.h
firmware_header::ver_patch
uint16_t ver_patch
Definition:
loader.h:47
firmware_header::entry_addr
uint32_t entry_addr
Definition:
loader.h:50
bootloader_command::cmd
uint32_t cmd
Definition:
loader.h:37
cemdloader_command::magic
uint32_t magic
Definition:
loader.h:54
firmware_header::size
uint32_t size
Definition:
loader.h:49
bootloader_command
Definition:
loader.h:33
bootloader_status_code::tag
uint32_t tag
Definition:
loader.h:64
firmware_header::ver_minor
uint16_t ver_minor
Definition:
loader.h:44
bootloader_command::bytes
uint32_t bytes
Definition:
loader.h:36
uint32_t
unsigned int uint32_t
Definition:
OniPlatformWin32.h:67
cemdloader_command
Definition:
loader.h:53
upload_firmware_from_memory
int upload_firmware_from_memory(fnusb_dev *dev, unsigned char *fw_from_mem, unsigned int fw_size_in_bytes)
Definition:
loader.c:233
bootloader_status_code::magic
uint32_t magic
Definition:
loader.h:63
bootloader_status_code::status
uint32_t status
Definition:
loader.h:65
libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:42