このライブラリは1桁から8桁までのSeven segment Numeric LEDを制御します。 LEDはanode commonとcathode common を使用することができます。 LEDの表示は1秒で表示をスムースに切り替えるモードと、直ぐに切り替えるモードの2つのモードを選択することができます。 This library to control the Seven segment Numeric LED 8 digit of 1. You can use the LED cathode common and anode common. Switch mode LED display and a second displayed a smooth, you can choose two modes to switch modes quickly.
Dependents: kitchenTimer_Clock kitchenTimer LPC1114FN28_kitchenTimer_Clock SevenSegmentLedSample ... more
types.h
00001 /*----------------------------------------------------------------------------*/ 00002 /* File Information */ 00003 /*----------------------------------------------------------------------------*/ 00004 /* Name : types.h */ 00005 /* Type : C Programming Language Header */ 00006 /*----------------------------------------------------------------------------*/ 00007 /*----------------------------------------------------------------------------*/ 00008 00009 #ifndef __TYPES_H__ 00010 #define __TYPES_H__ 00011 00012 #include "stdint.h" 00013 /* 00014 typedef char int8_t; 00015 typedef unsigned char uint8_t; 00016 typedef signed short int16_t; 00017 typedef unsigned short uint16_t; 00018 typedef signed int int32_t; 00019 typedef unsigned int uint32_t; 00020 typedef signed long long int64_t; 00021 typedef unsigned long long uint64_t; 00022 */ 00023 //typedef bool bool_t; 00024 typedef enum{TRUE, FALSE} bool_t; 00025 00026 //========================================================================= 00027 // byte bit access 00028 //========================================================================= 00029 typedef union{ // BYTE/NIBBLE/BIT access 00030 uint8_t byte; // Byte access 00031 struct{ // Nibble access 00032 uint8_t lo : 4; // lower(Bit0 - 3) 00033 uint8_t hi : 4; // upper(Bit4 - 7) 00034 }nibble; 00035 struct{ // Bit access 00036 uint8_t b0 : 1; // Bit0 00037 uint8_t b1 : 1; // Bit1 00038 uint8_t b2 : 1; // Bit2 00039 uint8_t b3 : 1; // Bit3 00040 uint8_t b4 : 1; // Bit4 00041 uint8_t b5 : 1; // Bit5 00042 uint8_t b6 : 1; // Bit6 00043 uint8_t b7 : 1; // Bit7 00044 }bits; 00045 }byte_t; 00046 00047 //========================================================================= 00048 // word bit access 00049 //========================================================================= 00050 typedef union{ // WORD/BYTE/NIBBLE/BIT access 00051 uint16_t word; // Word access 00052 struct{ // Byte access 00053 uint8_t b0; // upper byte 00054 uint8_t b1; // lower byte 00055 }byte; 00056 struct { // Nibble access 00057 uint8_t n0 : 4; // lower byte low(Bit 0 - 3) 00058 uint8_t n1 : 4; // lower byte up (Bit 4 - 7) 00059 uint8_t n2 : 4; // upper byte low(Bit 8 - 11) 00060 uint8_t n3 : 4; // upper byte up (Bit12 - 15) 00061 }nibble; 00062 struct{ // Bit acces 00063 uint8_t b0 : 1; // Bit0 00064 uint8_t b1 : 1; // Bit1 00065 uint8_t b2 : 1; // Bit2 00066 uint8_t b3 : 1; // Bit3 00067 uint8_t b4 : 1; // Bit4 00068 uint8_t b5 : 1; // Bit5 00069 uint8_t b6 : 1; // Bit6 00070 uint8_t b7 : 1; // Bit7 00071 uint8_t b8 : 1; // Bit8 00072 uint8_t b9 : 1; // Bit9 00073 uint8_t b10: 1; // Bit10 00074 uint8_t b11: 1; // Bit11 00075 uint8_t b12: 1; // Bit12 00076 uint8_t b13: 1; // Bit13 00077 uint8_t b14: 1; // Bit14 00078 uint8_t b15: 1; // Bit15 00079 }bits; 00080 }word_t; 00081 00082 00083 //========================================================================= 00084 // ascii code 00085 //========================================================================= 00086 #define Z_NUL (0x00) 00087 #define Z_SOH (0x01) 00088 #define Z_STX (0x02) 00089 #define Z_ETX (0x03) 00090 #define Z_EOT (0x04) 00091 #define Z_ENQ (0x05) 00092 #define Z_ACK (0x06) 00093 #define Z_BEL (0x07) 00094 00095 #define Z_BS (0x08) 00096 #define Z_HT (0x09) 00097 #define Z_LF (0x0A) 00098 #define Z_HM (0x0B) 00099 #define Z_FF (0x0C) 00100 #define Z_CR (0x0D) 00101 #define Z_SO (0x0E) 00102 #define Z_SI (0x0F) 00103 00104 #define Z_DLE (0x10) 00105 #define Z_DC1 (0x11) 00106 #define Z_DC2 (0x12) 00107 #define Z_DC3 (0x13) 00108 #define Z_DC4 (0x14) 00109 #define Z_NAK (0x15) 00110 #define Z_SYN (0x16) 00111 #define Z_ETB (0x17) 00112 00113 00114 #endif /* __TYPES_H__*/
Generated on Mon Jul 18 2022 19:34:36 by 1.7.2