Accessing custom field type in programatic form

I have installed the ‘phone’ module, which enables a new field type called ‘phone’. (It’s available through the Field UI by selected ‘Phone Number’ as the field type).

How do I gain access to this field type in a programatically created form? I have a form, that calls it like this:

$form['phone'] = array(
    '#type' => 'phone',
    '#title' => t('Your phone number'),
    '#required' => TRUE,  
);

however, when I render the form, that field is not available on the form. The same thing applies with the ’email’ module, if I set the type of that field type ‘#email’. How can I implement these two field types programatically?

phone appears to have some settings that you set when you create the field instance, but I can’t figure out how to tell the $form to set these settings when declaring the field type (If that’s even the issue)

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed