Linux下SPI环回测试

文章目录

  • 前言
  • 一、回环测试代码
    • 1.1 头文件 spidev.h
    • 2.2 c代码 spidev_test.c
  • 二、 编译验证
    • 2.1 交叉编译
    • 2.2 测试


前言

linux下做spi回环测试


一、回环测试代码

1.1 头文件 spidev.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/** include/linux/spi/spidev.h** Copyright (C) 2006 SWAPP*	Andrea Paterniani <a.paterniani@swapp-eng.it>** 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., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef SPIDEV_H
#define SPIDEV_H#include <linux/types.h>
#include <linux/ioctl.h>/* User space versions of kernel symbols for SPI clocking modes,* matching <linux/spi/spi.h>*/#define SPI_CPHA		0x01
#define SPI_CPOL		0x02#define SPI_MODE_0		(0|0)
#define SPI_MODE_1		(0|SPI_CPHA)
#define SPI_MODE_2		(SPI_CPOL|0)
#define SPI_MODE_3		(SPI_CPOL|SPI_CPHA)#define SPI_CS_HIGH		0x04
#define SPI_LSB_FIRST		0x08
#define SPI_3WIRE		0x10
#define SPI_LOOP		0x20
#define SPI_NO_CS		0x40
#define SPI_READY		0x80
#define SPI_TX_DUAL		0x100
#define SPI_TX_QUAD		0x200
#define SPI_RX_DUAL		0x400
#define SPI_RX_QUAD		0x800
#define SPI_CS_WORD		0x1000
#define SPI_TX_OCTAL		0x2000
#define SPI_RX_OCTAL		0x4000
#define SPI_3WIRE_HIZ		0x8000/*---------------------------------------------------------------------------*//* IOCTL commands */#define SPI_IOC_MAGIC			'k'/*** struct spi_ioc_transfer - describes a single SPI transfer* @tx_buf: Holds pointer to userspace buffer with transmit data, or null.*	If no data is provided, zeroes are shifted out.* @rx_buf: Holds pointer to userspace buffer for receive data, or null.* @len: Length of tx and rx buffers, in bytes.* @speed_hz: Temporary override of the device's bitrate.* @bits_per_word: Temporary override of the device's wordsize.* @delay_usecs: If nonzero, how long to delay after the last bit transfer*	before optionally deselecting the device before the next transfer.* @cs_change: True to deselect device before starting the next transfer.* @word_delay_usecs: If nonzero, how long to wait between words within one*	transfer. This property needs explicit support in the SPI controller,*	otherwise it is silently ignored.** This structure is mapped directly to the kernel spi_transfer structure;* the fields have the same meanings, except of course that the pointers* are in a different address space (and may be of different sizes in some* cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel).* Zero-initialize the structure, including currently unused fields, to* accommodate potential future updates.** SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync().* Pass it an array of related transfers, they'll execute together.* Each transfer may be half duplex (either direction) or full duplex.**	struct spi_ioc_transfer mesg[4];*	...*	status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg);** So for example one transfer might send a nine bit command (right aligned* in a 16-bit word), the next could read a block of 8-bit data before* terminating that command by temporarily deselecting the chip; the next* could send a different nine bit command (re-selecting the chip), and the* last transfer might write some register values.*/
struct spi_ioc_transfer {__u64		tx_buf;__u64		rx_buf;__u32		len;__u32		speed_hz;__u16		delay_usecs;__u8		bits_per_word;__u8		cs_change;__u8		tx_nbits;__u8		rx_nbits;__u8		word_delay_usecs;__u8		pad;/* If the contents of 'struct spi_ioc_transfer' ever change* incompatibly, then the ioctl number (currently 0) must change;* ioctls with constant size fields get a bit more in the way of* error checking than ones (like this) where that field varies.** NOTE: struct layout is the same in 64bit and 32bit userspace.*/
};/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
#define SPI_MSGSIZE(N) \((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])/* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) (limited to 8 bits) */
#define SPI_IOC_RD_MODE			_IOR(SPI_IOC_MAGIC, 1, __u8)
#define SPI_IOC_WR_MODE			_IOW(SPI_IOC_MAGIC, 1, __u8)/* Read / Write SPI bit justification */
#define SPI_IOC_RD_LSB_FIRST		_IOR(SPI_IOC_MAGIC, 2, __u8)
#define SPI_IOC_WR_LSB_FIRST		_IOW(SPI_IOC_MAGIC, 2, __u8)/* Read / Write SPI device word length (1..N) */
#define SPI_IOC_RD_BITS_PER_WORD	_IOR(SPI_IOC_MAGIC, 3, __u8)
#define SPI_IOC_WR_BITS_PER_WORD	_IOW(SPI_IOC_MAGIC, 3, __u8)/* Read / Write SPI device default max speed hz */
#define SPI_IOC_RD_MAX_SPEED_HZ		_IOR(SPI_IOC_MAGIC, 4, __u32)
#define SPI_IOC_WR_MAX_SPEED_HZ		_IOW(SPI_IOC_MAGIC, 4, __u32)/* Read / Write of the SPI mode field */
#define SPI_IOC_RD_MODE32		_IOR(SPI_IOC_MAGIC, 5, __u32)
#define SPI_IOC_WR_MODE32		_IOW(SPI_IOC_MAGIC, 5, __u32)#endif /* SPIDEV_H */

2.2 c代码 spidev_test.c

// SPDX-License-Identifier: GPL-2.0-only
/** SPI testing utility (using spidev driver)** Copyright (c) 2007  MontaVista Software, Inc.* Copyright (c) 2007  Anton Vorontsov <avorontsov@ru.mvista.com>** Cross-compile with cross-gcc -I/path/to/cross-kernel/include*/#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <getopt.h>
#include <fcntl.h>
#include <time.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
#include <sys/stat.h>
#include <linux/types.h>
#include "spidev.h"#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))static void pabort(const char *s)
{if (errno != 0)perror(s);elseprintf("%s\n", s);abort();
}static const char *device = "/dev/spidev1.1";
static uint32_t mode;
static uint8_t bits = 8;
static char *input_file;
static char *output_file;
static uint32_t speed = 500000;
static uint16_t delay;
static int verbose;
static int transfer_size;
static int iterations;
static int interval = 5; /* interval in seconds for showing transfer rate */static uint8_t default_tx[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0x40, 0x00, 0x00, 0x00, 0x00, 0x95,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xF0, 0x0D,
};static uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, };
static char *input_tx;static void hex_dump(const void *src, size_t length, size_t line_size,char *prefix)
{int i = 0;const unsigned char *address = src;const unsigned char *line = address;unsigned char c;printf("%s | ", prefix);while (length-- > 0) {printf("%02X ", *address++);if (!(++i % line_size) || (length == 0 && i % line_size)) {if (length == 0) {while (i++ % line_size)printf("__ ");}printf(" |");while (line < address) {c = *line++;printf("%c", (c < 32 || c > 126) ? '.' : c);}printf("|\n");if (length > 0)printf("%s | ", prefix);}}
}/**  Unescape - process hexadecimal escape character*      converts shell input "\x23" -> 0x23*/
static int unescape(char *_dst, char *_src, size_t len)
{int ret = 0;int match;char *src = _src;char *dst = _dst;unsigned int ch;while (*src) {if (*src == '\\' && *(src+1) == 'x') {match = sscanf(src + 2, "%2x", &ch);if (!match)pabort("malformed input string");src += 4;*dst++ = (unsigned char)ch;} else {*dst++ = *src++;}ret++;}return ret;
}static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len)
{int ret;int out_fd;struct spi_ioc_transfer tr = {.tx_buf = (unsigned long)tx,.rx_buf = (unsigned long)rx,.len = len,.delay_usecs = delay,.speed_hz = speed,.bits_per_word = bits,};if (mode & SPI_TX_OCTAL)tr.tx_nbits = 8;else if (mode & SPI_TX_QUAD)tr.tx_nbits = 4;else if (mode & SPI_TX_DUAL)tr.tx_nbits = 2;if (mode & SPI_RX_OCTAL)tr.rx_nbits = 8;else if (mode & SPI_RX_QUAD)tr.rx_nbits = 4;else if (mode & SPI_RX_DUAL)tr.rx_nbits = 2;if (!(mode & SPI_LOOP)) {if (mode & (SPI_TX_OCTAL | SPI_TX_QUAD | SPI_TX_DUAL))tr.rx_buf = 0;else if (mode & (SPI_RX_OCTAL | SPI_RX_QUAD | SPI_RX_DUAL))tr.tx_buf = 0;}ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);if (ret < 1)pabort("can't send spi message");if (verbose)hex_dump(tx, len, 32, "TX");if (output_file) {out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);if (out_fd < 0)pabort("could not open output file");ret = write(out_fd, rx, len);if (ret != len)pabort("not all bytes written to output file");close(out_fd);}if (verbose)hex_dump(rx, len, 32, "RX");
}static void print_usage(const char *prog)
{printf("Usage: %s [-DsbdlHOLC3vpNR24SI]\n", prog);puts("  -D --device   device to use (default /dev/spidev1.1)\n""  -s --speed    max speed (Hz)\n""  -d --delay    delay (usec)\n""  -b --bpw      bits per word\n""  -i --input    input data from a file (e.g. \"test.bin\")\n""  -o --output   output data to a file (e.g. \"results.bin\")\n""  -l --loop     loopback\n""  -H --cpha     clock phase\n""  -O --cpol     clock polarity\n""  -L --lsb      least significant bit first\n""  -C --cs-high  chip select active high\n""  -3 --3wire    SI/SO signals shared\n""  -v --verbose  Verbose (show tx buffer)\n""  -p            Send data (e.g. \"1234\\xde\\xad\")\n""  -N --no-cs    no chip select\n""  -R --ready    slave pulls low to pause\n""  -2 --dual     dual transfer\n""  -4 --quad     quad transfer\n""  -8 --octal    octal transfer\n""  -S --size     transfer size\n""  -I --iter     iterations\n");exit(1);
}static void parse_opts(int argc, char *argv[])
{while (1) {static const struct option lopts[] = {{ "device",  1, 0, 'D' },{ "speed",   1, 0, 's' },{ "delay",   1, 0, 'd' },{ "bpw",     1, 0, 'b' },{ "input",   1, 0, 'i' },{ "output",  1, 0, 'o' },{ "loop",    0, 0, 'l' },{ "cpha",    0, 0, 'H' },{ "cpol",    0, 0, 'O' },{ "lsb",     0, 0, 'L' },{ "cs-high", 0, 0, 'C' },{ "3wire",   0, 0, '3' },{ "no-cs",   0, 0, 'N' },{ "ready",   0, 0, 'R' },{ "dual",    0, 0, '2' },{ "verbose", 0, 0, 'v' },{ "quad",    0, 0, '4' },{ "octal",   0, 0, '8' },{ "size",    1, 0, 'S' },{ "iter",    1, 0, 'I' },{ NULL, 0, 0, 0 },};int c;c = getopt_long(argc, argv, "D:s:d:b:i:o:lHOLC3NR248p:vS:I:",lopts, NULL);if (c == -1)break;switch (c) {case 'D':device = optarg;break;case 's':speed = atoi(optarg);break;case 'd':delay = atoi(optarg);break;case 'b':bits = atoi(optarg);break;case 'i':input_file = optarg;break;case 'o':output_file = optarg;break;case 'l':mode |= SPI_LOOP;break;case 'H':mode |= SPI_CPHA;break;case 'O':mode |= SPI_CPOL;break;case 'L':mode |= SPI_LSB_FIRST;break;case 'C':mode |= SPI_CS_HIGH;break;case '3':mode |= SPI_3WIRE;break;case 'N':mode |= SPI_NO_CS;break;case 'v':verbose = 1;break;case 'R':mode |= SPI_READY;break;case 'p':input_tx = optarg;break;case '2':mode |= SPI_TX_DUAL;break;case '4':mode |= SPI_TX_QUAD;break;case '8':mode |= SPI_TX_OCTAL;break;case 'S':transfer_size = atoi(optarg);break;case 'I':iterations = atoi(optarg);break;default:print_usage(argv[0]);}}if (mode & SPI_LOOP) {if (mode & SPI_TX_DUAL)mode |= SPI_RX_DUAL;if (mode & SPI_TX_QUAD)mode |= SPI_RX_QUAD;if (mode & SPI_TX_OCTAL)mode |= SPI_RX_OCTAL;}
}static void transfer_escaped_string(int fd, char *str)
{size_t size = strlen(str);uint8_t *tx;uint8_t *rx;tx = malloc(size);if (!tx)pabort("can't allocate tx buffer");rx = malloc(size);if (!rx)pabort("can't allocate rx buffer");size = unescape((char *)tx, str, size);transfer(fd, tx, rx, size);free(rx);free(tx);
}static void transfer_file(int fd, char *filename)
{ssize_t bytes;struct stat sb;int tx_fd;uint8_t *tx;uint8_t *rx;if (stat(filename, &sb) == -1)pabort("can't stat input file");tx_fd = open(filename, O_RDONLY);if (tx_fd < 0)pabort("can't open input file");tx = malloc(sb.st_size);if (!tx)pabort("can't allocate tx buffer");rx = malloc(sb.st_size);if (!rx)pabort("can't allocate rx buffer");bytes = read(tx_fd, tx, sb.st_size);if (bytes != sb.st_size)pabort("failed to read input file");transfer(fd, tx, rx, sb.st_size);free(rx);free(tx);close(tx_fd);
}static uint64_t _read_count;
static uint64_t _write_count;static void show_transfer_rate(void)
{static uint64_t prev_read_count, prev_write_count;double rx_rate, tx_rate;rx_rate = ((_read_count - prev_read_count) * 8) / (interval*1000.0);tx_rate = ((_write_count - prev_write_count) * 8) / (interval*1000.0);printf("rate: tx %.1fkbps, rx %.1fkbps\n", rx_rate, tx_rate);prev_read_count = _read_count;prev_write_count = _write_count;
}static void transfer_buf(int fd, int len)
{uint8_t *tx;uint8_t *rx;int i;tx = malloc(len);if (!tx)pabort("can't allocate tx buffer");for (i = 0; i < len; i++)tx[i] = random();rx = malloc(len);if (!rx)pabort("can't allocate rx buffer");transfer(fd, tx, rx, len);_write_count += len;_read_count += len;if (mode & SPI_LOOP) {if (memcmp(tx, rx, len)) {fprintf(stderr, "transfer error !\n");hex_dump(tx, len, 32, "TX");hex_dump(rx, len, 32, "RX");exit(1);}}free(rx);free(tx);
}int main(int argc, char *argv[])
{int ret = 0;int fd;parse_opts(argc, argv);if (input_tx && input_file)pabort("only one of -p and --input may be selected");fd = open(device, O_RDWR);if (fd < 0)pabort("can't open device");/** spi mode*/ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode);if (ret == -1)pabort("can't set spi mode");ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode);if (ret == -1)pabort("can't get spi mode");/** bits per word*/ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);if (ret == -1)pabort("can't set bits per word");ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);if (ret == -1)pabort("can't get bits per word");/** max speed hz*/ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);if (ret == -1)pabort("can't set max speed hz");ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);if (ret == -1)pabort("can't get max speed hz");printf("spi mode: 0x%x\n", mode);printf("bits per word: %u\n", bits);printf("max speed: %u Hz (%u kHz)\n", speed, speed/1000);if (input_tx)transfer_escaped_string(fd, input_tx);else if (input_file)transfer_file(fd, input_file);else if (transfer_size) {struct timespec last_stat;clock_gettime(CLOCK_MONOTONIC, &last_stat);while (iterations-- > 0) {struct timespec current;transfer_buf(fd, transfer_size);clock_gettime(CLOCK_MONOTONIC, &current);if (current.tv_sec - last_stat.tv_sec > interval) {show_transfer_rate();last_stat = current;}}printf("total: tx %.1fKB, rx %.1fKB\n",_write_count/1024.0, _read_count/1024.0);} elsetransfer(fd, default_tx, default_rx, sizeof(default_tx));close(fd);return ret;
}

