Remove unused files after #312

This commit is contained in:
popcornmix
2016-09-14 21:22:05 +01:00
parent 52a2a38887
commit 19d0403234
6 changed files with 0 additions and 1183 deletions

View File

@@ -1,39 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HOST_APP_H
#define HOST_APP_H
#include "platform.h"
//Definition for the single message handler, as provided by the host app.
extern void host_app_message_handler( const uint16_t msg, const uint32_t param1, const uint32_t param2);
//Definition for a function that returns the host app's name
extern char *host_app_name( void );
#endif /* HOST_APP_H */

View File

@@ -1,360 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PLATFORM_H
#define PLATFORM_H
#include "interface/vmcs_host/vchost.h"
#include "interface/vcos/vcos.h"
/******************************************************************************
Global typedefs, macros and constants
******************************************************************************/
/* the definition of all the message types that a
platform can send to the message handler */
typedef enum
{
/* A message sent at the start of the day
Param 1 = 0
Param 2 = 0 */
PLATFORM_MSG_INIT,
/*A message sent at the end of the day
Param 1 = 0
Param 2 = 0 */
PLATFORM_MSG_END,
/*A message sent when a button action occurs
Param 1 = the button ID
Param 2 = the hold time - only valid for repeat button presses */
PLATFORM_MSG_BUTTON_PRESS,
PLATFORM_MSG_BUTTON_REPEAT,
PLATFORM_MSG_BUTTON_RELEASE,
/*A message sent when a timer event occurs
Param 1 = the timer ID
Param 2 = 0 */
PLATFORM_MSG_TIMER_TICK,
/*A message sent when a hostreq notify is sent from VMCS
Param 1 = the event id
Param 2 = event param */
PLATFORM_MSG_HOSTREQ_NOTIFY,
/*A touchscreen event
Param 1 = the event id
Param 2 = event param */
PLATFORM_MSG_TOUCHSCREEN_EVENT,
/* user messages go here */
PLATFORM_MSG_USER
} PLATFORM_MSG_T;
/* the definitions of the buttons in the system
Current these are mapped to the VC02DK */
typedef enum
{
//The push buttons
PLATFORM_BUTTON_A = 0x0001,
PLATFORM_BUTTON_B = 0x0002,
PLATFORM_BUTTON_C = 0x0004,
PLATFORM_BUTTON_D = 0x0008,
PLATFORM_BUTTON_E = 0x0010,
//The joystick moves
PLATFORM_BUTTON_DOWN = 0x0020,
PLATFORM_BUTTON_LEFT = 0x0040,
PLATFORM_BUTTON_UP = 0x0080,
PLATFORM_BUTTON_RIGHT = 0x0100,
PLATFORM_BUTTON_Z = 0x0200,
PLATFORM_BUTTON_PAGE_UP = 0x0400,
PLATFORM_BUTTON_PAGE_DOWN = 0x0800,
//Some extra buttons for HDMI/TV
PLATFORM_BUTTON_HDMI0 = 0x1000,
PLATFORM_BUTTON_HDMI1 = 0x2000,
PLATFORM_BUTTON_HDMI2 = 0x4000,
PLATFORM_BUTTON_TV = 0x8000,
//Some extra buttons for CEC
PLATFORM_BUTTON_CEC0 = 0x10000,
PLATFORM_BUTTON_CEC1 = 0x20000
//UPDATE THE NUMBER OF BUTTONS BELOW IF YOU EDIT THESE
} PLATFORM_BUTTON_T;
//the max number of buttons definition
#define PLATFORM_NUMBER_BUTTONS 18
/* the touchscreen events */
typedef enum
{
PLATFORM_TOUCHSCREEN_EVENT_MIN,
PLATFORM_TOUCHSCREEN_EVENT_GESTURE_RIGHT,
PLATFORM_TOUCHSCREEN_EVENT_GESTURE_LEFT,
PLATFORM_TOUCHSCREEN_EVENT_GESTURE_DOWN,
PLATFORM_TOUCHSCREEN_EVENT_GESTURE_UP,
PLATFORM_TOUCHSCREEN_EVENT_PRESS,
PLATFORM_TOUCHSCREEN_EVENT_PRESS_DOUBLE_TAP,
PLATFORM_TOUCHSCREEN_EVENT_PRESS_AND_HOLD,
PLATFORM_TOUCHSCREEN_EVENT_PINCH_IN,
PLATFORM_TOUCHSCREEN_EVENT_SPREAD_OUT,
PLATFORM_TOUCHSCREEN_EVENT_FINGER_DOWN,
PLATFORM_TOUCHSCREEN_EVENT_FINGER_UP,
PLATFORM_TOUCHSCREEN_EVENT_MAX
} PLATFORM_TOUCHSCREEN_EVENT_T;
//define the max file path
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
//The default buffer size of the general command response
#define PLATFORM_DEFAULT_RESPONSE_BUF_SIZE (uint32_t)(128)
#define PLATFORM_DEFAULT_REQUEST_BUF_SIZE (uint32_t)(128)
//the max number of timers which an app can use
#define PLATFORM_MAX_NUM_TIMERS 6
//the starting id for the timers
#define PLATFORM_TIMER_START_ID 0
/* Definition for a platfor message handler - returning FALSE means that the app wishes to quit */
typedef int32_t (*PLATFORM_MESSAGE_HANDLER_T)( const uint16_t msg,
const uint32_t param1,
const uint32_t param2 );
/******************************************************************************
Global Message funcs definitions
******************************************************************************/
// routines used to post a message to the platform message handle
VCHPRE_ int32_t VCHPOST_ platform_post_message( const uint16_t msg,
const uint32_t param1,
const uint32_t param2);
/******************************************************************************
Global Task funcs definitions
******************************************************************************/
// Definition for a platform thread function
typedef int32_t (*PLATFORM_THREAD_FUNC_T)( void *param );
// Definition for a platform thread handle
typedef void *PLATFORM_THREAD_T;
// routine used to create a new thread. This thread will be passed the void *param when created
// NOTE: the 'thread_func' MUST call the platform_thread_exit function before leaving the context of the function
VCHPRE_ PLATFORM_THREAD_T VCHPOST_ platform_thread_create( PLATFORM_THREAD_FUNC_T thread_func,
void *param );
//Routine to set a threads priority
VCHPRE_ int32_t VCHPOST_ platform_thread_set_priority(PLATFORM_THREAD_T thread,
const uint32_t priority );
//Routine to exit a thead (called from within the thread)
//NOTE! You must call this function before exiting a thread.
VCHPRE_ void VCHPOST_ platform_thread_exit( void );
//Routine used to wait until a thread has exited
VCHPRE_ int32_t VCHPOST_ platform_thread_join( PLATFORM_THREAD_T thread );
/******************************************************************************
Semaphore funcs definitions
******************************************************************************/
//definition of a semaphore
struct PLATFORM_SEMAPHORE;
typedef struct PLATFORM_SEMAPHORE *PLATFORM_SEMAPHORE_T;
//Routine to create a semaphore. Seeds the semaphore with an initial count
VCHPRE_ int32_t VCHPOST_ platform_semaphore_create( PLATFORM_SEMAPHORE_T *semaphore, const uint32_t inital_count );
//Routine to delete a semaphore
VCHPRE_ int32_t VCHPOST_ platform_semaphore_delete( PLATFORM_SEMAPHORE_T *semaphore );
//Routine used to wait for a semaphore to be free (will suspend the calling thread if not available)
VCHPRE_ int32_t VCHPOST_ platform_semaphore_wait( PLATFORM_SEMAPHORE_T *semaphore );
//Routine used to post (increment) a semaphore. used to release any tasks waiting on the semaphore
VCHPRE_ int32_t VCHPOST_ platform_semaphore_post( PLATFORM_SEMAPHORE_T *semaphore );
/******************************************************************************
Global Event funcs definitions
******************************************************************************/
// Definition of an event group
struct PLATFORM_EVENTGROUP;
typedef struct PLATFORM_EVENTGROUP *PLATFORM_EVENTGROUP_T;
//Event group flags
typedef enum
{
PLATFORM_EVENTGROUP_OPERATION_MIN,
PLATFORM_EVENTGROUP_OPERATION_AND,
PLATFORM_EVENTGROUP_OPERATION_OR,
PLATFORM_EVENTGROUP_OPERATION_AND_CONSUME,
PLATFORM_EVENTGROUP_OPERATION_OR_CONSUME,
PLATFORM_EVENTGROUP_OPERATION_MAX
} PLATFORM_EVENTGROUP_OPERATION_T;
#define PLATFORM_EVENTGROUP_SUSPEND -1
#define PLATFORM_EVENTGROUP_NO_SUSPEND 0
//Routines used to create an event group
VCHPRE_ int32_t VCHPOST_ platform_eventgroup_create( PLATFORM_EVENTGROUP_T *eventgroup );
//Routines used to delete an event group
VCHPRE_ int32_t VCHPOST_ platform_eventgroup_delete( PLATFORM_EVENTGROUP_T *eventgroup );
//Routines used to set a bit in an eventgroup
VCHPRE_ int32_t VCHPOST_ platform_eventgroup_set( PLATFORM_EVENTGROUP_T *eventgroup,
const uint32_t bitmask,
const PLATFORM_EVENTGROUP_OPERATION_T operation );
//Routine used to wait for bits in an eventgroup to be set
VCHPRE_ int32_t VCHPOST_ platform_eventgroup_get( PLATFORM_EVENTGROUP_T *eventgroup,
const uint32_t bitmask,
const PLATFORM_EVENTGROUP_OPERATION_T operation,
const uint32_t suspend,
uint32_t *retrieved_bits );
/******************************************************************************
Global Timer func definitions
******************************************************************************/
// Routines used to start / stop a single timer for the host app platform
VCHPRE_ int32_t VCHPOST_ platform_timer_start( const uint32_t timer_id,
const uint32_t timer_period );
VCHPRE_ int32_t VCHPOST_ platform_timer_stop( const uint32_t timer_id );
// Routine to change the timer resolution
VCHPRE_ int32_t VCHPOST_ platform_timer_reschedule(const uint32_t timer_id,
const uint32_t timer_period );
/******************************************************************************
Global C library style func definitions
******************************************************************************/
// routine to set the button repeat rate
VCHPRE_ void VCHPOST_ platform_set_button_repeat_time( const uint32_t repeat_rate_in_ms );
// routine to enable / disable a host req message
VCHPRE_ int32_t VCHPOST_ platform_enable_hostreq_notify( const uint32_t notify_event, const uint32_t enable );
// routine to sleep the platform
VCHPRE_ void VCHPOST_ platform_sleep( const uint32_t sleep_time_in_ms );
// routine to get the local resource path
VCHPRE_ char * VCHPOST_ platform_get_local_resource_path( void );
// routine perform a str comparison with case sensitivity
VCHPRE_ int32_t VCHPOST_ platform_stricmp( const char *str1, const char *str2 );
// routine to return the number of ticks since the start of day, in ms
VCHPRE_ int32_t VCHPOST_ platform_get_ticks( void );
// routine to send out debug print messages to the platform host
VCHPRE_ void VCHPOST_ platform_debug_print( const char *string, ... );
//Routine to malloc a section of memory - has addition line and file parameters for debug
VCHPRE_ void * VCHPOST_ platform_malloc( const uint32_t size_in_bytes,
const int line,
const char *file );
//Routine to malloc and clear a section of memory - has addition line and file parameters for debug
VCHPRE_ void * VCHPOST_ platform_calloc( const uint32_t num,
const uint32_t size_in_bytes,
const int line,
const char *file );
// Routine to free memory previously malloc'd
VCHPRE_ void VCHPOST_ platform_free( void *buffer );
//Routine to allocate memory on specific alignment
VCHPRE_ void *VCHPOST_ platform_malloc_aligned( const uint32_t size_in_bytes,
unsigned int align,
const char *description);
//Routine to query if we are connected to VMCS or not
VCHPRE_ uint32_t VCHPOST_ platform_get_vmcs_connected_status( void );
//Routine to create + return the hosts native debug window handle
VCHPRE_ uint32_t VCHPOST_ platform_create_and_get_debug_window_handle( void );
//Routine to get the platforms screen size
VCHPRE_ int32_t VCHPOST_ platform_get_screen_size( uint32_t *width,
uint32_t *height );
//Set the height of the buttons created along the bottom of the touchscreen. The
//format is Q8 fixed-point fraction of the screen - e.g. 0x80 will give you buttons
//half the height of the screen. If zero, no buttons are created.
VCHPRE_ int32_t VCHPOST_ platform_set_touchscreen_buttons_height(uint32_t xHeight);
//Translate gestures (left/right/up/down) into the joystick equivalents.
VCHPRE_ int32_t VCHPOST_ platform_translate_gestures_to_joystick(int);
//Set the size of the screen in an alternative coordinate system.
// scaled_width - scaled X width of the touch screen area
// scaled_height - scaled Y height of the touch screen area
VCHPRE_ int32_t VCHPOST_ platform_set_touchscreen_scale(int scaled_width, int scaled_height);
//Return the scaled location of the fingers currently in contact with the
//touchscreen.
VCHPRE_ int32_t /*rc*/ VCHPOST_ platform_touch_finger_scaled_pos(
int *out_x, int *out_y,
int *out_pressure, int *out_width);
#endif /* PLATFORM_H */
/**************************** End of file ************************************/

