Skip to content

Commit

Permalink
update fw regs
Browse files Browse the repository at this point in the history
  • Loading branch information
NouranAbdelaziz committed Jan 13, 2025
1 parent 4a44293 commit 2150315
Showing 1 changed file with 53 additions and 30 deletions.
83 changes: 53 additions & 30 deletions fw/EF_I2C_regs.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
Copyright 2024 Mohamed Shalan
Copyright 2024 Efabless Corp.
Author: Mohamed Shalan (mshalan@efabless.com)
Author: Efabless Corp. (ip_admin@efabless.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

Expand All @@ -27,25 +27,48 @@
#define __RW volatile unsigned int
#endif

#define EF_I2C_COMMAND_REG_CMD_ADDRESS_BIT 0
#define EF_I2C_COMMAND_REG_CMD_ADDRESS_MASK 0x7f
#define EF_I2C_COMMAND_REG_CMD_START_BIT 8
#define EF_I2C_COMMAND_REG_CMD_START_MASK 0x100
#define EF_I2C_COMMAND_REG_CMD_READ_BIT 9
#define EF_I2C_COMMAND_REG_CMD_READ_MASK 0x200
#define EF_I2C_COMMAND_REG_CMD_WRITE_BIT 10
#define EF_I2C_COMMAND_REG_CMD_WRITE_MASK 0x400
#define EF_I2C_COMMAND_REG_CMD_WRITE_MULTIPLE_BIT 11
#define EF_I2C_COMMAND_REG_CMD_WRITE_MULTIPLE_MASK 0x800
#define EF_I2C_COMMAND_REG_CMD_STOP_BIT 12
#define EF_I2C_COMMAND_REG_CMD_STOP_MASK 0x1000
#define EF_I2C_DATA_REG_DATA_BIT 0
#define EF_I2C_DATA_REG_DATA_MASK 0xff
#define EF_I2C_DATA_REG_DATA_VALID_BIT 8
#define EF_I2C_DATA_REG_DATA_VALID_MASK 0x100
#define EF_I2C_DATA_REG_DATA_LAST_BIT 9
#define EF_I2C_DATA_REG_DATA_LAST_MASK 0x200

#define EF_I2C_STATUS_REG_BUSY_BIT 0
#define EF_I2C_STATUS_REG_BUSY_MASK 0x1
#define EF_I2C_STATUS_REG_BUS_CONT_BIT 1
#define EF_I2C_STATUS_REG_BUS_CONT_MASK 0x2
#define EF_I2C_STATUS_REG_BUS_ACT_BIT 2
#define EF_I2C_STATUS_REG_BUS_ACT_MASK 0x4
#define EF_I2C_STATUS_REG_MISS_ACK_BIT 3
#define EF_I2C_STATUS_REG_MISS_ACK_MASK 0x8
#define EF_I2C_STATUS_REG_CMD_EMPTY_BIT 8
#define EF_I2C_STATUS_REG_CMD_EMPTY_MASK 0x100
#define EF_I2C_STATUS_REG_CMD_FULL_BIT 9
#define EF_I2C_STATUS_REG_CMD_FULL_MASK 0x200
#define EF_I2C_STATUS_REG_CMD_OVF_BIT 10
#define EF_I2C_STATUS_REG_CMD_OVF_MASK 0x400
#define EF_I2C_STATUS_REG_WR_EMPTY_BIT 11
#define EF_I2C_STATUS_REG_WR_EMPTY_MASK 0x800
#define EF_I2C_STATUS_REG_WR_FULL_BIT 12
#define EF_I2C_STATUS_REG_WR_FULL_MASK 0x1000
#define EF_I2C_STATUS_REG_WR_OVF_BIT 13
#define EF_I2C_STATUS_REG_WR_OVF_MASK 0x2000
#define EF_I2C_STATUS_REG_RD_EMPTY_BIT 14
#define EF_I2C_STATUS_REG_RD_EMPTY_MASK 0x4000
#define EF_I2C_STATUS_REG_RD_FULL_BIT 15
#define EF_I2C_STATUS_REG_RD_FULL_MASK 0x8000
#define EF_I2C_COMMAND_REG_CMD_ADDRESS_BIT 0
#define EF_I2C_COMMAND_REG_CMD_ADDRESS_MASK 0x7f
#define EF_I2C_COMMAND_REG_CMD_START_BIT 8
#define EF_I2C_COMMAND_REG_CMD_START_MASK 0x100
#define EF_I2C_COMMAND_REG_CMD_READ_BIT 9
#define EF_I2C_COMMAND_REG_CMD_READ_MASK 0x200
#define EF_I2C_COMMAND_REG_CMD_WRITE_BIT 10
#define EF_I2C_COMMAND_REG_CMD_WRITE_MASK 0x400
#define EF_I2C_COMMAND_REG_CMD_WRITE_MULTIPLE_BIT 11
#define EF_I2C_COMMAND_REG_CMD_WRITE_MULTIPLE_MASK 0x800
#define EF_I2C_COMMAND_REG_CMD_STOP_BIT 12
#define EF_I2C_COMMAND_REG_CMD_STOP_MASK 0x1000
#define EF_I2C_DATA_REG_DATA_BIT 0
#define EF_I2C_DATA_REG_DATA_MASK 0xff
#define EF_I2C_DATA_REG_DATA_VALID_BIT 8
#define EF_I2C_DATA_REG_DATA_VALID_MASK 0x100
#define EF_I2C_DATA_REG_DATA_LAST_BIT 9
#define EF_I2C_DATA_REG_DATA_LAST_MASK 0x200

#define EF_I2C_MISS_ACK_FLAG 0x1
#define EF_I2C_CMDE_FLAG 0x2
Expand Down

0 comments on commit 2150315

Please sign in to comment.