Revision: 1745
Author: vsurducan
Date: Tue Mar 2 22:40:49 2010
Log: [No log message]
http://code.google.com/p/jallib/source/detail?r=1745
Modified:
/trunk/include/external/temperature/smbus_mlx90615.jal
=======================================
--- /trunk/include/external/temperature/smbus_mlx90615.jal Tue Mar 2
09:08:21 2010
+++ /trunk/include/external/temperature/smbus_mlx90615.jal Tue Mar 2
22:40:49 2010
@@ -11,7 +11,7 @@
-- Released under the BSD license
(http://www.opensource.org/licenses/bsd-license.php)
--
-- Description: software implementation for single SMbus master, use 4 hw
stack
--- --
+--
-- define SM_bus pins like:
-- alias SM_SCL is pin_C3
-- alias SM_SCL_direction is pin_C3_direction
@@ -43,7 +43,7 @@
-- MLX90615 EEPROM addresses
-- -----------------------------------------------------
-const smbus_SA = 0 ; SMbus Slave Address 7 bit, 0 to 6; 0x5b factory
default
+const smbus_sa = 0 ; SMbus Slave Address 7 bit, 0 to 6; 0x5b factory
default
const pwm_t_range = 0x01
const config_reg = 0x02
const emissivity = 0x03
@@ -58,7 +58,7 @@
var volatile bit pwm_frequency at config: 1 ; 1=low, 0=high
var volatile bit pwm_output_temp at config: 2 ; 1=Tambiant, 0=Tobject
var volatile bit*9 factory_cal at config: 3 ; do not alter
-var volatile bit*3 IIR_setting at config: 12 ; see table below
+var volatile bit*3 iir_setting at config: 12 ; see table below
var volatile bit zero at config: 15 ; keep 0
-- binary settling time spike response
@@ -78,7 +78,7 @@
-- -----------------------------------------------------
-- 0x04 to 0x4h Melexis reserved
-const raw_IR_data = 0x05
+const raw_ir_data = 0x05
const tambiant = 0x06
const tobject = 0x07
-- 0x08 to 0x0F Melexis reserved
@@ -127,7 +127,7 @@
sm_scl_direction = input ; SM_SCL = high from pull-up
_scl_low
- delay_1mS ( 30 )
+ delay_1ms ( 30 )
_scl_high ; SM_bus mode
end procedure
-- -------------------------------------------------------------------
@@ -195,13 +195,13 @@
-- --------------------------------------------------------
-- Transmit one byte on SM bus
-- --------------------------------------------------------
-function sm_transmit_byte(byte in TX_buffer) return bit is
- var bit b at TX_buffer : 7
+function sm_transmit_byte(byte in tx_buffer) return bit is
+ var bit b at tx_buffer : 7
var bit ack_noack
for 8 loop
_sm_send_bit( b )
- TX_buffer = TX_buffer << 1
+ tx_buffer = tx_buffer << 1
end loop
_sm_receive_bit ( ack_noack )
return ack_noack ; 0=ack received, 1=no ack received
@@ -213,14 +213,14 @@
-- Receive one byte on SM bus
-- ---------------------------------------------------------
function sm_receive_byte(bit in ack_noack) return byte is
- var byte RX_buffer
- var bit b at RX_buffer : 0
+ var byte rx_buffer
+ var bit b at rx_buffer : 0
for 8 loop
- RX_buffer = RX_buffer << 1
+ rx_buffer = rx_buffer << 1
_sm_receive_bit ( b )
end loop
_sm_send_bit (ack_noack); 0=ack, 1 = no_ack
- return RX_buffer
+ return rx_buffer
end function
-- ---------------------------------------------------------
@@ -255,7 +255,7 @@
sm_stop_bit
return
end if
-mlx90615_ack = sm_transmit_byte ( MEM_address );
+mlx90615_ack = sm_transmit_byte ( mem_address );
if mlx90615_ack == nack then
nack_counter = nack_counter + 1
sm_stop_bit
@@ -313,7 +313,7 @@
return
end if
sm_stop_bit
-delay_1mS ( 5 )
+delay_1ms ( 5 )
end procedure
-- -------------------------------------------------------------------
@@ -353,7 +353,7 @@
procedure mlx90615_wake() is
_scl_low
- delay_1mS ( 60 )
+ delay_1ms ( 60 )
_scl_high
sm_start_bit
mlx90615_ack = sm_transmit_byte (0b1111_1110) ; send a dummy
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.