CAC_smartcushion / Mbed OS ADISense1000_Smartcushion_v2_ble_standard_stream

Fork of ADISense1000_Smartcushion_v1_ble_reply_over_usb2ser by CAC_smartcushion

Committer:
nfathurr
Date:
Fri Aug 24 08:58:48 2018 +0000
Revision:
1:25a2bf666957
Child:
2:24e75651c6c4
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nfathurr 1:25a2bf666957 1 /*
nfathurr 1:25a2bf666957 2 ******************************************************************************
nfathurr 1:25a2bf666957 3 * file: myswift_periph.cpp
nfathurr 1:25a2bf666957 4 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 5 */
nfathurr 1:25a2bf666957 6
nfathurr 1:25a2bf666957 7 #include "myproswift_periph.h"
nfathurr 1:25a2bf666957 8
nfathurr 1:25a2bf666957 9 /*
nfathurr 1:25a2bf666957 10 ******************************************************************************
nfathurr 1:25a2bf666957 11 * ADISense1000
nfathurr 1:25a2bf666957 12 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 13 */
nfathurr 1:25a2bf666957 14 //connection information for initialising ADISense1000
nfathurr 1:25a2bf666957 15 ADI_SENSE_CONNECTION connectionInfo = {
nfathurr 1:25a2bf666957 16 .type = ADI_SENSE_CONNECTION_TYPE_SPI,
nfathurr 1:25a2bf666957 17 .spi = {
nfathurr 1:25a2bf666957 18 .mosiPin = SENSE_SPI_MOSI,
nfathurr 1:25a2bf666957 19 .misoPin = SENSE_SPI_MISO,
nfathurr 1:25a2bf666957 20 .sckPin = SENSE_SPI_SCK,
nfathurr 1:25a2bf666957 21 .csPin = SENSE_SPI_CS,
nfathurr 1:25a2bf666957 22 .maxSpeedHz = SENSE_SPI_FREQUENCY,
nfathurr 1:25a2bf666957 23 },
nfathurr 1:25a2bf666957 24 .gpio = {
nfathurr 1:25a2bf666957 25 .resetPin = SENSE_RST_PIN,
nfathurr 1:25a2bf666957 26 .errorPin = SENSE_ERROR_PIN,
nfathurr 1:25a2bf666957 27 .alertPin = SENSE_ALERT_PIN,
nfathurr 1:25a2bf666957 28 .datareadyPin = SENSE_DREADY_PIN,
nfathurr 1:25a2bf666957 29 },
nfathurr 1:25a2bf666957 30 };
nfathurr 1:25a2bf666957 31
nfathurr 1:25a2bf666957 32 /*
nfathurr 1:25a2bf666957 33 ******************************************************************************
nfathurr 1:25a2bf666957 34 * Bluetooth Low Energy
nfathurr 1:25a2bf666957 35 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 36 */
nfathurr 1:25a2bf666957 37 //reset pin of BLE module
nfathurr 1:25a2bf666957 38 DigitalOut ble_rst(BLE_RST_PIN, 0);
nfathurr 1:25a2bf666957 39 //flow control
nfathurr 1:25a2bf666957 40 DigitalOut ble_Cts(BLE_CTS_PIN, 1);
nfathurr 1:25a2bf666957 41 DigitalIn ble_Rts(BLE_RTS_PIN);
nfathurr 1:25a2bf666957 42
nfathurr 1:25a2bf666957 43 Serial bleSerialDevice(BLE_SERIAL_TX, BLE_SERIAL_RX, BLE_BAUD_RATE);
nfathurr 1:25a2bf666957 44
nfathurr 1:25a2bf666957 45 #ifdef BL652
nfathurr 1:25a2bf666957 46 DigitalOut bleMode0(BLE_MODE_0_PIN, 0);
nfathurr 1:25a2bf666957 47 DigitalOut bleMode1(BLE_MODE_1_PIN, 0);
nfathurr 1:25a2bf666957 48 #endif
nfathurr 1:25a2bf666957 49
nfathurr 1:25a2bf666957 50
nfathurr 1:25a2bf666957 51 /*
nfathurr 1:25a2bf666957 52 ******************************************************************************
nfathurr 1:25a2bf666957 53 * PC Serial
nfathurr 1:25a2bf666957 54 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 55 */
nfathurr 1:25a2bf666957 56
nfathurr 1:25a2bf666957 57 //pointer initialised in adi_sense_Log.cpp using pins defined in this header
nfathurr 1:25a2bf666957 58 Serial *gpUartDevice = new Serial(PC_UART_TX_PIN, PC_UART_RX_PIN, PC_UART_BAUDRATE);
nfathurr 1:25a2bf666957 59
nfathurr 1:25a2bf666957 60 /*
nfathurr 1:25a2bf666957 61 ******************************************************************************
nfathurr 1:25a2bf666957 62 * Battery
nfathurr 1:25a2bf666957 63 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 64 */
nfathurr 1:25a2bf666957 65
nfathurr 1:25a2bf666957 66 //pin for reading the current voltage of the battery
nfathurr 1:25a2bf666957 67 //need solution to this. Battery ranges from 4.2V to 2V where the adc can only
nfathurr 1:25a2bf666957 68 //read to 3.3V (VDD)
nfathurr 1:25a2bf666957 69 //AnalogIn batteryV(BATTERY_V_PIN);
nfathurr 1:25a2bf666957 70
nfathurr 1:25a2bf666957 71 /*
nfathurr 1:25a2bf666957 72 ******************************************************************************
nfathurr 1:25a2bf666957 73 * Status LED
nfathurr 1:25a2bf666957 74 *-----------------------------------------------------------------------------
nfathurr 1:25a2bf666957 75 */
nfathurr 1:25a2bf666957 76
nfathurr 1:25a2bf666957 77 //flash when flash led is called, also iluminated when device boots successfully
nfathurr 1:25a2bf666957 78 DigitalOut status_led(STATUS_LED_PIN, 0);
nfathurr 1:25a2bf666957 79 //DigitalOut status_led1(PC_6, 0);
nfathurr 1:25a2bf666957 80
nfathurr 1:25a2bf666957 81