Using And Enabling Peripheral Devices - Globalstar ST150M User Manual

Hide thumbs Also See for ST150M:
Table of Contents

Advertisement

9150-0125-01 R-1
There are 18 configurable baud rates:
1200
2400
4800
9600
14400
19200
28800
31250
38400
56000
57600
76800
115200
230400
250000
460800
921600
1000000

4.3 USING AND ENABLING PERIPHERAL DEVICES

It is possible to re-assign the general purpose GPIO pins provided on the ST150M module to peripherals such as SPI ports
and I2C ports using custom code. One existing I2C port is brought out to the external pins on the module and an I2C HAL is
provided in the Globalstar SDK for sending data over that module.
Using the external I2C pins
I2C port pins are available on the module as follows:
Pin 45 – CLK
Pin 44 – SDA
A HAL in the SDK supports the following functions for transferring data to and from I2C devices via those pins:
bool i2c_is_hal_initialized(void); bool i2c_initialize_hal(i2c_config_t* ptr_i2c_config); void i2c_shutdown(void);
ghal_ret_code_t i2c_simple_read(uint8_t u8_address, uint8_t* ptr_rx_data, size_t rx_length);
ghal_ret_code_t i2c_byte_offset_read(uint8_t u8_address, uint8_t u8_offset, uint8_t* ptr_rx_data, size_t rx_length); ghal_ret_
code_t i2c_word_offset_read(uint8_t u8_address, uint16_t u16_offset, uint8_t* ptr_rx_data, size_t rx_length); ghal_ret_code_t
i2c_dword_offset_read(uint8_t u8_address, uint32_t u32_offset, uint8_t* ptr_rx_data, size_t rx_length); ghal_ret_code_t i2c_
simple_write(uint8_t u8_address, uint8_t* ptr_tx_data, size_t tx_length);
ghal_ret_code_t i2c_byte_offset_write(uint8_t u8_address, uint8_t u8_offset, uint8_t* ptr_tx_data, size_t tx_length); ghal_ret_
code_t i2c_word_offset_write(uint8_t u8_address, uint16_t u16_offset, uint8_t* ptr_tx_data, size_t tx_length); ghal_ret_code_t
i2c_dword_offset_write(uint8_t u8_address, uint32_t u32_offset, uint8_t* ptr_tx_data, size_t tx_length); To initialize the HAL,
call the function "i2c_initialize_hal(NULL);"
This will initialize the pins on the I2C port to those provided on the module.
ST150M User Manual
Confidential & Proprietary Information
15

Advertisement

Table of Contents
loading

Table of Contents