diff --git a/avr/modules/ccs811/0BUILD b/avr/modules/ccs811/0BUILD new file mode 100644 index 0000000..febd367 --- /dev/null +++ b/avr/modules/ccs811/0BUILD @@ -0,0 +1,11 @@ + + + + + + main.asm + + + + + diff --git a/avr/modules/ccs811/main.asm b/avr/modules/ccs811/main.asm new file mode 100644 index 0000000..ca42f55 --- /dev/null +++ b/avr/modules/ccs811/main.asm @@ -0,0 +1,537 @@ +; *************************************************************************** +; copyright : (C) 2023 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + + + +; *************************************************************************** +; defines + +.equ CCS811_FLAGS_ACTIVATED = 0x80 +.equ CCS811_FLAGS_RESETTED = 0x40 +.equ CCS811_FLAGS_VALIDDATA = 0x20 + + +.equ CCS811_WAITMS_AFTER_RESET = 50 +.equ CCS811_WAITMS_AFTER_START = 50 + +.equ CCS811_REG_STATUS = 0x00 +.equ CCS811_REG_MEASMODE = 0x01 +.equ CCS811_REG_DATA = 0x02 +.equ CCS811_REG_APP_START = 0xf4 +.equ CCS811_REG_SWRESET = 0xff + +.equ CCS811_STATUS_FWMODE_BIT = 7 +.equ CCS811_STATUS_APPVALID_BIT = 4 +.equ CCS811_STATUS_DATAREADY_BIT = 3 +.equ CCS811_STATUS_ERROR_BIT = 0 + +.equ CCS811_MEASUREMODE_DM2_BIT = 6 +.equ CCS811_MEASUREMODE_DM1_BIT = 5 +.equ CCS811_MEASUREMODE_DM0_BIT = 4 + +.equ CCS811_MEASUREMODE = (0<