9 辛佳奇

学生身份

我要认证

绿水青山境长静,花落虽频意自闲。

等级
TA的排名 2w+

软件实现uart 8n1 的接收

/** * @file * Software serial (UART) receiver * * This module implements the receive engine for asynchronous serial * communications using polling ("bit banging"). Transmission capability * is not provided. * * The data format is <tt>8-N-1&l

2020-08-20 14:49:52

MCU位操作实现(读写)

// Get a bit field from a value#define GetField(Var, Mask, Shift) \ (((Var) >> (Shift)) & (Mask))// Set a bit field in a value#define SetField(Var, Mask, Shift, Val) \ (Var) = (((Var) & ~((Mask) << (Shift))) | (((Val) &a

2020-08-20 14:47:38

PID float版本功能实现

/*! \details This structure holds the data to run a * floating point PID loop. */typedef struct{ float max /*! \brief Max manipulated value */; float min /*! \brief Miniumum manipulated value */; float e /*! \brief Error value */; float i /*! \brief

2020-08-20 14:46:17

加性高斯白噪声产生

#include <stdio.h>#include <stdlib.h>#include <math.h>#define PI 3.1415926536double AWGN_generator(){/* Generates additive white Gaussian Noise samples with zero mean and a standard deviation of 1. */ double temp1; double tem

2020-08-20 14:41:04

步进电机精确控制

/* * IBM-PC Parallel Printer Port Data & Status Registers * ==================================================== * 7 6 5 4 3 2 1 0 I/O Port * +---+---+---+---+---+---+---+---+ ======== * Data | C8| C7| C6| C5| C4| C3| C

2020-08-20 14:39:43

二进制表示

// The following macros build values in binary. Nybbles are separated by// commas for readability. If a non-binary digit is used, a compiler error// will result. Here are some examples of the usage of the binary macros://// B4 (0110) = 0x06//

2020-08-20 14:38:25

1维2维查找表线性差值实现

/** * @file * Table lookup with interpolation (1-D and 2-D). * * This is a 1/2-D table lookup facility. Each routine looks up data in a table * structure, interpolating as needed between data points. The 2-D version * looks up along 2 axes and int

2020-08-20 14:35:57

4*4矩阵运算

/Keypad connection: #define col0 PIN_B3#define col1 PIN_B2#define col2 PIN_B1#define col3 PIN_B0#define row0 PIN_B7#define row1 PIN_B6#define row2 PIN_B5#define row3 PIN_B4#define num_col 4// Keypad layout:char const KEYS[4][4] = {{1,2,3,13},

2020-08-20 14:32:43

键盘矩阵扫描实现

// PID Control program by Bill Keenan, Melbourne// Throttle PID loop stuff#define Umin -1022#define Umax 1022#define Kp 0.5 //#define Ki 0.005 //#define Kd 1.25 //float U0 = 0;float integ; // integration part of PID-loop must be saved float

2020-08-20 14:09:52

18B20 驱动 MSP430

float get_temp(void);void reset_18B20(void);void send_18B20(char data);unsigned int read_18B20(void);#define ONE_WIRE_PIN BIT4#define ONE_WIRE_IN P1IN#define ONE_WIRE_OUT P1OUT#define ONE_WIRE_DIR P1DIRfloat get_temp(void){ unsigned int temp

2020-08-20 14:08:39

循环FIFO buffer实现

/***** circularBuffer.h *****/#ifndef CIRCULAR_BUFFER_H_#define CIRCULAR_BUFFER_H_#define BUFFER_SIZE 128#define TYPE char// Check if the buffer it is fullbool isFull();// Check if the buffer it is empty bool isEmpty();// Get the first elemen

2020-08-20 13:48:26

SHT11 驱动

/*********** begin of library header file sht11.h ***************/#ifndef _SHTXX_H#define _SHTXX_H#include <inttypes.h>#define HUMIDITY_BYTE 0x05#define TEMPERATURE_BYTE 0x03//State machine states#define SHT_DATA_WAIT_INITIAL_STATE

2020-08-20 13:46:57

base64 编码

#include <string.h>#include <stdint.h>//This is a helper function to convert a six-bit value to base64char base64_encode_six(uint8_t six_bit_value){ uint8_t x; char c; x = six_bit_value & ~0xC0; //remove top two bits (should be zero

2020-08-20 10:31:47

mcu输入滤波

/**************************************************************************************//* sample usage of the library *//*****************************************************************************

2020-08-20 10:30:36

python handcalcs使用

项目开源地址 github.com/connorferster/handcalcsfrom math import sqrtimport handcalcs.render数据显示%%render#Parametersa =2b =-5c =3a=2b=−5c=3\begin{aligned}a &= 2 &b &= -5 &c &= 3\\\end{aligned}a​=2​b​=−5​c​=3​ %%render# Symbolic

2020-08-20 10:21:57

matlab音频频谱实现

function plot_amp_spectrum(Fs, y, varargin)%PLOT_AMP_SPECTRUM Plot amplitude spectrum of a one dimensional signal% PLOT_AMP_SPECTRUM(FS, Y, COLOR, SEMILOG_SCALE, TITLE_STRING) plots the% amplitude spectrum of y which has sampling frency Fs. Specific

2020-08-15 14:18:17

ARM 定点fir 汇编实现

/* ********************************************************************** * * Fixed Point Filtering Library * * ********************************************************************** * * lowpass_fir.S * * Jordan Rhee * rhee.jordan@gmail.com * *

2020-08-15 14:12:05

小数延时的实现

小数延迟的实现/****************DELAY.C*******************************/#include "delay.h"#include "math.h"#define MAX_BUF_SIZE 64000/****************************************************************************** Fractional delay line implementation i

2020-08-15 14:03:11

头文件保存matlab数据

% This program is useful to convert numbers in MATLAB's Double% format to a text file in float format for C compilers% You should copy the resulting text to a file and save it with .h% extension% THIS PROGRAM RECEIVES AN UNIDIMENTIONAL VECTOR OF DOUB

2020-08-15 13:57:39

音频能量计算

音频能量计算function [y] = pow_1(x)N = length(x); % Length of voice signal 'x'xold =0.0; %initialize it to zerofor n = 1:N sumx = xold+(x(n)^2); xold = sumx;endy = sumx/N

2020-08-15 13:51:56

查看更多

勋章 我的勋章
  • 新人勋章
    新人勋章
    用户发布第一条blink获赞超过3个即可获得
  • 专栏达人
    专栏达人
    授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。
  • 分享宗师
    分享宗师
    成功上传21个资源即可获取