rename usbh_driver to usbh_low_level_driver
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
This commit is contained in:
parent
2c0f82a4f0
commit
1c8aa9d315
3 changed files with 11 additions and 11 deletions
|
|
@ -142,7 +142,7 @@ struct _usbh_packet {
|
|||
};
|
||||
typedef struct _usbh_packet usbh_packet_t;
|
||||
|
||||
struct _usbh_driver {
|
||||
struct _usbh_low_level_driver {
|
||||
/**
|
||||
* @brief init initialization routine of the low-level driver
|
||||
*
|
||||
|
|
@ -178,7 +178,7 @@ struct _usbh_driver {
|
|||
*/
|
||||
void *driver_data;
|
||||
};
|
||||
typedef struct _usbh_driver usbh_driver_t;
|
||||
typedef struct _usbh_low_level_driver usbh_low_level_driver_t;
|
||||
|
||||
struct _usbh_generic_data {
|
||||
usbh_device_t usbh_device[USBH_MAX_DEVICES];
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
static struct {
|
||||
bool enumeration_run;
|
||||
const usbh_driver_t * const *lld_drivers;
|
||||
const usbh_low_level_driver_t * const *lld_drivers;
|
||||
const usbh_dev_driver_t * const *dev_drivers;
|
||||
int8_t address_temporary;
|
||||
} usbh_data = {0};
|
||||
|
|
@ -169,7 +169,7 @@ void usbh_init(const void *low_level_drivers[], const usbh_dev_driver_t * const
|
|||
return;
|
||||
}
|
||||
|
||||
usbh_data.lld_drivers = (const usbh_driver_t **)low_level_drivers;
|
||||
usbh_data.lld_drivers = (const usbh_low_level_driver_t **)low_level_drivers;
|
||||
usbh_data.dev_drivers = device_drivers;
|
||||
|
||||
// TODO: init structures
|
||||
|
|
@ -249,7 +249,7 @@ bool usbh_enum_available(void)
|
|||
*/
|
||||
usbh_device_t *usbh_get_free_device(const usbh_device_t *dev)
|
||||
{
|
||||
const usbh_driver_t *lld = dev->lld;
|
||||
const usbh_low_level_driver_t *lld = dev->lld;
|
||||
usbh_generic_data_t *lld_data = lld->driver_data;
|
||||
usbh_device_t *usbh_device = lld_data->usbh_device;
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ static void device_enumeration_terminate(usbh_device_t *dev)
|
|||
*/
|
||||
static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
||||
{
|
||||
const usbh_driver_t *lld = dev->lld;
|
||||
const usbh_low_level_driver_t *lld = dev->lld;
|
||||
usbh_generic_data_t *lld_data = lld->driver_data;
|
||||
uint8_t *usbh_buffer = lld_data->usbh_buffer;
|
||||
uint8_t state_start = dev->state; // Detection of hang
|
||||
|
|
@ -620,13 +620,13 @@ void usbh_poll(uint32_t time_curr_us)
|
|||
|
||||
void usbh_read(usbh_device_t *dev, usbh_packet_t *packet)
|
||||
{
|
||||
const usbh_driver_t *lld = dev->lld;
|
||||
const usbh_low_level_driver_t *lld = dev->lld;
|
||||
lld->read(lld->driver_data, packet);
|
||||
}
|
||||
|
||||
void usbh_write(usbh_device_t *dev, const usbh_packet_t *packet)
|
||||
{
|
||||
const usbh_driver_t *lld = dev->lld;
|
||||
const usbh_low_level_driver_t *lld = dev->lld;
|
||||
lld->write(lld->driver_data, packet);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ static enum USBH_SPEED root_speed(void *drvdata)
|
|||
*/
|
||||
void print_channels(const void *lld)
|
||||
{
|
||||
usbh_lld_stm32f4_driver_data_t *dev = ((usbh_driver_t *)lld)->driver_data;
|
||||
usbh_lld_stm32f4_driver_data_t *dev = ((usbh_low_level_driver_t *)lld)->driver_data;
|
||||
channel_t *channels = dev->channels;
|
||||
int32_t i;
|
||||
LOG_PRINTF("\nCHANNELS: \n");
|
||||
|
|
@ -1017,7 +1017,7 @@ static usbh_lld_stm32f4_driver_data_t driver_data_fs = {
|
|||
.channels = channels_fs,
|
||||
.num_channels = NUM_CHANNELS_FS
|
||||
};
|
||||
static const usbh_driver_t driver_fs = {
|
||||
static const usbh_low_level_driver_t driver_fs = {
|
||||
.init = init,
|
||||
.poll = poll,
|
||||
.read = read,
|
||||
|
|
@ -1037,7 +1037,7 @@ static usbh_lld_stm32f4_driver_data_t driver_data_hs = {
|
|||
.channels = channels_hs,
|
||||
.num_channels = NUM_CHANNELS_HS
|
||||
};
|
||||
static const usbh_driver_t driver_hs = {
|
||||
static const usbh_low_level_driver_t driver_hs = {
|
||||
.init = init,
|
||||
.poll = poll,
|
||||
.read = read,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue