$(shell mkdir -p sim/build >/dev/null)
NAME="test_2024-07-23_nano-5v"
-
-SRC= $(wildcard src/*.c src/*.cpp src/*/*.cpp)
+SRC= $(wildcard src/*.c src/*.cpp src/*/*.c src/*/*.cpp)
+HDR= $(wildcard src/*.h src/*.hpp src/*/*.h src/*/*.hpp)
OBJ_CPP = $(SRC:src/%.cpp=build/%.o)
OBJ = $(OBJ_CPP:src/%.c=build/%.o)
OBJ_SIM_CPP = $(SRC:src/%.cpp=sim/build/%.o)
CFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -c
LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -Wl,-u,vfprintf -lprintf_flt -lm
-CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -c
+CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -c -c
LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -Wl,-u,vfprintf -lprintf_flt -lm
all: dist/$(NAME).elf dist/$(NAME).s dist/$(NAME).hex sim/$(NAME).elf sim/$(NAME).s info
dbg:
- @echo "OBJ_CPP" $(OBJ_CPP)
- @echo "OBJ" $(OBJ)
- @echo "OBJ_SIM_CPP" $(OBJ_SIM_CPP)
- @echo "OBJ_SIM" $(OBJ_SIM)
+ @echo --HDR---------------------------------
+ @echo $(HDR)
+ @echo --SRC---------------------------------
+ @echo $(SRC)
+ @echo --OBJ---------------------------------
+ @echo $(OBJ)
+ @echo --OBJ_CPP-----------------------------
+ @echo $(OBJ_CPP)
+ @echo --OBJ---------------------------------
+ @echo $(OBJ)
+ @echo ===================================
+ @echo
info:
- @echo
@avr-size --mcu=$(DEVICE) --format=avr dist/$(NAME).elf
-.depend: $(SRC)
- $(CC) -MM $(SRC) > .depend
+.depend: $(SRC) $(HDR)
+ $(CC) -mmcu=$(DEVICE) -MM $(SRC) | sed --regexp-extended 's/^(.*\.o)\: src\/(.*)(\.cpp|\.c) (.*)/build\/\2\.o\: src\/\2\3 \4/g' > .depend
+
+-include .depend
--include $(DEPENDFILE)
+# .depend solte auch auf Header Files achten!
dist/$(NAME).elf: .depend $(OBJ)
$(CC) $(LFLAGS) -o $@ $(OBJ)
gdb: sim/$(NAME).elf
avr-gdb $<
+
+flash: dist/$(NAME).elf all
+ avrdude -c arduino -P /dev/ttyUSB0 -p m328p -e -U flash:w:$<
+
+flash0: dist/$(NAME).elf all
+ avrdude -c arduino -P /dev/ttyUSB0 -p m328p -e -U flash:w:$<
+
+flash1: dist/$(NAME).elf all
+ avrdude -c arduino -P /dev/ttyUSB1 -p m328p -e -U flash:w:$<
+
+flash2: dist/$(NAME).elf all
+ avrdude -c arduino -P /dev/ttyUSB2 -p m328p -e -U flash:w:$<
+
+picocom:
+ # picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
+ picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+
+picocom0:
+ picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+
+picocom1:
+ picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1
+
+picocom2:
+ picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
+
+
isp-644p:
avrdude -c usbasp -p m644p
avrdude -c arduino -p m644p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$<
-picocom:
- # picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
- picocom -b 115200 --omap crlf /dev/ttyUSB0
-
isp-fuse-644p:
avrdude -c usbasp -p m644p -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xFF:m -U lock:w:0xFF:m
* @param reg the register address to write to
* @param value the value to write to the register
*/
-void Adafruit_BME280::write8(byte reg, byte value) {
- byte buffer[2];
+void Adafruit_BME280::write8(uint8_t reg, uint8_t value) {
+ uint8_t buffer[2];
buffer[1] = value;
if (i2c_dev) {
buffer[0] = reg;
* @param reg the register address to read from
* @returns the data byte read from the device
*/
-uint8_t Adafruit_BME280::read8(byte reg) {
+uint8_t Adafruit_BME280::read8(uint8_t reg) {
uint8_t buffer[1];
if (i2c_dev) {
buffer[0] = uint8_t(reg);
* @param reg the register address to read from
* @returns the 16 bit data value read from the device
*/
-uint16_t Adafruit_BME280::read16(byte reg) {
+uint16_t Adafruit_BME280::read16(uint8_t reg) {
uint8_t buffer[2];
if (i2c_dev) {
* @param reg the register address to read from
* @returns the 16 bit data value read from the device
*/
-uint16_t Adafruit_BME280::read16_LE(byte reg) {
+uint16_t Adafruit_BME280::read16_LE(uint8_t reg) {
uint16_t temp = read16(reg);
return (temp >> 8) | (temp << 8);
}
* @param reg the register address to read from
* @returns the 16 bit data value read from the device
*/
-int16_t Adafruit_BME280::readS16(byte reg) { return (int16_t)read16(reg); }
+int16_t Adafruit_BME280::readS16(uint8_t reg) { return (int16_t)read16(reg); }
/*!
* @brief Reads a signed little endian 16 bit value over I2C or SPI
* @param reg the register address to read from
* @returns the 16 bit data value read from the device
*/
-int16_t Adafruit_BME280::readS16_LE(byte reg) {
+int16_t Adafruit_BME280::readS16_LE(uint8_t reg) {
return (int16_t)read16_LE(reg);
}
* @param reg the register address to read from
* @returns the 24 bit data value read from the device
*/
-uint32_t Adafruit_BME280::read24(byte reg) {
+uint32_t Adafruit_BME280::read24(uint8_t reg) {
uint8_t buffer[3];
if (i2c_dev) {
#include "../i2cmaster.hpp"
#include "../main.hpp"
-#define byte uint8_t
+// #define byte uint8_t
void readCoefficients(void);
bool isReadingCalibration(void);
- void write8(byte reg, byte value);
- uint8_t read8(byte reg);
- uint16_t read16(byte reg);
- uint32_t read24(byte reg);
- int16_t readS16(byte reg);
- uint16_t read16_LE(byte reg); // little endian
- int16_t readS16_LE(byte reg); // little endian
+ void write8(uint8_t reg, uint8_t value);
+ uint8_t read8(uint8_t reg);
+ uint16_t read16(uint8_t reg);
+ uint32_t read24(uint8_t reg);
+ int16_t readS16(uint8_t reg);
+ uint16_t read16_LE(uint8_t reg); // little endian
+ int16_t readS16_LE(uint8_t reg); // little endian
uint8_t _i2caddr; //!< I2C addr for the TwoWire interface
int32_t _sensorID; //!< ID of the BME Sensor
}
-bool ScioSense_ENS160::write8 (byte reg, byte value) {
- byte buffer[2];
+bool ScioSense_ENS160::write8 (uint8_t reg, uint8_t value) {
+ uint8_t buffer[2];
buffer[1] = value;
buffer[0] = reg;
return i2cDevice.write(buffer, 2);
}
-bool ScioSense_ENS160::read8 (byte reg, byte *value) {
+bool ScioSense_ENS160::read8 (uint8_t reg, uint8_t *value) {
uint8_t buffer[1];
buffer[0] = uint8_t(reg);
return i2cDevice.write_then_read(buffer, 1, value, 1);
}
-bool ScioSense_ENS160::read16 (byte reg, uint16_t *value) {
+bool ScioSense_ENS160::read16 (uint8_t reg, uint16_t *value) {
uint8_t buffer[1];
buffer[0] = uint8_t(reg);
return i2cDevice.write_then_read(buffer, 1, (uint8_t *)value, 2);
}
-bool ScioSense_ENS160::read16LE (byte reg, uint16_t *value) {
+bool ScioSense_ENS160::read16LE (uint8_t reg, uint16_t *value) {
uint16_t tmp;
if (read16(reg, &tmp)) {
*value = ((tmp & 0xff) << 8) | (tmp >> 8);
return false;
}
-bool ScioSense_ENS160::readBytes (byte reg, uint8_t *bytes, uint8_t len) {
+bool ScioSense_ENS160::readBytes (uint8_t reg, uint8_t *bytes, uint8_t len) {
uint8_t buffer[1];
buffer[0] = uint8_t(reg);
return i2cDevice.write_then_read(buffer, 1, buffer, len);
#include "../i2cmaster.hpp"
#include <stdint.h>
-#define byte uint8_t
+// #define byte uint8_t
// #if (ARDUINO >= 100)
// #include "Arduino.h"
uint8_t _seq_steps[1][8];
- bool write8(byte reg, byte value);
- bool read8 (byte reg, byte *value);
- bool read16 (byte reg, uint16_t *value);
- bool read16LE (byte reg, uint16_t *value);
- bool readBytes (byte reg, uint8_t *bytes, uint8_t len);
+ bool write8(uint8_t reg, uint8_t value);
+ bool read8 (uint8_t reg, uint8_t *value);
+ bool read16 (uint8_t reg, uint16_t *value);
+ bool read16LE (uint8_t reg, uint16_t *value);
+ bool readBytes (uint8_t reg, uint8_t *bytes, uint8_t len);
};
// ------------------------------------
// not available
- void PortExp::init () {}
- void PortExp::cleanup () {}
- void PortExp::setChipEnable () {}
- void PortExp::clearChipEnable () {}
+ void Cc1101::init () {}
+ void Cc1101::cleanup () {}
+ int8_t Cc1101::run (uint8_t subtest) { return -1; }
+ PGM_P Cc1101::getName () { return PSTR("?"); }
#endif
return (PINA & (1 << PA5)) != 0;
}
-#endif
-
uint8_t Cc1101::sendSpiByte (uint8_t b) {
SPDR = b;
while (!(SPSR & (1<<SPIF))) {}
return -1;
}
+#endif
\ No newline at end of file
void Cc1101New::init () {}
void Cc1101New::cleanup () {}
- void Cc1101New::setChipEnable () {}
- void Cc1101New::clearChipEnable () {}
+ void Cc1101New::setChipEnableLow () {}
+ void Cc1101New::setChipEnableHigh () {}
+ int8_t Cc1101New::run (uint8_t subtest) { return -1; }
+ PGM_P Cc1101New::getName () { return PSTR("?"); }
#endif
// --------------------------------------------------------
const Cc1101New::Register_t PMEM_CC1101_REGISTER_INIT PROGMEM = {
- { Cc1101New::CHIP_NOT_READY, 0, 0 }, // iocfg2 (GDO2)
- { Cc1101New::HIGH_IMPEDANCE_WHEN_CHIP_SELECT_HIGH, 0, 0 }, // iocfg1 (GDO1/MISO)
- { Cc1101New::CLK_XOSC_DIV_128, 0, 0 }, // iocfg0 (GDO0)
- { 7, 0, 1, 0 }, // fifothr (fifo_thr = 7, close_in_rx=0, adc_retention = 1)
- // { 0x91, 0xd3 }, // sync word = 0xd391
- { 0x7a, 0x0e }, // sync word = 0xd391
+ /* iocfg2 0x0b (----) */ { Cc1101New::CHIP_NOT_READY, 0, 0 }, // GDO2
+ /* iocfg1 0x2e (----) */ { Cc1101New::HIGH_IMPEDANCE_WHEN_CHIP_SELECT_HIGH, 0, 0 }, // GDO1/MISO
+ /* iocfg0 0x06 (----) */ { Cc1101New::CLK_XOSC_DIV_128, 0, 0 }, // GDO0
+ /* fifothr 0x47 (0x07) */ { 7, 0, 1, 0 }, // fifo_thr = 0b111, close_in_rx=0, adc_retention = 1, (bit7=0)
+ /* sync1 0x7a (0xd3) */ 0x7a,
+ /* sync0 0x0e (0x91) */ 0x0e,
+ /* pktlen 0x14 (0x3d) */ 0x14,
+ /* pktctrl1 0x04 (----) */ { Cc1101New::NO_ADDR_CHECK, 1, 0, 0, 0 }, // adr_chk=0b00, append_status=1, crc_autoflush=0, (bit4=0), pqt=0b000
+ /* pktctrl0 0x05 (----) */ { Cc1101New::FIXED, 1, 0, Cc1101New::NORMAL_USE_FIFO, 0, 0 }, // length_config=0b01, crc_en=1, (bit3=0), pkt_format=0b00, white_data=0, (bit7=0)
+ /* addr 0x00 (----) */ 0x00,
+ /* channr 0x00 (----) */ 0x00,
+ /* fsctrl1 0x06 (0x08) */ { 6, 0, 0 }, // frqu_if=6, (bit5=0), (bit76=0b00)
+ /* fsctrl0 0x00 (----) */ { 0 }, // freqoff = 0
+ /* frequ2 0x21 (----) */ 0x21,
+ /* frequ1 0x62 (----) */ 0x62,
+ /* frequ0 0x76 (----) */ 0x76,
+ /* mdmcfg4 0xca (0x5b) */ { 0x0a, 0, 3 }, // drate_e=0x0a, chanbw_m=0, chanbw_e=3
+ /* mdmcfg3 0xf8 (----) */ { 0xf8 }, // drate_m=0xf8
+ /* mdmcfg2 0x16 (0x03) */ { Cc1101New::SYNC_16_16_CARRIER_SENSE, 0, Cc1101New::GFSK, 0}, // sync_mode=0b110, manchester_en=0, mod_format=0b001, dem_dcfilt_off=0
+ /* mdmcfg1 0x22 (----) */ { 2, 0, Cc1101New::FOUR, 0 }, // chanspc_e=0b10, bit32=0, num_preamble=0b010, fec_en=0
+ /* mdmcfg0 0xf8 (----) */ { 0xf8 }, // chanspc_m = 0x08
+ /* deviatn 0x40 (0x47) */ { 0, 0, 4, 0 }, // deviation_m=0, (bit3=0), deviation_e=4, (bit7=0)
+ /* mcsm2 0x07 (----) */ { 7, 0, 0, 0 }, // rx_time=7 (NA), rx_time_qual=0, rx_time_rssi=0, (bit76=0b00)
+ /* mcsm1 0x30 (----) */ { Cc1101New::TXOFF_IDLE, Cc1101New::RXOFF_IDLE, Cc1101New::RSSI_BELOW_THRESHOLD__UNLESS_RECEIVE_PACKET, 0 }, // mcsm1 (txoff_mode=0b00, rxoff_mode=0b00, cca_mode=0b11, (bit76=0b00) )
+ /* mcsm0 0x18 (----) */ { 0, 0, 2, Cc1101New::IDLE_TO_RX_OR_TX, 0 }, // xosc_force_on=0, pin_ctrl_en=0, po_timeout=2 (149-155us), fs_autocal=0b01, (bit76=0b00)
+ /* foccfg 0x16 (0x1d) */ 0x16,
+ /* bscfg 0x6c (0x1c) */ 0x6c,
+ /* agcctrl2 0x43 (0xc7) */ 0x43,
+ /* agcctrl1 0x49 (0x00) */ 0x49,
+ /* agcctrl0 0x91 (0xb2) */ 0x91,
+ /* worevt1 0x87 (----) */ 0x87,
+ /* worevt0 0x6b (----) */ 0x6b,
+ /* worctrl 0xfb (0xf8) */ 0xfb,
+ /* frend1 0x56 (0xb6) */ 0x56,
+ /* frend0 0x10 (----) */ 0x10,
+ /* fscal3 0xe9 (0xea) */ 0xe9,
+ /* fscal2 0x2a (----) */ 0x2a,
+ /* fscal1 0x00 (----) */ 0x00,
+ /* fscal0 0x1f (0x11) */ 0x1f,
+ /* rcctrl1 0x41 (----) */ 0x41,
+ /* rcctrl0 0x00 (----) */ 0x00,
+ /* fstest 0x59 (----) */ 0x59,
+ /* ptest 0x7f (----) */ 0x7f,
+ /* agctest 0x3f (----) */ 0x3f,
+ /* test2 0x81 (0x88) */ 0x81,
+ /* test1 0x35 (0x31) */ 0x35,
+ /* test0 0x09 (0x0b) */ 0x09
};
}
void Cc1101New::init () {
+
+ printf_P(PSTR("\n sizeof(status)=%d "), sizeof(status));
+
// trigger for debugging
PORTB &= ~(1 << PB0);
DDRB |= ( 1 << PB0);
bool Cc1101New::writeRegister (uint8_t addr, uint8_t value) {
bool ok = true;
- printf_P(PSTR(" [writeRegister(0x%02x, 0x%02x)] "), addr, value);
- timer = 10;
+
setChipEnableLow();
ok &= waitForMisoLow();
sendSpiByte(addr);
- sendSpiByte(value);
+ status.byte = sendSpiByte(value);
+ setChipEnableHigh();
+
+ printf_P(PSTR("\n [writeRegister(0x%02x, 0x%02x) -> "), addr, value);
+ if (ok) {
+ printf_P(PSTR("status=0x%02x]"), status.byte);
+ } else {
+ printf_P(PSTR("ERR]"));
+ }
+
+ return ok;
+ }
+
+ bool Cc1101New::readRegister (uint8_t addr, uint8_t *value) {
+ bool ok = true;
+ addr = (addr & 0x3f) | 0x80;
+ setChipEnableLow();
+ ok &= waitForMisoLow();
+ status.byte = sendSpiByte(addr);
+ *value = sendSpiByte(0);
setChipEnableHigh();
+
+ printf_P(PSTR("\n [readRegister(0x%02x) -> "), addr & 0x3f);
+ if (ok) {
+ printf_P(PSTR("0x%02x,status=0x%02x]"), *value, status.byte);
+ } else {
+ printf_P(PSTR("ERR]"));
+ }
return ok;
}
+ void Cc1101New::printRegisters () {
+ const Register_t *regValues = &PMEM_CC1101_REGISTER_INIT;
+ printf_P(PSTR("\n"));
+ for (uint8_t addr = 0; addr < sizeof(Register_t); addr++) {
+ bool ok = true;
+ uint8_t regValue, value;
+ memcpy_P(®Value, ((const uint8_t *)regValues) + addr, 1);
+ ok &= readRegister(addr, &value);
+ if (value != regValue) { printf_P(PSTR(" != 0x%02x"), regValue); }
+ }
+ printf_P(PSTR("\n"));
+ }
+
bool Cc1101New::resetCC1101 () {
bool ok = true;
setChipEnableLow();
bool Cc1101New::initRegister () {
const Register_t *regValues = &PMEM_CC1101_REGISTER_INIT;
bool ok = true;
+
+ printRegisters();
+
triggerOn();
for (uint8_t addr = 0; ok && addr < sizeof(Register_t); addr++) {
uint8_t regValue;
ok &= writeRegister(addr, regValue);
}
triggerOff();
+
+ printRegisters();
return ok;
}
public:
typedef enum { MHZ915, MHZ433, MHZ868 } InitFrequency;
typedef enum { Test } Cc1101Mode;
-
+ typedef enum { IDLE = 0, RX = 1, TX = 2, FSTXON = 3, CALIBRATE = 4, SETTLING = 5, RXFIFO_OVFL = 6, TXFIFO_UNFL = 7 } StatusState_t;
+ typedef struct { uint8_t fifoBytes:4; StatusState_t state:3; uint8_t chipNotReady:1; } Status_t;
+ union {
+ Status_t status;
+ uint8_t byte;
+ } status;
public:
- Cc1101New (Cc1101Mode mode) { timer = 0; this->mode = mode; };
+ Cc1101New (Cc1101Mode mode) { timer = 0; this->mode = mode; status.byte = 0x80; }
virtual void init ();
virtual void cleanup ();
virtual int8_t run (uint8_t subtest);
bool waitForMisoLow ();
bool strobe (StrobeCommand_t strobe);
bool writeRegister (uint8_t addr, uint8_t value);
+ bool readRegister (uint8_t addr, uint8_t *value);
+ void printRegisters ();
+
bool resetCC1101 ();
bool initRegister ();
Cc1101Mode mode;
uint8_t timer;
-
public:
typedef enum {
IOCFG2 = 0x00, IOCFG1 = 0x01, IOCFG0 = 0x02,
- FIFOTHR = 0x03
+ FIFOTHR = 0x03,
+ SYNC1 = 0x04, SYNC0 = 0x05,
+ PKTLEN = 0x06,
+ PKTCTRL1 = 0x07, PKTCTRL0 = 0x08
} RegisterAddress_t;
typedef enum {
CLK_XOSC_DIV_192 = 0x3f
} GDOx_CFG_t;
+ typedef enum { NO_ADDR_CHECK = 0, CHECK_NO_BROADCAST = 1, CHECK_WITH_BROADCAST_0 = 2, CHECK_WITH_BROADCAST_0_AND_255 = 3 } ADR_CHK_t;
+ typedef enum { FIXED = 0, VARIABLE = 1, INFINITE = 2 } LENGTH_CONFIG_t;
+ typedef enum { NORMAL_USE_FIFO = 0, SYNC_SERIAL = 1, RANDOM_TX = 2, ASYNC_SERIAL = 3 } PKT_FORMAT_t;
+ typedef enum { FSK2 = 0, GFSK = 1, ASK_OOK = 3, FSK4 = 4, MSK = 7 } MOD_FORMAT_t;
+ typedef enum { NO_SYNC = 0, SYNC_15_16 = 1, SYNC_16_16 = 2, SYNC_30_32 = 3, CARRIER_SENSE = 4, SYNC_15_16_CARRIER_SENSE = 5, SYNC_16_16_CARRIER_SENSE = 6 , SYNC_30_326_CARRIER_SENSE = 7} SYNC_MODE_t;
+ typedef enum { TWO = 0, THREE = 1, FOUR = 2, SIX = 3, EIGHT = 4, TWELVE = 5, SIXTEEN = 6, TWENTYFOUR = 7 } NUM_PREAMBLE_t;
+ typedef enum { TXOFF_IDLE = 0, TXOFF_FSTXON = 1, STAY_IN_TX = 2, TXOFF_RX = 3 } TXOFF_MODE_t;
+ typedef enum { RXOFF_IDLE = 0, RXOFF_FSTXON = 1, RXOFF_TX = 2, STAY_IN_RX = 3 } RXOFF_MODE_t;
+ typedef enum { ALWAYS = 0, RSSI_BELOW_THRESHOLD = 1, UNLESS_RECEIVE_PACKET = 2, RSSI_BELOW_THRESHOLD__UNLESS_RECEIVE_PACKET = 3 } CCA_MODE_t;
+ typedef enum { NEVER = 0, IDLE_TO_RX_OR_TX = 1, RX_OR_TX_TO_IDLE = 2, RX_OR_TX_TO_IDLE_EVERY_4_TIME = 3 } FS_AUTOCAL_t;
+
typedef struct { GDOx_CFG_t gdo0_cfg:6; uint8_t gdo0_inv:1; uint8_t bit7:1; } IOCFG0_t;
typedef struct { GDOx_CFG_t gdo1_cfg:6; uint8_t gdo1_inv:1; uint8_t bit7:1; } IOCFG1_t;
typedef struct { GDOx_CFG_t gdo2_cfg:6; uint8_t gdo2_inv:1; uint8_t bit7:1; } IOCFG2_t;
typedef struct { uint8_t fifo_thr:4; uint8_t close_in_rx:2; uint8_t adc_retention:1; uint8_t bit7:1; } FIFOTHR_t;
- typedef struct { uint8_t lowByte; uint8_t highByte; } SYNC_t;
+ typedef struct { ADR_CHK_t adr_chk:2; uint8_t append_status:1; uint8_t crc_autoflush:1; uint8_t bit4:1; uint8_t pqt:3; } PKTCTRL1_t;
+ typedef struct { LENGTH_CONFIG_t length_config:2; uint8_t crc_en:1; uint8_t bit3:1; PKT_FORMAT_t pkt_format:2; uint8_t white_data:1; uint8_t bit7:1; } PKTCTRL0_t;
+ typedef struct { uint8_t frequ_if:5; uint8_t bit5:1; uint8_t bit76:2; } FSCTRL1_t;
+ typedef struct { uint8_t frequoff:8; } FSCTRL0_t;
+ typedef struct { uint8_t drate_e:4; uint8_t chanbw_m:2; uint8_t chanbw_e:2; } MDMCFG4_t;
+ typedef struct { uint8_t drate_m:8; } MDMCFG3_t;
+ typedef struct { SYNC_MODE_t sync_mode:3; uint8_t manchester_en:1; MOD_FORMAT_t mod_format:3; uint8_t dem_dcfilt_off:1; } MDMCFG2_t;
+ typedef struct { uint8_t chanspc_e:2; uint8_t bit32:2; NUM_PREAMBLE_t num_preamble:3; uint8_t fec_en:1; } MDMCFG1_t;
+ typedef struct { uint8_t chanspc_m:8; } MDMCFG0_t;
+ typedef struct { uint8_t deviation_m:3; uint8_t bit3:1; uint8_t deviation_e:3; uint8_t bit7:1; } DEVIATN_t;
+ typedef struct { uint8_t rx_time:3; uint8_t rx_time_qual:1; uint8_t rx_time_rssi:1; uint8_t bit765:3; } MCSM2_t;
+ typedef struct { TXOFF_MODE_t txoff_mode:2; RXOFF_MODE_t rxoff_mode:2; CCA_MODE_t cca_mode:2; uint8_t bit76:2; } MCSM1_t;
+ typedef struct { uint8_t xosc_force_on:1; uint8_t pin_ctrl_en:1; uint8_t po_timeout:2; FS_AUTOCAL_t fs_autocal:2; uint8_t bit76:2; } MCSM0_t;
typedef struct {
IOCFG2_t iocfg2;
IOCFG1_t iocfg1;
IOCFG0_t iocfg0;
FIFOTHR_t fifothr;
- SYNC_t sync;
+ uint8_t sync1;
+ uint8_t sync0;
+ uint8_t pktlen;
+ PKTCTRL1_t pktctrl1;
+ PKTCTRL0_t pktctrl0;
+ uint8_t addr;
+ uint8_t channr;
+ FSCTRL1_t fsctrl1;
+ FSCTRL0_t fsctrl0;
+ uint8_t frequ2;
+ uint8_t frequ1;
+ uint8_t frequ0;
+ MDMCFG4_t mdmcfg4;
+ MDMCFG3_t mdmcfg3;
+ MDMCFG2_t mdmcfg2;
+ MDMCFG1_t mdmcfg1;
+ MDMCFG0_t mdmcfg0;
+ DEVIATN_t deviatn;
+ MCSM2_t mcsm2;
+ MCSM1_t mcsm1;
+ MCSM0_t mcsm0;
+ uint8_t foccfg;
+ uint8_t bscfg;
+ uint8_t agcctrl2;
+ uint8_t agcctrl1;
+ uint8_t agcctrl0;
+ uint8_t worevt1;
+ uint8_t worevt0;
+ uint8_t worctrl;
+ uint8_t frend1;
+ uint8_t frend0;
+ uint8_t fscal3;
+ uint8_t fscal2;
+ uint8_t fscal1;
+ uint8_t fscal0;
+ uint8_t rcctrl1;
+ uint8_t rcctrl0;
+ uint8_t fstest;
+ uint8_t ptest;
+ uint8_t agctest;
+ uint8_t test2;
+ uint8_t test1;
+ uint8_t test0;
+
} Register_t;
}
#ifdef __AVR_ATmega328P__
-void Modbus::init () {}
-void Modbus::cleanup () {}
-int8_t Modbus::run (uint8_t subtest) { return -1; }
-void Modbus::handleRxByte (uint8_t b) {}
+void Rtc8563::init () {}
+void Rtc8563::cleanup () {}
+int8_t Rtc8563::run (uint8_t subtest) { return -1; }
#endif
#ifdef __AVR_ATmega644P__