View File

@@ -1,174 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _VC_TOUCH_API_TYPES_H
#define _VC_TOUCH_API_TYPES_H
/*===========================================================================*/
/* Touch Service Errors (informational) */
/*===========================================================================*/
#define TOUCH_RC_NONE (0)
#define TOUCH_RC_BAD_HANDLE (-1)
#define TOUCH_RC_UNIMPLEMENTED (-2)
#define TOUCH_RC_OPEN_INVAL (-3) /*< event open arguments invalid */
#define TOUCH_RC_RXLEN (-13) /*< received length was unexpected */
#define TOUCH_RC_NOTRSP (-14) /*< received msg not a response or event */
#define TOUCH_RC_NOTMINE (-15) /*< received msg not my response */
#define TOUCH_RC_BADRC (-16) /*< received with bad RC */
/*===========================================================================*/
/* Touch Service Lifetime Control */
/*===========================================================================*/
/*! Opaque type to hold per-client details of interface */
typedef uint32_t TOUCH_SERVICE_T[80];
/*===========================================================================*/
/* Touchscreen Fingers */
/*===========================================================================*/
typedef struct vc_touch_point_s {
int x;
int y;
int pressure;
/* 'width' may join this list one day */
} vc_touch_point_t;
typedef struct vc_touch_properties_s {
uint32_t screen_width; /*< touch screen width in reported coordinates */
uint32_t screen_height; /*< touch screen height in reported coordinates */
uint8_t rightward_x; /*< X increases in rightward direction (else left) */
uint8_t rising_y; /*< Y increases in updward direction (else down) */
uint8_t finger_count; /*< max number of fingers recorded simultaneously */
unsigned max_pressure; /*< max pressure that can be recorded (1 for a
pressure-insensitve device) */
int32_t scaled_width; /*< touch screen width in scaled coordinates */
int32_t scaled_height; /*< touch screen height in scaled coordinates */
/* gesture box - movement further than these limits triggers a gesture */
uint32_t gesture_box_width;
uint32_t gesture_box_height;
} vc_touch_properties_t;
typedef enum {
vc_touch_event_down,
vc_touch_event_up,
vc_touch_event_press,
vc_touch_event_hold,
vc_touch_event_press_tap_tap,
vc_touch_event_gesture_right,
vc_touch_event_gesture_left,
vc_touch_event_gesture_up,
vc_touch_event_gesture_down,
} vc_touch_event_t;
/*! Prototype for callback function for \c vc_touch_finger_events_open
* The positions of \c max_fingers fingers will reported (where
* the value of \c max_fingers is set in vc_touch_finger_events_open)
*/
typedef void
vc_touch_event_fn_t(void *open_arg,
vc_touch_event_t action, uint32_t action_arg);
/*===========================================================================*/
/* Buttons */
/*===========================================================================*/
/*! This is an ennumeration of the different kinds of button supported
*/
typedef enum {
vc_touch_button_default
/* add new types here */
} vc_touch_button_type_t;
typedef uint8_t vc_button_id_t; /*< an integer 1 .. 31 */
typedef uint32_t vc_button_set_t; /*< bitmap of button IDs */
typedef struct vc_button_state_s {
vc_button_set_t active; /*< buttons that have been defined */
vc_button_set_t depressed; /*< buttons that are currently pressed */
/* buttons that are active but not depressed are released */
} vc_button_state_t;
typedef enum {
vc_button_event_press,
vc_button_event_repeat,
vc_button_event_release
} vc_button_event_t;
typedef uint32_t vc_button_handle_t;
#define VC_BUTTON_HANDLE_BAD 0
/*! Names for buttons likely to be on the development card */
typedef enum
{
/* The push button keys */
vc_key_a,
vc_key_b,
vc_key_c,
vc_key_d,
vc_key_e,
/* Joystick function keys */
vc_key_down,
vc_key_left,
vc_key_up,
vc_key_right,
vc_key_z,
/* Other functions */
vc_key_pageup,
vc_key_pagedown
/*! update this define if you add further key names */
#define VC_KEY_NAME_MAX vc_key_pagedown
} vc_key_name_t;
/*! Prototype for callback function for \c vc_buttons_events_open
*/
typedef void
vc_button_event_fn_t(void *open_arg, vc_button_event_t action,
vc_button_id_t button, uint32_t action_arg);
#endif /* _VC_TOUCH_API_TYPES_H */