二、 编译验证

2.1 交叉编译

arm-linux-gnueabihf-gcc  spidev_test.c -o spidev_test -static

2.2 测试

./spidev_test -D /dev/spidev1.0 -v -p 12345678

没短接rx,tx,数据接收异常

在这里插入图片描述

短接rx,tx,数据收发正常
在这里插入图片描述


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/192832.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

蓝桥杯 插入排序

插入排序的思想 插入排序是一种简单直观的排序算法&#xff0c;其基本思想是将待排序的元素逐个插入到已排序序列 的合适位置中&#xff0c;使得已排序序列逐渐扩大&#xff0c;从而逐步构建有序序列&#xff0c;最终得到完全有序的序 列。 它类似于我们打扑克牌时的排序方式&…

竞赛 题目:基于卷积神经网络的手写字符识别 - 深度学习

文章目录 0 前言1 简介2 LeNet-5 模型的介绍2.1 结构解析2.2 C1层2.3 S2层S2层和C3层连接 2.4 F6与C5层 3 写数字识别算法模型的构建3.1 输入层设计3.2 激活函数的选取3.3 卷积层设计3.4 降采样层3.5 输出层设计 4 网络模型的总体结构5 部分实现代码6 在线手写识别7 最后 0 前言…

探索未来,开启无限可能:打造智慧应用,亚马逊云科技大语言模型助您一臂之力

