diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320')
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c | 4 | ||||
-rwxr-xr-x | firmware/target/arm/tms320dm320/i2c-dm320.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c index 334ef25683..836d46c067 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c | |||
@@ -271,7 +271,7 @@ void send_command_to_pic(unsigned char in, unsigned char* out, | |||
271 | IO_INTC_EINT1 &= ~INTR_EINT1_EXT0; | 271 | IO_INTC_EINT1 &= ~INTR_EINT1_EXT0; |
272 | /* Clear EXT0 interrupt */ | 272 | /* Clear EXT0 interrupt */ |
273 | IO_INTC_IRQ1 = INTR_IRQ1_EXT0; | 273 | IO_INTC_IRQ1 = INTR_IRQ1_EXT0; |
274 | /* Write command to I²C */ | 274 | /* Write command to I²C */ |
275 | restart: | 275 | restart: |
276 | i2c_write(PIC_ADR, &in, 1); | 276 | i2c_write(PIC_ADR, &in, 1); |
277 | /* Wait for PIC */ | 277 | /* Wait for PIC */ |
@@ -283,7 +283,7 @@ void send_command_to_pic(unsigned char in, unsigned char* out, | |||
283 | if(i > 50) | 283 | if(i > 50) |
284 | goto restart; | 284 | goto restart; |
285 | } | 285 | } |
286 | /* Read return from I²C */ | 286 | /* Read return from I²C */ |
287 | i2c_read(PIC_ADR, out, length); | 287 | i2c_read(PIC_ADR, out, length); |
288 | /* Re-enable GIO0 interrupt */ | 288 | /* Re-enable GIO0 interrupt */ |
289 | IO_INTC_EINT1 |= INTR_EINT1_EXT0; | 289 | IO_INTC_EINT1 |= INTR_EINT1_EXT0; |
diff --git a/firmware/target/arm/tms320dm320/i2c-dm320.c b/firmware/target/arm/tms320dm320/i2c-dm320.c index a87019c69c..7915ca5a94 100755 --- a/firmware/target/arm/tms320dm320/i2c-dm320.c +++ b/firmware/target/arm/tms320dm320/i2c-dm320.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Copyright (C) 2008 by Maurus Cuelenaere | 10 | * Copyright (C) 2008 by Maurus Cuelenaere |
11 | * | 11 | * |
12 | * DM320 I²C driver | 12 | * DM320 I²C driver |
13 | * | 13 | * |
14 | * All files in this archive are subject to the GNU General Public License. | 14 | * All files in this archive are subject to the GNU General Public License. |
15 | * See the file COPYING in the source tree root for full license agreement. | 15 | * See the file COPYING in the source tree root for full license agreement. |
@@ -145,12 +145,12 @@ int i2c_read(unsigned short address, unsigned char* buf, int count) | |||
145 | void i2c_init(void) | 145 | void i2c_init(void) |
146 | { | 146 | { |
147 | #if 0 //TODO: mimic OF I2C clock settings; currently this is done by the bootloader | 147 | #if 0 //TODO: mimic OF I2C clock settings; currently this is done by the bootloader |
148 | IO_CLK_MOD2 &= ~CLK_MOD2_I2C; // turn I²C clock off (just to be sure) | 148 | IO_CLK_MOD2 &= ~CLK_MOD2_I2C; // turn I²C clock off (just to be sure) |
149 | IO_CLK_LPCTL1 &= ~1; // set Powerdown mode to off | 149 | IO_CLK_LPCTL1 &= ~1; // set Powerdown mode to off |
150 | IO_CLK_SEL0 &= ~0x800; // set I²C clock to PLLA | 150 | IO_CLK_SEL0 &= ~0x800; // set I²C clock to PLLA |
151 | IO_CLK_DIV4 &= ~0x1F; // I²C clock division = 1 | 151 | IO_CLK_DIV4 &= ~0x1F; // I²C clock division = 1 |
152 | IO_CLK_MOD2 |= CLK_MOD2_I2C; // enable I²C clock | 152 | IO_CLK_MOD2 |= CLK_MOD2_I2C; // enable I²C clock |
153 | #endif | 153 | #endif |
154 | IO_I2C_SCS &= ~0x8; //set clock to 100 kHz | 154 | IO_I2C_SCS &= ~0x8; //set clock to 100 kHz |
155 | IO_INTC_EINT2 &= ~INTR_EINT2_I2C; // disable I²C interrupt | 155 | IO_INTC_EINT2 &= ~INTR_EINT2_I2C; // disable I²C interrupt |
156 | } | 156 | } |