-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from floripasat/dev
Drivers: Antenna: ISIS Antenna: Using I2C routines from DriverLib wit…
- Loading branch information
Showing
4 changed files
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.12 | ||
* \version 0.4.0 | ||
* | ||
* \date 20/09/2017 | ||
* | ||
|
@@ -51,8 +51,7 @@ void isis_antenna_arm() | |
{ | ||
debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Arming...\n\r"); | ||
|
||
uint8_t data = ISIS_ANTENNA_CMD_ARM; | ||
isis_antenna_i2c_write_data(&data, 1); | ||
isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_ARM); | ||
|
||
debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Arming command transmitted!\n\r"); | ||
|
||
|
@@ -63,8 +62,7 @@ void isis_antenna_disarm() | |
{ | ||
debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Disarming...\n\r"); | ||
|
||
uint8_t data = ISIS_ANTENNA_CMD_DISARM; | ||
isis_antenna_i2c_write_data(&data, 1); | ||
isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_DISARM); | ||
|
||
isis_antenna_delay_ms(100); | ||
} | ||
|
@@ -153,8 +151,7 @@ isis_antenna_status_t isis_antenna_read_deployment_status() | |
{ | ||
uint16_t status_code = ISIS_ANTENNA_STATUS_MASK; // Initial state | ||
|
||
uint8_t data = ISIS_ANTENNA_CMD_REPORT_DEPLOY_STATUS; | ||
isis_antenna_i2c_write_data(&data, 1); | ||
isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_REPORT_DEPLOY_STATUS); | ||
|
||
isis_antenna_delay_ms(1000); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.12 | ||
* \version 0.4.0 | ||
* | ||
* \date 21/09/2017 | ||
* | ||
|
@@ -56,6 +56,7 @@ | |
|
||
#define ISIS_ANTENNA_I2C_CLOCK UCS_getSMCLK() | ||
|
||
#define ISIS_ANTENNA_I2C_TIMEOUT 10000 | ||
#define ISIS_ANTENNA_I2C_TIMEOUT_MS 100 | ||
|
||
#endif // ISIS_ANTENNA_CONFIG_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.13 | ||
* \version 0.4.0 | ||
* | ||
* \date 21/09/2017 | ||
* | ||
|
@@ -98,7 +98,7 @@ void isis_antenna_i2c_write_byte(uint8_t byte) | |
USCI_A_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_A_I2C_TRANSMIT_MODE); | ||
|
||
// Send single byte data | ||
USCI_A_I2C_masterSendSingleByte(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte); | ||
USCI_A_I2C_masterSendSingleByteWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte, ISIS_ANTENNA_I2C_TIMEOUT); | ||
|
||
// Wait until transmission completes | ||
uint16_t timeout_ms = ISIS_ANTENNA_I2C_TIMEOUT_MS; | ||
|
@@ -118,7 +118,7 @@ void isis_antenna_i2c_write_byte(uint8_t byte) | |
USCI_B_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_B_I2C_TRANSMIT_MODE); | ||
|
||
// Send single byte data | ||
USCI_B_I2C_masterSendSingleByte(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte); | ||
USCI_B_I2C_masterSendSingleByteWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte, ISIS_ANTENNA_I2C_TIMEOUT); | ||
|
||
// Wait until transmission completes | ||
uint16_t timeout_ms = ISIS_ANTENNA_I2C_TIMEOUT_MS; | ||
|
@@ -141,29 +141,29 @@ void isis_antenna_i2c_write_data(uint8_t *data, uint8_t len) | |
#if ISIS_ANTENNA_I2C_USCI == USCI_A | ||
// Set in transmit mode | ||
USCI_A_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_A_I2C_TRANSMIT_MODE); | ||
USCI_A_I2C_masterSendMultiByteStart(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0]); | ||
|
||
USCI_A_I2C_masterSendMultiByteStartWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0], ISIS_ANTENNA_I2C_TIMEOUT); | ||
|
||
uint8_t i = 1; | ||
for(i=1; i<len; i++) | ||
{ | ||
USCI_A_I2C_masterSendMultiByteNext(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[i]); | ||
USCI_A_I2C_masterSendMultiByteNextWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[i], ISIS_ANTENNA_I2C_TIMEOUT); | ||
} | ||
|
||
USCI_A_I2C_masterSendMultiByteStop(ISIS_ANTENNA_I2C_BASE_ADDRESS); | ||
#elif ISIS_ANTENNA_I2C_USCI == USCI_B | ||
// Set in transmit mode | ||
USCI_B_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_B_I2C_TRANSMIT_MODE); | ||
USCI_B_I2C_masterSendMultiByteStart(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0]); | ||
|
||
USCI_B_I2C_masterSendMultiByteStartWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0], ISIS_ANTENNA_I2C_TIMEOUT); | ||
|
||
uint8_t i = 1; | ||
for(i=1; i<len; i++) | ||
{ | ||
USCI_B_I2C_masterSendMultiByteNext(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[i]); | ||
USCI_B_I2C_masterSendMultiByteNextWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[i], ISIS_ANTENNA_I2C_TIMEOUT); | ||
} | ||
USCI_B_I2C_masterSendMultiByteStop(ISIS_ANTENNA_I2C_BASE_ADDRESS); | ||
|
||
USCI_B_I2C_masterSendMultiByteStopWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, ISIS_ANTENNA_I2C_TIMEOUT); | ||
#endif // ISIS_ANTENNA_I2C_USCI | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.3.5 | ||
* \version 0.4.0 | ||
* | ||
* \date 08/02/2019 | ||
* | ||
|
@@ -36,7 +36,7 @@ | |
#ifndef VERSION_H_ | ||
#define VERSION_H_ | ||
|
||
#define FIRMWARE_VERSION "0.3.5" | ||
#define FIRMWARE_VERSION "0.4.0" | ||
|
||
#define FIRMWARE_STATUS "Development" | ||
|
||
|