文章目录 什么是大模型&#xff1f;大模型训练方法亚马逊云科技推出生成式AI新工具 —— aws toolkit使用教程 总结 什么是大模型&#xff1f; 近期&#xff0c;生成式大模型是人工智能领域的研究热点。这些生成式大模型&#xff0c;诸如文心一言、文心一格、ChatGPT、Stable …

Linux 系统目录结构

Linux 系统目录结构 登录系统后&#xff0c;在当前命令窗口下输入命令&#xff1a; ls / 你会看到如下图所示: 以下是对这些目录的解释&#xff1a; /bin&#xff1a; bin 是 Binaries (二进制文件) 的缩写, 这个目录存放着最经常使用的命令。 /boot&#xff1a; 这里存放…

【Java 进阶篇】JQuery 案例:优雅的隔行换色

在前端的设计中&#xff0c;页面的美观性是至关重要的。而其中一个简单而实用的设计技巧就是隔行换色。通过巧妙地使用 JQuery&#xff0c;我们可以轻松地实现这一效果&#xff0c;为网页增添一份优雅。本篇博客将详细解析 JQuery 隔行换色的实现原理和应用场景&#xff0c;让我…

python数据处理作业11:建一个5*3的随机数组和一个3*2的数组,其元素为1,2,3,4,5,6,求两矩阵的积

