From 238918dad8dcb440f8f55a9ce3b15dd583d6d348 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 03 Nov 2021 23:09:01 +0800 Subject: [PATCH] update makefile and add pin.txt --- /dev/null | 38 ------------------- modules/c/makefile | 4 -- modules/c/pin.txt | 27 +++++++++++++ 3 files changed, 27 insertions(+), 42 deletions(-) diff --git a/modules/c/beep.h b/modules/c/beep.h deleted file mode 100644 index 68c4751..0000000 --- a/modules/c/beep.h +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************************* - * Copyright: (C) 2018 LingYun IoT System Studio - * All rights reserved. - * - * Filename: beep.h - * Description: This file is used to control Passive buzzer or Active buzzer - * - * pi@raspberrypi:~ $ gpio readall show BCM and wPi pinmap - * - * VCC ---- 5V/3.3V - * GND ---- GND - * I/O ---- GPIO.18 ---- GPIO.1 - * BCM wPi - * - * Version: 1.0.0(2018/10/14) - * Author: Guo Wenxue <guowenxue@gmail.com> - * ChangeLog: 1, Release initial version on "2018/10/14 12:13:26" - * - ********************************************************************************/ - -#ifndef __BEEP_H -#define __BEEP_H - -#define OFF 0 -#define ON 1 - -#define BEEP_FREQ 2400 - -/* Use Pin12 == GPIO18(BCM) == GPIO.1(wPi) */ -#define PWM_PIN 1 - - -int turn_passive_beep(int cmd, int freq); - -int turn_active_beep(int cmd); - -#endif - diff --git a/modules/c/makefile b/modules/c/makefile index 240ce22..e397ab0 100644 --- a/modules/c/makefile +++ b/modules/c/makefile @@ -18,10 +18,6 @@ CFLAGS+=-I${PWD} #CFLAGS+=-Wall -Werror -# default use libgpiod library -#CFLAGS+=-DCONFIG_USE_WIRINGPI - -LDFLAGS+=-lwiringPi LDFLAGS+=-lgpiod LDFLAGS+=-lpthread LDFLAGS+=-lm diff --git a/modules/c/pin.txt b/modules/c/pin.txt new file mode 100644 index 0000000..07aef89 --- /dev/null +++ b/modules/c/pin.txt @@ -0,0 +1,27 @@ +pi@raspberrypi:~$ gpio readall + +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ + | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | + +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ + | | | 3.3v | | | 1 || 2 | | | 5v | | | + | 2 | 8 | SDA.1 | ALT0 | 1 | 3 || 4 | | | 5v | | | + | 3 | 9 | SCL.1 | ALT0 | 1 | 5 || 6 | | | 0v | | | + | 4 | 7 | GPIO. 7 | OUT | 0 | 7 || 8 | 1 | ALT5 | TxD | 15 | 14 | + | | | 0v | | | 9 || 10 | 1 | ALT5 | RxD | 16 | 15 | + | 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 | + | 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | | + | 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 | + | | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 | + | 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | | + | 9 | 13 | MISO | IN | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 | + | 11 | 14 | SCLK | IN | 0 | 23 || 24 | 1 | IN | CE0 | 10 | 8 | + | | | 0v | | | 25 || 26 | 1 | IN | CE1 | 11 | 7 | + | 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 | + | 5 | 21 | GPIO.21 | OUT | 0 | 29 || 30 | | | 0v | | | + | 6 | 22 | GPIO.22 | OUT | 0 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 | + | 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | | + | 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 | + | 26 | 25 | GPIO.25 | OUT | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 | + | | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 | + +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ + | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | + +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ -- Gitblit v1.9.1