-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsupport.h
30 lines (26 loc) · 1.21 KB
/
support.h
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
/*
* Copyright 2015 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* This file was copied from https://github.com/devttys0/libmpsse.git (sha1
* f1a6744b), and modified to suite the Chromium OS project.
*/
#ifndef TRUNKS_FTDI_SUPPORT_H_
#define TRUNKS_FTDI_SUPPORT_H_
#include "mpsse.h"
int raw_write(struct mpsse_context* mpsse, uint8_t* buf, int size);
int raw_read(struct mpsse_context* mpsse, uint8_t* buf, int size);
void set_timeouts(struct mpsse_context* mpsse, int timeout);
uint16_t freq2div(uint32_t system_clock, uint32_t freq);
uint32_t div2freq(uint32_t system_clock, uint16_t div);
uint8_t* build_block_buffer(struct mpsse_context* mpsse,
uint8_t cmd,
const uint8_t* data,
int size,
int* buf_size);
int set_bits_high(struct mpsse_context* mpsse, int port);
int set_bits_low(struct mpsse_context* mpsse, int port);
int gpio_write(struct mpsse_context* mpsse, int pin, int direction);
int is_valid_context(struct mpsse_context* mpsse);
#endif /* TRUNKS_FTDI_SUPPORT_H_ */