每日小语 打碎的杯子&#xff0c;烫伤的手&#xff0c;对菩萨是堪忍&#xff0c;因为他在里面得悟甚深之法&#xff0c;心生欢喜。 可是对一般人来说&#xff0c;一生何止打破千百个杯子&#xff1f;何止烫伤过千百次手&#xff1f;他只是痛苦地忍受&#xff0c;只记得下次要…

基于SpringBoot+Redis的前后端分离外卖项目-苍穹外卖(三)

员工分页查询和账号启用禁用功能 1. 员工分页查询1.1 需求分析和设计1.1.1 产品原型1.1.2 接口设计 1.2 代码开发1.2.1 设计DTO类1.2.2 封装PageResult1.2.3 Controller层1.2.4 Service层接口1.2.5 Service层实现类1.2.6 Mapper层 1.3 功能测试1.4 代码完善 2. 启用禁用员工账号…

数据结构—内部排序(下)

文章目录 8.内部排序(下)(6).归并排序#1.先做合并#2.再来排序#3.代码实现#4.稳定性与时间复杂度分析 (7).快速排序#1.算法思想#2.代码实现#3.稳定性与时间复杂度分析 (8).基数排序#1.算法思想#2.稳定性和时间复杂度分析 小结 8.内部排序(下) (6).归并排序 那我们的时间复杂度还…

C++ [多态]

本文已收录至《C语言和高级数据结构》专栏&#xff01; 作者&#xff1a;ARMCSKGT 多态 前言正文多态的概念多态的定义构成多态的条件关于final和override关于重载,重写和重定义 抽象类概念补充 多态的原理虚表指针和虚表关于虚函数的调用动态绑定和静态绑定 单继承与多继承中的…

