Esempio n. 1
0
    def _set_reg_header_enable_1(self, value=0xFF):
        """
        Set Header Enable 1.

        This is register 0x45.
        """
        spi.write(0x45, value)
Esempio n. 2
0
    def _set_reg_rx_fifo_control(self, value):
        """
        Set RX FIFO Control.

        This is register 0x7E.
        """
        spi.write(0x7E, value)
Esempio n. 3
0
    def _set_reg_GPIO_2(self, value=0x00):
        """
        Set GPIO Configuration 2.

        This is register 0x0D.
        """
        spi.write(0x0D, value)
Esempio n. 4
0
    def _set_reg_freq_band(self, value=0x53):
        """
        Set Frequency Band Select.

        This is register 0x75.
        """
        spi.write(0x75, value)
Esempio n. 5
0
    def _set_reg_freq_hopping_chan(self, value=0x00):
        """
        Set Frequency Hopping Channel Select.

        This is register 0x79.
        """
        spi.write(0x79, value)
Esempio n. 6
0
    def _set_reg_tx_power(self, value=0x07):
        """
        Set TX Power,

        This is register 0x6D.
        """
        spi.write(0x6D, value)
Esempio n. 7
0
    def _set_reg_modulation_mode_2(self, value=0x22):
        """
        Set Modulation Mode Control 2.

        This is register 0x71.
        """
        spi.write(0x71, value)
Esempio n. 8
0
    def _set_reg_ADC_tuning_2(self, value=0x04):
        """
        Set Delta-Sigma ADC Tuning 2.

        This is register 0x68.
        """
        spi.write(0x68, value)
Esempio n. 9
0
    def _set_reg_AGC_override_2(self, value=0x0B):
        """
        Set AGC Override 2.

        This is register 0x6A.
        """
        spi.write(0x6A, value)
Esempio n. 10
0
    def _set_reg_divider_current(self, value=0x40):
        """
        Set Divider Current Trimming/Delta-Sigma Test.

        This is register 0x59.
        """
        spi.write(0x59, value)
Esempio n. 11
0
    def _set_reg_VCO_current(self, value=0x7F):
        """
        Set VCO Current Trimming.

        This is register 0x5A.
        """
        spi.write(0x5A, value)
Esempio n. 12
0
    def _set_reg_charge_pump(self, value=0x80):
        """
        Set Charge Pump Current Trimming/Override.

        This is register 0x58.
        """
        spi.write(0x58, value)
Esempio n. 13
0
    def _set_reg_modem_test(self, value=0x01):
        """
        Set Modem Test.

        This is register 0x56.
        """
        spi.write(0x56, value)
Esempio n. 14
0
    def _set_reg_header_enable_0(self, value=0xFF):
        """
        Set Header Enable 0.

        This is register 0x46.
        """
        spi.write(0x46, value)
Esempio n. 15
0
    def _set_reg_VCO_current(self, value=0x7F):
        """
        Set VCO Current Trimming.

        This is register 0x5A.
        """
        spi.write(0x5A, value)
Esempio n. 16
0
    def _set_reg_tx_power(self, value=0x07):
        """
        Set TX Power,

        This is register 0x6D.
        """
        spi.write(0x6D, value)
Esempio n. 17
0
    def _set_reg_capacitor(self, value=0x7F):
        """
        Set 30 MHz Crystal Oscillator Load Capacitance.

        This is register 0x09.
        """
        spi.write(0x09, value)
Esempio n. 18
0
    def _set_reg_tx_rate_1(self, value=0x27):
        """
        Set TX Data Rate 1.

        This is register 0x6E.
        """
        spi.write(0x6E, value)
Esempio n. 19
0
    def _set_reg_tx_rate_0(self, value=0x52):
        """
        Set TX Data Rate 0.

        This is register 0x6F.
        """
        spi.write(0x6F, value)
Esempio n. 20
0
    def _set_reg_tx_rate_0(self, value=0x52):
        """
        Set TX Data Rate 0.

        This is register 0x6F.
        """
        spi.write(0x6F, value)