View File

@@ -1,336 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _VC_TOUCHSERV_DEFS_H
#define _VC_TOUCHSERV_DEFS_H
#define VC_TOUCHSERV_VER 1
/*! Message header */
typedef struct {
uint16_t id; /*< identify the type of this message */
uint16_t rc; /*< return code in responses */
} vc_touch_msg_hdr_t;
/*! bits for inclusion in the an message ID */
#define VC_TOUCH_REPLY 0x1000 /*< response in synchronous transacton */
#define VC_TOUCH_EVENT 0x2000 /*< asynchronous response */
/* PROPERTIES transaction */
#define VC_TOUCH_ID_PROP_REQ 1
typedef struct {
vc_touch_msg_hdr_t hdr;
} vc_touch_msg_prop_req_t;
#define VC_TOUCH_ID_PROP_RSP (VC_TOUCH_ID_PROP_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t screen_width; /*< touch screen width in reported coordinates */
uint32_t screen_height; /*< touch screen height in reported coordinates */
uint32_t max_pressure; /*< max pressure that can be recorded (1 for a
pressure-insensitve device) */
uint32_t gesture_box_width; /*< distance for gesture_right/left */
uint32_t gesture_box_height; /*< distance for gesture up/down */
int32_t scaled_width; /*< touch screen width in scaled coordinates */
int32_t scaled_height; /*< touch screen height in scaled coordinates */
uint8_t rightward_x; /*< X increases in rightward direction (else left) */
uint8_t rising_y; /*< Y increases in updward direction (else down) */
uint8_t finger_count; /*< max number of fingers recorded simultaneously */
} vc_touch_msg_prop_rsp_t;
typedef union {
vc_touch_msg_prop_req_t req;
vc_touch_msg_prop_rsp_t rsp;
} VC_TOUCH_MSG_PROP_T;
/* FINGERPOS transaction */
#define VC_TOUCHSERV_FINGERS_MAX 10
#define VC_TOUCH_ID_FINGERPOS_REQ 2
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t fingers;
} vc_touch_msg_fingerpos_req_t;
#define VC_TOUCH_ID_FINGERPOS_RSP (VC_TOUCH_ID_FINGERPOS_REQ | VC_TOUCH_REPLY)
typedef struct {
uint32_t x;
uint32_t y;
uint32_t pressure;
} VC_TOUCH_POSN_T;
typedef struct {
vc_touch_msg_hdr_t hdr;
VC_TOUCH_POSN_T posn[VC_TOUCHSERV_FINGERS_MAX];
} vc_touch_msg_fingerpos_rsp_t;
typedef union {
vc_touch_msg_fingerpos_req_t req;
vc_touch_msg_fingerpos_rsp_t rsp;
} VC_TOUCH_MSG_FINGERPOS_T;
/* FINGEROPEN transaction */
#define VC_TOUCH_ID_FINGEROPEN_REQ 3
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t period_ms;
uint32_t max_fingers;
} vc_touch_msg_fingeropen_req_t;
#define VC_TOUCH_ID_FINGEROPEN_RSP (VC_TOUCH_ID_FINGEROPEN_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
} vc_touch_msg_fingeropen_rsp_t;
#define VC_TOUCH_ID_FINGER_EVENT (VC_TOUCH_ID_FINGEROPEN_REQ | VC_TOUCH_EVENT)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t type; /*< type of finger event */
uint32_t arg; /*< type-dependent argument for button event */
} VC_TOUCH_MSG_FINGER_EVENT_T;
typedef union {
vc_touch_msg_fingeropen_req_t req;
vc_touch_msg_fingeropen_rsp_t rsp;
} VC_TOUCH_MSG_FINGEROPEN_T;
/* BUTTNEW_TOUCH transaction */
#define VC_TOUCH_ID_BUTTNEW_TOUCH_REQ 4
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_id;
uint32_t kind;
int32_t bottom_y;
int32_t left_x;
int32_t width;
int32_t height;
} vc_touch_msg_buttnew_touch_req_t;
#define VC_TOUCH_ID_BUTTNEW_TOUCH_RSP \
(VC_TOUCH_ID_BUTTNEW_TOUCH_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_handle;
} vc_touch_msg_buttnew_touch_rsp_t;
typedef union {
vc_touch_msg_buttnew_touch_req_t req;
vc_touch_msg_buttnew_touch_rsp_t rsp;
} VC_TOUCH_MSG_BUTTNEW_TOUCH_T;
/* BUTTNEW_KEY transaction */
#define VC_TOUCH_ID_BUTTNEW_KEY_REQ 5
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_id;
uint32_t key_name;
} vc_touch_msg_buttnew_key_req_t;
#define VC_TOUCH_ID_BUTTNEW_KEY_RSP \
(VC_TOUCH_ID_BUTTNEW_KEY_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_handle;
} vc_touch_msg_buttnew_key_rsp_t;
typedef union {
vc_touch_msg_buttnew_key_req_t req;
vc_touch_msg_buttnew_key_rsp_t rsp;
} VC_TOUCH_MSG_BUTTNEW_KEY_T;
/* KEYRATE transaction */
#define VC_TOUCH_ID_KEYRATE_REQ 6
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t period_ms;
} vc_touch_msg_keyrate_req_t;
#define VC_TOUCH_ID_KEYRATE_RSP (VC_TOUCH_ID_KEYRATE_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t period_ms;
} vc_touch_msg_keyrate_rsp_t;
typedef union {
vc_touch_msg_keyrate_req_t req;
vc_touch_msg_keyrate_rsp_t rsp;
} VC_TOUCH_MSG_KEYRATE_T;
/* BUTTNEW_IR transaction */
#define VC_TOUCH_ID_BUTTNEW_IR_REQ 7
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_id;
} vc_touch_msg_buttnew_ir_req_t;
#define VC_TOUCH_ID_BUTTNEW_IR_RSP \
(VC_TOUCH_ID_BUTTNEW_IR_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_handle;
} vc_touch_msg_buttnew_ir_rsp_t;
typedef union {
vc_touch_msg_buttnew_ir_req_t req;
vc_touch_msg_buttnew_ir_rsp_t rsp;
} VC_TOUCH_MSG_BUTTNEW_IR_T;
/* BUTTDEL transaction */
#define VC_TOUCH_ID_BUTTDEL_REQ 8
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t button_handle;
} vc_touch_msg_buttdel_req_t;
#define VC_TOUCH_ID_BUTTDEL_RSP (VC_TOUCH_ID_BUTTDEL_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
} vc_touch_msg_buttdel_rsp_t;
typedef union {
vc_touch_msg_buttdel_req_t req;
vc_touch_msg_buttdel_rsp_t rsp;
} VC_TOUCH_MSG_BUTTDEL_T;
/* BUTTSTATE transaction */
#define VC_TOUCH_ID_BUTTSTATE_REQ 9
typedef struct {
vc_touch_msg_hdr_t hdr;
} vc_touch_msg_buttstate_req_t;
#define VC_TOUCH_ID_BUTTSTATE_RSP (VC_TOUCH_ID_BUTTSTATE_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t active_button_set;
uint32_t depressed_button_set;
} vc_touch_msg_buttstate_rsp_t;
typedef union {
vc_touch_msg_buttstate_req_t req;
vc_touch_msg_buttstate_rsp_t rsp;
} VC_TOUCH_MSG_BUTTSTATE_T;
/* BUTTOPEN transaction */
#define VC_TOUCH_ID_BUTTOPEN_REQ 10
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t period_ms;
uint32_t arg;
} vc_touch_msg_buttopen_req_t;
#define VC_TOUCH_ID_BUTTOPEN_RSP (VC_TOUCH_ID_BUTTOPEN_REQ | VC_TOUCH_REPLY)
typedef struct {
vc_touch_msg_hdr_t hdr;
} vc_touch_msg_buttopen_rsp_t;
#define VC_TOUCH_ID_BUTTON_EVENT (VC_TOUCH_ID_BUTTOPEN_REQ | VC_TOUCH_EVENT)
typedef struct {
vc_touch_msg_hdr_t hdr;
uint32_t type; /*< type of button event */
uint32_t button_id; /*< button ID the event refers to */
uint32_t arg; /*< type-dependent argument for button event */
} VC_TOUCH_MSG_BUTTON_EVENT_T;
typedef union {
vc_touch_msg_buttopen_req_t req;
vc_touch_msg_buttopen_rsp_t rsp;
} VC_TOUCH_MSG_BUTTOPEN_T;
/* Generic service transaction */
typedef union {
VC_TOUCH_MSG_PROP_T prop;
VC_TOUCH_MSG_FINGERPOS_T fingerpos;
VC_TOUCH_MSG_FINGEROPEN_T fingeropen;
VC_TOUCH_MSG_FINGER_EVENT_T finger_ev;
VC_TOUCH_MSG_BUTTNEW_KEY_T buttnew_key;
VC_TOUCH_MSG_KEYRATE_T keyrate;
VC_TOUCH_MSG_BUTTNEW_TOUCH_T buttnew_touch;
VC_TOUCH_MSG_BUTTNEW_IR_T buttnew_ir;
VC_TOUCH_MSG_BUTTDEL_T buttdel;
VC_TOUCH_MSG_BUTTSTATE_T buttstate;
VC_TOUCH_MSG_BUTTOPEN_T buttopen;
VC_TOUCH_MSG_BUTTON_EVENT_T button_ev;
} VC_TOUCH_MSG_T;
typedef union {
VC_TOUCH_MSG_FINGER_EVENT_T finger_ev;
VC_TOUCH_MSG_BUTTON_EVENT_T button_ev;
} VC_TOUCH_EVENT_MSG_T;
#endif /* _VC_TOUCHSERV_DEFS_H */

