加入外设头文件,移动中断编号
This commit is contained in:
36
tb/sw/periph/gpio.h
Normal file
36
tb/sw/periph/gpio.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef _GPIO_H_
|
||||
#define _GPIO_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define GPIO_BASE 0x3000000U
|
||||
|
||||
#define GPIO_VALUE 0x00
|
||||
#define GPIO_INPUT_EN 0x04
|
||||
#define GPIO_OUTPUT_EN 0x08
|
||||
#define GPIO_PORT 0x0c
|
||||
#define GPIO_PULLUP_EN 0x10
|
||||
#define GPIO_DRIVE 0x14
|
||||
#define GPIO_RISE_IE 0x18
|
||||
#define GPIO_RISE_IP 0x1c
|
||||
#define GPIO_FALL_IE 0x20
|
||||
#define GPIO_FALL_IP 0x24
|
||||
#define GPIO_HIGH_IE 0x28
|
||||
#define GPIO_HIGH_IP 0x2c
|
||||
#define GPIO_LOW_IE 0x30
|
||||
#define GPIO_LOW_IP 0x34
|
||||
#define GPIO_IOF_EN 0x38
|
||||
#define GPIO_IOF_SEL 0x3c
|
||||
#define GPIO_OUT_XOR 0x40
|
||||
#define GPIO_PASSTHRU_HIGH_IE 0x44
|
||||
#define GPIO_PASSTHRU_LOW_IE 0x48
|
||||
#define GPIO_PS 0x4c
|
||||
#define GPIO_POE 0x50
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
13
tb/sw/periph/i2c.h
Normal file
13
tb/sw/periph/i2c.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _I2C_H_
|
||||
#define _I2C_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define I2C_BASE 0x3040000U
|
||||
|
||||
#define I2C_PRESCALER_LO 0x00 // low byte clock prescaler register
|
||||
#define I2C_PRESCALER_HI 0x04 // high byte clock prescaler register
|
||||
#define I2C_CONTROL 0x08 // control register
|
||||
#define I2C_DATA 0x0c // write: transmit byte, read: receive byte
|
||||
#define I2C_CMD_STATUS 0x10 // write: command, read: status
|
||||
|
||||
21
tb/sw/periph/pwm.h
Normal file
21
tb/sw/periph/pwm.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _PWM_H_
|
||||
#define _PWM_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PWM_BASE 0x3020000U
|
||||
|
||||
#define CFG 0x00
|
||||
|
||||
#define COUNT 0x08
|
||||
|
||||
#define PWMS 0x10
|
||||
|
||||
#define CMP0 0x20
|
||||
#define CMP1 0x24
|
||||
#define CMP2 0x28
|
||||
#define CMP3 0x2C
|
||||
|
||||
|
||||
|
||||
|
||||
31
tb/sw/periph/spi.h
Normal file
31
tb/sw/periph/spi.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _SPI_H_
|
||||
#define _SPI_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SPI_BASE 0x3030000U
|
||||
|
||||
#define SPI_SCKDIV 0x00
|
||||
#define SPI_SCKMODE 0x04
|
||||
#define SPI_CSID 0x10
|
||||
#define SPI_CSDEF 0x14
|
||||
#define SPI_CSMODE 0x18
|
||||
#define SPI_DCSSCK 0x28
|
||||
#define SPI_DSCKCS 0x2a
|
||||
#define SPI_DINTERCS 0x2c
|
||||
#define SPI_DINTERXFR 0x2e
|
||||
#define SPI_EXTRADEL 0x38
|
||||
#define SPI_SAMPLEDEL 0x3c
|
||||
#define SPI_FMT 0x40
|
||||
#define SPI_LEN 0x42
|
||||
#define SPI_TXFIFO 0x48
|
||||
#define SPI_RXFIFO 0x4c
|
||||
#define SPI_TXMARK 0x50
|
||||
#define SPI_RXMARK 0x54
|
||||
#define SPI_INSNMODE 0x60
|
||||
#define SPI_INSNFMT 0x64
|
||||
#define SPI_INSNPROTO 0x65
|
||||
#define SPI_INSNCMD 0x66
|
||||
#define SPI_INSNPAD 0x67
|
||||
#define SPI_IE 0x70
|
||||
#define SPI_IP 0x74
|
||||
31
tb/sw/periph/uart.h
Normal file
31
tb/sw/periph/uart.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _UART_H_
|
||||
#define _UART_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define UART_BASE 0x3010000U
|
||||
|
||||
|
||||
|
||||
#define UART_TXFIFO 0x00
|
||||
#define UART_RXFIFO 0x04
|
||||
#define UART_TXCTRL 0x08
|
||||
#define UART_TXMARK 0x0a
|
||||
#define UART_RXCTRL 0x0c
|
||||
#define UART_RXMARK 0x0e
|
||||
#define UART_IE 0x10
|
||||
#define UART_IP 0x14
|
||||
#define UART_DIV 0x18
|
||||
#define UART_PARITY 0x1c
|
||||
#define UART_WIRE4 0x20
|
||||
#define UART_EITHER8OR9 0x24
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user