Esempio n. 21
0
    def _set_reg_freq_offset_1(self, value=0x00):
        """
        Set Frequency Offset 1.

        This is register 0x73.
        """
        spi.write(0x73, value)
Esempio n. 22
0
    def _set_reg_modulation_mode_1(self, value=0x20):
        """
        Set Modulation Mode Control 1.

        This is register 0x70.
        """
        spi.write(0x70, value)
Esempio n. 23
0
    def _set_reg_carrier_freq_1(self, value=0x64):
        """
        Set Nominal Carrier Frequency 1.

        This is register 0x76.
        """
        spi.write(0x76, value)
Esempio n. 24
0
    def _set_reg_interrupt_enable_1(self, value):
        """
        Set Interrupt Enable 1.

        This is register 0x05.
        """
        spi.write(0x05, value)
Esempio n. 25
0
    def _set_reg_tx_fifo_control_1(self, value):
        """
        Set TX FIFO Control 1.

        This is register 0x7C.
        """
        spi.write(0x7C, value)
Esempio n. 26
0
    def _set_reg_modulation_mode_2(self, value=0x22):
        """
        Set Modulation Mode Control 2.

        This is register 0x71.
        """
        spi.write(0x71, value)
Esempio n. 27
0
    def reset_all_registers(self):
        """
        Reset all registers.

        This function resets all registers to POR state.
        """
        spi.write(0x07, 0x80)
Esempio n. 28
0
    def _set_reg_freq_deviation(self, value=0x48):
        """
        Set Frequency Deviation

        This is register 0x72.
        """
        spi.write(0x72, value)
Esempio n. 29
0
    def _set_reg_ADC_config(self, value=0x70):
        """
        Set ADC Configuration.

        This is register 0x0F.
        """
        spi.write(0x0F, 0x70)
Esempio n. 30
0
    def _set_reg_freq_offset_1(self, value=0x00):
        """
        Set Frequency Offset 1.

        This is register 0x73.
        """
        spi.write(0x73, value)
Esempio n. 31
0
    def _set_reg_divider_current(self, value=0x40):
        """
        Set Divider Current Trimming/Delta-Sigma Test.

        This is register 0x59.
        """
        spi.write(0x59, value)
Esempio n. 32
0
    def _set_reg_freq_offset_2(self, value=0x00):
        """
        Set Frequency Offset 2.

        This is register 0x74.
        """
        spi.write(0x74, value)
Esempio n. 33
0
    def _set_reg_ADC_tuning_2(self, value=0x04):
        """
        Set Delta-Sigma ADC Tuning 2.

        This is register 0x68.
        """
        spi.write(0x68, value)
Esempio n. 34
0
    def _set_reg_freq_band(self, value=0x53):
        """
        Set Frequency Band Select.

        This is register 0x75.
        """
        spi.write(0x75, value)
Esempio n. 35
0
    def _set_reg_AGC_override_2(self, value=0x0B):
        """
        Set AGC Override 2.

        This is register 0x6A.
        """
        spi.write(0x6A, value)
Esempio n. 36
0
    def _set_reg_carrier_freq_1(self, value=0x64):
        """
        Set Nominal Carrier Frequency 1.

        This is register 0x76.
        """
        spi.write(0x76, value)
Esempio n. 37
0
    def _set_reg_tx_rate_1(self, value=0x27):
        """
        Set TX Data Rate 1.

        This is register 0x6E.
        """
        spi.write(0x6E, value)
Esempio n. 38
0
    def _set_reg_carrier_freq_0(self, value=0x00):
        """
        Set Nominal Carrier Frequency 0.

        This is register 0x77.
        """
        spi.write(0x77, value)
Esempio n. 39
0
    def _set_reg_modulation_mode_1(self, value=0x20):
        """
        Set Modulation Mode Control 1.

        This is register 0x70.
        """
        spi.write(0x70, value)
Esempio n. 40
0
    def _set_reg_freq_hopping_chan(self, value=0x00):
        """
        Set Frequency Hopping Channel Select.

        This is register 0x79.
        """
        spi.write(0x79, value)
