{"id":24030790,"url":"https://github.com/ebrezadev/nrf24l01-c-driver","last_synced_at":"2025-04-19T12:02:22.652Z","repository":{"id":160180755,"uuid":"299508949","full_name":"ebrezadev/nRF24L01-C-Driver","owner":"ebrezadev","description":"Nordic Semiconductor nRF24L01+ 2.4GHz Transceiver portable lightweight c library (high level driver)","archived":false,"fork":false,"pushed_at":"2023-04-30T17:07:55.000Z","size":85,"stargazers_count":27,"open_issues_count":4,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T07:41:34.555Z","etag":null,"topics":["arduino","arduino-library","c","embedded","microcontroller","nrf24l01","portable","rf","telemetry"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebrezadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-29T05:00:47.000Z","updated_at":"2025-02-19T23:23:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"3941bbbc-53fb-4899-9cd8-123a989c8038","html_url":"https://github.com/ebrezadev/nRF24L01-C-Driver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebrezadev%2FnRF24L01-C-Driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebrezadev%2FnRF24L01-C-Driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebrezadev%2FnRF24L01-C-Driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebrezadev%2FnRF24L01-C-Driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebrezadev","download_url":"https://codeload.github.com/ebrezadev/nRF24L01-C-Driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249690363,"owners_count":21311308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","c","embedded","microcontroller","nrf24l01","portable","rf","telemetry"],"created_at":"2025-01-08T17:58:15.199Z","updated_at":"2025-04-19T12:02:22.631Z","avatar_url":"https://github.com/ebrezadev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nRF24L01+ C LIBRARY\n* version 1.0\n* Reza Ebrahimi\n\nThis library is written in **portable C**, and is **MCU independent**. It consumes a small amount of RAM (under 50 bytes) and program memory (under 2 KB). In order to implement it to your MCU of choice, you need to manipulate functions inside nrf24l01_low_level.c file (SPI, pin configurations) and leave other files as they are.\n\nnRF24L01+ C library abstracts away the internals of the hardware, using LEVEL 4 functions (description below).\n\nThis library is written based on the nRF24L01+ Preliminary Product Specification released by Nordic Semiconductor and is not influenced by other (probably numorous) libraries out there. Any resemblance to pre-existing code is unintentional.\n\nYou can use this library in any way, shape or form. I'd be very happy if you mention my name though.\n\n## HOW TO USE\n\nAs mentioned earlier, first you need to implement low level settings like SPI, delay function and pin configurations inside nrf24l01_low_level.c file (LEVEL 1).\n\nStart by calling nrf24_device(uint8_t device_mode, uint8_t reset_state) function. You can set the device mode to either TRANSMITTER, RECEIVER, POWER_SAVING or TURN_OFF and reset_state to RESET or NO_RESET. if this is the first time nrf24_device is called, nrf24l01+ is reset regardless of reset_state. nrf24_device initializes the low level API like SPI etc, and sets nrf24l01+ with default values and settings. These settings and values can be changed with manipulating macros inside nrf24l01.h, or by calling LEVEL 3 functions. the next steps depend on the chosen device_mode.\n\nFor TRANSMITTER:\nUse nrf24_transmit(uint8_t *payload, uint8_t payload_width, uint8_t acknowledgement_state) to send an array of 1 byte blocks, with the specified payload_width and acknowledgement_state (could be ACK_MODE or NO_ACK_MODE). If nrf24l01+ is set to static payload width, payload_width is ignored. nrf24_transmit has 2 different outputs: TRANSMIT_BEGIN and TRANSMIT_FAIL (in case of wrong mode of operation or full TX FIFO buffer). Next, you can use nrf24_transmit_status() which has no input, but gives back status: TRANSMIT_IN_PROGRESS if the payload is still not sent or if TX buffer is empty, TRANSMIT_DONE if the payload is sent successfully, TRANSMIT_FAILED if the payload has reached he maximum number of retransmits (only in ACK_MODE).\n\nFor RECEIVER:\nnrf24_receive(uint8_t *payload, uint8_t payload_width) can be used to both poll the RX buffer, and receive the payload if its already inside the buffer. payload_width is ignored if nrf24l01+ was set to static payload width mode. nrf24_receive outputs the polling results as: OPERATION_ERROR if not in RECEIVER mode, RECEIVE_FIFO_EMPTY in case of empty buffer (payload array is not updated) and OPERATION_DONE if the received data is saved inside payload array.\n\nFor POWER_SAVING or TURN_OFF:\nYou cannot send or receive any data in these modes of operation, these are used only to reduce power consumption. device_mode can be changed mid code.\n\nGeneral considerations:\nthe default value for transmit radio power is set to -6 dbm.\nthe default value for radio channel is set to channel 32.\nthe default payload width is 1 byte and its static.\nthe default value for datarate is 1Mbps.\n\n## HOW IT WORKS\n\nFunctions can be categorized into different levels: from low level APIs up to higher ones.\nLower level APIs are used by higher level APIs. Use LEVEL 4 functions (or sometimes LEVEL 3, \nif you want to change settings) in your firmware.\n\nLEVEL 1:\n *  void delay_function(uint32_t duration_ms)\n *  void SPI_Initializer()\n *  void pinout_Initializer()\n *  void nrf24_SPI(uint8_t input)\n *  uint8_t SPI_send_command(uint8_t command)\n *  void nrf24_CE(uint8_t input)\n \nLEVEL 2:\n *  void nrf24_write(uint8_t address, uint8_t *value, uint8_t data_length, uint8_t spi_state)\n *  void nrf24_read(uint8_t address, uint8_t *value, uint8_t data_length, uint8_t spi_state)\n *  void nrf24_send_payload(uint8_t *payload, uint8_t payload_width)\n \nLEVEL 3:\n *  void nrf24_mode(uint8_t mode)\n *  void nrf24_crc_configuration(uint8_t crc_enable, uint8_t crc_encoding_scheme)\n *  void nrf24_interrupt_mask(uint8_t rx_mask, uint8_t tx_mask, uint8_t max_rt_mask)\n *  void nrf24_rf_channel(uint8_t rf_channel)\n *  void nrf24_rf_power(uint8_t rf_power)\n *  void nrf24_rf_datarate(uint8_t rf_datarate)\n *  void nrf24_address_width(uint8_t address_width)\n *  void nrf24_datapipe_enable(uint8_t number_of_datapipes)\n *  void nrf24_prx_static_payload_width(uint8_t static_payload_width, uint8_t number_of_datapipes)\n *  void nrf24_datapipe_address_configuration()\n *  void nrf24_datapipe_ptx(uint8_t datapipe_number)\n *  void nrf24_dynamic_payload(uint8_t state, uint8_t datapipe)\n *  void nrf24_auto_acknowledgment_setup(uint8_t datapipe)\n *  void nrf24_automatic_retransmit_setup(uint16_t delay_time, uint8_t retransmit_count)\n *  void nrf24_dynamic_ack(uint8_t state)\n  \nLEVEL 4:\n *  void nrf24_device(uint8_t device_mode, uint8_t reset_state)\n *  void nrf24_reset()\n *  uint8_t nrf24_flush(uint8_t fifo_select)\n *  uint8_t nrf24_receive(uint8_t *payload, uint8_t payload_width)\n *  uint8_t nrf24_transmit_status()\n *  uint8_t nrf24_transmit(uint8_t *payload, uint8_t payload_width, uint8_t acknowledgement_state)\n\n## EXAMPLE \n \n As an example, a simple byte transmitter for arduino/atmega boards is provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febrezadev%2Fnrf24l01-c-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febrezadev%2Fnrf24l01-c-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febrezadev%2Fnrf24l01-c-driver/lists"}