Skip to content

Commit

Permalink
Merge pull request #6 from movetones/fix-bank-select
Browse files Browse the repository at this point in the history
fix alignment of bankselect bits in c backbone.
  • Loading branch information
oclyke authored Jul 8, 2019
2 parents ecceea7 + 0d1bc20 commit 3e825a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util/ICM_20948_C.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ ICM_20948_Status_e ICM_20948_i2c_master_single_r( ICM_20948_Device_t* pdev, uint

ICM_20948_Status_e ICM_20948_set_bank( ICM_20948_Device_t* pdev, uint8_t bank ){
if( bank > 3 ){ return ICM_20948_Stat_ParamErr; } // Only 4 possible banks
bank = (bank << 4) & 0x30; // bits 5:4 of REG_BANK_SEL
return ICM_20948_execute_w( pdev, REG_BANK_SEL, &bank, 1 );
}

Expand Down

0 comments on commit 3e825a3

Please sign in to comment.