it is missing from your system. Install or enable PHP‘s sodium extension.

Composer with –ignore-platform-reqext-sodium it is missing from your system. Install or enable PHP’s sodium extension. 出现如上的报错是的 开启php.ini中的 sodium的扩展

Docker Rootfs

一、rootfs 介绍 rootfs 是一个操作系统所包含的文件、配置和目录&#xff0c;并不包括操作系统内核。在 Linux 操作系统中&#xff0c;这两部分是分开存放的&#xff0c;操作系统只有在开机启动时才会加载指定版本的内核镜像。 实际上&#xff0c;同一台机器上的所有容器&am…

【解决方案】危化品厂区安防系统EasyCVR+AI智能监控

危化品属于危险、易燃易爆、易中毒行类&#xff0c;一旦在生产运输过程中发生泄漏后果不堪想象&#xff0c;所以危化品的生产储存更需要严密、精细的监控&#xff0c;来保障危化品的安全。EasyCVRTSINGSEE青犀AI智能分析网关搭建的危化品智能监控方案就能很好的为危化品监管保驾…

RedisTemplate乱码问题

其实这是在解决一个项目问题是发现的&#xff0c;因为原开发者的大意&#xff0c;造成了系统出现严重的逻辑问题。 因为系统系统采用分模块开发&#xff0c;某模块使用Spring提供的RedisTemplate进行值的读写&#xff0c;另一位使用了框架基于Jedis的一套公用方法进行值的读写…

海康设备、LiveNVR等通过GB35114国密协议对接到LiveGBS GB28181/GB35114平台的详细操作说明

一、LiveNVR通过GB35114接入LiveGBS 1.1 开启LiveGBS 35114功能 信令服务livecms.ini配置文件中[sip]增加一行gm1 启动LiveCMS 1.2 生成设备端证书 我们用LiveNVR做为设备端向LiveGBS注册&#xff0c;这里先生成LiveNVR的设备证书&#xff0c;并将LiveNVR的设备证书给LiveGB…

echarts实现不展示X轴Y轴轴线、刻度

今日工作中需要实现折线图的简图&#xff0c;就是只看个大概趋势不展示具体坐标&#xff0c;查阅了文档记录一下。 initCharts(_id, _name, yAxisData, _unit){if(this[_id]) this[_id].clear();this[_id] $echarts.init(document.getElementById(_id));const options {grid…

瑞吉外卖Day04

1.文件的上传下载 Value("${reggie.path}")private String basePath;/*** 文件上传** param file* return*/PostMapping("/upload")public R<String> upload(MultipartFile file) {log.info("文件上传");//原始文件名String originalFilen…

JimuReport积木报表 v1.6.5 版本发布—免费报表工具

项目介绍 一款免费的数据可视化报表&#xff0c;含报表和大屏设计&#xff0c;像搭建积木一样在线设计报表&#xff01;功能涵盖&#xff0c;数据报表、打印设计、图表报表、大屏设计等&#xff01; Web 版报表设计器&#xff0c;类似于excel操作风格&#xff0c;通过拖拽完成报…

k8s集群搭建(ubuntu 20.04 + k8s 1.28.3 + calico + containerd1.7.8)

环境&需求 服务器&#xff1a; 10.235.165.21 k8s-master 10.235.165.22 k8s-slave1 10.235.165.23 k8s-slave2OS版本&#xff1a; rootvms131:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: …

从头开始的卷积神经网络

VGG-16 卷积神经网络。来源&#xff1a;LearnOpenCV 参考资料&#xff1a;这篇文章可以在 Kaggle Notebook &#x1f9e0; Convolutional Neural Network From Scratch上更好地阅读。路易斯费尔南多托雷斯 一、说明 本文详细介绍在tf2.0上&#xff0c;使用ceras实现基本的神经…

μC/OS-II---计时器管理1(os_tmr.c)

目录 创建一个计时器重新启动一个计时器停止一个计时器删除一个计时器 计时器是倒计时器&#xff0c;当计数器达到零时执行某个动作。用户通过回调函数提供这个动作。回调函数是用户声明的函数&#xff0c;在计时器到期时被调用。在回调函数中绝对不能进行阻塞调用&#xff08;…