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.
Dependencies: SX1276GenericLib USBDevice
Fork of NonPingPong_PICO_LoRa by
AO19_lib.h
00001 #include "mbed.h" 00002 00003 //AO19 Registers 00004 #define AO19_DEVICE_ID 0x00 // AO19 Chip ID 00005 #define AO19_BB_CFG0 0x01 // AO19 Buck Boost Configure 00006 #define AO19_BB_VSET 0x02 // AO19 Buck Boost Voltage Set 00007 #define AO19_BB_ISET 0x03 // AO19 Buck Boost Current Set 00008 #define AO19_BB_CFG1 0x04 // AO19 Buck Boost Configure 1 00009 #define AO19_STATUS 0x05 // AO19 Status Register 00010 #define AO19_INT 0x06 // AO19 Interrupt 00011 #define AO19_MSK 0x07 // AO19 Mask 00012 #define AO19_LOCK_MSK 0x50 // AO19 Lock Mask 00013 #define AO19_PASSWD 0x51 // AO19 Password 00014 00015 #define DEVICE_ACK 0 00016 #define DEVICE_NACK 1 00017 #define DEVICE_BAD_RESP 2 00018 00019 #define MAX_DEVICES 64 // Maximum number of rom devices allowed 00020 #define ID_LENGTH 6 // Rom ID length in bytes 00021 00022 struct AO19_struct { 00023 char rom_id[ID_LENGTH]; // device ROM ID 00024 char I2C_address; // I2C addess, based on GPIO0 and GPIO1 at power up 00025 // Why char? 00026 }; 00027 00028 // ***************************************************************************** 00029 // AO19_write_register(char, char, char) writes single byte to AO19 00030 // char I2C address 00031 // char AO19 register address 00032 // char data byte to be writen 00033 // returns 0 on success ACK, 1 on NACK 00034 // ***************************************************************************** 00035 int AO19_write_register(I2C *i2c, char I2C_add, char reg_add, char byte); 00036 00037 /// **************************************************************************** 00038 // AO19_write_register(char, char, char *, int) writes multiple bytes to AO19 00039 // char I2C address 00040 // char AO19 register address 00041 // char * data vector of bytes to be written 00042 // int number of bytes to write 00043 // returns 0 on success ACK, 1 on NACK 00044 // ***************************************************************************** 00045 int AO19_write_register(I2C *i2c, char I2C_add, char reg_add, char *bytes, int n); 00046 00047 // ***************************************************************************** 00048 // AO19_read_register(char, char, char *) reads single byte from AO19 00049 // char I2C address 00050 // char AO19 register address 00051 // char * data vector for read bytes to be stored in 00052 // returns 0 on success, 1 on fail 00053 // ***************************************************************************** 00054 int AO19_read_register(I2C *i2c, char I2C_add, char reg_add, char *bytes); 00055 00056 // ***************************************************************************** 00057 // AO19_read_register(char, char, char *, int) reads byte(s) from AO19 00058 // char I2C address 00059 // char OT07 register address 00060 // char * data vector for read bytes to be stored in 00061 // int number of bytes to read 00062 // returns 0 on success, 1 on fail 00063 // ***************************************************************************** 00064 int AO19_read_register(I2C *i2c, char I2C_add, char reg_add, char *bytes, int n);
Generated on Mon Jul 18 2022 15:25:00 by
1.7.2
