parent
290fe32e46
commit
aef27aaa5b
@ -1,44 +0,0 @@ |
||||
|
||||
#############################################################
|
||||
# Required variables for each makefile
|
||||
# Discard this section from all parent makefiles
|
||||
# Expected variables (with automatic defaults):
|
||||
# CSRCS (all "C" files in the dir)
|
||||
# SUBDIRS (all subdirs with a Makefile)
|
||||
# GEN_LIBS - list of libs to be generated ()
|
||||
# GEN_IMAGES - list of images to be generated ()
|
||||
# COMPONENTS_xxx - a list of libs/objs in the form
|
||||
# subdir/lib to be extracted and rolled up into
|
||||
# a generated lib/image xxx.a ()
|
||||
#
|
||||
ifndef PDIR |
||||
GEN_LIBS = libdriver.a
|
||||
endif |
||||
|
||||
|
||||
#############################################################
|
||||
# Configuration i.e. compile options etc.
|
||||
# Target specific stuff (defines etc.) goes in here!
|
||||
# Generally values applying to a tree are captured in the
|
||||
# makefile at its root level - these are then overridden
|
||||
# for a subtree within the makefile rooted therein
|
||||
#
|
||||
#DEFINES +=
|
||||
|
||||
#############################################################
|
||||
# Recursion Magic - Don't touch this!!
|
||||
#
|
||||
# Each subtree potentially has an include directory
|
||||
# corresponding to the common APIs applicable to modules
|
||||
# rooted at that subtree. Accordingly, the INCLUDE PATH
|
||||
# of a module can only contain the include directories up
|
||||
# its parent path, and not its siblings
|
||||
#
|
||||
# Required for each makefile to inherit from the parent
|
||||
#
|
||||
|
||||
INCLUDES := $(INCLUDES) -I $(PDIR)include
|
||||
INCLUDES += -I ./
|
||||
PDIR := ../$(PDIR)
|
||||
sinclude $(PDIR)Makefile |
||||
|
@ -1,248 +0,0 @@ |
||||
/******************************************************************************
|
||||
* Copyright 2013-2014 Espressif Systems (Wuxi) |
||||
* |
||||
* FileName: uart.c |
||||
* |
||||
* Description: Two UART mode configration and interrupt handler. |
||||
* Check your hardware connection while use this mode. |
||||
* |
||||
* Modification history: |
||||
* 2014/3/12, v1.0 create this file. |
||||
*******************************************************************************/ |
||||
#include "espmissingincludes.h" |
||||
#include "ets_sys.h" |
||||
#include "osapi.h" |
||||
#include "driver/uart.h" |
||||
|
||||
#include "driver/uart_register.h" |
||||
//#include "ssc.h"
|
||||
//#include "at.h"
|
||||
|
||||
// UartDev is defined and initialized in rom code.
|
||||
extern UartDevice UartDev; |
||||
//extern os_event_t at_recvTaskQueue[at_recvTaskQueueLen];
|
||||
|
||||
LOCAL void uart0_rx_intr_handler(void *para); |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart_config |
||||
* Description : Internal used function |
||||
* UART0 used for data TX/RX, RX buffer size is 0x100, interrupt enabled |
||||
* UART1 just used for debug output |
||||
* Parameters : uart_no, use UART0 or UART1 defined ahead |
||||
* Returns : NONE |
||||
*******************************************************************************/ |
||||
LOCAL void ICACHE_FLASH_ATTR |
||||
uart_config(uint8 uart_no) |
||||
{ |
||||
if (uart_no == UART1) |
||||
{ |
||||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_U1TXD_BK); |
||||
} |
||||
else |
||||
{ |
||||
/* rcv_buff size if 0x100 */ |
||||
ETS_UART_INTR_ATTACH(uart0_rx_intr_handler, &(UartDev.rcv_buff)); |
||||
PIN_PULLUP_DIS(PERIPHS_IO_MUX_U0TXD_U); |
||||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD); |
||||
// PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_U0RTS);
|
||||
} |
||||
|
||||
uart_div_modify(uart_no, UART_CLK_FREQ / (UartDev.baut_rate)); |
||||
|
||||
WRITE_PERI_REG(UART_CONF0(uart_no), UartDev.exist_parity |
||||
| UartDev.parity |
||||
| (UartDev.stop_bits << UART_STOP_BIT_NUM_S) |
||||
| (UartDev.data_bits << UART_BIT_NUM_S)); |
||||
|
||||
//clear rx and tx fifo,not ready
|
||||
SET_PERI_REG_MASK(UART_CONF0(uart_no), UART_RXFIFO_RST | UART_TXFIFO_RST); |
||||
CLEAR_PERI_REG_MASK(UART_CONF0(uart_no), UART_RXFIFO_RST | UART_TXFIFO_RST); |
||||
|
||||
//set rx fifo trigger
|
||||
// WRITE_PERI_REG(UART_CONF1(uart_no),
|
||||
// ((UartDev.rcv_buff.TrigLvl & UART_RXFIFO_FULL_THRHD) << UART_RXFIFO_FULL_THRHD_S) |
|
||||
// ((96 & UART_TXFIFO_EMPTY_THRHD) << UART_TXFIFO_EMPTY_THRHD_S) |
|
||||
// UART_RX_FLOW_EN);
|
||||
if (uart_no == UART0) |
||||
{ |
||||
//set rx fifo trigger
|
||||
WRITE_PERI_REG(UART_CONF1(uart_no), |
||||
((0x01 & UART_RXFIFO_FULL_THRHD) << UART_RXFIFO_FULL_THRHD_S) | |
||||
((0x01 & UART_RX_FLOW_THRHD) << UART_RX_FLOW_THRHD_S) | |
||||
UART_RX_FLOW_EN); |
||||
} |
||||
else |
||||
{ |
||||
WRITE_PERI_REG(UART_CONF1(uart_no), |
||||
((UartDev.rcv_buff.TrigLvl & UART_RXFIFO_FULL_THRHD) << UART_RXFIFO_FULL_THRHD_S)); |
||||
} |
||||
|
||||
//clear all interrupt
|
||||
WRITE_PERI_REG(UART_INT_CLR(uart_no), 0xffff); |
||||
//enable rx_interrupt
|
||||
SET_PERI_REG_MASK(UART_INT_ENA(uart_no), UART_RXFIFO_FULL_INT_ENA); |
||||
} |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart1_tx_one_char |
||||
* Description : Internal used function |
||||
* Use uart1 interface to transfer one char |
||||
* Parameters : uint8 TxChar - character to tx |
||||
* Returns : OK |
||||
*******************************************************************************/ |
||||
LOCAL STATUS |
||||
uart_tx_one_char(uint8 uart, uint8 TxChar) |
||||
{ |
||||
while (true) |
||||
{ |
||||
uint32 fifo_cnt = READ_PERI_REG(UART_STATUS(uart)) & (UART_TXFIFO_CNT<<UART_TXFIFO_CNT_S); |
||||
if ((fifo_cnt >> UART_TXFIFO_CNT_S & UART_TXFIFO_CNT) < 126) { |
||||
break; |
||||
} |
||||
} |
||||
|
||||
WRITE_PERI_REG(UART_FIFO(uart) , TxChar); |
||||
return OK; |
||||
} |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart1_write_char |
||||
* Description : Internal used function |
||||
* Do some special deal while tx char is '\r' or '\n' |
||||
* Parameters : char c - character to tx |
||||
* Returns : NONE |
||||
*******************************************************************************/ |
||||
LOCAL void ICACHE_FLASH_ATTR |
||||
uart0_write_char(char c) |
||||
{ |
||||
if (c == '\n') |
||||
{ |
||||
uart_tx_one_char(UART0, '\r'); |
||||
uart_tx_one_char(UART0, '\n'); |
||||
} |
||||
else if (c == '\r') |
||||
{ |
||||
} |
||||
else |
||||
{ |
||||
uart_tx_one_char(UART0, c); |
||||
} |
||||
} |
||||
/******************************************************************************
|
||||
* FunctionName : uart0_tx_buffer |
||||
* Description : use uart0 to transfer buffer |
||||
* Parameters : uint8 *buf - point to send buffer |
||||
* uint16 len - buffer len |
||||
* Returns : |
||||
*******************************************************************************/ |
||||
void ICACHE_FLASH_ATTR |
||||
uart0_tx_buffer(uint8 *buf, uint16 len) |
||||
{ |
||||
uint16 i; |
||||
|
||||
for (i = 0; i < len; i++) |
||||
{ |
||||
uart_tx_one_char(UART0, buf[i]); |
||||
} |
||||
} |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart0_sendStr |
||||
* Description : use uart0 to transfer buffer |
||||
* Parameters : uint8 *buf - point to send buffer |
||||
* uint16 len - buffer len |
||||
* Returns : |
||||
*******************************************************************************/ |
||||
void ICACHE_FLASH_ATTR |
||||
uart0_sendStr(const char *str) |
||||
{ |
||||
while(*str) |
||||
{ |
||||
uart_tx_one_char(UART0, *str++); |
||||
} |
||||
} |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart0_rx_intr_handler |
||||
* Description : Internal used function |
||||
* UART0 interrupt handler, add self handle code inside |
||||
* Parameters : void *para - point to ETS_UART_INTR_ATTACH's arg |
||||
* Returns : NONE |
||||
*******************************************************************************/ |
||||
//extern void at_recvTask(void);
|
||||
|
||||
LOCAL void |
||||
uart0_rx_intr_handler(void *para) |
||||
{ |
||||
/* uart0 and uart1 intr combine togther, when interrupt occur, see reg 0x3ff20020, bit2, bit0 represents
|
||||
* uart1 and uart0 respectively |
||||
*/ |
||||
// RcvMsgBuff *pRxBuff = (RcvMsgBuff *)para;
|
||||
// uint8 RcvChar;
|
||||
uint8 uart_no = UART0;//UartDev.buff_uart_no;
|
||||
|
||||
// if (UART_RXFIFO_FULL_INT_ST != (READ_PERI_REG(UART_INT_ST(uart_no)) & UART_RXFIFO_FULL_INT_ST))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
if (UART_RXFIFO_FULL_INT_ST == (READ_PERI_REG(UART_INT_ST(uart_no)) & UART_RXFIFO_FULL_INT_ST)) |
||||
{ |
||||
// at_recvTask();
|
||||
WRITE_PERI_REG(UART_INT_CLR(uart_no), UART_RXFIFO_FULL_INT_CLR); |
||||
} |
||||
|
||||
// WRITE_PERI_REG(UART_INT_CLR(uart_no), UART_RXFIFO_FULL_INT_CLR);
|
||||
|
||||
// if (READ_PERI_REG(UART_STATUS(uart_no)) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S))
|
||||
// {
|
||||
// RcvChar = READ_PERI_REG(UART_FIFO(uart_no)) & 0xFF;
|
||||
// at_recvTask();
|
||||
// *(pRxBuff->pWritePos) = RcvChar;
|
||||
|
||||
// system_os_post(at_recvTaskPrio, NULL, RcvChar);
|
||||
|
||||
// //insert here for get one command line from uart
|
||||
// if (RcvChar == '\r')
|
||||
// {
|
||||
// pRxBuff->BuffState = WRITE_OVER;
|
||||
// }
|
||||
//
|
||||
// pRxBuff->pWritePos++;
|
||||
//
|
||||
// if (pRxBuff->pWritePos == (pRxBuff->pRcvMsgBuff + RX_BUFF_SIZE))
|
||||
// {
|
||||
// // overflow ...we may need more error handle here.
|
||||
// pRxBuff->pWritePos = pRxBuff->pRcvMsgBuff ;
|
||||
// }
|
||||
// }
|
||||
} |
||||
|
||||
/******************************************************************************
|
||||
* FunctionName : uart_init |
||||
* Description : user interface for init uart |
||||
* Parameters : UartBautRate uart0_br - uart0 bautrate |
||||
* UartBautRate uart1_br - uart1 bautrate |
||||
* Returns : NONE |
||||
*******************************************************************************/ |
||||
void ICACHE_FLASH_ATTR |
||||
uart_init(UartBautRate uart0_br, UartBautRate uart1_br) |
||||
{ |
||||
// rom use 74880 baut_rate, here reinitialize
|
||||
UartDev.baut_rate = uart0_br; |
||||
uart_config(UART0); |
||||
UartDev.baut_rate = uart1_br; |
||||
uart_config(UART1); |
||||
ETS_UART_INTR_ENABLE(); |
||||
|
||||
// install uart0 putc callback
|
||||
os_install_putc1((void *)uart0_write_char); |
||||
} |
||||
|
||||
void ICACHE_FLASH_ATTR |
||||
uart_reattach() |
||||
{ |
||||
uart_init(BIT_RATE_74880, BIT_RATE_74880); |
||||
// ETS_UART_INTR_ATTACH(uart_rx_intr_handler_ssc, &(UartDev.rcv_buff));
|
||||
// ETS_UART_INTR_ENABLE();
|
||||
} |
@ -1,13 +0,0 @@ |
||||
<html><head><title>Test</title></head> |
||||
<body> |
||||
|
||||
<p> |
||||
There's a LED. You can't see it, so it's no use clicking any of the buttons below. The buttons |
||||
do, however, turn the LED on and off. |
||||
</p> |
||||
<form method="post" action="led.cgi"> |
||||
<input type="submit" name="led" value="1"> |
||||
<input type="submit" name="led" value="0"> |
||||
</form> |
||||
|
||||
</body></html> |
@ -1,7 +0,0 @@ |
||||
<html> |
||||
<head><title>Test</title></head> |
||||
<body> |
||||
<h1>Test!</h1> |
||||
<p>Yay, the cpio filesystem thingy works. Click <a href="/test2.html">here</a> to see |
||||
if the 2nd page works too. |
||||
</p> |
@ -1,12 +0,0 @@ |
||||
<html> |
||||
<head><title>Test</title></head> |
||||
<body> |
||||
<h1>Test2!</h1> |
||||
<p><b>New!</b>You can also control the <a href="led.html">LED</a>...</p> |
||||
<p>Here's an image of a cat (hopefully...)<br /> |
||||
<img src="cat.jpeg"><br /> |
||||
<img src="ceilingcat.jpg"><br /> |
||||
<img src="disapprove.jpg"><br /> |
||||
<img src="invisiblepogostick.jpg"><br /> |
||||
</p> |
||||
</body></html> |
@ -1,10 +0,0 @@ |
||||
<html><head><title>Test</title></head> |
||||
<body> |
||||
|
||||
<form method="post" action="test.cgi"> |
||||
<input type="text" name="Test1" value="t1"> |
||||
<input type="text" name="Test2" value="t2"> |
||||
<input type="submit" name="DoIt" value="Do It"> |
||||
</form> |
||||
|
||||
</body></html> |
@ -1,103 +0,0 @@ |
||||
#ifndef UART_APP_H |
||||
#define UART_APP_H |
||||
|
||||
#include "uart_register.h" |
||||
#include "eagle_soc.h" |
||||
#include "c_types.h" |
||||
|
||||
#define RX_BUFF_SIZE 256 |
||||
#define TX_BUFF_SIZE 100 |
||||
#define UART0 0 |
||||
#define UART1 1 |
||||
|
||||
typedef enum { |
||||
FIVE_BITS = 0x0, |
||||
SIX_BITS = 0x1, |
||||
SEVEN_BITS = 0x2, |
||||
EIGHT_BITS = 0x3 |
||||
} UartBitsNum4Char; |
||||
|
||||
typedef enum { |
||||
ONE_STOP_BIT = 0, |
||||
ONE_HALF_STOP_BIT = BIT2, |
||||
TWO_STOP_BIT = BIT2 |
||||
} UartStopBitsNum; |
||||
|
||||
typedef enum { |
||||
NONE_BITS = 0, |
||||
ODD_BITS = 0, |
||||
EVEN_BITS = BIT4 |
||||
} UartParityMode; |
||||
|
||||
typedef enum { |
||||
STICK_PARITY_DIS = 0, |
||||
STICK_PARITY_EN = BIT3 | BIT5 |
||||
} UartExistParity; |
||||
|
||||
typedef enum { |
||||
BIT_RATE_9600 = 9600, |
||||
BIT_RATE_19200 = 19200, |
||||
BIT_RATE_38400 = 38400, |
||||
BIT_RATE_57600 = 57600, |
||||
BIT_RATE_74880 = 74880, |
||||
BIT_RATE_115200 = 115200, |
||||
BIT_RATE_230400 = 230400, |
||||
BIT_RATE_460800 = 460800, |
||||
BIT_RATE_921600 = 921600 |
||||
} UartBautRate; |
||||
|
||||
typedef enum { |
||||
NONE_CTRL, |
||||
HARDWARE_CTRL, |
||||
XON_XOFF_CTRL |
||||
} UartFlowCtrl; |
||||
|
||||
typedef enum { |
||||
EMPTY, |
||||
UNDER_WRITE, |
||||
WRITE_OVER |
||||
} RcvMsgBuffState; |
||||
|
||||
typedef struct { |
||||
uint32 RcvBuffSize; |
||||
uint8 *pRcvMsgBuff; |
||||
uint8 *pWritePos; |
||||
uint8 *pReadPos; |
||||
uint8 TrigLvl; //JLU: may need to pad
|
||||
RcvMsgBuffState BuffState; |
||||
} RcvMsgBuff; |
||||
|
||||
typedef struct { |
||||
uint32 TrxBuffSize; |
||||
uint8 *pTrxBuff; |
||||
} TrxMsgBuff; |
||||
|
||||
typedef enum { |
||||
BAUD_RATE_DET, |
||||
WAIT_SYNC_FRM, |
||||
SRCH_MSG_HEAD, |
||||
RCV_MSG_BODY, |
||||
RCV_ESC_CHAR, |
||||
} RcvMsgState; |
||||
|
||||
typedef struct { |
||||
UartBautRate baut_rate; |
||||
UartBitsNum4Char data_bits; |
||||
UartExistParity exist_parity; |
||||
UartParityMode parity; // chip size in byte
|
||||
UartStopBitsNum stop_bits; |
||||
UartFlowCtrl flow_ctrl; |
||||
RcvMsgBuff rcv_buff; |
||||
TrxMsgBuff trx_buff; |
||||
RcvMsgState rcv_state; |
||||
int received; |
||||
int buff_uart_no; //indicate which uart use tx/rx buffer
|
||||
} UartDevice; |
||||
|
||||
void uart_init(UartBautRate uart0_br, UartBautRate uart1_br); |
||||
void uart0_sendStr(const char *str); |
||||
|
||||
|
||||
|
||||
#endif |
||||
|
@ -1,128 +0,0 @@ |
||||
//Generated at 2012-07-03 18:44:06
|
||||
/*
|
||||
* Copyright (c) 2010 - 2011 Espressif System |
||||
* |
||||
*/ |
||||
|
||||
#ifndef UART_REGISTER_H_INCLUDED |
||||
#define UART_REGISTER_H_INCLUDED |
||||
#define REG_UART_BASE( i ) (0x60000000+(i)*0xf00) |
||||
//version value:32'h062000
|
||||
|
||||
#define UART_FIFO( i ) (REG_UART_BASE( i ) + 0x0) |
||||
#define UART_RXFIFO_RD_BYTE 0x000000FF |
||||
#define UART_RXFIFO_RD_BYTE_S 0 |
||||
|
||||
#define UART_INT_RAW( i ) (REG_UART_BASE( i ) + 0x4) |
||||
#define UART_RXFIFO_TOUT_INT_RAW (BIT(8)) |
||||
#define UART_BRK_DET_INT_RAW (BIT(7)) |
||||
#define UART_CTS_CHG_INT_RAW (BIT(6)) |
||||
#define UART_DSR_CHG_INT_RAW (BIT(5)) |
||||
#define UART_RXFIFO_OVF_INT_RAW (BIT(4)) |
||||
#define UART_FRM_ERR_INT_RAW (BIT(3)) |
||||
#define UART_PARITY_ERR_INT_RAW (BIT(2)) |
||||
#define UART_TXFIFO_EMPTY_INT_RAW (BIT(1)) |
||||
#define UART_RXFIFO_FULL_INT_RAW (BIT(0)) |
||||
|
||||
#define UART_INT_ST( i ) (REG_UART_BASE( i ) + 0x8) |
||||
#define UART_RXFIFO_TOUT_INT_ST (BIT(8)) |
||||
#define UART_BRK_DET_INT_ST (BIT(7)) |
||||
#define UART_CTS_CHG_INT_ST (BIT(6)) |
||||
#define UART_DSR_CHG_INT_ST (BIT(5)) |
||||
#define UART_RXFIFO_OVF_INT_ST (BIT(4)) |
||||
#define UART_FRM_ERR_INT_ST (BIT(3)) |
||||
#define UART_PARITY_ERR_INT_ST (BIT(2)) |
||||
#define UART_TXFIFO_EMPTY_INT_ST (BIT(1)) |
||||
#define UART_RXFIFO_FULL_INT_ST (BIT(0)) |
||||
|
||||
#define UART_INT_ENA( i ) (REG_UART_BASE( i ) + 0xC) |
||||
#define UART_RXFIFO_TOUT_INT_ENA (BIT(8)) |
||||
#define UART_BRK_DET_INT_ENA (BIT(7)) |
||||
#define UART_CTS_CHG_INT_ENA (BIT(6)) |
||||
#define UART_DSR_CHG_INT_ENA (BIT(5)) |
||||
#define UART_RXFIFO_OVF_INT_ENA (BIT(4)) |
||||
#define UART_FRM_ERR_INT_ENA (BIT(3)) |
||||
#define UART_PARITY_ERR_INT_ENA (BIT(2)) |
||||
#define UART_TXFIFO_EMPTY_INT_ENA (BIT(1)) |
||||
#define UART_RXFIFO_FULL_INT_ENA (BIT(0)) |
||||
|
||||
#define UART_INT_CLR( i ) (REG_UART_BASE( i ) + 0x10) |
||||
#define UART_RXFIFO_TOUT_INT_CLR (BIT(8)) |
||||
#define UART_BRK_DET_INT_CLR (BIT(7)) |
||||
#define UART_CTS_CHG_INT_CLR (BIT(6)) |
||||
#define UART_DSR_CHG_INT_CLR (BIT(5)) |
||||
#define UART_RXFIFO_OVF_INT_CLR (BIT(4)) |
||||
#define UART_FRM_ERR_INT_CLR (BIT(3)) |
||||
#define UART_PARITY_ERR_INT_CLR (BIT(2)) |
||||
#define UART_TXFIFO_EMPTY_INT_CLR (BIT(1)) |
||||
#define UART_RXFIFO_FULL_INT_CLR (BIT(0)) |
||||
|
||||
#define UART_CLKDIV( i ) (REG_UART_BASE( i ) + 0x14) |
||||
#define UART_CLKDIV_CNT 0x000FFFFF |
||||
#define UART_CLKDIV_S 0 |
||||
|
||||
#define UART_AUTOBAUD( i ) (REG_UART_BASE( i ) + 0x18) |
||||
#define UART_GLITCH_FILT 0x000000FF |
||||
#define UART_GLITCH_FILT_S 8 |
||||
#define UART_AUTOBAUD_EN (BIT(0)) |
||||
|
||||
#define UART_STATUS( i ) (REG_UART_BASE( i ) + 0x1C) |
||||
#define UART_TXD (BIT(31)) |
||||
#define UART_RTSN (BIT(30)) |
||||
#define UART_DTRN (BIT(29)) |
||||
#define UART_TXFIFO_CNT 0x000000FF |
||||
#define UART_TXFIFO_CNT_S 16 |
||||
#define UART_RXD (BIT(15)) |
||||
#define UART_CTSN (BIT(14)) |
||||
#define UART_DSRN (BIT(13)) |
||||
#define UART_RXFIFO_CNT 0x000000FF |
||||
#define UART_RXFIFO_CNT_S 0 |
||||
|
||||
#define UART_CONF0( i ) (REG_UART_BASE( i ) + 0x20) |
||||
#define UART_TXFIFO_RST (BIT(18)) |
||||
#define UART_RXFIFO_RST (BIT(17)) |
||||
#define UART_IRDA_EN (BIT(16)) |
||||
#define UART_TX_FLOW_EN (BIT(15)) |
||||
#define UART_LOOPBACK (BIT(14)) |
||||
#define UART_IRDA_RX_INV (BIT(13)) |
||||
#define UART_IRDA_TX_INV (BIT(12)) |
||||
#define UART_IRDA_WCTL (BIT(11)) |
||||
#define UART_IRDA_TX_EN (BIT(10)) |
||||
#define UART_IRDA_DPLX (BIT(9)) |
||||
#define UART_TXD_BRK (BIT(8)) |
||||
#define UART_SW_DTR (BIT(7)) |
||||
#define UART_SW_RTS (BIT(6)) |
||||
#define UART_STOP_BIT_NUM 0x00000003 |
||||
#define UART_STOP_BIT_NUM_S 4 |
||||
#define UART_BIT_NUM 0x00000003 |
||||
#define UART_BIT_NUM_S 2 |
||||
#define UART_PARITY_EN (BIT(1)) |
||||
#define UART_PARITY (BIT(0)) |
||||
|
||||
#define UART_CONF1( i ) (REG_UART_BASE( i ) + 0x24) |
||||
#define UART_RX_TOUT_EN (BIT(31)) |
||||
#define UART_RX_TOUT_THRHD 0x0000007F |
||||
#define UART_RX_TOUT_THRHD_S 24 |
||||
#define UART_RX_FLOW_EN (BIT(23)) |
||||
#define UART_RX_FLOW_THRHD 0x0000007F |
||||
#define UART_RX_FLOW_THRHD_S 16 |
||||
#define UART_TXFIFO_EMPTY_THRHD 0x0000007F |
||||
#define UART_TXFIFO_EMPTY_THRHD_S 8 |
||||
#define UART_RXFIFO_FULL_THRHD 0x0000007F |
||||
#define UART_RXFIFO_FULL_THRHD_S 0 |
||||
|
||||
#define UART_LOWPULSE( i ) (REG_UART_BASE( i ) + 0x28) |
||||
#define UART_LOWPULSE_MIN_CNT 0x000FFFFF |
||||
#define UART_LOWPULSE_MIN_CNT_S 0 |
||||
|
||||
#define UART_HIGHPULSE( i ) (REG_UART_BASE( i ) + 0x2C) |
||||
#define UART_HIGHPULSE_MIN_CNT 0x000FFFFF |
||||
#define UART_HIGHPULSE_MIN_CNT_S 0 |
||||
|
||||
#define UART_PULSE_NUM( i ) (REG_UART_BASE( i ) + 0x30) |
||||
#define UART_PULSE_NUM_CNT 0x0003FF |
||||
#define UART_PULSE_NUM_CNT_S 0 |
||||
|
||||
#define UART_DATE( i ) (REG_UART_BASE( i ) + 0x78) |
||||
#define UART_ID( i ) (REG_UART_BASE( i ) + 0x7C) |
||||
#endif // UART_REGISTER_H_INCLUDED
|
@ -1,5 +1,10 @@ |
||||
|
||||
CFLAGS=-I../lib/heatshrink -std=gnu99
|
||||
OBJS=main.o heatshrink_encoder.o
|
||||
TARGET=mkespfsimage
|
||||
|
||||
mkespfsimage: main.o heatshrink_encoder.o |
||||
$(TARGET): $(OBJS) |
||||
$(CC) -o $@ $^
|
||||
|
||||
clean: |
||||
rm -f $(TARGET) $(OBJS)
|
Loading…
Reference in new issue