diff --git a/libs/bao1x-api/src/api.rs b/libs/bao1x-api/src/api.rs index 693266a34..c2ca18da4 100644 --- a/libs/bao1x-api/src/api.rs +++ b/libs/bao1x-api/src/api.rs @@ -43,9 +43,6 @@ pub enum HalOpcode { // blocking scalar UpdatePerclk = 18, - /// I2C operations - I2c = 9, - /// Peripheral reset PeriphReset = 10, @@ -69,3 +66,11 @@ pub enum PeripheralOpcode { ReadAdcChannel = 0x100, EnableChannel = 0x101, } + +#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)] +#[repr(usize)] +pub enum I2cOpcode { + InvalidCall = 0, + Transaction, + UpdatePerclk, +} diff --git a/libs/bao1x-api/src/lib.rs b/libs/bao1x-api/src/lib.rs index dadefafd9..5e471e09d 100644 --- a/libs/bao1x-api/src/lib.rs +++ b/libs/bao1x-api/src/lib.rs @@ -53,6 +53,7 @@ pub const SERVER_NAME_BAO1X_HAL: &str = "_bao1x-SoC HAL_"; /// be in a separate server to avoid lock-up issues of the server depending on itself /// for services. pub const SERVER_NAME_BAO1X_OTHERS: &str = "_HAL-everthing-else_"; +pub const SERVER_NAME_BAO1X_I2C: &str = "_bao1x-i2c_"; /// Number of boots to trigger the 'audit' command. It's set to be bigger than 1, because /// the chip tester may power cycle the chip during the provisioning process before the