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 {
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.
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)
52 
53 typedef struct {
56  uint32_t arg1; // initial command: 0. Firmware blocks: byte count.
58  uint32_t arg2; // initial command: byte count. Firmware blocks: target address.
59  uint32_t zeros[8];
61 
62 typedef struct {
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);
int upload_firmware(fnusb_dev *dev, char *fw_filename)
Definition: loader.c:125
uint32_t arg2
Definition: loader.h:58
uint32_t base_addr
Definition: loader.h:48
uint32_t magic
Definition: loader.h:34
uint32_t tag
Definition: loader.h:35
uint32_t magic
Definition: loader.h:43
unsigned short uint16_t
uint32_t unk
Definition: loader.h:39
uint32_t tag
Definition: loader.h:55
uint32_t cmd
Definition: loader.h:57
uint32_t addr
Definition: loader.h:38
uint32_t arg1
Definition: loader.h:56
uint16_t ver_release
Definition: loader.h:46
int upload_cemd_data(fnusb_dev *dev)
Definition: loader.c:340
uint16_t ver_major
Definition: loader.h:45
uint16_t ver_patch
Definition: loader.h:47
uint32_t entry_addr
Definition: loader.h:50
uint32_t cmd
Definition: loader.h:37
uint32_t magic
Definition: loader.h:54
uint32_t size
Definition: loader.h:49
uint16_t ver_minor
Definition: loader.h:44
uint32_t bytes
Definition: loader.h:36
unsigned int uint32_t
int upload_firmware_from_memory(fnusb_dev *dev, unsigned char *fw_from_mem, unsigned int fw_size_in_bytes)
Definition: loader.c:233


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:38