software tools update

v2
lincaigui 6 months ago
parent 178d44a562
commit 39c6b12a46

@ -1,64 +1,64 @@
module ges_recognize( module ges_recognize(
input wire sys_clk , input wire sys_clk ,
input wire sys_rst_n , input wire sys_rst_n ,
output wire scl , output wire scl ,
inout wire sda , inout wire sda ,
output wire [3: 0] led , output wire [3: 0] led ,
output wire tx output wire tx
); );
wire [2: 0] step ; wire [2: 0] step ;
wire [5: 0] cfg_num ; wire [5: 0] cfg_num ;
wire [15: 0] cfg_data ; wire [15: 0] cfg_data ;
wire cfg_start ; wire cfg_start ;
wire i2c_clk ; wire i2c_clk ;
wire i2c_start ; wire i2c_start ;
wire [7: 0] po_data ; wire [7: 0] po_data ;
wire tx_vld ; wire tx_vld ;
reg send_flag ; reg send_flag ;
wire rx_vld ; wire rx_vld ;
assign rx_vld = po_data != 8'h00; assign rx_vld = po_data != 8'h00;
paj7620_cfg paj7620_cfg_inst( paj7620_cfg paj7620_cfg_inst(
.i2c_clk (i2c_clk ), .i2c_clk (i2c_clk ),
.sys_rst_n (sys_rst_n ), .sys_rst_n (sys_rst_n ),
.cfg_start (cfg_start ), .cfg_start (cfg_start ),
.step (step ), .step (step ),
.cfg_num (cfg_num ), .cfg_num (cfg_num ),
.cfg_data (cfg_data ), .cfg_data (cfg_data ),
.i2c_start (i2c_start ) .i2c_start (i2c_start )
); );
i2c_ctrl i2c_ctrl_inst( i2c_ctrl i2c_ctrl_inst(
.sys_clk (sys_clk ), .sys_clk (sys_clk ),
.sys_rst_n (sys_rst_n ), .sys_rst_n (sys_rst_n ),
.i2c_start (i2c_start ), .i2c_start (i2c_start ),
.cfg_num (cfg_num ), .cfg_num (cfg_num ),
.cfg_data (cfg_data ), .cfg_data (cfg_data ),
.cfg_start (cfg_start ), .cfg_start (cfg_start ),
.step (step ), .step (step ),
.i2c_clk (i2c_clk ), .i2c_clk (i2c_clk ),
.scl (scl ), .scl (scl ),
.sda (sda ), .sda (sda ),
.po_data (po_data ) .po_data (po_data )
); );
uart_tx uart_tx_inst( uart_tx uart_tx_inst(
.sys_clk (sys_clk), .sys_clk (sys_clk),
.sys_rst_n (sys_rst_n), .sys_rst_n (sys_rst_n),
.tx_din (po_data),// .tx_din (po_data),//
.rx_vld (rx_vld),// .rx_vld (rx_vld),//
.tx_vld (tx_vld), .tx_vld (tx_vld),
.tx_dout (tx)// .tx_dout (tx)//
); );
led_ctrl led_ctrl_inst( led_ctrl led_ctrl_inst(
.sys_clk (sys_clk ), .sys_clk (sys_clk ),
.sys_rst_n (sys_rst_n ), .sys_rst_n (sys_rst_n ),
.po_data (po_data ), .po_data (po_data ),
.led (led ) .led (led )
); );
endmodule endmodule

@ -0,0 +1,29 @@
# Copyright (C) 2018 Intel Corporation. All rights reserved.
# Your use of Intel Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Intel Program License
# Subscription Agreement, the Intel Quartus Prime License Agreement,
# the Intel FPGA IP License Agreement, or other applicable license
# agreement, including, without limitation, that your use is for
# the sole purpose of programming logic devices manufactured by
# Intel and sold by Intel or its authorized distributors. Please
# refer to the applicable agreement for further details.
# Quartus Prime Version 18.1.0 Build 625 09/12/2018 SJ Lite Edition
# File: C:\Users\Stark-lin\Desktop\gesture_tiktok\hardware\rtl\gesture_tiktok.tcl
# Generated on: Tue May 21 08:37:41 2024
package require ::quartus::project
set_location_assignment PIN_M12 -to sda
set_location_assignment PIN_N14 -to scl
set_location_assignment PIN_E1 -to sys_clk
set_location_assignment PIN_E15 -to sys_rst_n
set_location_assignment PIN_G1 -to tx
set_location_assignment PIN_G15 -to led[0]
set_location_assignment PIN_F16 -to led[1]
set_location_assignment PIN_F15 -to led[2]
set_location_assignment PIN_D16 -to led[3]

