📄 module.h
字号:
/* 23 */
/*
typedef int8_t (* ker_fntable_subscribe_ker_func_t)( sos_pid_t sub_pid, sos_pid_t pub_pid, uint8_t fid, uint8_t table_index );
static inline int8_t ker_fntable_subscribe( sos_pid_t sub_pid, sos_pid_t pub_pid, uint8_t fid, uint8_t table_index )
{
ker_fntable_subscribe_ker_func_t func =
(ker_fntable_subscribe_ker_func_t)get_kertable_entry(23);
return func( sub_pid, pub_pid, fid, table_index );
}
*/
/**
* @brief System call for a driver to register a sensor with its own policy
* @param sensor_driver_pid The module ID of the driver
* @param sensor_type Type of the sensor being registered
* @param get_data_fid The function pointer pointer FID of the get data function implemented by the driver
**/
/* 24 */
/*
typedef int8_t (* ker_sensor_register_ker_func_t)( sos_pid_t sensor_driver_pid, uint8_t sensor_type, uint8_t get_data_fid );
static inline int8_t ker_sensor_register( sos_pid_t sensor_driver_pid, uint8_t sensor_type, uint8_t get_data_fid )
{
ker_sensor_register_ker_func_t func =
(ker_sensor_register_ker_func_t)get_kertable_entry(24);
return func( sensor_driver_pid, sensor_type, get_data_fid );
}
*/
/**
* @brief System call for removing driver from sensor API
* @param sensor_driver_pid The module ID of the driver
* @param sensor_type Type of the sensor being deregistered
* @param get_data_fid The function pointer pointer FID of the get data function implemented by the driver
*/
/* 25 */
/*
typedef int8_t (* ker_sensor_deregister_ker_func_t)( sos_pid_t sensor_driver_pid, uint8_t sensor_type, uint8_t get_data_fid );
static inline int8_t ker_sensor_deregister( sos_pid_t sensor_driver_pid, uint8_t sensor_type, uint8_t get_data_fid )
{
ker_sensor_deregister_ker_func_t func =
(ker_sensor_deregister_ker_func_t)get_kertable_entry(25);
return func( sensor_driver_pid, sensor_type, get_data_fid );
}
*/
/**
* @brief System call for getting data from the sensor
* @param client_pid The process id of the module requesting sensor data
* @param sensor_type Type of the sensor whose data is being requested
*/
/* 26 */
/*
typedef int8_t (* ker_sensor_get_data_ker_func_t)( sos_pid_t client_pid, uint8_t sensor_type );
static inline int8_t ker_sensor_get_data( sos_pid_t client_pid, uint8_t sensor_type )
{
ker_sensor_get_data_ker_func_t func =
(ker_sensor_get_data_ker_func_t)get_kertable_entry(26);
return func( client_pid, sensor_type );
}
*/
/**
* @brief Data ready system call for signalling to the kernel, the receipt of new sensor data
* @param sensor_type The type of the sensor
* @param sensor_data The value of data received from the sensor
*/
/* 27 */
/*
typedef int8_t (* ker_sensor_data_ready_ker_func_t)( uint8_t sensor_type, uint16_t sensor_data );
static inline int8_t ker_sensor_data_ready( uint8_t sensor_type, uint16_t sensor_data )
{
ker_sensor_data_ready_ker_func_t func =
(ker_sensor_data_ready_ker_func_t)get_kertable_entry(27);
return func( sensor_type, sensor_data );
}
*/
/* 28 */
typedef sos_pid_t (* ker_set_current_pid_ker_func_t)( sos_pid_t pid );
static inline sos_pid_t KER_set_current_pid( sos_pid_t pid )
{
ker_set_current_pid_ker_func_t func =
(ker_set_current_pid_ker_func_t)get_kertable_entry(28);
return func( pid );
}
/* 29 */
typedef sos_pid_t (* ker_get_current_pid_ker_func_t)( void );
static inline sos_pid_t KER_get_current_pid( void )
{
ker_get_current_pid_ker_func_t func =
(ker_get_current_pid_ker_func_t)get_kertable_entry(29);
return func( );
}
/* 30 */
typedef void (* dummy30_ker_func_t)( void );
static inline void dummy30( void )
{
dummy30_ker_func_t func =
(dummy30_ker_func_t)get_kertable_entry(30);
func( );
}
/**
* @brief random function
* @return random value
*/
/* 31 */
typedef uint16_t (* ker_rand_ker_func_t)( void );
static inline uint16_t KER_rand( void )
{
ker_rand_ker_func_t func =
(ker_rand_ker_func_t)get_kertable_entry(31);
return func( );
}
/* 32 */
/*
typedef mod_header_ptr (* ker_codemem_get_header_address_ker_func_t)( codemem_t cid );
static inline mod_header_ptr ker_codemem_get_header_address( codemem_t cid )
{
ker_codemem_get_header_address_ker_func_t func =
(ker_codemem_get_header_address_ker_func_t)get_kertable_entry(32);
return func( cid );
}
*/
/* 33 */
typedef void (* dummy33_ker_func_t)( void );
static inline void dummy33( void )
{
dummy33_ker_func_t func =
(dummy33_ker_func_t)get_kertable_entry(33);
func( );
}
/* 34 */
typedef int8_t (* post_longer_ker_func_t)( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void * larg, uint16_t flag, uint16_t saddr );
static inline int8_t KER_post_longer( sos_pid_t did, sos_pid_t sid, uint8_t type, uint8_t arg, void * larg, uint16_t flag, uint16_t saddr )
{
post_longer_ker_func_t func =
(post_longer_ker_func_t)get_kertable_entry(34);
return func( did, sid, type, arg, larg, flag, saddr );
}
/* 35 */
typedef void (* dummy35_ker_func_t)( void );
static inline void dummy35( void )
{
dummy35_ker_func_t func =
(dummy35_ker_func_t)get_kertable_entry(35);
func( );
}
/**
* @brief Initialize the timer
* @param pid Module Id
* @param tid Module defined timer id
*/
/* 36 */
typedef int8_t (* ker_timer_init_ker_func_t)( sos_pid_t pid, uint8_t tid, uint8_t type );
static inline int8_t KER_timer_init( sos_pid_t pid, uint8_t tid, uint8_t type )
{
ker_timer_init_ker_func_t func =
(ker_timer_init_ker_func_t)get_kertable_entry(36);
return func( pid, tid, type );
}
/* 37 */
/*
typedef gps_t (* ker_gps_ker_func_t)( void );
static inline gps_t ker_gps( void )
{
ker_gps_ker_func_t func =
(ker_gps_ker_func_t)get_kertable_entry(37);
return func( );
}
*/
/* 38 */
/*
typedef uint32_t (* ker_loc_r2_ker_func_t)( node_loc_t * loc1, node_loc_t * loc2 );
static inline uint32_t ker_loc_r2( node_loc_t * loc1, node_loc_t * loc2 )
{
ker_loc_r2_ker_func_t func =
(ker_loc_r2_ker_func_t)get_kertable_entry(38);
return func( loc1, loc2 );
}
*/
/* 39 */
typedef void (* dummy39_ker_func_t)( void );
static inline void dummy39( void )
{
dummy39_ker_func_t func =
(dummy39_ker_func_t)get_kertable_entry(39);
func( );
}
/**
* @brief Data fail system call for signalling to the kernel, the failure to get data
* @param sensor_type The type of the sensor
*/
/* 40 */
/*
typedef int8_t (* ker_sensor_data_fail_ker_func_t)( uint8_t sensor_type );
static inline int8_t ker_sensor_data_fail( uint8_t sensor_type )
{
ker_sensor_data_fail_ker_func_t func =
(ker_sensor_data_fail_ker_func_t)get_kertable_entry(40);
return func( sensor_type );
}
*/
/**
* @brief Get pointer to module control block if it is the next module with a PID > pid given
* @param pid is the lower bound for the pid ie the next module_pid > pid and will be closest
* to that pid
* @return handle if successful, NULL otherwise
*/
/* 41 */
typedef void (* dummy41_ker_func_t)( void );
static inline void dummy41( void )
{
dummy41_ker_func_t func =
(dummy41_ker_func_t)get_kertable_entry(41);
func( );
}
/* 42 */
typedef void * (* ker_get_module_state_ker_func_t)( sos_pid_t pid );
static inline void * KER_get_module_state( sos_pid_t pid )
{
ker_get_module_state_ker_func_t func =
(ker_get_module_state_ker_func_t)get_kertable_entry(42);
return func( pid );
}
/* 43 */
typedef sos_pid_t (* ker_spawn_module_ker_func_t)( mod_header_ptr h, void * init, uint8_t init_size, uint8_t flag );
static inline sos_pid_t KER_spawn_module( mod_header_ptr h, void * init, uint8_t init_size, uint8_t flag )
{
ker_spawn_module_ker_func_t func =
(ker_spawn_module_ker_func_t)get_kertable_entry(43);
return func( h, init, init_size, flag );
}
/* 44 */
/*
typedef mod_header_ptr (* ker_codemem_get_header_from_code_id_ker_func_t)( sos_code_id_t cid );
static inline mod_header_ptr ker_codemem_get_header_from_code_id( sos_code_id_t cid )
{
ker_codemem_get_header_from_code_id_ker_func_t func =
(ker_codemem_get_header_from_code_id_ker_func_t)get_kertable_entry(44);
return func( cid );
}
*/
/* 45 */
/*
typedef codemem_t (* ker_codemem_alloc_ker_func_t)( uint16_t size, codemem_type_t type );
static inline codemem_t ker_codemem_alloc( uint16_t size, codemem_type_t type )
{
ker_codemem_alloc_ker_func_t func =
(ker_codemem_alloc_ker_func_t)get_kertable_entry(45);
return func( size, type );
}
*/
/* 46 */
/*
typedef int8_t (* ker_codemem_write_ker_func_t)( codemem_t h, sos_pid_t pid, void * buf, uint16_t nbytes, uint16_t offset );
static inline int8_t ker_codemem_write( codemem_t h, sos_pid_t pid, void * buf, uint16_t nbytes, uint16_t offset )
{
ker_codemem_write_ker_func_t func =
(ker_codemem_write_ker_func_t)get_kertable_entry(46);
return func( h, pid, buf, nbytes, offset );
}
*/
/* 47 */
/*
typedef int8_t (* ker_codemem_read_ker_func_t)( codemem_t h, sos_pid_t pid, void * buf, uint16_t nbytes, uint16_t offset );
static inline int8_t ker_codemem_read( codemem_t h, sos_pid_t pid, void * buf, uint16_t nbytes, uint16_t offset )
{
ker_codemem_read_ker_func_t func =
(ker_codemem_read_ker_func_t)get_kertable_entry(47);
return func( h, pid, buf, nbytes, offset );
}
*/
/* 48 */
/*
typedef int8_t (* ker_codemem_free_ker_func_t)( codemem_t h );
static inline int8_t ker_codemem_free( codemem_t h )
{
ker_codemem_free_ker_func_t func =
(ker_codemem_free_ker_func_t)get_kertable_entry(48);
return func( h );
}
*/
/* 49 */
/*
typedef int8_t (* ker_codemem_flush_ker_func_t)( codemem_t h, sos_pid_t pid );
static inline int8_t ker_codemem_flush( codemem_t h, sos_pid_t pid )
{
ker_codemem_flush_ker_func_t func =
(ker_codemem_flush_ker_func_t)get_kertable_entry(49);
return func( h, pid );
}
*/
//#include <module_virtual.h> ////***NEED TO DO PORTING ZHOU YA JIN
/**
* @brief critical section helpers
*/
#include <hardware_types.h>
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -