Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
A7105 Class Reference
Class for interfacing with the AMICCOM A7105 2.4G FSK/GFSK Transceiver. More...
#include <A7105.h>
Public Member Functions | |
| A7105 (PinName mosi, PinName miso, PinName clk, PinName cs, uint32_t freqHz) | |
| uint8_t | writeRegister (uint8_t regAddr, uint8_t value) |
| Writes a value to the given register. | |
| uint8_t | readRegister (uint8_t regAddr) |
| Reads a value from the given register. | |
| uint8_t | strobe (enum A7105_State state) |
| Sends a strobe command to the A7105. | |
| void | writeData (uint8_t *data, size_t len, uint8_t channel) |
| Send a packet of data to the A7105. | |
| void | readData (uint8_t *buffer, size_t len) |
| Read a packet of date from the A7105. | |
| void | setId (uint32_t id) |
| Set the A7105's ID. | |
| void | setPower (int32_t power) |
| Set the TX power. | |
| void | setTxRxMode (enum TXRX_State mode) |
| Sets the TxRx mode. | |
| int8_t | reset () |
| Resets the A7105, putting it into standby mode. | |
Detailed Description
Class for interfacing with the AMICCOM A7105 2.4G FSK/GFSK Transceiver.
See the A7105 datasheet for complete documentation on this part http://www.avantcom.com.tw/AVANTCOM/TC/DATA/PRODUCT/SOLVE/18_3.pdf
Example:
#include "mbed.h" #include "A7105.h" #define A7105_SPI_FREQUENCY 10000000 // 10MHz A7105 txrx(D4, D5, D3, D6, A7105_SPI_FREQUENCY); int main() { // reset ret = txrx.reset(); // use GPIO1 as miso ret = txrx.writeRegister(A7105_0B_GPIO1_PIN_I, 0x19); // set various radio options ret = txrx.writeRegister(A7105_01_MODE_CONTROL, 0x63); // set packet length (FIFO end pointer) to 0x0f + 1 == 16 ret = txrx.writeRegister(A7105_03_FIFOI, 0x0f); // select crystal oscillator and system clock divider of 1/2 ret = txrx.writeRegister(A7105_0D_CLOCK, 0x05); // sanity check ret = txrx.readRegister(A7105_0D_CLOCK); if (ret != 0x05) { // do something :) } }
Definition at line 129 of file A7105.h.
Constructor & Destructor Documentation
| A7105 | ( | PinName | mosi, |
| PinName | miso, | ||
| PinName | clk, | ||
| PinName | cs, | ||
| uint32_t | freqHz | ||
| ) |
Member Function Documentation
| void readData | ( | uint8_t * | buffer, |
| size_t | len | ||
| ) |
| uint8_t readRegister | ( | uint8_t | regAddr ) |
| int8_t reset | ( | ) |
| void setId | ( | uint32_t | id ) |
| void setPower | ( | int32_t | power ) |
| void setTxRxMode | ( | enum TXRX_State | mode ) |
| uint8_t strobe | ( | enum A7105_State | state ) |
| void writeData | ( | uint8_t * | data, |
| size_t | len, | ||
| uint8_t | channel | ||
| ) |
Generated on Fri Jul 29 2022 08:56:12 by
1.7.2