'전체 글'에 해당되는 글 28건

  1. 2020.02.04 nrf52840 uart
  2. 2020.02.04 nrf52840 gpio
  3. 2020.02.04 beacon Data Format
Firmware2020. 2. 4. 11:29

Universal asynchronous receiver / transmitter

 

#define RX_PIN_NUMBER           36

#define TX_PIN_NUMBER           34

void uart_init(void)

{

    uint32_t err_code;

    const app_uart_comm_params_t comm_params =

    {

      RX_PIN_NUMBER,

      TX_PIN_NUMBER,

      RTS_PIN_NUMBER,

      CTS_PIN_NUMBER,

      UART_HWFC,

      false,

      NRF_UART_BAUDRATE_115200

    };

 

    APP_UART_FIFO_INIT(&comm_params,

                         UART_RX_BUF_SIZE,

                         UART_TX_BUF_SIZE,

                         uart_error_handle,

                         APP_IRQ_PRIORITY_LOWEST,

                         err_code);

 

    APP_ERROR_CHECK(err_code);

}

 

위 코드는 유아트 초기화.

 

sdk설정(sdk_config.h)은 필수.

추가적으로 printf 까지 설정하여 사용하면 편리하다.

'Firmware' 카테고리의 다른 글

nrf52840 gpio  (0) 2020.02.04
nRF51 Timer(1)  (0) 2017.12.14
Keil nRF51 간단한 쌍방향 통신.  (0) 2017.12.13
Posted by
Firmware2020. 2. 4. 11:26

General purpose input/output

 

 

#define LED_1 13

nrf_gpio_cfg_output(LED_1); 
nrf_gpio_pin_write(LED_1, 1);

 

기본적인 13번핀을 아웃풋 설정하는 함수와 디지털 설정하는 함수.

'Firmware' 카테고리의 다른 글

nrf52840 uart  (0) 2020.02.04
nRF51 Timer(1)  (0) 2017.12.14
Keil nRF51 간단한 쌍방향 통신.  (0) 2017.12.13
Posted by
Bluetooth2020. 2. 4. 10:55

 

최근 비콘의 데이타 포멧은 두가지가 있다.

 

상용 비콘을 만들 예정이라면 위의 두 그림을 참고해야한다.

 

 

첨언하자면 본인의 경우 ibeacon 포멧을 참고하여 커스텀하였다.

 

uuid 부분에 각종 데이터를 넣는 방식으로 활용할 수 있다.

'Bluetooth' 카테고리의 다른 글

블루투스 계층(프로토콜 스택)  (0) 2020.02.05
HFP?  (0) 2020.02.05
beacon 개념.  (0) 2020.02.04
BT 관련 개발.  (0) 2020.02.04
BLE 활용 - Observer&Broadcasting  (0) 2017.12.05
Posted by