File diff suppressed because it is too large Load Diff

@ -1,253 +1,253 @@
module i2c_ctrl( module i2c_ctrl(
input wire sys_clk , input wire sys_clk ,
input wire sys_rst_n , input wire sys_rst_n ,
output wire scl , output wire scl ,
inout wire sda inout wire sda
); );
parameter I2C_CLK_DIV = 5'd24, parameter I2C_CLK_DIV = 5'd24,
MAX = 10'd1000, MAX = 10'd1000,
SLAVE_ID = 7'h73; SLAVE_ID = 7'h73;
// //
parameter IDLE = 3'd0, parameter IDLE = 3'd0,
START = 3'd1, START = 3'd1,
SLAVE_ADDR= 3'd2, SLAVE_ADDR= 3'd2,
WAIT = 3'd3, WAIT = 3'd3,
STOP = 3'd4; STOP = 3'd4;
reg [2: 0] state_c; reg [2: 0] state_c;
reg [2: 0] state_n; reg [2: 0] state_n;
//// ////
//i2c //i2c
reg [4: 0] cnt_clk; reg [4: 0] cnt_clk;
reg i2c_clk; reg i2c_clk;
///// /////
// //
reg [9: 0] cnt_wait ;//1000us reg [9: 0] cnt_wait ;//1000us
reg skip_en_1 ;// reg skip_en_1 ;//
reg [2: 0] step ;// reg [2: 0] step ;//
reg [1: 0] cnt_i2c_clk ;// reg [1: 0] cnt_i2c_clk ;//
reg [2: 0] cnt_bit ;//bit reg [2: 0] cnt_bit ;//bit
reg i2c_end ;//i2c reg i2c_end ;//i2c
wire sda_en ; wire sda_en ;
wire sda_in ; wire sda_in ;
reg i2c_sda ; reg i2c_sda ;
reg i2c_scl ; reg i2c_scl ;
reg [7: 0] slave_addr ; reg [7: 0] slave_addr ;
reg [7: 0] device_addr ; reg [7: 0] device_addr ;
reg [7: 0] wr_data ; reg [7: 0] wr_data ;
// //
assign sda_en = 1'b1;// assign sda_en = 1'b1;//
assign sda_in = sda; assign sda_in = sda;
assign sda = (sda_en == 1'b1)? i2c_sda : 1'bz; assign sda = (sda_en == 1'b1)? i2c_sda : 1'bz;
//i2c //i2c
always @(posedge sys_clk or negedge sys_rst_n) begin always @(posedge sys_clk or negedge sys_rst_n) begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
cnt_clk <= 5'd0; cnt_clk <= 5'd0;
end end
else if(cnt_clk == I2C_CLK_DIV)begin else if(cnt_clk == I2C_CLK_DIV)begin
cnt_clk <= 5'd0; cnt_clk <= 5'd0;
end end
else begin else begin
cnt_clk <= cnt_clk + 1; cnt_clk <= cnt_clk + 1;
end end
end end
always @(posedge sys_clk or negedge sys_rst_n) begin always @(posedge sys_clk or negedge sys_rst_n) begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
i2c_clk <= 1'b1; i2c_clk <= 1'b1;
end end
else if(cnt_clk == I2C_CLK_DIV)begin else if(cnt_clk == I2C_CLK_DIV)begin
i2c_clk <= ~i2c_clk; i2c_clk <= ~i2c_clk;
end end
else begin else begin
i2c_clk <= i2c_clk; i2c_clk <= i2c_clk;
end end
end end
///////// /////////
// //
always @(posedge sys_clk or negedge sys_rst_n) begin always @(posedge sys_clk or negedge sys_rst_n) begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
state_c <= IDLE; state_c <= IDLE;
end end
else begin else begin
state_c <= state_n; state_c <= state_n;
end end
end end
// //
always @(*)begin always @(*)begin
case(state_c) case(state_c)
IDLE: if(skip_en_1 == 1'b1)begin IDLE: if(skip_en_1 == 1'b1)begin
state_n = START; state_n = START;
end end
else begin else begin
state_n = IDLE; state_n = IDLE;
end end
START: if(skip_en_1 == 1'b1)begin START: if(skip_en_1 == 1'b1)begin
state_n = SLAVE_ADDR; state_n = SLAVE_ADDR;
end end
else begin else begin
state_n = START; state_n = START;
end end
SLAVE_ADDR: if(skip_en_1 == 1'b1)begin SLAVE_ADDR: if(skip_en_1 == 1'b1)begin
state_n = WAIT; state_n = WAIT;
end end
else begin else begin
state_n = SLAVE_ADDR; state_n = SLAVE_ADDR;
end end
WAIT: if(skip_en_1 == 1'b1)begin WAIT: if(skip_en_1 == 1'b1)begin
state_n = STOP; state_n = STOP;
end end
else begin else begin
state_n = WAIT; state_n = WAIT;
end end
STOP: if(skip_en_1 == 1'b1)begin STOP: if(skip_en_1 == 1'b1)begin
state_n = IDLE; state_n = IDLE;
end end
else begin else begin
state_n = STOP; state_n = STOP;
end end
default: begin default: begin
state_n = IDLE; state_n = IDLE;
end end
endcase endcase
end end
// //
always @(posedge i2c_clk or negedge sys_rst_n)begin always @(posedge i2c_clk or negedge sys_rst_n)begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
cnt_wait <= 10'd0; cnt_wait <= 10'd0;
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
step <= 3'd0; step <= 3'd0;
cnt_i2c_clk <= 2'd0; cnt_i2c_clk <= 2'd0;
cnt_bit <= 3'd0; cnt_bit <= 3'd0;
i2c_end <= 1'b0; i2c_end <= 1'b0;
end end
else begin else begin
case(state_c) case(state_c)
IDLE: begin IDLE: begin
if(cnt_wait == MAX - 1)begin if(cnt_wait == MAX - 1)begin
cnt_wait <= 10'd0; cnt_wait <= 10'd0;
end end
else begin else begin
cnt_wait <= cnt_wait + 1; cnt_wait <= cnt_wait + 1;
end end
if((cnt_wait == MAX - 2'd2) && (step == 3'd0))begin if((cnt_wait == MAX - 2'd2) && (step == 3'd0))begin
skip_en_1 <= 1'b1; skip_en_1 <= 1'b1;
end end
else begin else begin
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
end end
end end
START: begin START: begin
cnt_i2c_clk <= cnt_i2c_clk + 1'd1; cnt_i2c_clk <= cnt_i2c_clk + 1'd1;
if((cnt_i2c_clk == 2'd2) && (step == 3'd0))begin if((cnt_i2c_clk == 2'd2) && (step == 3'd0))begin
skip_en_1 <= 1'b1; skip_en_1 <= 1'b1;
end end
else begin else begin
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
end end
end end
SLAVE_ADDR: begin SLAVE_ADDR: begin
cnt_i2c_clk <= cnt_i2c_clk + 1'd1; cnt_i2c_clk <= cnt_i2c_clk + 1'd1;
if((cnt_i2c_clk == 2'd2) && (cnt_bit == 3'd7) && (step == 3'd0))begin if((cnt_i2c_clk == 2'd2) && (cnt_bit == 3'd7) && (step == 3'd0))begin
skip_en_1 <= 1'b1; skip_en_1 <= 1'b1;
end end
else begin else begin
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
end end
if((cnt_bit == 3'd7) && (cnt_i2c_clk == 2'd3))begin if((cnt_bit == 3'd7) && (cnt_i2c_clk == 2'd3))begin
cnt_bit <= 3'd0; cnt_bit <= 3'd0;
end end
else if(cnt_i2c_clk == 2'd3)begin else if(cnt_i2c_clk == 2'd3)begin
cnt_bit <= cnt_bit + 1'd1; cnt_bit <= cnt_bit + 1'd1;
end end
else begin else begin
cnt_bit <= cnt_bit; cnt_bit <= cnt_bit;
end end
end end
WAIT: begin WAIT: begin
if(cnt_wait == MAX - 1'd1)begin if(cnt_wait == MAX - 1'd1)begin
cnt_wait = 10'd0; cnt_wait = 10'd0;
end end
else begin else begin
cnt_wait <= cnt_wait + 1'd1; cnt_wait <= cnt_wait + 1'd1;
end end
if((cnt_wait == MAX - 2'd2) && (step == 3'd0))begin if((cnt_wait == MAX - 2'd2) && (step == 3'd0))begin
skip_en_1 <= 1'b1; skip_en_1 <= 1'b1;
end end
else begin else begin
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
end end
end end
STOP: begin STOP: begin
cnt_i2c_clk <= cnt_i2c_clk + 1'd1; cnt_i2c_clk <= cnt_i2c_clk + 1'd1;
if((cnt_i2c_clk == 2'd2) && (step == 3'd0))begin if((cnt_i2c_clk == 2'd2) && (step == 3'd0))begin
skip_en_1 <= 1'b1; skip_en_1 <= 1'b1;
end end
else begin else begin
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
end end
if(cnt_i2c_clk == 2'd2)begin if(cnt_i2c_clk == 2'd2)begin
i2c_end <= 1'b1; i2c_end <= 1'b1;
end end
else begin else begin
i2c_end <= 1'b0; i2c_end <= 1'b0;
end end
if(i2c_end == 1'b1)begin if(i2c_end == 1'b1)begin
step <= step + 1'd1; step <= step + 1'd1;
end end
else begin else begin
step <= step; step <= step;
end end
end end
default: begin default: begin
cnt_wait <= 10'd0; cnt_wait <= 10'd0;
skip_en_1 <= 1'b0; skip_en_1 <= 1'b0;
step <= step; step <= step;
cnt_i2c_clk <= 2'd0; cnt_i2c_clk <= 2'd0;
cnt_bit <= 3'd0; cnt_bit <= 3'd0;
i2c_end <= 1'b0; i2c_end <= 1'b0;
end end
endcase endcase
end end
end end
//step //step
always @(*)begin always @(*)begin
case(step) case(step)
3'd0: begin 3'd0: begin
slave_addr = {SLAVE_ID, 1'b0}; slave_addr = {SLAVE_ID, 1'b0};
device_addr = 8'h0; device_addr = 8'h0;
wr_data = 8'h0; wr_data = 8'h0;
end end
default:begin default:begin
slave_addr = 8'h0; slave_addr = 8'h0;
device_addr = 8'h0; device_addr = 8'h0;
wr_data = 8'h0; wr_data = 8'h0;
end end
endcase endcase
end end
//i2c_scl //i2c_scl
always @(*)begin always @(*)begin
case(state_c) case(state_c)
IDLE: i2c_scl = 1'b1; IDLE: i2c_scl = 1'b1;
START: i2c_scl = (cnt_i2c_clk >= 2'd2) ? 1'b1 : 1'b0; START: i2c_scl = (cnt_i2c_clk >= 2'd2) ? 1'b1 : 1'b0;
SLAVE_ADDR: i2c_scl = ((cnt_i2c_clk == 2'd1) || (cnt_i2c_clk == 2'd2)) ? 1'b1 : 1'b0; SLAVE_ADDR: i2c_scl = ((cnt_i2c_clk == 2'd1) || (cnt_i2c_clk == 2'd2)) ? 1'b1 : 1'b0;
WAIT: i2c_scl = 1'b0; WAIT: i2c_scl = 1'b0;
STOP: i2c_scl = (cnt_i2c_clk >= 2'd1) ? 1'b1 : 1'b0; STOP: i2c_scl = (cnt_i2c_clk >= 2'd1) ? 1'b1 : 1'b0;
endcase endcase
end end
//i2c_sda //i2c_sda
always @(*)begin always @(*)begin
case(state_c) case(state_c)
IDLE: i2c_sda = 1'b1; IDLE: i2c_sda = 1'b1;
START: i2c_sda = (cnt_i2c_clk >= 2'd1) ? 1'b0 : 1'b1; START: i2c_sda = (cnt_i2c_clk >= 2'd1) ? 1'b0 : 1'b1;
SLAVE_ADDR: i2c_sda = slave_addr[7 - cnt_bit]; SLAVE_ADDR: i2c_sda = slave_addr[7 - cnt_bit];
WAIT: i2c_sda = 1'b0; WAIT: i2c_sda = 1'b0;
STOP: i2c_sda = (cnt_i2c_clk >= 2'd2) ? 1'b1 : 1'b0; STOP: i2c_sda = (cnt_i2c_clk >= 2'd2) ? 1'b1 : 1'b0;
default: i2c_sda = 1'b1; default: i2c_sda = 1'b1;
endcase endcase
end end
assign scl = i2c_scl; assign scl = i2c_scl;
endmodule endmodule

@ -1,19 +1,19 @@
module led_ctrl( module led_ctrl(
input wire sys_clk , input wire sys_clk ,
input wire sys_rst_n , input wire sys_rst_n ,
input wire [7: 0] po_data , input wire [7: 0] po_data ,
output reg [3: 0] led output reg [3: 0] led
); );
wire [3: 0] data; wire [3: 0] data;
assign data = po_data[3: 0]; assign data = po_data[3: 0];
always @(posedge sys_clk or negedge sys_rst_n)begin always @(posedge sys_clk or negedge sys_rst_n)begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
led <= 4'b0000; led <= 4'b0000;
end end
else begin else begin
led <= data; led <= data;
end end
end end
endmodule endmodule

@ -1,86 +1,86 @@
module paj7620_cfg( module paj7620_cfg(
input wire i2c_clk , input wire i2c_clk ,
input wire sys_rst_n , input wire sys_rst_n ,
input wire cfg_start , input wire cfg_start ,
input wire [2: 0] step , input wire [2: 0] step ,
output reg [5: 0] cfg_num , output reg [5: 0] cfg_num ,
output wire [15: 0] cfg_data , output wire [15: 0] cfg_data ,
output reg i2c_start output reg i2c_start
); );
wire [15: 0] cfg_data_reg[50: 0]; wire [15: 0] cfg_data_reg[50: 0];
always @(posedge i2c_clk or negedge sys_rst_n)begin always @(posedge i2c_clk or negedge sys_rst_n)begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
cfg_num <= 6'd0; cfg_num <= 6'd0;
end end
else if((cfg_start == 1'b1) && (step == 3'd4))begin else if((cfg_start == 1'b1) && (step == 3'd4))begin
cfg_num <= cfg_num + 1'd1; cfg_num <= cfg_num + 1'd1;
end end
else begin else begin
cfg_num <= cfg_num; cfg_num <= cfg_num;
end end
end end
always @(posedge i2c_clk or negedge sys_rst_n)begin always @(posedge i2c_clk or negedge sys_rst_n)begin
if(!sys_rst_n)begin if(!sys_rst_n)begin
i2c_start <= 1'b0; i2c_start <= 1'b0;
end end
else if((cfg_data == 1'b1) && (step == 3'd4))begin else if((cfg_data == 1'b1) && (step == 3'd4))begin
i2c_start <= 1'b1; i2c_start <= 1'b1;
end end
else begin else begin
i2c_start <= 1'b0; i2c_start <= 1'b0;
end end
end end
assign cfg_data = (step == 3'd4) ? cfg_data_reg[cfg_num - 1]:16'h0; assign cfg_data = (step == 3'd4) ? cfg_data_reg[cfg_num - 1]:16'h0;
assign cfg_data_reg[00] = {8'hEF,8'h00}; assign cfg_data_reg[00] = {8'hEF,8'h00};
assign cfg_data_reg[01] = {8'h37,8'h07}; assign cfg_data_reg[01] = {8'h37,8'h07};
assign cfg_data_reg[02] = {8'h38,8'h17}; assign cfg_data_reg[02] = {8'h38,8'h17};
assign cfg_data_reg[03] = {8'h39,8'h06}; assign cfg_data_reg[03] = {8'h39,8'h06};
assign cfg_data_reg[04] = {8'h42,8'h01}; assign cfg_data_reg[04] = {8'h42,8'h01};
assign cfg_data_reg[05] = {8'h46,8'h2D}; assign cfg_data_reg[05] = {8'h46,8'h2D};
assign cfg_data_reg[06] = {8'h47,8'h0F}; assign cfg_data_reg[06] = {8'h47,8'h0F};
assign cfg_data_reg[07] = {8'h48,8'h3C}; assign cfg_data_reg[07] = {8'h48,8'h3C};
assign cfg_data_reg[08] = {8'h49,8'h00}; assign cfg_data_reg[08] = {8'h49,8'h00};
assign cfg_data_reg[09] = {8'h4A,8'h1E}; assign cfg_data_reg[09] = {8'h4A,8'h1E};
assign cfg_data_reg[10] = {8'h4C,8'h20}; assign cfg_data_reg[10] = {8'h4C,8'h20};
assign cfg_data_reg[11] = {8'h51,8'h10}; assign cfg_data_reg[11] = {8'h51,8'h10};
assign cfg_data_reg[12] = {8'h5E,8'h10}; assign cfg_data_reg[12] = {8'h5E,8'h10};
assign cfg_data_reg[13] = {8'h60,8'h27}; assign cfg_data_reg[13] = {8'h60,8'h27};
assign cfg_data_reg[14] = {8'h80,8'h42}; assign cfg_data_reg[14] = {8'h80,8'h42};
assign cfg_data_reg[15] = {8'h81,8'h44}; assign cfg_data_reg[15] = {8'h81,8'h44};
assign cfg_data_reg[16] = {8'h82,8'h04}; assign cfg_data_reg[16] = {8'h82,8'h04};
assign cfg_data_reg[17] = {8'h8B,8'h01}; assign cfg_data_reg[17] = {8'h8B,8'h01};
assign cfg_data_reg[18] = {8'h90,8'h06}; assign cfg_data_reg[18] = {8'h90,8'h06};
assign cfg_data_reg[19] = {8'h95,8'h0A}; assign cfg_data_reg[19] = {8'h95,8'h0A};
assign cfg_data_reg[20] = {8'h96,8'h0C}; assign cfg_data_reg[20] = {8'h96,8'h0C};
assign cfg_data_reg[21] = {8'h97,8'h05}; assign cfg_data_reg[21] = {8'h97,8'h05};
assign cfg_data_reg[22] = {8'h9A,8'h14}; assign cfg_data_reg[22] = {8'h9A,8'h14};
assign cfg_data_reg[23] = {8'h9C,8'h3F}; assign cfg_data_reg[23] = {8'h9C,8'h3F};
assign cfg_data_reg[24] = {8'hA5,8'h19}; assign cfg_data_reg[24] = {8'hA5,8'h19};
assign cfg_data_reg[25] = {8'hCC,8'h19}; assign cfg_data_reg[25] = {8'hCC,8'h19};
assign cfg_data_reg[26] = {8'hCD,8'h0B}; assign cfg_data_reg[26] = {8'hCD,8'h0B};
assign cfg_data_reg[27] = {8'hCE,8'h13}; assign cfg_data_reg[27] = {8'hCE,8'h13};
assign cfg_data_reg[28] = {8'hCF,8'h64}; assign cfg_data_reg[28] = {8'hCF,8'h64};
assign cfg_data_reg[29] = {8'hD0,8'h21}; assign cfg_data_reg[29] = {8'hD0,8'h21};
assign cfg_data_reg[30] = {8'hEF,8'h01}; assign cfg_data_reg[30] = {8'hEF,8'h01};
assign cfg_data_reg[31] = {8'h02,8'h0F}; assign cfg_data_reg[31] = {8'h02,8'h0F};
assign cfg_data_reg[32] = {8'h03,8'h10}; assign cfg_data_reg[32] = {8'h03,8'h10};
assign cfg_data_reg[33] = {8'h04,8'h02}; assign cfg_data_reg[33] = {8'h04,8'h02};
assign cfg_data_reg[34] = {8'h25,8'h01}; assign cfg_data_reg[34] = {8'h25,8'h01};
assign cfg_data_reg[35] = {8'h27,8'h39}; assign cfg_data_reg[35] = {8'h27,8'h39};
assign cfg_data_reg[36] = {8'h28,8'h7F}; assign cfg_data_reg[36] = {8'h28,8'h7F};
assign cfg_data_reg[37] = {8'h29,8'h08}; assign cfg_data_reg[37] = {8'h29,8'h08};
assign cfg_data_reg[38] = {8'h3E,8'hFF}; assign cfg_data_reg[38] = {8'h3E,8'hFF};
assign cfg_data_reg[39] = {8'h5E,8'h3D}; assign cfg_data_reg[39] = {8'h5E,8'h3D};
assign cfg_data_reg[40] = {8'h65,8'h96}; assign cfg_data_reg[40] = {8'h65,8'h96};
assign cfg_data_reg[41] = {8'h67,8'h97}; assign cfg_data_reg[41] = {8'h67,8'h97};
assign cfg_data_reg[42] = {8'h69,8'hCD}; assign cfg_data_reg[42] = {8'h69,8'hCD};
assign cfg_data_reg[43] = {8'h6A,8'h01}; assign cfg_data_reg[43] = {8'h6A,8'h01};
assign cfg_data_reg[44] = {8'h6D,8'h2C}; assign cfg_data_reg[44] = {8'h6D,8'h2C};
assign cfg_data_reg[45] = {8'h6E,8'h01}; assign cfg_data_reg[45] = {8'h6E,8'h01};
assign cfg_data_reg[46] = {8'h72,8'h01}; assign cfg_data_reg[46] = {8'h72,8'h01};
assign cfg_data_reg[47] = {8'h73,8'h35}; assign cfg_data_reg[47] = {8'h73,8'h35};
assign cfg_data_reg[48] = {8'h74,8'h00}; assign cfg_data_reg[48] = {8'h74,8'h00};
assign cfg_data_reg[49] = {8'h77,8'h01}; assign cfg_data_reg[49] = {8'h77,8'h01};
assign cfg_data_reg[50] = {8'hEF,8'h00}; assign cfg_data_reg[50] = {8'hEF,8'h00};
endmodule endmodule

@ -0,0 +1,29 @@
# Copyright (C) 2018 Intel Corporation. All rights reserved.
# Your use of Intel Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Intel Program License
# Subscription Agreement, the Intel Quartus Prime License Agreement,
# the Intel FPGA IP License Agreement, or other applicable license
# agreement, including, without limitation, that your use is for
# the sole purpose of programming logic devices manufactured by
# Intel and sold by Intel or its authorized distributors. Please
# refer to the applicable agreement for further details.
# Quartus Prime Version 18.1.0 Build 625 09/12/2018 SJ Lite Edition
# File: C:\Users\Stark-lin\Desktop\gesture_tiktok\hardware\tcl\gesture_tiktok.tcl
# Generated on: Tue May 21 08:18:12 2024
package require ::quartus::project
set_location_assignment PIN_D8 -to sda
set_location_assignment PIN_E7 -to scl
set_location_assignment PIN_E1 -to sys_clk
set_location_assignment PIN_E15 -to sys_rst_n
set_location_assignment PIN_G1 -to tx
set_location_assignment PIN_G15 -to led[0]
set_location_assignment PIN_F16 -to led[1]
set_location_assignment PIN_F15 -to led[2]
set_location_assignment PIN_D16 -to led[3]

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"log" "log"
"regexp"
"time" "time"
"github.com/StackExchange/wmi" "github.com/StackExchange/wmi"
@ -23,7 +24,9 @@ func check() string {
panic(fmt.Sprintf("Failed to query WMI: %v", err)) panic(fmt.Sprintf("Failed to query WMI: %v", err))
} }
return devices[0].Name[40:44] re := regexp.MustCompile(`COM\d+`)
dev := re.FindString(devices[0].Name)
return dev //获取串口名字
} }
func main() { func main() {
// 串口配置 // 串口配置
@ -57,6 +60,8 @@ func main() {
} else if buffer[0] == 0x02 { } else if buffer[0] == 0x02 {
robotgo.KeyPress("down") robotgo.KeyPress("down")
} else if buffer[0] == 0x04 {
robotgo.KeyPress("z")
} else if buffer[0] == 0x10 { } else if buffer[0] == 0x10 {
robotgo.KeyPress("f") robotgo.KeyPress("f")
} else { } else {

Binary file not shown.

Binary file not shown.

@ -0,0 +1,383 @@
;删除本文件可以恢复默认值。
;这是SSCOM的设置保存文件,您在程序中设置好的串口参数和字符串数据都会自动保存,请最好不要用外部编辑器改动本文件!
;如果文件被修改后程序不能打开,请删除本文件,程序将会自动生成一个新的ini文件.
;靠行首的半角分号是注释符号
;每行都以回车结束
;"="后面的H表示这是个HEX数据串
;"="后面的A表示这是个ASC字符串
;Nx表示第几条定义的字符串(1<x<=N)
N101=1,十六进制数据串1,1000
N1=H,13 00 FF 88
N102=3,字符串1,1000
N2=A,output string
N103=2,欢迎语,1000
N3=A,欢迎您使用SSCOM!
N104=0,4无注释,1000
N4=A,
N105=0,5无注释,1000
N5=A,
N106=0,6无注释,1000
N6=A,
N107=0,7无注释,1000
N7=A,
N108=0,8无注释,1000
N8=A,
N109=0,,1000
N9=A,作者的话:
N110=0,,1000
N10=A,为了更好地发展SSCOM软件.
N111=0,,1000
N11=A,请您注册嘉立创PCB打样F结尾ID.
N112=0,,1000
N12=A,本软件作者兼职了嘉立创业务员.
N113=0,,1000
N13=A,只有F结尾ID才能给作者带来收益.
N114=0,,1000
N14=A,即使您已有嘉立创的ID.
N115=0,,1000
N15=A,同一手机号也可以多注册一个F.
N116=0,,1000
N16=A,您将为SSCOM带来更多资金支持!
N117=0,,1000
N17=A,请联系F业务助理QQ:800058315
N118=0,,1000
N18=A,谢谢!(以上信息均可删除)
N119=0,19无注释,1000
N19=A,
N120=0,20无注释,1000
N20=A,
N121=0,21无注释,1000
N21=A,
N122=0,22无注释,1000
N22=A,
N123=0,23无注释,1000
N23=A,
N124=0,24无注释,1000
N24=A,
N125=0,25无注释,1000
N25=A,
N126=0,26无注释,1000
N26=A,
N127=0,27无注释,1000
N27=A,
N128=0,28无注释,1000
N28=A,
N129=0,29无注释,1000
N29=A,
N130=0,30无注释,1000
N30=A,
N131=0,31无注释,1000
N31=A,
N132=0,32无注释,1000
N32=A,
N133=0,33无注释,1000
N33=A,
N134=0,34无注释,1000
N34=A,
N135=0,35无注释,1000
N35=A,
N136=0,36无注释,1000
N36=A,
N137=0,37无注释,1000
N37=A,
N138=0,38无注释,1000
N38=A,
N139=0,39无注释,1000
N39=A,
N140=0,40无注释,1000
N40=A,
N141=0,41无注释,1000
N41=A,
N142=0,42无注释,1000
N42=A,
N143=0,43无注释,1000
N43=A,
N144=0,44无注释,1000
N44=A,
N145=0,45无注释,1000
N45=A,
N146=0,46无注释,1000
N46=A,
N147=0,47无注释,1000
N47=A,
N148=0,48无注释,1000
N48=A,
N149=0,49无注释,1000
N49=A,
N150=0,50无注释,1000
N50=A,
N151=0,51无注释,1000
N51=A,
N152=0,52无注释,1000
N52=A,
N153=0,53无注释,1000
N53=A,
N154=0,54无注释,1000
N54=A,
N155=0,55无注释,1000
N55=A,
N156=0,56无注释,1000
N56=A,
N157=0,57无注释,1000
N57=A,
N158=0,58无注释,1000
N58=A,
N159=0,59无注释,1000
N59=A,
N160=0,60无注释,1000
N60=A,
N161=0,61无注释,1000
N61=A,
N162=0,62无注释,1000
N62=A,
N163=0,63无注释,1000
N63=A,
N164=0,64无注释,1000
N64=A,
N165=0,65无注释,1000
N65=A,
N166=0,66无注释,1000
N66=A,
N167=0,67无注释,1000
N67=A,
N168=0,68无注释,1000
N68=A,
N169=0,69无注释,1000
N69=A,
N170=0,70无注释,1000
N70=A,
N171=0,71无注释,1000
N71=A,
N172=0,72无注释,1000
N72=A,
N173=0,73无注释,1000
N73=A,
N174=0,74无注释,1000
N74=A,
N175=0,75无注释,1000
N75=A,
N176=0,76无注释,1000
N76=A,
N177=0,77无注释,1000
N77=A,
N178=0,78无注释,1000
N78=A,
N179=0,79无注释,1000
N79=A,
N180=0,80无注释,1000
N80=A,
N181=0,81无注释,1000
N81=A,
N182=0,82无注释,1000
N82=A,
N183=0,83无注释,1000
N83=A,
N184=0,84无注释,1000
N84=A,
N185=0,85无注释,1000
N85=A,
N186=0,86无注释,1000
N86=A,
N187=0,87无注释,1000
N87=A,
N188=0,88无注释,1000
N88=A,
N189=0,89无注释,1000
N89=A,
N190=0,90无注释,1000
N90=A,
N191=0,91无注释,1000
N91=A,
N192=0,92无注释,1000
N92=A,
N193=0,93无注释,1000
N93=A,
N194=0,94无注释,1000
N94=A,
N195=0,95无注释,1000
N95=A,
N196=0,96无注释,1000
N96=A,
N197=0,97无注释,1000
N97=A,
N198=0,98无注释,1000
N98=A,
N199=0,99无注释,1000
N99=A,
;发送文件时每256字节延时时间ms
N1051=,1
;打开文件地址和名称
N1052=,
;主面板ASC字符串
N1053=,abcdefg
;主面板HEX数据串
N1054=,12 FF 00 30
;主面板发送方式(ASC or HEX)
N1055=,A
;主面板字符串发送间隔时间ms
N1056=,1000
;主面板字符串发送新行
N1057=,N
;多条字符串发送间隔时间ms
N1058=,1
;接收窗口是否HEX显示方式
N1059=,Y
;校验方式,0=None1=modbusCRC162=ADD3=XOR
N1060=,0
;保存DTR:
N1061=,Y
;保存RTS:
N1062=,N
;程序启动时是否打开串口
N1063=,N
;是否分包显示
N1064=,Y
;分包超时时间ms
N1065=,20
;接收窗背景颜色
N1066=,16777215
;显示缓冲上限,200K,500K,1M,2M,5M,10M,20M
N1067=,1000000
;远程IP地址
N1068=,120.76.28.211
;远程端口
N1069=,80
;本地端口
N1070=,777
;选择回车后发送行(带回显)
N1071=,N
;选择按键立即发送键值
N1072=,Y
;选择回显
N1073=,N
;第几字节至末尾加校验
N1074=,1
;至末尾倒数第几字节加校验,存第几个项目
N1075=,0
;终端仿真输入回车后是否自动加换行
N1076=,N
;当前串口号Port=COMX,网络模式):1=TCPCLIENT,2=TCPSERVER,3=UDP
N1080=,COM3
;波特率Band rate
N1081=,115200
;保存窗口宽度
N1082=,792
;保存窗口高度
N1083=,600
;保存窗口left
N1084=,287
;保存窗口top
N1085=,12
;分割线位置(右侧装多条自定义字符串的容器宽度)
N1086=,418
;多条发送按钮的宽度
N1087=,120
;保存窗口字体名称
N1088=,宋体
;保存窗口字体大小
N1089=,9
;保存窗口字体颜色
N1090=,0
;C:Chinese汉语,E:English
N1100=,汉语
;end
Loading…
Cancel
Save