Platform Abstraction layer for BLE applications.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "at_ble_api.h"
Data Structures | |
struct | os_signal |
Macros | |
#define | MAX_PLATFORM_OS_SIGNAL (3) |
Typedefs | |
typedef struct os_signal | os_signal_t |
Functions | |
void | plaform_ble_rx_callback (void) |
void | platform_configure_hw_fc_uart (uint32_t baudrate) |
void | platform_configure_primary_uart (uint32_t baudrate) |
sends a message over the platform-specific bus and blocks until Tx Completes More... | |
void * | platform_create_signal (void) |
void * | platform_create_timer (void(*timer_cb)(void *)) |
void | platform_delete_signal (void *signal_handler) |
void | platform_delete_timer (void *timer_handle) |
void | platform_dma_process_rxdata (uint8_t *buf, uint16_t len) |
void | platform_enter_sleep (void) |
void | platform_gpio_set (at_ble_gpio_pin_t pin, at_ble_gpio_status_t status) |
void | platform_host_set_sleep (bool sleep) |
at_ble_status_t | platform_init (uint8_t bus_type, uint8_t btlc1000_module_version) |
implements platform-specific initialization More... | |
void | platform_process_rxdata (uint8_t t_rx_data) |
void | platform_recv_async (void(*recv_async_callback)(uint8_t)) |
void | platform_reset_signal (void *signal_handler) |
void | platform_send_sync (uint8_t *data, uint32_t len) |
void | platform_sleep (uint32_t ms) |
void | platform_start_timer (void *timer_handle, uint32_t ms) |
void | platform_stop_timer (void *timer_handle) |
void | platform_trigger_signal (void *signal_handler) |
void | platform_wait_for_signal (uint32_t count, void **signal_handler_list) |
bool | platform_wakeup_pin_status (void) |
#define MAX_PLATFORM_OS_SIGNAL (3) |
typedef struct os_signal os_signal_t |
void plaform_ble_rx_callback | ( | void | ) |
void platform_configure_hw_fc_uart | ( | uint32_t | baudrate | ) |
References configure_usart_after_patch().
Referenced by ble_device_init(), and ble_init().
void platform_configure_primary_uart | ( | uint32_t | baudrate | ) |
sends a message over the platform-specific bus and blocks until Tx Completes
Sends a message over the platform-specific bus that might be UART, SPI
[in] | data | data to send over the interface |
[in] | len | length of data |
References configure_serial_drv().
Referenced by ble_device_init(), and ble_init().
void* platform_create_signal | ( | void | ) |
References NULL, platform_os_signals, os_signal::signal_usage, and os_signal::signal_value.
Referenced by ble_init().
void* platform_create_timer | ( | void(*)(void *) | timer_cb | ) |
References platform_create_hw_timer(), and timer_cb().
Referenced by ble_init().
void platform_delete_signal | ( | void * | signal_handler | ) |
References NULL, os_signal::signal_usage, and os_signal::signal_value.
Referenced by ble_init().
void platform_delete_timer | ( | void * | timer_handle | ) |
References platform_delete_bus_timer().
Referenced by ble_init().
void platform_dma_process_rxdata | ( | uint8_t * | buf, |
uint16_t | len | ||
) |
References recv_async_cb.
void platform_enter_sleep | ( | void | ) |
void platform_gpio_set | ( | at_ble_gpio_pin_t | pin, |
at_ble_gpio_status_t | status | ||
) |
References AT_BLE_CHIP_ENABLE, AT_BLE_EXTERNAL_WAKEUP, AT_BLE_HIGH, ble_assert, and serial_drive_rx_data_count().
Referenced by ble_init(), and main().
void platform_host_set_sleep | ( | bool | sleep | ) |
References host_sleep_flag.
Referenced by ble_device_init(), and ble_init().
at_ble_status_t platform_init | ( | uint8_t | bus_type, |
uint8_t | btlc1000_module_version | ||
) |
implements platform-specific initialization
[in] | bus_type | bus type can be UART or SPI |
[in] | btlc1000_module_version | BTLC1000 MR/ZR Module version |
References ALL_UNUSED, AT_BLE_INVALID_PARAM, AT_BLE_SUCCESS, AT_BLE_UART, ble_assert, configure_serial_drv(), platform_configure_sleep_manager(), and status.
void platform_process_rxdata | ( | uint8_t | t_rx_data | ) |
References Assert, NULL, and recv_async_cb.
Referenced by serial_drv_read_cb().
void platform_recv_async | ( | void(*)(uint8_t) | recv_async_callback | ) |
References platform_start_rx(), and recv_async_cb.
Referenced by ble_init().
void platform_reset_signal | ( | void * | signal_handler | ) |
References NULL, os_signal::signal_usage, and os_signal::signal_value.
Referenced by ble_init().
void platform_send_sync | ( | uint8_t * | data, |
uint32_t | len | ||
) |
References ble_assert, DBG_LOG_BLE, DBG_LOG_CONT, delay_ms, i, len, NULL, platform_wakeup_pin_status(), and serial_drv_send().
Referenced by ble_init().
void platform_sleep | ( | uint32_t | ms | ) |
References delay_ms.
Referenced by ble_init().
void platform_start_timer | ( | void * | timer_handle, |
uint32_t | ms | ||
) |
References platform_enter_critical_section(), platform_leave_critical_section(), and platform_start_bus_timer().
Referenced by ble_init().
void platform_stop_timer | ( | void * | timer_handle | ) |
References platform_enter_critical_section(), platform_leave_critical_section(), and platform_stop_bus_timer().
Referenced by ble_init().
void platform_trigger_signal | ( | void * | signal_handler | ) |
References NULL, os_signal::signal_usage, and os_signal::signal_value.
Referenced by ble_init().
void platform_wait_for_signal | ( | uint32_t | count, |
void ** | signal_handler_list | ||
) |
References count, NULL, platform_enter_sleep(), and os_signal::signal_usage.
Referenced by ble_init().
bool platform_wakeup_pin_status | ( | void | ) |
Referenced by platform_send_sync().