View File

@@ -1,166 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VC_HOSTREQ_DEFS_H
#define VC_HOSTREQ_DEFS_H
#include "vcinclude/common.h"
#define VC_HOSTREQ_VER 1
/* Types and constants common across the both ends of the interface */
#define VC_HRMAX_CMD_DATA 512
#define VC_HRMAX_VIBRATOR_SEQ (VC_HRMAX_CMD_DATA/4)
typedef unsigned int keys_t;
typedef unsigned int led_t;
/* Error codes used in responses and in the API */
enum
{
VC_HRERR_OK = 0, /* Success */
VC_HRERR_NOTREADY = 1,
VC_HRERR_UNSUPPORTED = 10, /* Unsupported or inappropriate request */
VC_HRERR_MEMADDR = 20, /* Trying to read protected host memory */
};
/* Key bit enumerations */
typedef enum
{
// ENTRIES MUST ONLY BE ADDED TO THE END OF THIS ENUM LIST
VC_KEY_0 = (1<<0),
VC_KEY_1 = (1<<1),
VC_KEY_2 = (1<<2),
VC_KEY_3 = (1<<3),
VC_KEY_4 = (1<<4),
VC_KEY_5 = (1<<5),
VC_KEY_6 = (1<<6),
VC_KEY_7 = (1<<7),
VC_KEY_8 = (1<<8),
VC_KEY_9 = (1<<9),
VC_KEY_UP = (1<<10),
VC_KEY_DOWN = (1<<11),
VC_KEY_LEFT = (1<<12),
VC_KEY_RIGHT = (1<<13),
VC_KEY_ENTER = (1<<14),
VC_KEY_SEND = (1<<15),
VC_KEY_END = (1<<16),
VC_KEY_MENU = (1<<17),
VC_KEY_VOLUP = (1<<18),
VC_KEY_VOLDOWN = (1<<19),
VC_KEY_STAR = (1<<20),
VC_KEY_HASH = (1<<21),
VC_KEY_CANCEL = (1<<22),
VC_KEY_CAMERA = (1<<23),
VC_KEY_RECORD = (1<<24),
VC_KEY_INFO = (1<<25),
VC_KEY_DVB = (1<<26),
VC_KEY_ANY = (1<<27)-1 // change this if any more keys are added
} VC_HOSTKEYS_T;
/* Add notify events here */
typedef enum
{
// ENTRIES MUST ONLY BE ADDED TO THE END OF THIS ENUM LIST
VC_HRNOTIFY_START = 0,
VC_HRNOTIFY_GAME_ACCEPT,
VC_HRNOTIFY_GAME_REJECT,
VC_HRNOTIFY_GAME_SAVE,
VC_HRNOTIFY_GAME_LOAD,
VC_HRNOTIFY_GAME_EXIT,
VC_HRNOTIFY_MELODY_END,
VC_HRNOTIFY_DISK_INSERTED,
VC_HRNOTIFY_DISK_REMOVED,
VC_HRNOTIFY_RINGTONE_END,
VC_HRNOTIFY_KEYTONE_END,
VC_HRNOTIFY_GAME_ABORT,
VC_HRNOTIFY_PCM_END,
VC_HRNOTIFY_FS_INUSE,
VC_HRNOTIFY_FS_NOT_INUSE,
VC_HRNOTIFY_APP_STATUS, /* app's status has changed (excluding things like elapsed times) - mainly errors or status changed */
VC_HRNOTIFY_CAMERA_EVENT,
VC_HRNOTIFY_END
} VC_HRNOTIFY_T;
//typedef of the callback from a HRNOTIFY function
typedef void (* VC_HRNOTIFY_CALLBACK_T)( const VC_HRNOTIFY_T notify_event, const uint32_t param );
//typedef of the callback from a RENDERTEXT/CONGIFTEXT/LINKDATA/DMB* function
typedef void (* VC_HRDATA_CALLBACK_T)( int cmd, void *userdata, uint8_t *data, int len );
/* Enum host request commands here rather than in vcinterface */
/*
NB There is overlap of command enumerations with other services
- but this does not matter
*/
enum
{
// ENTRIES MUST ONLY BE ADDED TO THE END OF THIS ENUM LIST
/* Host request service commands, vc->host */
VC_HOSTREQ_RESET = 64,
VC_HOSTREQ_CAPTUREKEYS,
VC_HOSTREQ_VIBRATORPLAY,
VC_HOSTREQ_VIBRATORSTOP,
VC_HOSTREQ_KEYLIGHT,
VC_HOSTREQ_SETLEDS,
VC_HOSTREQ_TIME,
VC_HOSTREQ_NOTIFY,
VC_HOSTREQ_READMEM,
VC_HOSTREQ_CONFIGTEXT,
VC_HOSTREQ_RENDERTEXT,
VC_HOSTREQ_LINKDATA,
VC_HOSTREQ_MALLOC,
VC_HOSTREQ_FREE,
VC_HOSTREQ_MEMMOVE,
VC_HOSTREQ_WRITEMEM,
VC_HOSTREQ_KEYIN,
VC_HOSTREQ_DISPLAYDEV,
VC_HOSTREQ_ACCESSURL,
VC_HOSTREQ_DMB_FIC,
VC_HOSTREQ_DMB_PAD,
VC_HOSTREQ_DMB_DATA,
VC_HOSTREQ_READMEM_3D,
VC_HOSTREQ_SEND_PCM,
VC_HOSTREQ_AUDIODEVREQUEST,
VC_HOSTREQ_AUDIODEVCONFIG,
VC_HOSTREQ_AUDIODEVRELEASE,
VC_HOSTREQ_PHOTOROW,
VC_HOSTREQ_COPYCONTROL,
VC_HOSTREQ_READPIXELS, /* Batch read of photo data from host */
VC_HOSTREQ_REPORT_AV_STATS,
VC_HOSTREQ_GPIO,
/* Host request service key messages */
VC_HOSTREQ_KEYEVENT = 96,
VC_HOSTREQ_KEYACK
};
#endif