Esempio n. 41
0
    def _set_reg_freq_deviation(self, value=0x48):
        """
        Set Frequency Deviation

        This is register 0x72.
        """
        spi.write(0x72, value)
Esempio n. 42
0
    def _set_reg_freq_hopping_step(self, value=0x00):
        """
        Set Frequency Hopping Step Size.

        This is register 0x7A.
        """
        spi.write(0x7A, value)
Esempio n. 43
0
    def _set_reg_freq_offset_2(self, value=0x00):
        """
        Set Frequency Offset 2.

        This is register 0x74.
        """
        spi.write(0x74, value)
Esempio n. 44
0
    def _set_reg_interrupt_enable_2(self, value):
        """
        Set Interrupt Enable 2.

        This is register 0x06.
        """
        spi.write(0x06, value)
Esempio n. 45
0
    def _set_reg_clock(self, value=0x05):
        """
        Set Microcontroller Output Clock.

        This is register 0x0A.
        """
        spi.write(0x0A, value)
Esempio n. 46
0
    def _set_reg_tx_fifo_control_1(self, value):
        """
        Set TX FIFO Control 1.

        This is register 0x7C.
        """
        spi.write(0x7C, value)
Esempio n. 47
0
    def _set_reg_carrier_freq_0(self, value=0x00):
        """
        Set Nominal Carrier Frequency 0.

        This is register 0x77.
        """
        spi.write(0x77, value)
Esempio n. 48
0
    def _set_reg_tx_fifo_control_2(self, value):
        """
        Set TX FIFO Control 2.

        This is register 0x7D.
        """
        spi.write(0x7D, value)
Esempio n. 49
0
    def _set_reg_freq_hopping_step(self, value=0x00):
        """
        Set Frequency Hopping Step Size.

        This is register 0x7A.
        """
        spi.write(0x7A, value)
Esempio n. 50
0
    def _set_reg_rx_fifo_control(self, value):
        """
        Set RX FIFO Control.

        This is register 0x7E.
        """
        spi.write(0x7E, value)
Esempio n. 51
0
    def _set_reg_tx_fifo_control_2(self, value):
        """
        Set TX FIFO Control 2.

        This is register 0x7D.
        """
        spi.write(0x7D, value)
Esempio n. 52
0
    def reset_all_registers(self):
        """
        Reset all registers.

        This function resets all registers to POR state.
        """
        spi.write(0x07, 0x80)
Esempio n. 53
0
    def _set_reg_GPIO_0(self, value=0xF4):
        """
        Set GPIO Configuration 0.

        This is register 0x0B.
        """
        spi.write(0x0B, value)
Esempio n. 54
0
    def _set_reg_operating_mode_2(self, value):
        """
        Set Operating Mode and Function Control 2.

        This is register 0x08.
        """
        spi.write(0x08, value)
Esempio n. 55
0
    def _set_reg_GPIO_1(self, value=0xEF):
        """
        Set GPIO Configuration 1.

        This is register 0x0C.
        """
        spi.write(0x0C, value)
Esempio n. 56
0
    def _set_reg_modem_test(self, value=0x01):
        """
        Set Modem Test.

        This is register 0x56.
        """
        spi.write(0x56, value)
Esempio n. 57
0
    def _set_reg_IO_config(self, value=0x00):
        """
        Set I/O Port Configuration.

        This is register 0x0E.
        """
        spi.write(0x0E, value)
Esempio n. 58
0
    def _set_reg_charge_pump(self, value=0x80):
        """
        Set Charge Pump Current Trimming/Override.

        This is register 0x58.
        """
        spi.write(0x58, value)
Esempio n. 59
0
 def enable_interrupt(self, signal):
     reg_1 = spi.read(0x05)
     reg_2 = spi.read(0x06)
     if signal == 'valid_packet_received':
         spi.write(0x05, reg_1 | 0x02)
     else:
         print "error in enable_interrupt"
Esempio n. 60
0
    def _set_reg_header_enable_2(self, value=0xFF):
        """
        Set Header Enable 2.

        This is register 0x44.
        """
        spi.write(0x44, value)