테스트를 진행한 프로젝트는 rfEasyLinkNp_cc1310 입니다.
설정방법은 간단합니다.
1. 만약 CTS,RTS 핀을 바꾸고 싶다면 CC1310_LAUNCHXL.h 파일에서 핀설정을 수정해 주시면 됩니다.
1
2
3
4
5
|
/* UART Board */
#define Board_UART_RX IOID_2 /* RXD */
#define Board_UART_TX IOID_3 /* TXD */
#define Board_UART_CTS IOID_19 /* CTS */
#define Board_UART_RTS IOID_18 /* RTS */
| cs |
2. 그런 다음, CC1310_LAUNCHXL.c 의 BoardGpioInitTable[] 설정을
다음과 같이 수정하고..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
const PIN_Config BoardGpioInitTable[] = {
Board_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
Board_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
Board_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
Board_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
Board_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
Board_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
Board_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
Board_UART_CTS | PIN_INPUT_EN | PIN_PULLUP,
Board_UART_RTS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
//Board_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
//Board_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
//Board_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
PIN_TERMINATE
};
| cs |
3. CC1310_LAUNCHXL.c 의 uartCC26XXHWAttrs[CC1310_LAUNCHXL_UARTCOUNT] 의 내용 중,
.ctsPin 과 .rtsPin 설정을 수정합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/* UART hardware parameter structure, also used to assign UART pins */
const UARTCC26XX_HWAttrsV1 uartCC26XXHWAttrs[CC1310_LAUNCHXL_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UART0,
.intNum = INT_UART0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = Board_UART_TX,
.rxPin = Board_UART_RX,
.ctsPin = Board_UART_CTS, // PIN_UNASSIGNED -> Board_UART_CTS
.rtsPin = Board_UART_RTS // PIN_UNASSIGNED -> Board_UART_RTS
}
};
| cs |
4. 빌드하고 다운로드하면 흐름제어 동작이 됩니다.