View File

@@ -1,108 +0,0 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VCHOSTREQ_H
#define VCHOSTREQ_H
#include "vc_hostreq_defs.h"
#include "vchost_platform_config.h"
#include <time.h>
#include "interface/vchi/vchi.h"
VCHPRE_ void VCHPOST_ vc_vchi_hostreq_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections );
//These are originally in vchostmem.c, we only provide them here for backward compatibility
//Host apps should be using bufman service to read/write host memory
VCHPRE_ int VCHPOST_ vchostreq_readmem( void* host_addr, void *vc_addr, int len );
VCHPRE_ int VCHPOST_ vchostreq_writemem( void* host_addr, void *vc_addr, int len, int channel );
VCHPRE_ int VCHPOST_ vc_hostreq_init (void);
VCHPRE_ void VCHPOST_ vc_hostreq_stop (void);
/* Supplies current key settings (preferably when there is a change) */
VCHPRE_ void VCHPOST_ vc_hostreq_keychange(keys_t keys);
/* Sets a user notify function to be called for the given notify event */
VCHPRE_ int32_t VCHPOST_ vc_hostreq_set_notify( const VC_HRNOTIFY_T notify_event, VC_HRNOTIFY_CALLBACK_T notifyfunc );
/* Sets a user callback to be called for the given hostreq event */
VCHPRE_ int32_t VCHPOST_ vc_hostreq_set_data_callback( const int cmd, VC_HRDATA_CALLBACK_T callback, void *userdata );
/*---------------------------------------------------------------------------*/
/*** The following require a host/application specific implementation ***/
/* Change key capture settings (might be ignored) */
VCHPRE_ void VCHPOST_ vc_hostreq_capturekeys(keys_t keymask);
/* Play a zero terminated sequence on the vibrator */
VCHPRE_ void VCHPOST_ vc_hostreq_vibratorplay(const int *sequence);
/* Stop the vibrator sequence immediately */
VCHPRE_ void VCHPOST_ vc_hostreq_vibratorstop(void);
/* Switch backlight on or off. */
VCHPRE_ void VCHPOST_ vc_hostreq_keylight(int state);
/* Set LEDs to specific brightness and colour levels. */
VCHPRE_ void VCHPOST_ vc_hostreq_setleds(led_t ledvalues);
/* Returns seconds since midnight (00:00.00) Jan 1 1970, local time. */
VCHPRE_ time_t VCHPOST_ vc_hostreq_time(void);
/* Send an event with the given eventcode to the host. */
VCHPRE_ void VCHPOST_ vc_hostreq_notify(int eventcode, int param);
/* Receive config data for subsequent hostreq_rendertext events. */
VCHPRE_ void VCHPOST_ vc_hostreq_configtext(char *config_data, int len);
/* Render a text string as a bitmap and then return it to VideoCore. */
VCHPRE_ void VCHPOST_ vc_hostreq_rendertext(char *text, int len);
/* Receive link information from a media file. */
VCHPRE_ void VCHPOST_ vc_hostreq_linkdata(char *link_data, int len);
/* Receive DMB FIC data */
VCHPRE_ void VCHPOST_ vc_hostreq_dmb_fic(char *data, int len);
/* Receive DMB PAD data */
VCHPRE_ void VCHPOST_ vc_hostreq_dmb_pad(char *data, int len);
/* Receive DMB DATA data */
VCHPRE_ void VCHPOST_ vc_hostreq_dmb_data(char *data, int len);
/* Request keypress info (from RTSP server). */
VCHPRE_ void VCHPOST_ vc_hostreq_keyin(void);
#endif