File: ch341a_spi.h

package info (click to toggle)
imsprog 1.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,828 kB
  • sloc: cpp: 6,525; ansic: 5,899; xml: 552; sh: 231; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download
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
/*
 * Copyright (C) 2018-2021 McMCC <mcmcc@mail.ru>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */
#ifndef __CH341_SPI_H__
#define __CH341_SPI_H__

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


#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))

int ch341a_spi_init(void);
int ch341a_spi_shutdown(void);
int ch341a_spi_send_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);
int enable_pins(bool enable);
int config_stream(unsigned int speed);
int ch341a_init_i2c(void);
int ch341a_init(uint8_t chipType, uint8_t i2cSpeed);
#endif /* __CH341_SPI_H__ */
/* End of [ch341a_spi.h] package */