项目作者: kattaliraees

项目描述 :
Decoding and saving carrier modulated IR signals and sending modulated IR signals using NRF52 SoCs
高级语言: C
项目地址: git://github.com/kattaliraees/nrf52-IR.git
创建时间: 2019-09-02T12:40:19Z
项目社区:https://github.com/kattaliraees/nrf52-IR

开源协议:MIT License

下载


nrf52, 51 - IR Capture/Transmitter

  • Capture IR Burst from any IR remote. Send captured or any predefined IR burst.
  • Minimal use of CPU cycles. Completely based on PPI Channels
  • This will work irrespective of the IR Protocol
  • Tested with nRF SDK v15.3 & nrf52832 custom board (IR LED + TSOP38238)
  • Required nRFX drivers PPI, Timer, LOG, Clock
  • Have to be in 64MHz HFCLK
  • Refer to the complete example project in Segger embedded studio

    1. start_capturing(&ir_decode_task_completed);
    2. //Capture completion callback
    3. void ir_decode_task_completed (int number_of_bits, ir_data_t *ir_data_ptr) {
    4. nrf_delay_ms(5000);
    5. send_ir_burst(ir_data_ptr, number_of_bits, &ir_transmit_task_completed); //Sending what is received after 5 Secs
    6. }
    7. //Transmit task completed callback
    8. void ir_transmit_task_completed (void) {
    9. start_capturing(&ir_decode_task_completed);
    10. }

    Sending IR Code

    1. void send_ir_code () {
    2. //{{IR CARRIER ON or OFF, FOR_HOW_LONG_us}, {IR CARRIER ON or OFF, FOR_HOW_LONG_us}, ...}
    3. ir_data_t ir_code[] = {{1,9063}, {0,4472}, {1,541}, {0,551},
    4. {1,538}, {0,552}, {1,537}, {0,1670},
    5. {1,541}, {0,550}, {1,539}, {0,550},
    6. {1,539}, {0,549}, {1,541}, {0,550},
    7. {1,537}, {0,1670}, {1,541}, {0,550}};
    8. send_ir_burst(ir_code, sizeof(ir_code)/sizeof(ir_code[0]), &ir_transmit_task_completed);
    9. }

    Image of Schematic