Globalstar ST150 User Manual page 24

Table of Contents

Advertisement

9150-0125-01 R-4
To initialize the HAL, call the function "i2c_initialize_hal(NULL);"
This will initialize the pins on the I
Advanced users can tweak the settings, or assign other module GPIO pins (after removing those pins from the GPIO list) by
calling the function above with a pointer to a structure like the following (default values shown):
static i2c_config_t m_i2c_hal_default_config =
{
.u32_scl_pin
.u32_sda_pin
.frequency
= I2C_1_FREQUENCY,
.u8_interrupt_priority = APP_IRQ_PRIORITY_LOW,
};
Assigning pins for peripheral interface.
To assign pins for use by peripheral devices (SPI ports, I
list in the file: UAPI_GPIO_list.c
Then, the pins you intend to assign should be reserved in the GPIO library with a call to the function:
int32_t g_library_set_pin_pinmap_by_pin_number(uint32_t u32_pin_no);
This function takes the Nordic pin number as an argument and will return an error code if the pin is already reserved. The
function is found in GSTAR_Library_gpio.c and its definition can be included in your source file by including
GSTAR_Library_gpio.h
To check if a pin is already reserved, use:
int32_t g_library_get_pin_pinmap_by_pin_number(uint32_t u32_pin_no);
Example of re-assigning an I
Remove the pins you intend to use for the I
the previous section).
You could, optionally, add GPIO definitions to the "default" I
o
I2C_CLK = 43 (1.11)
o
I2C_SDA = 45 (1.13)
Use the function "int32_t g_library_set_pin_pinmap_by_pin_number(uint32_t u32_pin_no);" to reserve the pins
you intend to move the I
Create a structure as shown below, with the pin assignments you intend to use.
Then call:
o
bool ret_val = i2c_initialize_hal(&m_i2c_hal_my_config)
i2c_config_t m_i2c_hal_my_config =
{
.u32_scl_pin
.u32_sda_pin
.frequency
= I2C_1_FREQUENCY,
.u8_interrupt_priority = APP_IRQ_PRIORITY_LOW,
};
Setting up a SPI master peripheral
The Nordic nRF52840 can support up to 4 SPI master interfaces. At the Nordic SDK level, the SPI Master interfaces are
identified via "instances" 1 – 4. The ST150M uses instance 1 to communicate with its on board GPS receiver. External
devices cannot be added to this SPI port since its signals are dedicated to the GPS and are not brought out to external
pins. This leaves instances 2 – 4 available for other uses via custom code.
ST150M User Manual
C port to those provided on the module.
2
= I2C_1_SCL_PIN,
= I2C_1_SDA_PIN,
C peripheral
2
C peripheral to.
2
= I2C_1_SCL_PIN,
= I2C_1_SDA_PIN,
C ports, UARTS, etc), they should first be removed from the GPIO
2
C peripheral from the GPIO list in UAPI_GPIO_list.c (as described in
2
C pins that you are re-assigning.
2
Confidential & Proprietary Information
24

Advertisement

Table of Contents
loading

This manual is also suitable for:

St150m-devkit

Table of Contents