Other Parts Discussed in Thread: CC1310, CC1190,
Tool/software: TI-RTOS
Hi,
I have 2 Launchpad of cc13-90 which i am using one as SERVER and other as CLIENT both are running on contiki OS.
I am facing the issue with enabling and disabling the power amplifier (CC1190). When i dig cc1190 doc i came to across that cc1190 is connected with CC1310 using GPIO 28,29,30 and can operate in 5 different mode.
LGM_RX, LGM_TX,HGM_RX,HGM_TX,Power_down,
I my project i want to use TX_HGM and RX_HGM.
Producer of Project;
On SERVER SIDE:
1: SERVER will register with ADDR and SERVICE ID.
2: ENABLE HGM_TX
3: Send broadcast packet
4: Go to POWER_DOWN STATE
5: ENABLE HGM _RX
6: wait for packet from Client.
7: once packet received go to power down
8: Enable HGM_TX
9: Send ACK to Client
10: Go to POWER_DOWN
11: Repeat the step 5 ---> 10
STEPS on CLIENT SIDE
1: Register the Client with IPV6 address.
2: ENABLE RX_HGM
3; WAIT for packet from SERVER
4: Once packet received POWER_DOWN
5; set the time for X sec.
6: if X sec timer expire.
7:Enable HGM_TX and send packet to SERVER
8; Go to POWER_DOWN and set timer for Y sec
9; Enable HGM_RX and wait for ACK for Y sec
10: Once packet received or timeout POWER_DOWN the Client
8:Repeat step 5 ---> 10
on looking into code of contiki i came across given below API which can be used for enavle and disabling the GPIO pins.
------> ti_lib_rom_ioc_pin_type_gpio_output() ----> to set the GPIO pins for output mode
------> ti_lib_gpio_clear_dio() ---> Clear the GPIO pins to 0
------> ti_lib_gpio_set_dio() ----> Enable the GPIO pins to 1
Question I have:
Q1: Given below is the Piece of code which i am using in my code for enabling and disabling the GPIO pins. Please have a look and let me know if it is the correct way to do so;
#ifndef POWER_CONTROL
#define POWER_CONTROL 1
static void init_pin(void){
ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_DIO29);
ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_DIO30);
ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_DIO28);
}
static void RX_HGM(void) {
ti_lib_gpio_clear_dio(BOARD_IOID_DIO30);
ti_lib_gpio_set_dio(BOARD_IOID_DIO29);
ti_lib_gpio_set_dio(BOARD_IOID_DIO28);
}
static void TX_HGM(void) {
ti_lib_gpio_set_dio(BOARD_IOID_DIO30);
ti_lib_gpio_clear_dio(BOARD_IOID_DIO29);
ti_lib_gpio_set_dio(BOARD_IOID_DIO28);
}
static void POWER_DOWN(void) {
ti_lib_gpio_clear_dio(BOARD_IOID_DIO30);
ti_lib_gpio_clear_dio(BOARD_IOID_DIO28);
ti_lib_gpio_clear_dio(BOARD_IOID_DIO29);
}
#endif
Q 2: Is it possible to enable TX_HGM and RX_HGM at same time.
Q 3: om which layer of contik netstack should i implement this functionality.
if you need any more info please let me know
Thanks in Advance.