<commit_before>"""
Radio driver for the AT86RF215, for the rPi 3.

Connections

| rPi pin | ATREB215-XPRO Extension Board pin |
|---------|-----------------------------------|
| 01- +3V |  20 - VCC                         |
| 03-     |  09 - IRQ                         |
| 09- GND |  19 - GND                         |
| 19-     |  16 - SPI_MOSI                    |
| 21-     |  17 - SPI_MISO                    |
| 23-     |  18 - SPI_SCK                     |
| 24-     |  15 - SPI_SS_A                    |

\author <NAME> (<EMAIL>), January 2017
"""

import threading
import time
import logging

import spidev
import RPi.GPIO as GPIO

import at86rf215 as at86

RADIOSTATE_RFOFF = 0x00  # ///< Completely stopped.
RADIOSTATE_FREQUENCY_SET = 0x01  # ///< Listening for commands, but RF chain is off.
RADIOSTATE_PACKET_LOADED = 0x02  # ///< Configuring the frequency.
RADIOSTATE_TRX_ENABLED = 0x03  # ///< Done configuring the frequency.
RADIOSTATE_RECEIVING = 0x04  # ///< Loading packet into the radio's TX buffer.
RADIOSTATE_TXRX_DONE = 0x05  # ///< Packet is fully loaded in the radio's TX buffer.


# FIXME: turn code in this file into a class

class At86rf215(object):
    at86_state = RADIOSTATE_RFOFF
    rx_done = 0
    spi = 0

    def __init__(self, cb):
        self.cb = cb

    # ======================== public ==========================================

    def method1(self, param1):
        pass

    # ======================== private =========================================

    def _method2(self, param1):
        pass

    def read_isr(self):
        """
        Read the interruption source from the radio.

        This function is called typically after the interrupt pin triggers.
        The CPU then called this function the read the 4 RG_RFXX_IRQS registers
        to figure out the reason for the interrupt.
<commit_msg>Fixes 1<commit_after>"""
Radio driver for the AT86RF215, for the rPi 3.

Connections

| rPi pin | ATREB215-XPRO Extension Board pin |
|---------|-----------------------------------|
| 01- +3V |  20 - VCC                         |
| 03-     |  09 - IRQ                         |
| 09- GND |  19 - GND                         |
| 19-     |  16 - SPI_MOSI                    |
| 21-     |  17 - SPI_MISO                    |
| 23-     |  18 - SPI_SCK                     |
| 24-     |  15 - SPI_SS_A                    |

\author <NAME> (<EMAIL>), January 2017
"""

import threading
import time
import logging

import spidev
import RPi.GPIO as GPIO

import at86rf215 as at86

RADIOSTATE_RFOFF = 0x00  # ///< Completely stopped.
RADIOSTATE_FREQUENCY_SET = 0x01  # ///< Listening for commands, but RF chain is off.
RADIOSTATE_PACKET_LOADED = 0x02  # ///< Configuring the frequency.
RADIOSTATE_TRX_ENABLED = 0x03  # ///< Done configuring the frequency.
RADIOSTATE_RECEIVING = 0x04  # ///< Loading packet into the radio's TX buffer.
RADIOSTATE_TXRX_DONE = 0x05  # ///< Packet is fully loaded in the radio's TX buffer.


# FIXME: turn code in this file into a class

class At86rf215(object):
    at86_state = RADIOSTATE_RFOFF
    #rx_done = 0
    #spi = 0

    def __init__(self, cb):
        self.cb = cb

    # ======================== public ==========================================

    def method1(self, param1):
        pass

    # ======================== private =========================================

    def _method2(self, param1):
        pass

    def read_isr(self):
        """
        Read the interruption source from the radio.

        This function is called typically after the interrupt pin triggers.
        The CPU then called this function the read the 4 RG_RFXX_IRQS registers
        to figure out the reason for the interrupt.

{'fraction_non_alphanumeric': 0.1709816612729234, 'fraction_numerical': 0.04395900755124056, 'mean_word_length': 1.9436507936507936, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2721827', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1082, 'n_words': 355}