1# Copyright (c) 2019-2020 Gerson Fernando Budke <nandojve@gmail.com> 2# SPDX-License-Identifier: Apache-2.0 3 4description: ATMEL AT86RF2xx 802.15.4 wireless transceiver 5 6compatible: "atmel,rf2xx" 7 8include: spi-device.yaml 9 10properties: 11 irq-gpios: 12 type: phandle-array 13 required: true 14 15 reset-gpios: 16 type: phandle-array 17 required: true 18 19 slptr-gpios: 20 type: phandle-array 21 required: true 22 description: | 23 Multi-functional pin that controls sleep, deep sleep, transmit 24 start and receive states 25 26 dig2-gpios: 27 type: phandle-array 28 description: RX and TX Frame Time Stamping(TX_ARET) 29 30 clkm-gpios: 31 type: phandle-array 32 description: Master clock signal output 33 34 local-mac-address: 35 type: uint8-array 36 description: | 37 Specifies the MAC address that was assigned to the network 38 device 39 40 channel-page: 41 type: int 42 enum: 43 - 0 44 - 2 45 - 5 46 description: | 47 Selects Channel Page accordingly with IEEE 802.15.4 standard. The Page 0 48 is used in both Sub-Giga and 2.4GHz. It allows select channels 0-10 in 49 Sub-Giga band (0: BPSK-20, 1-10: BPSK-40) and 11-26 in 2.4GHz band 50 (11-26: O-QPSK-250). Channel 2 is for Sub-Giga and selects 51 (0: OQPSK-SIN-RC-100, 1-10: OQPSK-SIN-250). Channel 5 is for Sub-Giga 52 (JAPAN) and selects (0-3: OQPSK-RC-250) . 53 0: Page 0 - BPSK-20 [0], BPSK-40 [1-10], O-QPSK-250 [11-26]. 54 2: Page 2 - OQPSK-SIN-RC-100 [0], OQPSK-SIN-250 [1-10]. 55 5: Page 5 - OQPSK-RC-250 [0-3]. 56 57 tx-pwr-table: 58 type: uint8-array 59 default: [0x00] 60 description: | 61 This is the Transmission Power Mapping Table array used to comply with 62 local regulations. By default this value set an output power above 0dBm 63 for all transceivers. This property must be used with tx-pwr-min and 64 tx-pwr-max for normal operations. The number of elements is defined by 65 the size of the tx-pwr-table array property. The max entry value for 66 2.4GHz is 0x0f and 0xff for Sub-Giga. See PHY_TX_PWR at datasheet for 67 more details. 68 69 The output power is determined by following formula: 70 71 linear_step = (tx-pwr-max - tx-pwr-min) 72 / (sizeof(tx-pwr-table) - 1.0); 73 table_index = abs((value_in_dbm - tx-pwr-max) / linear_step); 74 output_power = tx-pwr-table[table_index]; 75 76 Using AT86RF233 as example without external PA. By the datasheet the 77 tx-pwr-min = -17 dBm and tx-pwr-max = +4 dBm. Using 48 elements in the 78 tx-pwr-table array. The table array is filled from higher to lower power. 79 80 tx-pwr-min = [01 11]; /* -17.0 dBm */ 81 tx-pwr-max = [00 04]; /* 4.0 dBm */ 82 tx-pwr-table = [00 01 03 04 05 05 06 06 83 07 07 07 08 08 09 09 0a 84 0a 0a 0b 0b 0b 0b 0c 0c 85 0c 0c 0d 0d 0d 0d 0d 0d 86 0d 0d 0e 0e 0e 0e 0e 0e 87 0e 0e 0e 0e 0e 0e 0f 0f]; 88 89 The values in the table are filled based on table 9-9 [TX Output Power] 90 using the linear step in dBm as: 91 92 linear_step = (4 - (-17)) / (48 - 1) => ~0.45 dBm 93 94 Assuming that user wants set 0 dBm as output power: 95 96 table_index = abs((0 - 4) / 0.45) => 8.95 ( round to 9 ) 97 output_power = tx-pwr-table[9] => 0x07 ( 0 dBm as table 9-9 ) 98 99 Note when tx-pwr-min is [0x00, 0x00] and tx-pwr-max is [0x00, 0x00] 100 the linear step is zero. This means that table_index will be always the 101 first element of the tx-pwr-table array, which is 0x00 by default. This 102 is defined as general case when user not define any tx-pwr-* entries. It 103 sets the transceiver to use always a value above 0 dBm as output power. 104 105 tx-pwr-min: 106 type: uint8-array 107 default: [0x00, 0x00] 108 description: | 109 This value represent minimum normalized value in dBm for the transceiver 110 output power. This property must be used when tx-pwr-table is defined. 111 The value is represented by two entries where first element represents 112 the signal indication [0x00-positive, 0x01-negative] and second element 113 is the minimal value in dBm for the transceiver output power. By default, 114 the combination of tx-pwr-min as [0x00, 0x00] and tx-pwr-max as [0x00, 115 0x00] will create a fixed transmission power. 116 117 tx-pwr-max: 118 type: uint8-array 119 default: [0x00, 0x00] 120 description: | 121 This value represent maximum normalized value in dBm for the transceiver 122 output power. This property must be used when tx-pwr-table is defined. 123 The value is represented by two entries where first element represents 124 the signal indication [ 0x00-positive] and second element is the maximum 125 value in dBm for the transceiver output power. By default, the 126 combination of tx-pwr-max as [0x00, 0x00] and tx-pwr-min as [0x00, 127 0x00] will create a fixed transmission power. 128